00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00023
00024
00025
00026
00027
00028
00029 #ifndef _raw_sock_h
00030 #define _raw_sock_h
00031
00032 #include "ip_addr.h"
00033
00035 struct raw_filter{
00036 struct net dst;
00037 unsigned short port1;
00038 unsigned short port2;
00039 char proto;
00040 };
00041
00042 extern int raw_ipip;
00043
00044 int raw_socket(int proto, struct ip_addr* ip, str* iface, int iphdr_incl);
00045 int raw_udp4_socket(struct ip_addr* ip, str* iface, int iphdr_incl);
00046 int recvpkt4(int sock, char* buf, int len, union sockaddr_union* from,
00047 union sockaddr_union* to);
00048 int raw_udp4_recv(int rsock, char** buf, int len, union sockaddr_union* from,
00049 union sockaddr_union* to, struct raw_filter* rf);
00050 int raw_udp4_send(int rsock, char* buf, unsigned int len,
00051 union sockaddr_union* from,
00052 union sockaddr_union* to);
00053 int raw_iphdr_udp4_send(int rsock, char* buf, unsigned int len,
00054 union sockaddr_union* from,
00055 union sockaddr_union* to, unsigned short mtu);
00056
00057 #endif