From: John Hodge Date: Sat, 6 Mar 2010 11:33:48 +0000 (+0800) Subject: IPv6, and I need to learn to compile before commiting X-Git-Tag: rel0.06~286 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=07173b260d76a7e6482838c02d5deb2ead2afbb2;p=tpg%2Facess2.git IPv6, and I need to learn to compile before commiting --- diff --git a/Kernel/Makefile.BuildNum b/Kernel/Makefile.BuildNum index e07c2ce6..332e1aa5 100644 --- a/Kernel/Makefile.BuildNum +++ b/Kernel/Makefile.BuildNum @@ -1 +1 @@ -BUILD_NUM = 1510 +BUILD_NUM = 1511 diff --git a/Kernel/binary.c b/Kernel/binary.c index 229031f7..b02ca6e9 100644 --- a/Kernel/binary.c +++ b/Kernel/binary.c @@ -569,7 +569,7 @@ char *Binary_RegInterp(char *Path) // Scan Array for( i = 0; i < giRegInterps; i++ ) { - if(strcmp(gsaRegInterps[i], path) == 0) + if(strcmp(gsaRegInterps[i], Path) == 0) return gsaRegInterps[i]; } @@ -599,16 +599,16 @@ void *Binary_LoadKernel(char *File) Uint addr; int i; - ENTER("sfile", file); + ENTER("sfile", File); // Sanity Check Argument - if(file == NULL) { + if(File == NULL) { LEAVE('n'); return 0; } // Get True File Path - sTruePath = VFS_GetTruePath(file); + sTruePath = VFS_GetTruePath(File); if(sTruePath == NULL) { LEAVE('n'); return 0; diff --git a/Modules/IPStack/ipv6.c b/Modules/IPStack/ipv6.c index 16c9bbdc..b709dfa0 100644 --- a/Modules/IPStack/ipv6.c +++ b/Modules/IPStack/ipv6.c @@ -34,7 +34,20 @@ void IPv6_int_GetPacket(tAdapter *Interface, tMacAddr From, int Length, void *Bu tIPv6Header *hdr = Buffer; if(Length < sizeof(tIPv6Header)) return; - if(hdr->Version != 6) return; + if( ((hdr->Head >> (20+8)) & 0xF) != 6 ) + return; + + Log("[IPv6 ] hdr = {"); + Log("[IPv6 ] .Version = %i", (hdr->Head >> (20+8)) & 0xF ); + Log("[IPv6 ] .TrafficClass = %i", (hdr->Head >> (20)) & 0xFF ); + Log("[IPv6 ] .FlowLabel = %i", hdr->Head & 0xFFFFF ); + Log("[IPv6 ] .PayloadLength = 0x%04x", ntohs(hdr->PayloadLength) ); + Log("[IPv6 ] .NextHeader = 0x%02x", hdr->NextHeader ); + Log("[IPv6 ] .HopLimit = 0x%02x", hdr->HopLimit ); + Log("[IPv6 ] .Source = %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x", hdr->Source ); + Log("[IPv6 ] .Destination = %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x", hdr->Destination ); + Log("[IPv6 ] }"); + } /** diff --git a/Modules/IPStack/ipv6.h b/Modules/IPStack/ipv6.h index a98561db..c2810a38 100644 --- a/Modules/IPStack/ipv6.h +++ b/Modules/IPStack/ipv6.h @@ -11,11 +11,18 @@ typedef struct sIPv6Header tIPv6Header; struct sIPv6Header { + #if 1 + // High 4: Version + // Next: Traffic Class + // Low 20: Flow Label + Uint32 Head; + #else struct { unsigned Version: 4; unsigned TrafficClass: 8; unsigned FlowLabel: 20; }; + #endif Uint16 PayloadLength; Uint8 NextHeader; // Type of payload data Uint8 HopLimit; diff --git a/Modules/IPStack/main.c b/Modules/IPStack/main.c index 7ec76899..6b6f8a93 100644 --- a/Modules/IPStack/main.c +++ b/Modules/IPStack/main.c @@ -21,6 +21,8 @@ extern void UDP_Initialise(); extern void TCP_Initialise(); extern int IPv4_Initialise(); extern int IPv4_Ping(tInterface *Iface, tIPv4 Addr); +extern int IPv6_Initialise(); +//extern int IPv6_Ping(tInterface *Iface, tIPv6 Addr); // === PROTOTYPES === int IPStack_Install(char **Arguments); @@ -65,9 +67,12 @@ int IPStack_Install(char **Arguments) { int i = 0; - // Install Handlers + // Layer 2 - Data Link Layer ARP_Initialise(); + // Layer 3 - Network Layer IPv4_Initialise(); + IPv6_Initialise(); + // Layer 4 - Transport Layer TCP_Initialise(); UDP_Initialise();