avoid MSG_PEEK

This commit is contained in:
wangyu-
2018-07-21 14:23:13 -05:00
parent 1e98ae10c2
commit 9e9ad56890
3 changed files with 86 additions and 24 deletions

View File

@@ -26,6 +26,10 @@ extern int random_drop;
extern int ifindex;
extern char g_packet_buf[buf_len];
extern int g_packet_buf_len;
extern int g_packet_buf_cnt;
struct icmphdr
{
uint8_t type;
@@ -108,6 +112,9 @@ int try_to_list_and_bind(int & bind_fd,u32_t local_ip_uint32,int port); //try t
int client_bind_to_a_new_port(int & bind_fd,u32_t local_ip_uint32);//find a free port and bind to it.
int client_bind_to_a_new_port2(int &fd,const address_t& address);
int discard_raw_packet();
int pre_recv_raw_packet();
int send_raw_ip(raw_info_t &raw_info,const char * payload,int payloadlen);
int peek_raw(packet_info_t &peek_info);