#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
#include "misc.h"
#include "net.h"
Go to the source code of this file.
Functions | |
void | net_ip_checksum (unsigned char *ip_header, int chksumoffset, int len) |
void | net_ip_tcp_checksum (unsigned char *tcp_header, int chksumoffset, int tcp_len, unsigned char *srcaddr, unsigned char *dstaddr, int udpflag) |
void | net_ip_tcp_connectionreply (struct net *net, void *extra, int con_id, int connecting, unsigned char *data, int datalen, int rst) |
void | net_ip (struct net *net, void *extra, unsigned char *packet, int len) |
void | net_ip_broadcast (struct net *net, void *extra, unsigned char *packet, int len) |
void | net_udp_rx_avail (struct net *net, void *extra) |
void | net_tcp_rx_avail (struct net *net, void *extra) |
void net_ip | ( | struct net * | net, |
void * | extra, | ||
unsigned char * | packet, | ||
int | len | ||
) |
void net_ip_broadcast | ( | struct net * | net, |
void * | extra, | ||
unsigned char * | packet, | ||
int | len | ||
) |
Definition at line 1133 of file net_ip.cc.
References fatal(), ethernet_packet_link::len, net::netmask_ipv4, and net::netmask_ipv4_len.
Referenced by net_ethernet_tx().
void net_ip_checksum | ( | unsigned char * | ip_header, |
int | chksumoffset, | ||
int | len | ||
) |
Definition at line 55 of file net_ip.cc.
Referenced by net_ip_tcp_connectionreply(), and net_udp_rx_avail().
void net_ip_tcp_checksum | ( | unsigned char * | tcp_header, |
int | chksumoffset, | ||
int | tcp_len, | ||
unsigned char * | srcaddr, | ||
unsigned char * | dstaddr, | ||
int | udpflag | ||
) |
Definition at line 91 of file net_ip.cc.
Referenced by net_ip_tcp_connectionreply().
void net_ip_tcp_connectionreply | ( | struct net * | net, |
void * | extra, | ||
int | con_id, | ||
int | connecting, | ||
unsigned char * | data, | ||
int | datalen, | ||
int | rst | ||
) |
Definition at line 228 of file net_ip.cc.
References ethernet_packet_link::data, tcp_connection::ethernet_address, fatal(), net::gateway_ethernet_addr, tcp_connection::inside_seqnr, tcp_connection::inside_tcp_port, net_allocate_ethernet_packet_link(), net_ip_checksum(), net_ip_tcp_checksum(), tcp_connection::outside_acknr, tcp_connection::outside_seqnr, tcp_connection::outside_tcp_port, tcp_connection::state, net::tcp_connections, tcp_connection::tcp_id, TCP_OUTSIDE_CONNECTED, TCP_OUTSIDE_DISCONNECTED, and net::timestamp.
Referenced by net_tcp_rx_avail().
void net_tcp_rx_avail | ( | struct net * | net, |
void * | extra | ||
) |
Definition at line 1384 of file net_ip.cc.
References CHECK_ALLOCATION, debug, fatal(), tcp_connection::in_use, tcp_connection::incoming_buf, tcp_connection::incoming_buf_len, tcp_connection::incoming_buf_rounds, tcp_connection::incoming_buf_seqnr, tcp_connection::inside_acknr, tcp_connection::last_used_timestamp, MAX_TCP_CONNECTIONS, net_ip_tcp_connectionreply(), tcp_connection::outside_seqnr, tcp_connection::socket, tcp_connection::state, net::tcp_connections, TCP_INCOMING_BUF_LEN, TCP_OUTSIDE_CONNECTED, TCP_OUTSIDE_DISCONNECTED, TCP_OUTSIDE_TRYINGTOCONNECT, and net::timestamp.
Referenced by net_ethernet_rx_avail().
void net_udp_rx_avail | ( | struct net * | net, |
void * | extra | ||
) |
Definition at line 1225 of file net_ip.cc.
References ethernet_packet_link::data, udp_connection::fake_ns, fatal(), net::gateway_ethernet_addr, net::gateway_ipv4_addr, udp_connection::in_use, udp_connection::last_used_timestamp, MAX_UDP_CONNECTIONS, net_allocate_ethernet_packet_link(), net_ip_checksum(), udp_connection::socket, net::timestamp, net::udp_connections, and udp_connection::udp_id.
Referenced by net_ethernet_rx_avail().