aboutsummaryrefslogtreecommitdiffstats
path: root/gpxe/src/net/tcpip.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-02-03 16:06:41 -0800
committerH. Peter Anvin <hpa@zytor.com>2010-02-03 16:06:41 -0800
commitaddaeaeb3949d576c4e0eb5cfc133b7c3bcfa8fa (patch)
tree2ffea726dc494e87ecc9f506bc6a2bc9242730e3 /gpxe/src/net/tcpip.c
parent5c0f48e49f8d7d084810ecf0b98a76aaebb44835 (diff)
parente7a5f95432132c8fc8f8ede39fda1d368002ddd8 (diff)
downloadsyslinux.git-addaeaeb3949d576c4e0eb5cfc133b7c3bcfa8fa.tar.gz
syslinux.git-addaeaeb3949d576c4e0eb5cfc133b7c3bcfa8fa.tar.xz
syslinux.git-addaeaeb3949d576c4e0eb5cfc133b7c3bcfa8fa.zip
Merge branch 'master' into i915res
Diffstat (limited to 'gpxe/src/net/tcpip.c')
-rw-r--r--gpxe/src/net/tcpip.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/gpxe/src/net/tcpip.c b/gpxe/src/net/tcpip.c
index d4542b05..932fd482 100644
--- a/gpxe/src/net/tcpip.c
+++ b/gpxe/src/net/tcpip.c
@@ -14,17 +14,7 @@
* TCP/IP transport-network layer interface
*/
-/** Registered network-layer protocols that support TCP/IP */
-static struct tcpip_net_protocol tcpip_net_protocols[0]
- __table_start ( struct tcpip_net_protocol, tcpip_net_protocols );
-static struct tcpip_net_protocol tcpip_net_protocols_end[0]
- __table_end ( struct tcpip_net_protocol, tcpip_net_protocols );
-
-/** Registered transport-layer protocols that support TCP/IP */
-static struct tcpip_protocol tcpip_protocols[0]
- __table_start ( struct tcpip_protocol, tcpip_protocols );
-static struct tcpip_protocol tcpip_protocols_end[0]
- __table_end ( struct tcpip_protocol, tcpip_protocols );
+FILE_LICENCE ( GPL2_OR_LATER );
/** Process a received TCP/IP packet
*
@@ -48,7 +38,7 @@ int tcpip_rx ( struct io_buffer *iobuf, uint8_t tcpip_proto,
struct tcpip_protocol *tcpip;
/* Hand off packet to the appropriate transport-layer protocol */
- for ( tcpip = tcpip_protocols; tcpip < tcpip_protocols_end; tcpip++ ) {
+ for_each_table_entry ( tcpip, TCPIP_PROTOCOLS ) {
if ( tcpip->tcpip_proto == tcpip_proto ) {
DBG ( "TCP/IP received %s packet\n", tcpip->name );
return tcpip->rx ( iobuf, st_src, st_dest, pshdr_csum );
@@ -76,8 +66,7 @@ int tcpip_tx ( struct io_buffer *iobuf, struct tcpip_protocol *tcpip_protocol,
struct tcpip_net_protocol *tcpip_net;
/* Hand off packet to the appropriate network-layer protocol */
- for ( tcpip_net = tcpip_net_protocols ;
- tcpip_net < tcpip_net_protocols_end ; tcpip_net++ ) {
+ for_each_table_entry ( tcpip_net, TCPIP_NET_PROTOCOLS ) {
if ( tcpip_net->sa_family == st_dest->st_family ) {
DBG ( "TCP/IP sending %s packet\n", tcpip_net->name );
return tcpip_net->tx ( iobuf, tcpip_protocol, st_src,