TSG-7784 PacketAdapter支持CI自动构建RPM; 修改代码结构
This commit is contained in:
58
common/include/decode_ipv6.h
Normal file
58
common/include/decode_ipv6.h
Normal file
@@ -0,0 +1,58 @@
|
||||
#ifndef _DECODE_IPV6_H
|
||||
#define _DECODE_IPV6_H
|
||||
|
||||
#ifdef __cpluscplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "public.h"
|
||||
|
||||
#define IPV6_HEADER_LEN 40
|
||||
|
||||
typedef struct ipv6_header_s
|
||||
{
|
||||
union
|
||||
{
|
||||
struct ip6_un1_
|
||||
{
|
||||
uint32_t ip6_un1_flow; /* 20 bits of flow-ID */
|
||||
uint16_t ip6_un1_plen; /* payload length */
|
||||
uint8_t ip6_un1_nxt; /* next header */
|
||||
uint8_t ip6_un1_hlim; /* hop limit */
|
||||
} ip6_un1;
|
||||
uint8_t ip6_un2_vfc; /* 4 bits version, top 4 bits class */
|
||||
} ip6_hdrun;
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint32_t ip6_src[4];
|
||||
uint32_t ip6_dst[4];
|
||||
} ip6_un2;
|
||||
uint16_t ip6_addrs[16];
|
||||
} ip6_hdrun2;
|
||||
} __attribute__((__packed__)) ipv6_header_t;
|
||||
|
||||
typedef struct ipv6_info_s
|
||||
{
|
||||
char src_addr[INET6_ADDRSTRLEN];
|
||||
char dst_addr[INET6_ADDRSTRLEN];
|
||||
|
||||
ipv6_header_t *hdr;
|
||||
uint8_t *payload;
|
||||
uint8_t next_protocol;
|
||||
|
||||
uint32_t hdr_len;
|
||||
uint32_t payload_len;
|
||||
} ipv6_info_t;
|
||||
|
||||
int decode_ipv6(ipv6_info_t *packet, const uint8_t *data, uint32_t len);
|
||||
void dump_ipv6_info(uint32_t pkt_id, ipv6_info_t *packet);
|
||||
|
||||
#ifdef __cpluscplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user