Lines Matching defs:packet

32  * - Additional packet options (commented on the middle of sources)
46 #include <netpacket/packet.h>
799 //Listening for multicast packet
857 dhcp6_raw_t packet;
861 memset(&packet, 0, sizeof(dhcp6_raw_t));
862 memcpy(&packet.dhcp6, &gstate.send.send_pkt6, sizeof(dhcp6_msg_t));
863 padding = sizeof(packet.dhcp6.options) - optlen;
881 memcpy(&packet.iph.ip6_src, &gconfig.server_nip6, sizeof(uint32_t)*4);
882 memcpy(&packet.iph.ip6_dst, &gstate.client_nip6, sizeof(uint32_t)*4);
884 packet.udph.source = htons(gconfig.port); //SERVER_PORT
885 packet.udph.dest = gstate.client_port; //CLIENT_PORT
886 packet.udph.len = htons(sizeof(dhcp6_raw_t) - sizeof(struct ip6_hdr) - padding);
887 packet.iph.ip6_ctlun.ip6_un1.ip6_un1_plen = htons(ntohs(packet.udph.len) + 0x11);
888 packet.udph.check = dhcp_checksum(&packet, sizeof(dhcp6_raw_t) - padding);
889 packet.iph.ip6_ctlun.ip6_un1.ip6_un1_flow = htonl(0x60000000);
890 packet.iph.ip6_ctlun.ip6_un1.ip6_un1_plen = packet.udph.len;
891 packet.iph.ip6_ctlun.ip6_un1.ip6_un1_nxt = IPPROTO_UDP;
892 packet.iph.ip6_ctlun.ip6_un1.ip6_un1_hlim = 0x64;
894 result = sendto(fd, &packet, sizeof(dhcp6_raw_t)-padding,
907 dhcp_raw_t packet;
912 memset(&packet, 0, sizeof(dhcp_raw_t));
913 memcpy(&packet.dhcp, &gstate.send.send_pkt, sizeof(dhcp_msg_t));
932 packet.iph.protocol = IPPROTO_UDP;
933 packet.iph.saddr = gconfig.server_nip;
934 packet.iph.daddr = (broadcast || (gstate.rcvd.rcvd_pkt.ciaddr == 0))?
936 packet.udph.source = htons(gconfig.port);//SERVER_PORT
937 packet.udph.dest = gstate.client_port; //CLIENT_PORT
938 packet.udph.len = htons(sizeof(dhcp_raw_t) - sizeof(struct iphdr) - padding);
939 packet.iph.tot_len = packet.udph.len;
940 packet.udph.check = dhcp_checksum(&packet, sizeof(dhcp_raw_t) - padding);
941 packet.iph.tot_len = htons(sizeof(dhcp_raw_t) - padding);
942 packet.iph.ihl = sizeof(packet.iph) >> 2;
943 packet.iph.version = IPVERSION;
944 packet.iph.ttl = IPDEFTTL;
945 packet.iph.check = dhcp_checksum(&packet.iph, sizeof(packet.iph));
947 result = sendto(fd, &packet, sizeof(dhcp_raw_t) - padding, 0,
976 dbg("Received an ipv6 packet. Size : %d \n", ret);
1008 dbg("Received a packet. Size : %d \n", ret);
1012 // Preapres a dhcp packet with defaults and configs
1035 // Sets a option value in dhcp packet's option field
1056 // Gets a option value from dhcp packet's option field
1128 // Retrives Requested Parameter list from dhcp req packet.
1141 // Sets values of req param in dhcp offer packet.
1748 dbg("no or bad message type option, ignoring packet.\n");
1752 dbg("no or bad transaction id, ignoring packet.\n");
1990 dbg("no or bad message type option, ignoring packet.\n");
1996 dbg("server ID doesn't match, ignoring packet.\n");