This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
mesa-framework-mesa-jump-layer/inc/MESA_jump_layer.h
lijia f6f399f69a create new project.
除sapp和插件之外, 其他模块也经常有从某个层跳转到某个层的需求,
从sapp中剥离此部分代码, 独立成为一个公共库.
2021-09-14 15:50:53 +08:00

30 lines
751 B
C

#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