create new project.
除sapp和插件之外, 其他模块也经常有从某个层跳转到某个层的需求, 从sapp中剥离此部分代码, 独立成为一个公共库.
This commit is contained in:
30
inc/MESA_jump_layer.h
Normal file
30
inc/MESA_jump_layer.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#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);
|
||||
|
||||
/*
|
||||
The raw_layer_type and expect_layer_type refer to sapp_base.h->enum addr_type_t
|
||||
*/
|
||||
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
|
||||
Reference in New Issue
Block a user