Lines Matching defs:packet

30  * calculates the checksum over all the packet components starting from pos
31 * checksum - checksum of packet components before pos
32 * packet - packet to calculate the checksum of
36 uint16_t packet_checksum(uint32_t checksum, clat_packet packet, clat_packet_index pos) {
39 if (packet[i].iov_len > 0) {
40 checksum = ip_checksum_add(checksum, packet[i].iov_base, packet[i].iov_len);
47 * returns the total length of all the packet components after pos
48 * packet - packet to calculate the length of
50 * returns: the total length of the packet components after pos
52 uint16_t packet_length(clat_packet packet, clat_packet_index pos) {
56 len += packet[i].iov_len;
83 // Third party packet. Let the caller deal with it.
94 // Both addresses are in network byte order (addr4 comes from a network packet, and the config
118 * ip_targ - (ipv4) target packet header, source: original ipv4 addr, dest: local subnet addr
119 * payload_len - length of other data inside packet
121 * old_header - (ipv6) source packet header, source: nat64 prefix, dest: local subnet prefix
152 * ip6 - (ipv6) target packet header, source: local subnet prefix, dest: nat64 prefix
153 * payload_len - length of other data inside packet
155 * old_header - (ipv4) source packet header, source: local subnet addr, dest: internet's ipv4 addr
175 * old_header - (ipv4) source packet header
220 * out - output packet
221 * icmp - source packet icmp header
245 // Translate the nested packet (the one that caused the error).
249 // packet that we were asked to translate. This transport length is 20 bytes smaller than it
256 // Ping packet.
275 * out - output packet
276 * icmp6 - source packet icmp6 header
299 // Translate the nested packet (the one that caused the error).
302 // Ping packet.
320 * takes a generic IP packet and sets it up for translation
321 * out - output packet
322 * pos - position in the output packet of the transport header
336 * takes a udp packet and sets it up for translation
337 * out - output packet
338 * udp - pointer to udp header in packet
360 * takes a tcp packet and sets it up for translation
361 * out - output packet
362 * tcp - pointer to tcp header in packet
395 * common between ipv4/ipv6 - setup checksum and send udp packet
396 * out - output packet
435 * common between ipv4/ipv6 - setup checksum and send tcp packet
436 * out - output packet
478 // destination address in the packet header only affects what appears on the wire, not where the
479 // packet is sent to.
493 * takes a packet, translates it, and writes it to fd
494 * fd - fd to write translated packet to
496 * packet - packet
497 * packetsize - size of packet
499 void translate_packet(int fd, int to_ipv6, const uint8_t *packet, size_t packetsize) {
502 // Allocate buffers for all packet headers.
524 iov_len = ipv4_packet(out, CLAT_POS_IPHDR, packet, packetsize);
529 iov_len = ipv6_packet(out, CLAT_POS_IPHDR, packet, packetsize);