TSG-13630 tsg-service-chaining-engine使用mrzcpd捕获报文/回注报文
TSG-13685 tsg-service-chaining-engine使用VXLAN封装Steering/Mirroring的Package
This commit is contained in:
@@ -9,7 +9,16 @@ extern "C"
|
||||
#define MIN(a, b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
#define LOG_TAG_POLICY "POLICY"
|
||||
#define LOG_TAG_UTILS "UTILS"
|
||||
#define LOG_TAG_UTILS "UTILS"
|
||||
#define LOG_TAG_RAWPKT "RAW_PACKET"
|
||||
#define LOG_TAG_STABLE "SESSION_TABLE"
|
||||
#define LOG_TAG_PKTIO "PACKET_IO"
|
||||
#define LOG_TAG_METRICS "METRICS"
|
||||
#define LOG_TAG_SCE "SCE"
|
||||
|
||||
/******************************************************************************
|
||||
* fixed_num_array
|
||||
******************************************************************************/
|
||||
|
||||
struct fixed_num_array
|
||||
{
|
||||
@@ -21,9 +30,54 @@ struct fixed_num_array
|
||||
void fixed_num_array_init(struct fixed_num_array *array);
|
||||
void fixed_num_array_add_elem(struct fixed_num_array *array, int elem);
|
||||
void fixed_num_array_del_elem(struct fixed_num_array *array, int elem);
|
||||
int fixed_num_array_is_full(struct fixed_num_array *array);
|
||||
int fixed_num_array_count_elem(struct fixed_num_array *array);
|
||||
int fixed_num_array_exist_elem(struct fixed_num_array *array, int elem);
|
||||
int fixed_num_array_index_elem(struct fixed_num_array *array, int index);
|
||||
|
||||
/******************************************************************************
|
||||
* sids
|
||||
******************************************************************************/
|
||||
|
||||
#include "marsio.h"
|
||||
|
||||
struct sids
|
||||
{
|
||||
int num;
|
||||
sid_t elems[MR_SID_LIST_MAXLEN];
|
||||
};
|
||||
|
||||
void sids_write_once(struct sids *dst, struct sids *src);
|
||||
void sids_copy(struct sids *dst, struct sids *src);
|
||||
|
||||
/******************************************************************************
|
||||
* throughput_metrics
|
||||
******************************************************************************/
|
||||
|
||||
struct throughput_metrics
|
||||
{
|
||||
uint64_t n_pkts;
|
||||
uint64_t n_bytes;
|
||||
};
|
||||
|
||||
void throughput_metrics_inc(struct throughput_metrics *iterm, uint64_t n_pkts, uint64_t n_bytes);
|
||||
|
||||
/******************************************************************************
|
||||
* protocol
|
||||
******************************************************************************/
|
||||
|
||||
void build_udp_header(const char *l3_hdr, int l3_hdr_len, struct udphdr *udp_hdr, u_int16_t udp_sport, u_int16_t udp_dport, int payload_len);
|
||||
void build_ip_header(struct ip *ip_hdr, u_int8_t next_protocol, const char *src_addr, const char *dst_addr, uint16_t payload_len);
|
||||
void build_ether_header(struct ethhdr *eth_hdr, uint16_t next_protocol, const char *src_mac, const char *dst_mac);
|
||||
|
||||
/******************************************************************************
|
||||
* device
|
||||
******************************************************************************/
|
||||
|
||||
int get_ip_by_device_name(const char *dev_name, char *ip_buff);
|
||||
int get_mac_by_device_name(const char *dev_name, char *mac_buff);
|
||||
int str_to_mac(const char *str, char *mac_buff);
|
||||
|
||||
#ifdef __cpluscplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user