Pārlūkot izejas kodu

Use whole bytes for the ACKED and RCVD portions of tcp_state; it

produces slightly smaller code.
tags/v0.9.3
Michael Brown 18 gadus atpakaļ
vecāks
revīzija
b91b9d3d88
1 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. 3
    3
      src/include/gpxe/tcp.h

+ 3
- 3
src/include/gpxe/tcp.h Parādīt failu

58
  * Note that this applies only to SYN and FIN.
58
  * Note that this applies only to SYN and FIN.
59
  */
59
  */
60
 #define TCP_STATE_ACKED(flags) ( (flags) << 8 )
60
 #define TCP_STATE_ACKED(flags) ( (flags) << 8 )
61
-#define TCP_FLAGS_ACKED(state) ( ( (state) >> 8 ) & 0x03 )
61
+#define TCP_FLAGS_ACKED(state) ( ( (state) >> 8 ) & 0xff )
62
 
62
 
63
 /** TCP flags that have been received from the peer
63
 /** TCP flags that have been received from the peer
64
  *
64
  *
65
  * Note that this applies only to SYN and FIN, and that once SYN has
65
  * Note that this applies only to SYN and FIN, and that once SYN has
66
  * been received, we should always be sending ACK.
66
  * been received, we should always be sending ACK.
67
  */
67
  */
68
-#define TCP_STATE_RCVD(flags) ( (flags) << 12 )
69
-#define TCP_FLAGS_RCVD(state) ( ( (state) >> 12 ) & 0x03 )
68
+#define TCP_STATE_RCVD(flags) ( (flags) << 16 )
69
+#define TCP_FLAGS_RCVD(state) ( ( (state) >> 16 ) & 0xff )
70
 
70
 
71
 /** TCP flags that are currently being sent in outgoing packets */
71
 /** TCP flags that are currently being sent in outgoing packets */
72
 #define TCP_FLAGS_SENDING(state) \
72
 #define TCP_FLAGS_SENDING(state) \

Notiek ielāde…
Atcelt
Saglabāt