Lines Matching defs:pdhcp

184   dhcp_msg_t pdhcp;
694 memcpy(&state->pdhcp, &packet.dhcp, bytes - (sizeof(packet.iph) + sizeof(packet.udph)));
695 if (state->pdhcp.cookie != htonl(DHCP_MAGIC)) {
706 memset(&state->pdhcp, 0, sizeof(dhcp_msg_t));
707 if ((ret = read(state->sockfd, &state->pdhcp, sizeof(dhcp_msg_t))) < 0) {
711 if (state->pdhcp.cookie != htonl(DHCP_MAGIC)) {
727 memcpy(&packet.dhcp, &state->pdhcp, sizeof(dhcp_msg_t));
745 padding = 308 - 1 - dhcp_opt_size(state->pdhcp.options);
783 cli.sin_addr.s_addr = state->pdhcp.ciaddr;
796 int padding = 308 - 1 - dhcp_opt_size(state->pdhcp.options);
797 if((ret = write(fd, &state->pdhcp, sizeof(dhcp_msg_t) - padding)) < 0) {
992 memset(&state->pdhcp, 0, sizeof(dhcp_msg_t));
993 state->pdhcp.op = DHCP_REQUEST;
994 state->pdhcp.htype = DHCP_HTYPE_ETHERNET;
995 state->pdhcp.hlen = 6;
996 state->pdhcp.xid = xid;
997 memcpy(state->pdhcp.chaddr, state->macaddr, 6);
998 memset(&state->pdhcp.chaddr[6], 0, 10);
999 state->pdhcp.cookie = htonl(DHCP_MAGIC);;
1002 pend = state->pdhcp.options;
1009 state->pdhcp.flags = htons(BOOTP_BROADCAST); // Broadcast bit.
1024 state->pdhcp.flags = htons(BOOTP_BROADCAST); // Broadcast bit.
1025 if (state->status == STATE_RENEWING) memcpy(&state->pdhcp.ciaddr, &state->ipaddr.s_addr, 4);
1039 memcpy(&state->pdhcp.ciaddr, &state->ipaddr.s_addr, 4);
1200 if (state->pdhcp.op == DHCP_REPLY
1201 && !memcmp(state->pdhcp.chaddr, state->macaddr, 6)
1202 && !memcmp(&state->pdhcp.xid, &xid, sizeof(xid))) {
1203 memcpy(&presult->ipaddr.s_addr, &state->pdhcp.yiaddr, 4);
1205 return get_option_msgtype(state->pdhcp.options);
1370 memcpy(&state->ipaddr.s_addr,&state->pdhcp.yiaddr, 4);
1462 if (!msgType || !get_option_serverid(state->pdhcp.options, &result)) continue; //no server id ignore
1465 dhcpc_parseoptions(&result, state->pdhcp.options);
1466 get_option_lease(state->pdhcp.options, &result);