From 755b73c213813659c1b1e1f06dad895710bca3ad Mon Sep 17 00:00:00 2001 From: =?utf8?q?Philipp=20T=C3=B6lke?= Date: Tue, 20 Jul 2010 08:20:39 +0000 Subject: [PATCH] deleted unused functions --- src/vpn/Makefile.am | 2 +- src/vpn/gnunet-vpn-packet.c | 88 ------------------------------------- 2 files changed, 1 insertion(+), 89 deletions(-) delete mode 100644 src/vpn/gnunet-vpn-packet.c diff --git a/src/vpn/Makefile.am b/src/vpn/Makefile.am index 480d58145..a30ff7e6e 100644 --- a/src/vpn/Makefile.am +++ b/src/vpn/Makefile.am @@ -36,7 +36,7 @@ gnunet_vpn_helper_SOURCES = \ # 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 \ diff --git a/src/vpn/gnunet-vpn-packet.c b/src/vpn/gnunet-vpn-packet.c deleted file mode 100644 index deda87216..000000000 --- a/src/vpn/gnunet-vpn-packet.c +++ /dev/null @@ -1,88 +0,0 @@ -#include -#include -#include -#include -#include - -#include - -#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; -}}} -- 2.25.1