added send_raw_packet() and recv_raw_packet()

This commit is contained in:
wangyu-
2018-07-23 09:50:21 -05:00
parent b0d96a3c47
commit 80d21e56c7
7 changed files with 197 additions and 105 deletions

View File

@@ -28,6 +28,7 @@
#include <netinet/tcp.h> //Provides declarations for tcp header
#include <netinet/udp.h>
#include <netinet/ip.h> //Provides declarations for ip header
#include <netinet/ip6.h>
#include <netinet/if_ether.h>
#include <arpa/inet.h>
#include <fcntl.h>
@@ -150,6 +151,8 @@ struct address_t //TODO scope id
int from_str(char * str);
int from_str_ip_only(char * str);
int from_sockaddr(sockaddr *,socklen_t);
char* get_str();
@@ -233,6 +236,19 @@ template <>
};
}
union my_ip_t //just a simple version of address_t,stores ip only
{
u32_t v4;
in6_addr v6;
bool equal (const my_ip_t &b) const;
//int from_str(char * str);
char * get_str1() const;
char * get_str2() const;
};
struct not_copy_able_t
{
not_copy_able_t()