Michael Brown
978865da2f
[IPv4] Use default netmasks when no subnet mask is specified.
vor 17 Jahren
Michael Brown
aec9b8a41b
[Settings] Use a settings applicator to configure IPv4 routes.
vor 17 Jahren
Michael Brown
df868476e7
Various warnings fixups for OpenBSD with gcc-3.3.5.
vor 17 Jahren
Holger Lubitz
6f0eca1400
use malloc attribute
vor 18 Jahren
Michael Brown
5b52630a9c
Never attempt to route the broadcast address.
vor 18 Jahren
Michael Brown
f77815f2b1
Kill off hotplug.h and just make net devices normal reference-counted
structures.
DHCP still broken and #if 0'd out.
vor 18 Jahren
Michael Brown
3e2c6b6736
pkbuff->iobuf changeover
Achieved via Perl using:
perl -pi -e 's/pk_buff/io_buffer/g; s/Packet buffer/I\/O buffer/ig; ' \
-e 's/pkbuff\.h/iobuf.h/g; s/pkb_/iob_/g; s/_pkb/_iob/g; ' \
-e 's/pkb/iobuf/g; s/PKB/IOB/g;'
vor 18 Jahren
Michael Brown
73b09ecba6
Use stdio.h instead of vsprintf.h
vor 18 Jahren
Michael Brown
5ff23aa406
Include stdlib.h rather than malloc.h
vor 18 Jahren
Michael Brown
f11da20f25
When a network device is specified to tcpip_tx() or it's children, treat
it as a fallback network device rather than an explicitly forced network
device.
Clear routing table entries before re-attempting DHCP.
vor 18 Jahren
Michael Brown
1a1fc23417
Improve debugging
vor 18 Jahren
Michael Brown
c953c1a1c3
Use -ENETUNREACH to mean "no reachable network device exists, don't bother
retrying".
vor 18 Jahren
Michael Brown
d9ba8f790b
Add route() function to display routing table.
vor 18 Jahren
Michael Brown
cc9b32c405
Remove uIP; we haven't used it for quite some time now.
vor 18 Jahren
Michael Brown
f008b77ba2
Allow an explicit network device to be specified for IP-layer
transmissions.
vor 18 Jahren
Michael Brown
98b6154c3e
Add "name" field to network device, to facilitate netdev commands.
vor 18 Jahren
Michael Brown
35b5e5d3f5
Minirouting table entries hold a persistent reference to a net_device.
vor 18 Jahren
Michael Brown
a0525a4ed3
Verify checksums on the RX datapath.
Simplify checksum generation on the TX datapath.
vor 18 Jahren
Michael Brown
285beeff7c
Tidy up debug messages
Move routing into a separate function
vor 18 Jahren
Michael Brown
718294553b
Fix compiler warning
vor 18 Jahren
Michael Brown
867c7aef59
iphdr->hlen includes the IP header, so truncate packet *before*
stripping the header. Also fix an htons/ntohs confusion.
vor 19 Jahren
Marty Connor
ee9ae8130a
Remove _PROTOCOL macros for gcc 3.2 compatibility
vor 19 Jahren
Michael Brown
a3d508b648
Clarified packet ownership transfer between a few functions.
Added a large number of missing calls to free_pkb(). In the case of UDP,
no received packets were ever freed, which lead to memory exhaustion
remarkably quickly once pxelinux started up.
In general, any function with _rx() in its name which accepts a pk_buff
*must* either call free_pkb() or pass the pkb to another _rx() function
(e.g. the next layer up the stack). Since the UDP (and TCP) layers don't
pass packet buffers up to the higher-layer protocols (the
"applications"), they must free the packet buffer after calling the
application's newdata() method.
vor 19 Jahren
Nikhil Chandru Rao
409f69a08a
Changed ipv4_dump() to consume only one line.
vor 19 Jahren
Michael Brown
68e33224ef
gcc3 compatibility: removed ARP_NET_PROTOCOL().
vor 19 Jahren
Nikhil Chandru Rao
d2bdf81505
Removed some bugs in TCP
vor 19 Jahren
Michael Brown
885a630ddf
Fix routing when a gateway exists. This should probably be split into
a separate function.
vor 19 Jahren
Nikhil Chandru Rao
6714ec745a
Minor corrections
vor 19 Jahren
Michael Brown
467e9627cc
Added features that will be required for PXE UDP support.
Introduced struct sockaddr_tcpip, to simplify code that deals with
both IPv4 and IPv6 addresses.
Reorganised parts of tcpip.c and udp.c.
vor 19 Jahren
Nikhil Chandru Rao
c24546c70b
Minor changes to the network layer rx() functions
vor 19 Jahren
Michael Brown
1ebb68e49a
Renamed trans_{rx,tx}() to tcpip_{rx,tx}(), since they are specific to
the TCP/IP protocol suite (rather than being general transport-layer
functions).
vor 19 Jahren
Michael Brown
3a0e293123
Renamed tcpip_if.[ch] to tcpip.[ch]
vor 19 Jahren
Michael Brown
36c94eae78
Clarify hexiness of header length
vor 19 Jahren
Michael Brown
2c0eb6eb1d
Correct TCP/IP checksum generation.
vor 19 Jahren
Nikhil Chandru Rao
5f651f8622
Added fragment reassembly code
vor 19 Jahren
Nikhil Chandru Rao
c9ea710930
Renamed net/interface.c and include/gpxe/interface.h to net/tcpip_if.c and include/gpxe/tcpip_if.h respectively. Made changes in the other files.
vor 19 Jahren
Nikhil Chandru Rao
6e2c97b0c0
Added ipv4_pseudo_header structure
vor 19 Jahren
Nikhil Chandru Rao
41b399d672
Fixed endianness of 16- and 32- bit values
vor 19 Jahren
Michael Brown
35557914e3
Simplify ipv4_tx() by not having a separate "source" variable now that
we are constructing the IP header ourselves.
Formatting fix-ups (80 column limit is mandatory!)
vor 19 Jahren
Michael Brown
b49de73950
Factorise out common code
vor 19 Jahren
Michael Brown
e517a4771b
Split ipv6 functions out from ipv4.c
vor 19 Jahren
Michael Brown
e04ea505c9
Whitespace fixes
vor 19 Jahren
Nikhil Chandru Rao
90fbff8f34
added support for processing and transmitting without uIP
vor 19 Jahren
Michael Brown
8637834031
Made the temporary buffer part of the TCP senddata() API, to ease the
transition away from uIP.
Prepared ipv4.c for transition away from uIP.
vor 19 Jahren
Michael Brown
3c8aafa209
Simplify RX data path.
Kill off the static single net device and move to proper dynamic
registration (which we need with the new device model).
Break the (flawed) assumption that all network-layer protocols can use
ARP; such network-layer protocols (i.e. IPv4) must now register as an ARP
protocol using ARP_NET_PROTOCOL() and provide a single method for checking
the existence of a local network-layer address.
vor 19 Jahren
Michael Brown
bbd9e28061
Simplify TX datapath.
vor 19 Jahren
Michael Brown
69b1f24a97
I have no idea how this ever worked before.
vor 19 Jahren
Michael Brown
592a5a99c8
Moved uIP and tcp.c from proto/ to net/
vor 19 Jahren
Michael Brown
bac97eb979
Change semantics of network API so that packet-absorbing calls *always*
take ownership of the packet, rather than doing so only if they return
success. This breaks semantic compatibility with Linux's
hard_start_xmit() method, but means that we don't have to worry so much
about error cases.
Split mechanism of processing received packets (net_rx_process()) out
from policy (net_step()), preparatory to putting net_step() in a separate
object.
vor 19 Jahren
Michael Brown
129c6c3968
Network layer now works as a proof of concept
vor 19 Jahren