• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • Directories
  • File List
  • Globals

raw_sock.h

00001 /*
00002  * $Id$
00003  *
00004  * Copyright (C) 2010 iptelorg GmbH
00005  *
00006  * Permission to use, copy, modify, and distribute this software for any
00007  * purpose with or without fee is hereby granted, provided that the above
00008  * copyright notice and this permission notice appear in all copies.
00009  *
00010  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
00011  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
00012  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
00013  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
00014  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00015  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
00016  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00017  */
00023 /* 
00024  * History:
00025  * --------
00026  *  2010-06-07  initial version (from older code) andrei
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 /* _raw_sock_h */

Generated on Tue May 22 2012 13:10:13 for SIP Router by  doxygen 1.7.1