Sha256: 0b348aee16c8446df29c6e39ddf21e1156ee802b5fbc2a309b5a6799bc5ab141
Contents?: true
Size: 1.44 KB
Versions: 20
Compression:
Stored size: 1.44 KB
Contents
/* * TCP header definitions * * Copyright (C) 2008-2013 NEC Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef TCP_H #define TCP_H typedef struct tcp_header { uint16_t src_port; uint16_t dst_port; uint32_t seq_no; uint32_t ack_no; #if ( __BYTE_ORDER == __BIG_ENDIAN ) uint8_t offset:4, reserved:4; #else // _LITTLE_ENDIAN uint8_t reserved:4, offset:4; #endif uint8_t flags; uint16_t window; uint16_t csum; uint16_t urgent; } tcp_header_t; #define TCP_FLAG_FIN ( 1 << 0 ) #define TCP_FLAG_SYN ( 1 << 1 ) #define TCP_FLAG_RST ( 1 << 2 ) #define TCP_FLAG_PSH ( 1 << 3 ) #define TCP_FLAG_ACK ( 1 << 4 ) #define TCP_FLAG_URG ( 1 << 5 ) #define TCP_FLAG_ECE ( 1 << 6 ) #define TCP_FLAG_CWR ( 1 << 7 ) #endif // TCP_H /* * Local variables: * c-basic-offset: 2 * indent-tabs-mode: nil * End: */
Version data entries
20 entries across 20 versions & 1 rubygems