mirror of
https://github.com/ipxe/ipxe
synced 2025-12-27 10:02:42 +03:00
[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>
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user