Michael Brown
978865da2f
[IPv4] Use default netmasks when no subnet mask is specified.
17 years ago
Michael Brown
aec9b8a41b
[Settings] Use a settings applicator to configure IPv4 routes.
17 years ago
Michael Brown
df868476e7
Various warnings fixups for OpenBSD with gcc-3.3.5.
17 years ago
Holger Lubitz
6f0eca1400
use malloc attribute
18 years ago
Michael Brown
5b52630a9c
Never attempt to route the broadcast address.
18 years ago
Michael Brown
f77815f2b1
Kill off hotplug.h and just make net devices normal reference-counted
structures.
DHCP still broken and #if 0'd out.
18 years ago
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;'
18 years ago
Michael Brown
73b09ecba6
Use stdio.h instead of vsprintf.h
18 years ago
Michael Brown
5ff23aa406
Include stdlib.h rather than malloc.h
18 years ago
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.
18 years ago
Michael Brown
1a1fc23417
Improve debugging
18 years ago
Michael Brown
c953c1a1c3
Use -ENETUNREACH to mean "no reachable network device exists, don't bother
retrying".
18 years ago
Michael Brown
d9ba8f790b
Add route() function to display routing table.
18 years ago
Michael Brown
cc9b32c405
Remove uIP; we haven't used it for quite some time now.
18 years ago
Michael Brown
f008b77ba2
Allow an explicit network device to be specified for IP-layer
transmissions.
18 years ago
Michael Brown
98b6154c3e
Add "name" field to network device, to facilitate netdev commands.
18 years ago
Michael Brown
35b5e5d3f5
Minirouting table entries hold a persistent reference to a net_device.
18 years ago
Michael Brown
a0525a4ed3
Verify checksums on the RX datapath.
Simplify checksum generation on the TX datapath.
18 years ago
Michael Brown
285beeff7c
Tidy up debug messages
Move routing into a separate function
18 years ago
Michael Brown
718294553b
Fix compiler warning
18 years ago
Michael Brown
867c7aef59
iphdr->hlen includes the IP header, so truncate packet *before*
stripping the header. Also fix an htons/ntohs confusion.
19 years ago
Marty Connor
ee9ae8130a
Remove _PROTOCOL macros for gcc 3.2 compatibility
19 years ago
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.
19 years ago
Nikhil Chandru Rao
409f69a08a
Changed ipv4_dump() to consume only one line.
19 years ago
Michael Brown
68e33224ef
gcc3 compatibility: removed ARP_NET_PROTOCOL().
19 years ago
Nikhil Chandru Rao
d2bdf81505
Removed some bugs in TCP
19 years ago
Michael Brown
885a630ddf
Fix routing when a gateway exists. This should probably be split into
a separate function.
19 years ago
Nikhil Chandru Rao
6714ec745a
Minor corrections
19 years ago
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.
19 years ago
Nikhil Chandru Rao
c24546c70b
Minor changes to the network layer rx() functions
19 years ago
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).
19 years ago
Michael Brown
3a0e293123
Renamed tcpip_if.[ch] to tcpip.[ch]
19 years ago
Michael Brown
36c94eae78
Clarify hexiness of header length
19 years ago
Michael Brown
2c0eb6eb1d
Correct TCP/IP checksum generation.
19 years ago
Nikhil Chandru Rao
5f651f8622
Added fragment reassembly code
19 years ago
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.
19 years ago
Nikhil Chandru Rao
6e2c97b0c0
Added ipv4_pseudo_header structure
19 years ago
Nikhil Chandru Rao
41b399d672
Fixed endianness of 16- and 32- bit values
19 years ago
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!)
19 years ago
Michael Brown
b49de73950
Factorise out common code
19 years ago
Michael Brown
e517a4771b
Split ipv6 functions out from ipv4.c
19 years ago
Michael Brown
e04ea505c9
Whitespace fixes
19 years ago
Nikhil Chandru Rao
90fbff8f34
added support for processing and transmitting without uIP
19 years ago
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.
19 years ago
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.
19 years ago
Michael Brown
bbd9e28061
Simplify TX datapath.
19 years ago
Michael Brown
69b1f24a97
I have no idea how this ever worked before.
19 years ago
Michael Brown
592a5a99c8
Moved uIP and tcp.c from proto/ to net/
19 years ago
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.
19 years ago
Michael Brown
129c6c3968
Network layer now works as a proof of concept
19 years ago