summaryrefslogtreecommitdiff
path: root/include/support/tos_mc_api.h
blob: 08776da76f68ae6a54e15bda0f75bc3e89f555a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef _MC_API_H
#define _MC_API_H
#include <sys/types.h>
#include <unistd.h>
/* 
	update log:
	2015-06-30, lijia([email protected]), �ӿڳ�ʼ���ӿڡ�����pid����; 
 */

typedef unsigned long long __u64;
typedef unsigned int __u32;
typedef unsigned short __u16;
typedef unsigned char __u8;

// �������Ľṹ��
struct mc_desc {        
	int type; 
	int family;
	int tot_len; 	// �����㳤�ȣ������˵����㡢���IJ㼰���߲���ܳ���
	void *l2_header; 
	int l2_len;
	void *ip_hdr;	
	void *ip_lable;
	int ip_label_len;
	void *pkt_label;
	int pkt_label_len;
	/*topsec session*/
	int dir;
	int ifindex;
	char  ifname[32];
	void *ts;
	char buffer[0]; // ָ��������ͷ���ݣ��ɴ˻�ȡ���ݰ�
}; 

/* 2015-06-30 add, ��ʼ��ʱ��Ҫ��ȡ��� */
void *tos_get_handle(pid_t pid);

void tos_format_log_pro1(char *buf);
int tos_tr_packet_recv(struct mc_desc **tr_packet, void *handle);
int tos_tr_packet_send(struct mc_desc *tr_packet, void *handle);



#endif