[fpc-devel]ipv6 patch

Johannes Berg johannes at sipsolutions.de
Sun Nov 9 19:46:31 CET 2003


Hi,

Here's a patch to add some IPv6 definitions, I stole them from RFC 2553
:-)

Index: inc/socketsh.inc
===================================================================
RCS file: /FPC/CVS/fpc/rtl/inc/socketsh.inc,v
retrieving revision 1.9
diff -u -r1.9 socketsh.inc
--- inc/socketsh.inc	23 Mar 2003 17:47:15 -0000	1.9
+++ inc/socketsh.inc	9 Nov 2003 18:45:56 -0000
@@ -119,11 +119,37 @@
     end;
 
   TInetSockAddr = packed Record
-    family:Word;
+    {$ifdef BSD}  // as per RFC 2553
+      len   : byte;
+      family: byte;
+    {$ELSE}
+      family: word;
+    {$ENDIF}
     port  :Word;
     addr  :Cardinal;
     pad   :array [1..8] of byte; { to get to the size of sockaddr... }
-    end;
+  end;
+
+  Tin6_addr = packed record
+  case byte of
+    0: (u6_addr8  : array[0..15] of byte);
+    1: (u6_addr16 : array[0..7] of Word);
+    2: (u6_addr32 : array[0..3] of Cardinal);
+    3: (s6_addr8  : array[0..15] of shortint);
+    4: (s6_addr   : array[0..15] of shortint);
+    5: (s6_addr16 : array[0..7] of smallint);
+    6: (s6_addr32 : array[0..3] of LongInt);
+  end;
+
+  TInetSockAddr6 = packed Record
+    sin6_family   : Word;
+    sin6_port     : Word;
+    sin6_flowinfo : LongInt;
+    sin6_addr     : Tin6_addr;
+    sin6_scope_id : LongInt;
+  end;
+  sockaddr_in6 = TInetSockAddr6;
+  psockaddr_in6 = ^sockaddr_in6;
 
   TSockArray = Array[1..2] of Longint;
 


johannes
-- 
http://www.sipsolutions.de/
GnuPG key: http://www.sipsolutions.de/keys/JohannesBerg.asc
  Key-ID: 9AB78CA5 Johannes Berg <johannes at sipsolutions.de>
  Fingerprint = AD02 0176 4E29 C137 1DF6 08D2 FC44 CF86 9AB7 8CA5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20031109/5021a1a4/attachment.sig>


More information about the fpc-devel mailing list