summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/public/stream_inc/MESA_jump_layer.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/include/public/stream_inc/MESA_jump_layer.h b/include/public/stream_inc/MESA_jump_layer.h
new file mode 100644
index 0000000..d5715fe
--- /dev/null
+++ b/include/public/stream_inc/MESA_jump_layer.h
@@ -0,0 +1,57 @@
+#ifndef __MESA_JUMP_LAYER_H_
+#define __MESA_JUMP_LAYER_H_ 1
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "stream.h"
+#include <netinet/ip.h>
+#include <netinet/ip6.h>
+
+
+const char *MESA_jump_layer_get_last_error(void);
+
+
+/*
+ CHN : ���ݰ�ͷ��ƫ�ƺ���.
+
+ ����:
+ raw_data: ��ǰ���ͷ��ָ��;
+ raw_layer_type: ��ǰ��ĵ�ַ����, ���: enum addr_type_t ;
+ expect_layer_type: ������ת���ĵ�ַ����, ���: enum addr_type_t ;
+
+ ����ֵ:
+ NULL: �޴˵�ַ;
+ NON-NULL: ��Ӧ���ͷ����ַ.
+
+ ����:
+ ���赱ǰ��ΪEthernet, ��ʼ��ͷ��ַΪthis_layer_hdr, ����ת��IPv6��ͷ��:
+ struct ip6_hdr *ip6_header;
+ ip6_header = MESA_net_jump_to_layer(this_layer_hdr, ADDR_TYPE_MAC, ADDR_TYPE_IPV6);
+*/
+const void *MESA_jump_layer(const void *raw_data, int raw_layer_type, int expect_layer_type);
+
+/*
+ MESA_jump_layer_greedy��MESA_jump_layer������:
+ ��������Ƕ��Э����˵,
+ MESA_jump_layer��ת����һ��expect_layer_type;
+ MESA_jump_layer_greedy��ת�����ڲ��expect_layer_type;
+*/
+const void *MESA_jump_layer_greedy(const void *raw_data, int raw_layer_type, int expect_layer_type);
+
+
+
+/* ��ǰ������ǰ�Ľӿ�����, ����ͬ�� */
+const void *MESA_net_jump_to_layer(const void *raw_data, int raw_layer_type, int expect_layer_type);
+const void *MESA_net_jump_to_layer_greedy(const void *raw_data, int raw_layer_type, int expect_layer_type);
+
+
+
+const char *MESA_jump_layer_ipv4_ntop(const struct ip *ip4_hdr, char *out_buf, int buf_len );
+const char *MESA_jump_layer_ipv6_ntop(const struct ip6_hdr *ip6_hdr, char *out_buf, int buf_len);
+
+#ifdef __cplusplus
+}
+#endif