Transport-network layer interface.
More...
Go to the source code of this file.
Transport-network layer interface.
Definition in file tcpip.h.
◆ FILE_LICENCE()
| FILE_LICENCE |
( |
GPL2_OR_LATER_OR_UBDL |
| ) |
|
◆ FILE_SECBOOT()
| FILE_SECBOOT |
( |
PERMITTED |
| ) |
|
◆ tcpip_continue_chksum()
Calculate continued TCP/IP checkum.
- Parameters
-
| partial | Checksum of already-summed data, in network byte order |
| data | Data buffer |
| len | Length of data buffer |
- Return values
-
| cksum | Updated checksum, in network byte order |
Definition at line 46 of file x86_tcpip.c.
48 unsigned long sum = ( ( ~partial ) & 0xffff );
49 unsigned long initial_word_count;
50 unsigned long loop_count;
51 unsigned long loop_partial_count;
52 unsigned long final_word_count;
53 unsigned long final_byte;
56 unsigned long discard_a;
57 unsigned long discard_r1;
58 unsigned long discard_r2;
65 if (
len >=
sizeof ( sum ) ) {
67 (
sizeof ( sum ) - 1 ) ) >> 1 );
69 initial_word_count = 0;
71 len -= ( initial_word_count * 2 );
78 loop_count = (
len / (
sizeof ( sum ) * 16 ) );
80 ( (
len % (
sizeof ( sum ) * 16 ) ) /
sizeof ( sum ) );
85 final_word_count = ( (
len %
sizeof ( sum ) ) / 2 );
88 final_byte = (
len & 1 );
94 "imul $( -x86_tcpip_loop_step_size ), %4\n\t" 111 "\nx86_tcpip_loop_start:\n\t" 112 "lods%z2\n\tadc %2, %0\n\t" 113 "lods%z2\n\tadc %2, %0\n\t" 114 "lods%z2\n\tadc %2, %0\n\t" 115 "lods%z2\n\tadc %2, %0\n\t" 116 "lods%z2\n\tadc %2, %0\n\t" 117 "lods%z2\n\tadc %2, %0\n\t" 118 "lods%z2\n\tadc %2, %0\n\t" 119 "lods%z2\n\tadc %2, %0\n\t" 120 "lods%z2\n\tadc %2, %0\n\t" 121 "lods%z2\n\tadc %2, %0\n\t" 122 "lods%z2\n\tadc %2, %0\n\t" 123 "lods%z2\n\tadc %2, %0\n\t" 124 "lods%z2\n\tadc %2, %0\n\t" 125 "lods%z2\n\tadc %2, %0\n\t" 126 "lods%z2\n\tadc %2, %0\n\t" 127 "lods%z2\n\tadc %2, %0\n\t" 128 "\nx86_tcpip_loop_end:\n\t" 129 "loop x86_tcpip_loop_start\n\t" 130 ".equ x86_tcpip_loop_step_size, " 131 " ( ( x86_tcpip_loop_end - x86_tcpip_loop_start ) >> 4 )\n\t" 165 :
"=&Q" ( sum ),
"=&S" (
discard_S ),
"=&a" ( discard_a ),
166 "=&c" (
discard_c ),
"=&r" ( discard_r1 ),
168 :
"0" ( sum ),
"1" (
data ),
"2" ( 0 ),
169 "3" ( initial_word_count + 1 ),
"4" ( loop_partial_count ),
171 "g" ( final_word_count + 1 ),
"g" ( final_byte ) );
173 return ( ~sum & 0xffff );
char x86_tcpip_loop_end[]
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")
uint8_t data[48]
Additional event data.
References __asm__(), data, discard_c, discard_S, len, ULONG_MAX, and x86_tcpip_loop_end.
Referenced by icmpv6_rx(), ipv4_pshdr_chksum(), ipv6_pshdr_chksum(), tcp_rx(), tcpip_chksum(), tcpip_okx(), tcpip_random_okx(), and udp_rx().