gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r12268 - gnunet/src/vpn


From: gnunet
Subject: [GNUnet-SVN] r12268 - gnunet/src/vpn
Date: Tue, 20 Jul 2010 10:20:39 +0200

Author: toelke
Date: 2010-07-20 10:20:39 +0200 (Tue, 20 Jul 2010)
New Revision: 12268

Removed:
   gnunet/src/vpn/gnunet-vpn-packet.c
Modified:
   gnunet/src/vpn/Makefile.am
Log:
deleted unused functions

Modified: gnunet/src/vpn/Makefile.am
===================================================================
--- gnunet/src/vpn/Makefile.am  2010-07-20 08:20:38 UTC (rev 12267)
+++ gnunet/src/vpn/Makefile.am  2010-07-20 08:20:39 UTC (rev 12268)
@@ -36,7 +36,7 @@
 # udp.c udp.h
 
 gnunet_daemon_vpn_SOURCES = \
- gnunet-daemon-vpn.c
+ gnunet-daemon-vpn.c gnunet-vpn-pretty-print.c
 gnunet_daemon_vpn_LDADD = \
   $(top_builddir)/src/core/libgnunetcore.la \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \

Deleted: gnunet/src/vpn/gnunet-vpn-packet.c
===================================================================
--- gnunet/src/vpn/gnunet-vpn-packet.c  2010-07-20 08:20:38 UTC (rev 12267)
+++ gnunet/src/vpn/gnunet-vpn-packet.c  2010-07-20 08:20:39 UTC (rev 12268)
@@ -1,88 +0,0 @@
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/uio.h>
-
-#include <linux/if_tun.h>
-
-#include "debug.h"
-#include "packet.h"
-#include "arpa/inet.h"
-
-short payload(struct ip6_hdr* hdr) {{{
-       return ntohs(hdr->paylgth);
-}}}
-
-void send_pkt(int fd, struct ip6_pkt* pkt) {{{
-       int sz = payload(&(pkt->hdr));
-       int w = 0;
-       char* buf = (char*)pkt;
-
-       w = 0;
-       while ( w > 0) {
-               int t = write(fd, buf+w, (sz + 40) - w);
-               if (t < 0)
-                       debug(1, 0, "packet: write : %s\n", strerror(errno));
-               else
-                       w+=t;
-       }
-
-       free(buf);
-}}}
-
-int recv_pkt(int fd, struct pkt_tun** pkt) {{{
-       int size = 1504;
-       unsigned char data[size];
-
-       debug(1, 0, "beginning to read...\n");
-
-       int r = read(fd, data, size);
-       debug(1, 0, "read %d bytes\n", r);
-
-       *pkt = (struct pkt_tun*)malloc(r);
-
-       memcpy(*pkt, data, r);
-       struct pkt_tun *_pkt = *pkt;
-
-       debug(1, 0, "read the flags: %04x\n", ntohs(_pkt->flags));
-       debug(1, 0, "read the type: %04x\n", ntohs(_pkt->type));
-
-       switch(ntohs(_pkt->type)) {
-               case 0x86dd:
-                       debug(1, 0, "reading an ipv6-packet\n");
-                       struct ip6_pkt * pkt6 = (struct ip6_pkt*) *pkt;
-                       size = payload(&(pkt6->hdr));
-                       // TODO: size might be greater than r!
-                       debug(1, 0, "read the size: %d\n", size);
-                       return size;
-                       break;
-               case 0x0800:
-                       debug(1, 0, "unknown pkt-type: IPv4\n");
-                       //IPv4 TODO
-                       break;
-               default:
-                       debug(1, 0, "unknown pkt-type: 0x%02x\n", 0x800);
-                       //Whatever TODO
-                       break;
-       }
-       return -1;
-}}}
-
-struct ip6_pkt* parse_ip6(struct pkt_tun* pkt) {{{
-       struct ip6_pkt* pkt6 = (struct ip6_pkt*)pkt;
-
-       return pkt6;
-}}}
-
-struct ip6_tcp* parse_ip6_tcp(struct ip6_pkt* pkt) {{{
-       struct ip6_tcp* res = (struct ip6_tcp*) pkt;
-
-       return res;
-}}}
-
-struct ip6_udp* parse_ip6_udp(struct ip6_pkt* pkt) {{{
-       struct ip6_udp* res = (struct ip6_udp*) pkt;
-
-       return res;
-}}}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]