1 Star 0 Fork 0

ltfafei/icmptunnel

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
icmp.h 903 Bytes
一键复制 编辑 原始数据 按行查看 历史
YaoYu-Li 提交于 2017-03-23 22:25 . Change the MTU size of tunnel (#23)
/**
* icmp.h
*/
#ifndef icmp_guard
#define icmp_guard
// Maximum transmission unit
#define MTU 1472
struct icmp_packet
{
char src_addr[100];
char dest_addr[100];
int type;
char *payload;
int payload_size;
};
/**
* Function to set packet type as ECHO
*/
void set_echo_type(struct icmp_packet *packet);
/**
* Function to set packet type as REPLY
*/
void set_reply_type(struct icmp_packet *packet);
/**
* Function to open a socket for icmp
*/
int open_icmp_socket();
/**
* Function to bind the socket to INADDR_ANY
*/
void bind_icmp_socket(int sock_fd);
/**
* Function to send ICMP Packet
*/
void send_icmp_packet(int sock_fd, struct icmp_packet *packet_details);
/**
* Function to receive ICMP Packet
*/
void receive_icmp_packet(int sock_fd, struct icmp_packet *packet_details);
/**
* Function to close the icmp socket
*/
void close_icmp_socket(int sock_fd);
#endif
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/afei00123/icmptunnel.git
git@gitee.com:afei00123/icmptunnel.git
afei00123
icmptunnel
icmptunnel
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385