diff options
| author | Michael Brown | 2014-03-04 13:54:21 +0100 |
|---|---|---|
| committer | Michael Brown | 2014-03-04 14:02:58 +0100 |
| commit | db67de6f31a062dc1995d4561be83cd51609d6c4 (patch) | |
| tree | 642ebb50e33c2a720d40769dd59010ce0d5b8e05 /src/include | |
| parent | [prefix] Ignore PCI autoboot device location if set to 00:00.0 (diff) | |
| download | ipxe-db67de6f31a062dc1995d4561be83cd51609d6c4.tar.gz ipxe-db67de6f31a062dc1995d4561be83cd51609d6c4.tar.xz ipxe-db67de6f31a062dc1995d4561be83cd51609d6c4.zip | |
[tcpip] Provide tcpip_netdev() to determine the transmitting network device
Provide the function tcpip_netdev() to allow external code to
determine the transmitting network device for a given socket address.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/ipxe/tcpip.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/include/ipxe/tcpip.h b/src/include/ipxe/tcpip.h index f5ef4f043..d28689a10 100644 --- a/src/include/ipxe/tcpip.h +++ b/src/include/ipxe/tcpip.h @@ -116,6 +116,13 @@ struct tcpip_net_protocol { struct sockaddr_tcpip *st_dest, struct net_device *netdev, uint16_t *trans_csum ); + /** + * Determine transmitting network device + * + * @v st_dest Destination address + * @ret netdev Network device, or NULL + */ + struct net_device * ( * netdev ) ( struct sockaddr_tcpip *dest ); }; /** TCP/IP transport-layer protocol table */ @@ -140,6 +147,7 @@ extern int tcpip_tx ( struct io_buffer *iobuf, struct tcpip_protocol *tcpip, struct sockaddr_tcpip *st_dest, struct net_device *netdev, uint16_t *trans_csum ); +extern struct net_device * tcpip_netdev ( struct sockaddr_tcpip *st_dest ); extern uint16_t generic_tcpip_continue_chksum ( uint16_t partial, const void *data, size_t len ); extern uint16_t tcpip_chksum ( const void *data, size_t len ); |
