TSG-7784 PacketAdapter支持CI自动构建RPM; 修改代码结构

This commit is contained in:
卢文朋
2021-09-13 02:12:29 +00:00
committed by luwenpeng
parent aa887fd382
commit ba21a53bb7
35 changed files with 2878 additions and 915 deletions

View File

@@ -0,0 +1,46 @@
#ifndef _DECODE_TCP_H
#define _DECODE_TCP_H
#ifdef __cpluscplus
extern "C"
{
#endif
#include "public.h"
#define TCP_HEADER_LEN 20
typedef struct tcp_header_s
{
uint16_t th_sport; /**< source port */
uint16_t th_dport; /**< destination port */
uint32_t th_seq; /**< sequence number */
uint32_t th_ack; /**< acknowledgement number */
uint8_t th_offx2; /**< offset and reserved */
uint8_t th_flags; /**< pkt flags */
uint16_t th_win; /**< pkt window */
uint16_t th_sum; /**< checksum */
uint16_t th_urp; /**< urgent pointer */
} __attribute__((__packed__)) tcp_header_t;
typedef struct tcp_info_s
{
uint16_t src_port;
uint16_t dst_port;
tcp_header_t *hdr;
uint8_t *payload;
uint32_t opt_len;
uint32_t hdr_len;
uint32_t payload_len;
} tcp_info_t;
int decode_tcp(tcp_info_t *packet, const uint8_t *data, uint32_t len);
void dump_tcp_info(uint32_t pkt_id, tcp_info_t *packet);
#ifdef __cpluscplus
}
#endif
#endif