Lines Matching refs:packet
482 static uint8_t *init_d6_packet(struct d6_packet *packet, char type) in init_d6_packet() argument
487 memset(packet, 0, sizeof(*packet)); in init_d6_packet()
489 packet->d6_xid32 = client_data.xid; in init_d6_packet()
490 packet->d6_msg_type = type; /* union, overwrites lowest byte of d6_xid32 */ in init_d6_packet()
495 ptr = packet->d6_options; /* NB: it is 32-bit aligned */ in init_d6_packet()
546 static int d6_mcast_from_client_data_ifindex(struct d6_packet *packet, uint8_t *end) in d6_mcast_from_client_data_ifindex() argument
559 packet, (end - (uint8_t*) packet), in d6_mcast_from_client_data_ifindex()
590 struct d6_packet packet; in send_d6_info_request() local
594 opt_ptr = init_d6_packet(&packet, D6_MSG_INFORMATION_REQUEST); in send_d6_info_request()
602 return d6_mcast_from_client_data_ifindex(&packet, opt_ptr); in send_d6_info_request()
689 struct d6_packet packet; in send_d6_discover() local
694 opt_ptr = init_d6_packet(&packet, D6_MSG_SOLICIT); in send_d6_discover()
732 return d6_mcast_from_client_data_ifindex(&packet, opt_ptr); in send_d6_discover()
768 struct d6_packet packet; in send_d6_select() local
772 opt_ptr = init_d6_packet(&packet, D6_MSG_REQUEST); in send_d6_select()
789 return d6_mcast_from_client_data_ifindex(&packet, opt_ptr); in send_d6_select()
841 struct d6_packet packet; in send_d6_renew() local
845 opt_ptr = init_d6_packet(&packet, DHCPREQUEST); in send_d6_renew()
864 &packet, (opt_ptr - (uint8_t*) &packet), in send_d6_renew()
868 return d6_mcast_from_client_data_ifindex(&packet, opt_ptr); in send_d6_renew()
876 struct d6_packet packet; in send_d6_release() local
881 opt_ptr = init_d6_packet(&packet, D6_MSG_RELEASE); in send_d6_release()
898 &packet, (opt_ptr - (uint8_t*) &packet), in send_d6_release()
909 struct ip6_udp_d6_packet packet; in d6_recv_raw_packet() local
911 bytes = safe_read(fd, &packet, sizeof(packet)); in d6_recv_raw_packet()
918 if (bytes < (int) (sizeof(packet.ip6) + sizeof(packet.udp))) { in d6_recv_raw_packet()
923 if (bytes < sizeof(packet.ip6) + ntohs(packet.ip6.ip6_plen)) { in d6_recv_raw_packet()
930 bytes = sizeof(packet.ip6) + ntohs(packet.ip6.ip6_plen); in d6_recv_raw_packet()
933 if (packet.ip6.ip6_nxt != IPPROTO_UDP in d6_recv_raw_packet()
934 || (packet.ip6.ip6_vfc >> 4) != 6 in d6_recv_raw_packet()
935 || packet.udp.dest != htons(CLIENT_PORT6) in d6_recv_raw_packet()
937 || packet.udp.len != packet.ip6.ip6_plen in d6_recv_raw_packet()
956 *peer_ipv6 = packet.ip6.ip6_src; /* struct copy */ in d6_recv_raw_packet()
960 d6_dump_packet(&packet.data); in d6_recv_raw_packet()
962 bytes -= sizeof(packet.ip6) + sizeof(packet.udp); in d6_recv_raw_packet()
963 memcpy(d6_pkt, &packet.data, bytes); in d6_recv_raw_packet()
1324 struct d6_packet packet; in udhcpc6_main() local
1571 len = d6_recv_kernel_packet(&srv6_buf, &packet, client_data.sockfd); in udhcpc6_main()
1573 len = d6_recv_raw_packet(&srv6_buf, &packet, client_data.sockfd); in udhcpc6_main()
1582 packet_end = (uint8_t*)&packet + len; in udhcpc6_main()
1585 if ((packet.d6_xid32 & htonl(0x00ffffff)) != client_data.xid) { in udhcpc6_main()
1587 (unsigned)(packet.d6_xid32 & htonl(0x00ffffff)), (unsigned)client_data.xid, in udhcpc6_main()
1595 if (packet.d6_msg_type == D6_MSG_ADVERTISE) in udhcpc6_main()
1605 if (packet.d6_msg_type == D6_MSG_REPLY) { in udhcpc6_main()
1616 option = d6_find_option(packet.d6_options, packet_end, D6_OPT_STATUS_CODE); in udhcpc6_main()
1620 d6_run_script(packet.d6_options, in udhcpc6_main()
1632 option = d6_copy_option(packet.d6_options, packet_end, D6_OPT_SERVERID); in udhcpc6_main()
1643 if (packet.d6_msg_type == D6_MSG_ADVERTISE) { in udhcpc6_main()
1741 client6_data.ia_na = d6_copy_option(packet.d6_options, packet_end, D6_OPT_IA_NA); in udhcpc6_main()
1779 client6_data.ia_pd = d6_copy_option(packet.d6_options, packet_end, D6_OPT_IA_PD); in udhcpc6_main()
1827 d6_run_script(packet.d6_options, packet_end, in udhcpc6_main()