24 |
#define __IPTUNNEL_INIT_H__ |
#define __IPTUNNEL_INIT_H__ |
25 |
|
|
26 |
#include <sys/types.h> |
#include <sys/types.h> |
27 |
|
#include <sys/socket.h> |
28 |
#include <netinet/in.h> |
#include <netinet/in.h> |
29 |
|
#include <arpa/inet.h> |
30 |
|
|
31 |
#include "buffer.h" |
#include "buffer.h" |
32 |
#include "fdo.h" |
#include "fdo.h" |
33 |
|
|
38 |
__attribute__ ((packed)); |
__attribute__ ((packed)); |
39 |
|
|
40 |
|
|
41 |
struct ip_config_reply1 |
struct ip_config_header |
|
{ |
|
|
u_int8_t unknow1; |
|
|
in_addr_t address; |
|
|
u_int8_t unknow2[8]; |
|
|
in_addr_t dns_address; |
|
|
u_int8_t unknow3[8]; |
|
|
u_int8_t hostname_len; |
|
|
char hostname; |
|
|
} |
|
|
__attribute__ ((packed)); |
|
|
|
|
|
struct ip_config_reply2 |
|
42 |
{ |
{ |
43 |
u_int8_t unknow1[4]; |
u_int8_t type; |
44 |
in_addr_t address; |
u_int8_t length; |
45 |
u_int8_t unknow2[8]; |
}; |
46 |
in_addr_t dns_address; |
|
47 |
u_int8_t unknow3[5]; |
#define TYPE_IP_ADDR 3 |
48 |
u_int8_t hostname_len; |
#define TYPE_DNS_ADDR 4 |
49 |
char hostname; |
#define TYPE_MTU 5 |
50 |
} |
#define TYPE_HOSTNAME 10 |
51 |
__attribute__ ((packed)); |
#define TYPE_SUBNET 12 |
52 |
|
|
53 |
#define DEFAULT_IP_CONFIG_REQUEST (struct ip_config_request)\ |
#define DEFAULT_IP_CONFIG_REQUEST (struct ip_config_request)\ |
54 |
{ {0x07, 0x01, 0x01, 0x0c, 0x01, 0x01, 0x0d, 0x01, 0x01} } |
{ {0x07, 0x01, 0x01, 0x0c, 0x01, 0x01, 0x0d, 0x01, 0x01} } |
57 |
void ip_tunnel_init (); |
void ip_tunnel_init (); |
58 |
int ip_tunnel_ready (buffer_t *bufin); |
int ip_tunnel_ready (buffer_t *bufin); |
59 |
void ip_tunnel_config (token_t token, char *data, size_t data_size); |
void ip_tunnel_config (token_t token, char *data, size_t data_size); |
60 |
|
struct in_addr netmask(int bits); |
61 |
void init_iface (buffer_t *in, buffer_t *out); |
void init_iface (buffer_t *in, buffer_t *out); |
62 |
|
int destroy_iface (buffer_t *in, buffer_t *out); |
63 |
|
|
64 |
#endif /* __IPTUNNEL_INIT_H__ */ |
#endif /* __IPTUNNEL_INIT_H__ */ |