Lines Matching refs:udphdr
31 #define UDP_HLEN (sizeof(struct udphdr))
101 static uint16_t udp_checksum(struct ip *iphdr, struct udphdr *udphdr) in udp_checksum() argument
108 sum = raw_checksum((uint8_t *)udphdr, UDP_HLEN, sum); in udp_checksum()
117 static uint16_t udp6_checksum(struct ip6_hdr *iphdr, struct udphdr *udphdr) in udp6_checksum() argument
124 sum = raw_checksum((uint8_t *)&udphdr->len, sizeof(udphdr->len), sum); in udp6_checksum()
125 sum = raw_checksum((uint8_t *)udphdr, UDP_HLEN, sum); in udp6_checksum()
144 struct udphdr udphdr; in send_fragment() local
145 udphdr.source = htons(cfg_port + 1); in send_fragment()
146 udphdr.dest = htons(cfg_port); in send_fragment()
147 udphdr.len = htons(UDP_HLEN + payload_len); in send_fragment()
148 udphdr.check = 0; in send_fragment()
150 udphdr.check = udp6_checksum((struct ip6_hdr *)ip_frame, &udphdr); in send_fragment()
152 udphdr.check = udp_checksum((struct ip *)ip_frame, &udphdr); in send_fragment()
153 memcpy(frag_start, &udphdr, UDP_HLEN); in send_fragment()