diff options
author | Yonit <yhalperi@redhat.com> | 2009-05-27 12:20:10 +0300 |
---|---|---|
committer | Yonit <yhalperi@redhat.com> | 2009-05-27 12:20:10 +0300 |
commit | 0cc49020edd88d4a914c67407bc6ae0bda30bf48 (patch) | |
tree | 304e0f5c59de0c37dec9d08e6509945a40a6ffd0 /ip_input.c | |
parent | 47de9909ff0eb29285e62e5494dcc7ca4abb9da9 (diff) |
slirp that uses user defined interface for sockets instead of operating system
sockets. Currently supports only TCP.
some addtional changes:
1) DHCP NACK support
2) moving prototypes from slirp.h to specific header files
3) not supporting emulated sockets slirp
Diffstat (limited to 'ip_input.c')
-rw-r--r-- | ip_input.c | 32 |
1 files changed, 10 insertions, 22 deletions
@@ -42,9 +42,13 @@ * terms and conditions of the copyright. */ -#include <slirp.h> -#include <osdep.h> + +#include "slirp_common.h" +#include "ip.h" #include "ip_icmp.h" +#include "udp.h" +#include "tcp.h" +#include "cksum.h" #ifdef LOG_ENABLED struct ipstat ipstat; @@ -138,25 +142,6 @@ ip_input(m) goto bad; } - if (slirp_restrict) { - if (memcmp(&ip->ip_dst.s_addr, &special_addr, 3)) { - if (ip->ip_dst.s_addr == 0xffffffff && ip->ip_p != IPPROTO_UDP) - goto bad; - } else { - int host = ntohl(ip->ip_dst.s_addr) & 0xff; - struct ex_list *ex_ptr; - - if (host == 0xff) - goto bad; - - for (ex_ptr = exec_list; ex_ptr; ex_ptr = ex_ptr->ex_next) - if (ex_ptr->ex_addr == host) - break; - - if (!ex_ptr) - goto bad; - } - } /* Should drop packet if mbuf too long? hmmm... */ if (m->m_len > ip->ip_len) @@ -249,9 +234,12 @@ ip_input(m) udp_input(m, hlen); break; case IPPROTO_ICMP: - icmp_input(m, hlen); + //icmp_input(m, hlen); + printf("ip_input : ICMP not supported yet\n"); // TODO: temp + return; break; default: + printf("ip_input : IPPROTO %d not supported", ip->ip_p); // TODO: temp STAT(ipstat.ips_noproto++); m_free(m); } |