TSG-7784 PacketAdapter支持CI自动构建RPM; 修改代码结构
This commit is contained in:
40
common/include/decode_udp.h
Normal file
40
common/include/decode_udp.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef _DECODE_UDP_H
|
||||
#define _DECODE_UDP_H
|
||||
|
||||
#ifdef __cpluscplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "public.h"
|
||||
|
||||
#define UDP_HEADER_LEN 8
|
||||
|
||||
typedef struct udp_header_s
|
||||
{
|
||||
uint16_t udp_src_port;
|
||||
uint16_t udp_dst_port;
|
||||
uint16_t udp_len;
|
||||
uint16_t udp_sum;
|
||||
} __attribute__((__packed__)) udp_header_t;
|
||||
|
||||
typedef struct udp_info_s
|
||||
{
|
||||
uint16_t src_port;
|
||||
uint16_t dst_port;
|
||||
|
||||
udp_header_t *hdr;
|
||||
uint8_t *payload;
|
||||
|
||||
uint32_t hdr_len;
|
||||
uint32_t payload_len;
|
||||
} udp_info_t;
|
||||
|
||||
int decode_udp(udp_info_t *packet, const uint8_t *data, uint32_t len);
|
||||
void dump_udp_info(uint32_t pkt_id, udp_info_t *packet);
|
||||
|
||||
#ifdef __cpluscplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user