Lines Matching refs:pdhcp
184 dhcp_msg_t pdhcp; member
694 memcpy(&state->pdhcp, &packet.dhcp, bytes - (sizeof(packet.iph) + sizeof(packet.udph))); in read_raw()
695 if (state->pdhcp.cookie != htonl(DHCP_MAGIC)) { in read_raw()
706 memset(&state->pdhcp, 0, sizeof(dhcp_msg_t)); in read_app()
707 if ((ret = read(state->sockfd, &state->pdhcp, sizeof(dhcp_msg_t))) < 0) { in read_app()
711 if (state->pdhcp.cookie != htonl(DHCP_MAGIC)) { in read_app()
727 memcpy(&packet.dhcp, &state->pdhcp, sizeof(dhcp_msg_t)); in send_raw()
745 padding = 308 - 1 - dhcp_opt_size(state->pdhcp.options); in send_raw()
783 cli.sin_addr.s_addr = state->pdhcp.ciaddr; in send_app()
796 int padding = 308 - 1 - dhcp_opt_size(state->pdhcp.options); in send_app()
797 if((ret = write(fd, &state->pdhcp, sizeof(dhcp_msg_t) - padding)) < 0) { in send_app()
992 memset(&state->pdhcp, 0, sizeof(dhcp_msg_t)); in dhcpc_sendmsg()
993 state->pdhcp.op = DHCP_REQUEST; in dhcpc_sendmsg()
994 state->pdhcp.htype = DHCP_HTYPE_ETHERNET; in dhcpc_sendmsg()
995 state->pdhcp.hlen = 6; in dhcpc_sendmsg()
996 state->pdhcp.xid = xid; in dhcpc_sendmsg()
997 memcpy(state->pdhcp.chaddr, state->macaddr, 6); in dhcpc_sendmsg()
998 memset(&state->pdhcp.chaddr[6], 0, 10); in dhcpc_sendmsg()
999 state->pdhcp.cookie = htonl(DHCP_MAGIC);; in dhcpc_sendmsg()
1002 pend = state->pdhcp.options; in dhcpc_sendmsg()
1009 state->pdhcp.flags = htons(BOOTP_BROADCAST); // Broadcast bit. in dhcpc_sendmsg()
1024 state->pdhcp.flags = htons(BOOTP_BROADCAST); // Broadcast bit. in dhcpc_sendmsg()
1025 if (state->status == STATE_RENEWING) memcpy(&state->pdhcp.ciaddr, &state->ipaddr.s_addr, 4); in dhcpc_sendmsg()
1039 memcpy(&state->pdhcp.ciaddr, &state->ipaddr.s_addr, 4); in dhcpc_sendmsg()
1198 if (state->pdhcp.op == DHCP_REPLY in dhcpc_parsemsg()
1199 && !memcmp(state->pdhcp.chaddr, state->macaddr, 6) in dhcpc_parsemsg()
1200 && !memcmp(&state->pdhcp.xid, &xid, sizeof(xid))) { in dhcpc_parsemsg()
1201 memcpy(&presult->ipaddr.s_addr, &state->pdhcp.yiaddr, 4); in dhcpc_parsemsg()
1203 return get_option_msgtype(state->pdhcp.options); in dhcpc_parsemsg()
1368 memcpy(&state->ipaddr.s_addr,&state->pdhcp.yiaddr, 4); in dhcp_main()
1460 …if (!msgType || !get_option_serverid(state->pdhcp.options, &result)) continue; //no server id igno… in dhcp_main()
1463 dhcpc_parseoptions(&result, state->pdhcp.options); in dhcp_main()
1464 get_option_lease(state->pdhcp.options, &result); in dhcp_main()