From 3a0e29312394a9165b5f0fb58b407a372f4a0e6b Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 1 Aug 2006 14:18:09 +0000 Subject: Renamed tcpip_if.[ch] to tcpip.[ch] --- src/include/gpxe/tcpip.h | 93 +++++++++++++++++++++++++++++++++++++++++++++ src/include/gpxe/tcpip_if.h | 93 --------------------------------------------- 2 files changed, 93 insertions(+), 93 deletions(-) create mode 100644 src/include/gpxe/tcpip.h delete mode 100644 src/include/gpxe/tcpip_if.h (limited to 'src/include') diff --git a/src/include/gpxe/tcpip.h b/src/include/gpxe/tcpip.h new file mode 100644 index 000000000..df6354175 --- /dev/null +++ b/src/include/gpxe/tcpip.h @@ -0,0 +1,93 @@ +#ifndef _GPXE_INTERFACE_H +#define _GPXE_INTERFACE_H + +/** @file + * + * Transport-network layer interface + * + */ + +#include +#include +#include + +struct pk_buff; +struct net_protocol; +struct tcpip_protocol; +struct tcpip_net_protocol; + +/** + * A transport-layer protocol of the TCPIP stack (eg. UDP, TCP, etc) + */ +struct tcpip_protocol { + /** Protocol name */ + const char *name; + /** + * Process received packet + * + * @v pkb Packet buffer + * @v netdev Network device + * @v ll_source Link-layer source address + * + * This method takes ownership of the packet buffer. + */ + void ( * rx ) ( struct pk_buff *pkb, struct in_addr *src_net_addr, struct in_addr *dest_net_addr ); + /** + * Transport-layer protocol number + * + * This is a constant of the type IP_XXX + */ + uint8_t trans_proto; + /** + * Checksum offset + * + * A negative number indicates that the protocol does not require + * checksumming to be performed by the network layer. A positive number is + * the offset of the checksum field in the transport-layer header. + */ + int csum_offset; +}; + +/** + * A TCPIP supporting network-layer protocol + */ +struct tcpip_net_protocol { + /** Network protocol */ + struct net_protocol *net_protocol; + /** Network address family */ + sa_family_t sa_family; + /** Complete transport-layer checksum calculation + * + * @v pkb Packet buffer + * @v tcpip Transport-layer protocol + * + */ + void ( * tx_csum ) ( struct pk_buff *pkb, + struct tcpip_protocol *tcpip ); +}; + +/** + * Register a transport-layer protocol + * + * @v protocol Transport-layer protocol + */ +#define TCPIP_PROTOCOL( protocol ) \ + struct tcpip_protocol protocol __table ( tcpip_protocols, 01 ) + +#define TCPIP_NET_PROTOCOL( protocol ) \ + struct tcpip_net_protocol protocol __table ( tcpip_net_protocols, 01 ) + +extern void trans_rx ( struct pk_buff *pkb, uint8_t trans_proto, + struct in_addr *src, struct in_addr *dest ); + +extern int trans_tx ( struct pk_buff *pkb, struct tcpip_protocol *tcpip, + struct sockaddr *dest ); + +extern unsigned int tcpip_continue_chksum ( unsigned int partial, + const void *data, size_t len ); +extern unsigned int tcpip_chksum ( const void *data, size_t len ); + +extern struct tcpip_protocol * find_tcpip_protocol ( uint8_t trans_proto ); +extern struct tcpip_net_protocol * find_tcpip_net_protocol ( sa_family_t sa_family ); + +#endif /* _GPXE_INTERFACE_H */ diff --git a/src/include/gpxe/tcpip_if.h b/src/include/gpxe/tcpip_if.h deleted file mode 100644 index df6354175..000000000 --- a/src/include/gpxe/tcpip_if.h +++ /dev/null @@ -1,93 +0,0 @@ -#ifndef _GPXE_INTERFACE_H -#define _GPXE_INTERFACE_H - -/** @file - * - * Transport-network layer interface - * - */ - -#include -#include -#include - -struct pk_buff; -struct net_protocol; -struct tcpip_protocol; -struct tcpip_net_protocol; - -/** - * A transport-layer protocol of the TCPIP stack (eg. UDP, TCP, etc) - */ -struct tcpip_protocol { - /** Protocol name */ - const char *name; - /** - * Process received packet - * - * @v pkb Packet buffer - * @v netdev Network device - * @v ll_source Link-layer source address - * - * This method takes ownership of the packet buffer. - */ - void ( * rx ) ( struct pk_buff *pkb, struct in_addr *src_net_addr, struct in_addr *dest_net_addr ); - /** - * Transport-layer protocol number - * - * This is a constant of the type IP_XXX - */ - uint8_t trans_proto; - /** - * Checksum offset - * - * A negative number indicates that the protocol does not require - * checksumming to be performed by the network layer. A positive number is - * the offset of the checksum field in the transport-layer header. - */ - int csum_offset; -}; - -/** - * A TCPIP supporting network-layer protocol - */ -struct tcpip_net_protocol { - /** Network protocol */ - struct net_protocol *net_protocol; - /** Network address family */ - sa_family_t sa_family; - /** Complete transport-layer checksum calculation - * - * @v pkb Packet buffer - * @v tcpip Transport-layer protocol - * - */ - void ( * tx_csum ) ( struct pk_buff *pkb, - struct tcpip_protocol *tcpip ); -}; - -/** - * Register a transport-layer protocol - * - * @v protocol Transport-layer protocol - */ -#define TCPIP_PROTOCOL( protocol ) \ - struct tcpip_protocol protocol __table ( tcpip_protocols, 01 ) - -#define TCPIP_NET_PROTOCOL( protocol ) \ - struct tcpip_net_protocol protocol __table ( tcpip_net_protocols, 01 ) - -extern void trans_rx ( struct pk_buff *pkb, uint8_t trans_proto, - struct in_addr *src, struct in_addr *dest ); - -extern int trans_tx ( struct pk_buff *pkb, struct tcpip_protocol *tcpip, - struct sockaddr *dest ); - -extern unsigned int tcpip_continue_chksum ( unsigned int partial, - const void *data, size_t len ); -extern unsigned int tcpip_chksum ( const void *data, size_t len ); - -extern struct tcpip_protocol * find_tcpip_protocol ( uint8_t trans_proto ); -extern struct tcpip_net_protocol * find_tcpip_net_protocol ( sa_family_t sa_family ); - -#endif /* _GPXE_INTERFACE_H */ -- cgit v1.2.3-55-g7522