IPv6, and I need to learn to compile before commiting
authorJohn Hodge <[email protected]>
Sat, 6 Mar 2010 11:33:48 +0000 (19:33 +0800)
committerJohn Hodge <[email protected]>
Sat, 6 Mar 2010 11:33:48 +0000 (19:33 +0800)
Kernel/Makefile.BuildNum
Kernel/binary.c
Modules/IPStack/ipv6.c
Modules/IPStack/ipv6.h
Modules/IPStack/main.c

index e07c2ce..332e1aa 100644 (file)
@@ -1 +1 @@
-BUILD_NUM = 1510
+BUILD_NUM = 1511
index 229031f..b02ca6e 100644 (file)
@@ -569,7 +569,7 @@ char *Binary_RegInterp(char *Path)
        // Scan Array\r
        for( i = 0; i < giRegInterps; i++ )\r
        {\r
-               if(strcmp(gsaRegInterps[i], path) == 0)\r
+               if(strcmp(gsaRegInterps[i], Path) == 0)\r
                        return gsaRegInterps[i];\r
        }\r
        \r
@@ -599,16 +599,16 @@ void *Binary_LoadKernel(char *File)
        Uint    addr;\r
         int    i;\r
 \r
-       ENTER("sfile", file);\r
+       ENTER("sfile", File);\r
        \r
        // Sanity Check Argument\r
-       if(file == NULL) {\r
+       if(File == NULL) {\r
                LEAVE('n');\r
                return 0;\r
        }\r
 \r
        // Get True File Path\r
-       sTruePath = VFS_GetTruePath(file);\r
+       sTruePath = VFS_GetTruePath(File);\r
        if(sTruePath == NULL) {\r
                LEAVE('n');\r
                return 0;\r
index 16c9bbd..b709dfa 100644 (file)
@@ -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 ] }");
+       
 }
 
 /**
index a98561d..c2810a3 100644 (file)
@@ -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;
index 7ec7689..6b6f8a9 100644 (file)
@@ -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();
        

UCC git Repository :: git.ucc.asn.au