aboutsummaryrefslogtreecommitdiffstats
path: root/gpxe/src/net/tcpip.c
diff options
context:
space:
mode:
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,