summaryrefslogtreecommitdiffstats
path: root/src/net/ipv6.c
diff options
context:
space:
mode:
authorNikhil Chandru Rao2006-08-01 22:27:26 +0200
committerNikhil Chandru Rao2006-08-01 22:27:26 +0200
commitc24546c70b420ce84e60cd245d570eb87e6d37d3 (patch)
treed9658ad7ba47002476144712add0dc0a5b4ec401 /src/net/ipv6.c
parentRemove unused functions. (diff)
downloadipxe-c24546c70b420ce84e60cd245d570eb87e6d37d3.tar.gz
ipxe-c24546c70b420ce84e60cd245d570eb87e6d37d3.tar.xz
ipxe-c24546c70b420ce84e60cd245d570eb87e6d37d3.zip
Minor changes to the network layer rx() functions
Diffstat (limited to 'src/net/ipv6.c')
-rw-r--r--src/net/ipv6.c38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/net/ipv6.c b/src/net/ipv6.c
index e726bda7..9825a61a 100644
--- a/src/net/ipv6.c
+++ b/src/net/ipv6.c
@@ -1,12 +1,16 @@
#include <errno.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <byteswap.h>
#include <gpxe/pkbuff.h>
#include <gpxe/netdevice.h>
#include <gpxe/in.h>
+#include <gpxe/if_ether.h>
+#include <gpxe/tcpip.h>
/**
* Transmit IP6 packets
- *
- * Placeholder to allow linking. The function should be placed in net/ipv6.c
*/
int ipv6_tx ( struct pk_buff *pkb __unused, uint16_t trans_proto __unused,
struct in6_addr *dest __unused) {
@@ -22,3 +26,33 @@ void ipv6_rx ( struct pk_buff *pkb __unused,
struct net_device *netdev __unused,
const void *ll_source __unused ) {
}
+
+void ipv6_tx_csum ( struct pk_buff *pkb, struct tcpip_protocol *tcpip ) {
+ return;
+}
+
+static const char * ipv6_ntoa ( const void *net_addr ) {
+// return inet6_ntoa ( * ( ( struct in6_addr * ) net_addr ) );
+ return "no support yet";
+}
+
+/** IPv6 protocol */
+struct net_protocol ipv6_protocol = {
+ .name = "IP6",
+ .net_proto = htons ( ETH_P_IPV6 ),
+ .net_addr_len = sizeof ( struct in6_addr ),
+ .rx = ipv6_rx,
+ .ntoa = ipv6_ntoa,
+};
+
+NET_PROTOCOL ( ipv6_protocol );
+
+/** IPv6 TCPIP net protocol */
+struct tcpip_net_protocol ipv6_tcpip_protocol = {
+ .net_protocol = &ipv6_protocol,
+ .sa_family = AF_INET6,
+ .tx = ipv6_tx,
+ .tx_csum = ipv6_tx_csum,
+};
+
+TCPIP_NET_PROTOCOL ( ipv6_tcpip_protocol );