along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net_packet.c,v 1.1.2.22 2002/09/09 21:24:41 guus Exp $
+ $Id: net_packet.c,v 1.1.2.24 2002/09/15 14:55:53 guus Exp $
*/
#include "config.h"
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
-#ifdef HAVE_NETINET_IN_SYSTM_H
-#include <netinet/in_systm.h>
-#endif
-#ifdef HAVE_NETINET_IP_H
-#include <netinet/ip.h>
-#endif
-#ifdef HAVE_NETINET_TCP_H
-#include <netinet/tcp.h>
-#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <net/if.h>
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+#ifdef HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
#include <openssl/rand.h>
#include <openssl/evp.h>
/* VPN packet I/O */
-void receive_udppacket(node_t * n, vpn_packet_t * inpkt)
+void receive_udppacket(node_t *n, vpn_packet_t *inpkt)
{
vpn_packet_t pkt1, pkt2;
vpn_packet_t *pkt[] = { &pkt1, &pkt2, &pkt1, &pkt2 };
receive_packet(n, inpkt);
}
-void receive_tcppacket(connection_t * c, char *buffer, int len)
+void receive_tcppacket(connection_t *c, char *buffer, int len)
{
vpn_packet_t outpkt;
receive_packet(c->node, &outpkt);
}
-void receive_packet(node_t * n, vpn_packet_t * packet)
+void receive_packet(node_t *n, vpn_packet_t *packet)
{
cp();
route_incoming(n, packet);
}
-void send_udppacket(node_t * n, vpn_packet_t * inpkt)
+void send_udppacket(node_t *n, vpn_packet_t *inpkt)
{
vpn_packet_t pkt1, pkt2;
vpn_packet_t *pkt[] = { &pkt1, &pkt2, &pkt1, &pkt2 };
/*
send a packet to the given vpn ip.
*/
-void send_packet(node_t * n, vpn_packet_t * packet)
+void send_packet(node_t *n, vpn_packet_t *packet)
{
node_t *via;
/* Broadcast a packet using the minimum spanning tree */
-void broadcast_packet(node_t * from, vpn_packet_t * packet)
+void broadcast_packet(node_t *from, vpn_packet_t *packet)
{
avl_node_t *node;
connection_t *c;
}
}
-void flush_queue(node_t * n)
+void flush_queue(node_t *n)
{
list_node_t *node, *next;