Skip to content

Commit aa401b4

Browse files
committed
Add IPV6 constants
1 parent 2a6eb9f commit aa401b4

File tree

5 files changed

+133
-4
lines changed

5 files changed

+133
-4
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/SocketModuleBuiltins.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ public void initialize(Python3Core core) {
182182
addConstants(PosixConstants.tcpOptions);
183183
addConstants(PosixConstants.shutdownHow);
184184
addConstants(PosixConstants.ip4Address);
185+
addConstants(PosixConstants.ipv6Options);
185186
}
186187

187188
@Override

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PosixConstants.java

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,33 @@ public final class PosixConstants {
300300
public static final OptionalIntConstant TCP_CONGESTION;
301301
public static final OptionalIntConstant TCP_USER_TIMEOUT;
302302
public static final OptionalIntConstant TCP_NOTSENT_LOWAT;
303+
public static final OptionalIntConstant IPV6_JOIN_GROUP;
304+
public static final OptionalIntConstant IPV6_LEAVE_GROUP;
305+
public static final OptionalIntConstant IPV6_MULTICAST_HOPS;
306+
public static final OptionalIntConstant IPV6_MULTICAST_IF;
307+
public static final OptionalIntConstant IPV6_MULTICAST_LOOP;
308+
public static final OptionalIntConstant IPV6_UNICAST_HOPS;
309+
public static final OptionalIntConstant IPV6_V6ONLY;
310+
public static final OptionalIntConstant IPV6_CHECKSUM;
311+
public static final OptionalIntConstant IPV6_DONTFRAG;
312+
public static final OptionalIntConstant IPV6_DSTOPTS;
313+
public static final OptionalIntConstant IPV6_HOPLIMIT;
314+
public static final OptionalIntConstant IPV6_HOPOPTS;
315+
public static final OptionalIntConstant IPV6_NEXTHOP;
316+
public static final OptionalIntConstant IPV6_PATHMTU;
317+
public static final OptionalIntConstant IPV6_PKTINFO;
318+
public static final OptionalIntConstant IPV6_RECVDSTOPTS;
319+
public static final OptionalIntConstant IPV6_RECVHOPLIMIT;
320+
public static final OptionalIntConstant IPV6_RECVHOPOPTS;
321+
public static final OptionalIntConstant IPV6_RECVPKTINFO;
322+
public static final OptionalIntConstant IPV6_RECVRTHDR;
323+
public static final OptionalIntConstant IPV6_RECVTCLASS;
324+
public static final OptionalIntConstant IPV6_RTHDR;
325+
public static final OptionalIntConstant IPV6_RTHDRDSTOPTS;
326+
public static final OptionalIntConstant IPV6_RTHDR_TYPE_0;
327+
public static final OptionalIntConstant IPV6_RECVPATHMTU;
328+
public static final OptionalIntConstant IPV6_TCLASS;
329+
public static final OptionalIntConstant IPV6_USE_MIN_MTU;
303330
public static final MandatoryIntConstant SIZEOF_STRUCT_SOCKADDR_STORAGE;
304331
public static final MandatoryIntConstant SIZEOF_STRUCT_SOCKADDR_IN;
305332
public static final MandatoryIntConstant OFFSETOF_STRUCT_SOCKADDR_IN_SIN_FAMILY;
@@ -337,6 +364,7 @@ public final class PosixConstants {
337364
public static final IntConstant[] shutdownHow;
338365
public static final IntConstant[] socketOptions;
339366
public static final IntConstant[] tcpOptions;
367+
public static final IntConstant[] ipv6Options;
340368

341369
static {
342370
Registry reg = Registry.create();
@@ -564,6 +592,33 @@ public final class PosixConstants {
564592
TCP_CONGESTION = reg.createOptionalInt("TCP_CONGESTION");
565593
TCP_USER_TIMEOUT = reg.createOptionalInt("TCP_USER_TIMEOUT");
566594
TCP_NOTSENT_LOWAT = reg.createOptionalInt("TCP_NOTSENT_LOWAT");
595+
IPV6_JOIN_GROUP = reg.createOptionalInt("IPV6_JOIN_GROUP");
596+
IPV6_LEAVE_GROUP = reg.createOptionalInt("IPV6_LEAVE_GROUP");
597+
IPV6_MULTICAST_HOPS = reg.createOptionalInt("IPV6_MULTICAST_HOPS");
598+
IPV6_MULTICAST_IF = reg.createOptionalInt("IPV6_MULTICAST_IF");
599+
IPV6_MULTICAST_LOOP = reg.createOptionalInt("IPV6_MULTICAST_LOOP");
600+
IPV6_UNICAST_HOPS = reg.createOptionalInt("IPV6_UNICAST_HOPS");
601+
IPV6_V6ONLY = reg.createOptionalInt("IPV6_V6ONLY");
602+
IPV6_CHECKSUM = reg.createOptionalInt("IPV6_CHECKSUM");
603+
IPV6_DONTFRAG = reg.createOptionalInt("IPV6_DONTFRAG");
604+
IPV6_DSTOPTS = reg.createOptionalInt("IPV6_DSTOPTS");
605+
IPV6_HOPLIMIT = reg.createOptionalInt("IPV6_HOPLIMIT");
606+
IPV6_HOPOPTS = reg.createOptionalInt("IPV6_HOPOPTS");
607+
IPV6_NEXTHOP = reg.createOptionalInt("IPV6_NEXTHOP");
608+
IPV6_PATHMTU = reg.createOptionalInt("IPV6_PATHMTU");
609+
IPV6_PKTINFO = reg.createOptionalInt("IPV6_PKTINFO");
610+
IPV6_RECVDSTOPTS = reg.createOptionalInt("IPV6_RECVDSTOPTS");
611+
IPV6_RECVHOPLIMIT = reg.createOptionalInt("IPV6_RECVHOPLIMIT");
612+
IPV6_RECVHOPOPTS = reg.createOptionalInt("IPV6_RECVHOPOPTS");
613+
IPV6_RECVPKTINFO = reg.createOptionalInt("IPV6_RECVPKTINFO");
614+
IPV6_RECVRTHDR = reg.createOptionalInt("IPV6_RECVRTHDR");
615+
IPV6_RECVTCLASS = reg.createOptionalInt("IPV6_RECVTCLASS");
616+
IPV6_RTHDR = reg.createOptionalInt("IPV6_RTHDR");
617+
IPV6_RTHDRDSTOPTS = reg.createOptionalInt("IPV6_RTHDRDSTOPTS");
618+
IPV6_RTHDR_TYPE_0 = reg.createOptionalInt("IPV6_RTHDR_TYPE_0");
619+
IPV6_RECVPATHMTU = reg.createOptionalInt("IPV6_RECVPATHMTU");
620+
IPV6_TCLASS = reg.createOptionalInt("IPV6_TCLASS");
621+
IPV6_USE_MIN_MTU = reg.createOptionalInt("IPV6_USE_MIN_MTU");
567622
SIZEOF_STRUCT_SOCKADDR_STORAGE = reg.createMandatoryInt("SIZEOF_STRUCT_SOCKADDR_STORAGE");
568623
SIZEOF_STRUCT_SOCKADDR_IN = reg.createMandatoryInt("SIZEOF_STRUCT_SOCKADDR_IN");
569624
OFFSETOF_STRUCT_SOCKADDR_IN_SIN_FAMILY = reg.createMandatoryInt("OFFSETOF_STRUCT_SOCKADDR_IN_SIN_FAMILY");
@@ -608,6 +663,9 @@ public final class PosixConstants {
608663
SO_PRIORITY, SO_MARK, SO_DOMAIN, SO_PROTOCOL};
609664
tcpOptions = new IntConstant[]{TCP_NODELAY, TCP_MAXSEG, TCP_CORK, TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_KEEPCNT, TCP_SYNCNT, TCP_LINGER2, TCP_DEFER_ACCEPT, TCP_WINDOW_CLAMP, TCP_INFO, TCP_QUICKACK,
610665
TCP_FASTOPEN, TCP_CONGESTION, TCP_USER_TIMEOUT, TCP_NOTSENT_LOWAT};
666+
ipv6Options = new IntConstant[]{IPV6_JOIN_GROUP, IPV6_LEAVE_GROUP, IPV6_MULTICAST_HOPS, IPV6_MULTICAST_IF, IPV6_MULTICAST_LOOP, IPV6_UNICAST_HOPS, IPV6_V6ONLY, IPV6_CHECKSUM, IPV6_DONTFRAG,
667+
IPV6_DSTOPTS, IPV6_HOPLIMIT, IPV6_HOPOPTS, IPV6_NEXTHOP, IPV6_PATHMTU, IPV6_PKTINFO, IPV6_RECVDSTOPTS, IPV6_RECVHOPLIMIT, IPV6_RECVHOPOPTS, IPV6_RECVPKTINFO, IPV6_RECVRTHDR,
668+
IPV6_RECVTCLASS, IPV6_RTHDR, IPV6_RTHDRDSTOPTS, IPV6_RTHDR_TYPE_0, IPV6_RECVPATHMTU, IPV6_TCLASS, IPV6_USE_MIN_MTU};
611669
}
612670
// end generated by gen_native_cfg.py
613671
// @formatter:on

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PosixConstantsDarwin.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
*/
4141
package com.oracle.graal.python.runtime;
4242

43-
// Auto generated by gen_native_cfg.py at 2023-03-16 07:20:43.880000
44-
// on Darwin some-user.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Dec 19 20:44:01 PST 2022; root:xnu-8020.240.18~2/RELEASE_X86_64 x86_64 i386
43+
// Auto generated by gen_native_cfg.py at 2023-05-26 18:57:33.815121
44+
// on Darwin ol-mac-mini2-prague.cz.oracle.com 21.6.0 Darwin Kernel Version 21.6.0: Mon Apr 24 21:10:53 PDT 2023; root:xnu-8020.240.18.701.5~1/RELEASE_X86_64 x86_64 i386
4545
class PosixConstantsDarwin {
4646

4747
private PosixConstantsDarwin() {
@@ -83,6 +83,10 @@ static void getConstants(PosixConstants.Registry constants) {
8383
constants.put("O_CLOEXEC", 0x01000000);
8484
constants.put("O_SYNC", 0x00000080);
8585
constants.put("O_DIRECTORY", 0x00100000);
86+
constants.put("O_SHLOCK", 0x00000010);
87+
constants.put("O_EXLOCK", 0x00000020);
88+
constants.put("O_EXEC", 0x40000000);
89+
constants.put("O_SEARCH", 0x40100000);
8690
constants.put("S_IFMT", 0x0000F000);
8791
constants.put("S_IFSOCK", 0x0000C000);
8892
constants.put("S_IFLNK", 0x0000A000);
@@ -224,6 +228,17 @@ static void getConstants(PosixConstants.Registry constants) {
224228
constants.put("TCP_KEEPCNT", 258);
225229
constants.put("TCP_FASTOPEN", 261);
226230
constants.put("TCP_NOTSENT_LOWAT", 513);
231+
constants.put("IPV6_JOIN_GROUP", 12);
232+
constants.put("IPV6_LEAVE_GROUP", 13);
233+
constants.put("IPV6_MULTICAST_HOPS", 10);
234+
constants.put("IPV6_MULTICAST_IF", 9);
235+
constants.put("IPV6_MULTICAST_LOOP", 11);
236+
constants.put("IPV6_UNICAST_HOPS", 4);
237+
constants.put("IPV6_V6ONLY", 27);
238+
constants.put("IPV6_CHECKSUM", 26);
239+
constants.put("IPV6_RECVTCLASS", 35);
240+
constants.put("IPV6_RTHDR_TYPE_0", 0);
241+
constants.put("IPV6_TCLASS", 36);
227242
constants.put("SIZEOF_STRUCT_SOCKADDR_STORAGE", 128);
228243
constants.put("SIZEOF_STRUCT_SOCKADDR_IN", 16);
229244
constants.put("OFFSETOF_STRUCT_SOCKADDR_IN_SIN_FAMILY", 1);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PosixConstantsLinux.java

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
*/
4141
package com.oracle.graal.python.runtime;
4242

43-
// Auto generated by gen_native_cfg.py at 2023-03-17 10:24:55.349775
44-
// on Linux arisu 6.1.18-200.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 11 16:09:14 UTC 2023 x86_64 x86_64
43+
// Auto generated by gen_native_cfg.py at 2023-05-26 12:43:41.748991
44+
// on Linux arisu 6.2.15-200.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 11 15:56:33 UTC 2023 x86_64 x86_64
4545
class PosixConstantsLinux {
4646

4747
private PosixConstantsLinux() {
@@ -260,6 +260,32 @@ static void getConstants(PosixConstants.Registry constants) {
260260
constants.put("TCP_CONGESTION", 13);
261261
constants.put("TCP_USER_TIMEOUT", 18);
262262
constants.put("TCP_NOTSENT_LOWAT", 25);
263+
constants.put("IPV6_JOIN_GROUP", 20);
264+
constants.put("IPV6_LEAVE_GROUP", 21);
265+
constants.put("IPV6_MULTICAST_HOPS", 18);
266+
constants.put("IPV6_MULTICAST_IF", 17);
267+
constants.put("IPV6_MULTICAST_LOOP", 19);
268+
constants.put("IPV6_UNICAST_HOPS", 16);
269+
constants.put("IPV6_V6ONLY", 26);
270+
constants.put("IPV6_CHECKSUM", 7);
271+
constants.put("IPV6_DONTFRAG", 62);
272+
constants.put("IPV6_DSTOPTS", 59);
273+
constants.put("IPV6_HOPLIMIT", 52);
274+
constants.put("IPV6_HOPOPTS", 54);
275+
constants.put("IPV6_NEXTHOP", 9);
276+
constants.put("IPV6_PATHMTU", 61);
277+
constants.put("IPV6_PKTINFO", 50);
278+
constants.put("IPV6_RECVDSTOPTS", 58);
279+
constants.put("IPV6_RECVHOPLIMIT", 51);
280+
constants.put("IPV6_RECVHOPOPTS", 53);
281+
constants.put("IPV6_RECVPKTINFO", 49);
282+
constants.put("IPV6_RECVRTHDR", 56);
283+
constants.put("IPV6_RECVTCLASS", 66);
284+
constants.put("IPV6_RTHDR", 57);
285+
constants.put("IPV6_RTHDRDSTOPTS", 55);
286+
constants.put("IPV6_RTHDR_TYPE_0", 0);
287+
constants.put("IPV6_RECVPATHMTU", 60);
288+
constants.put("IPV6_TCLASS", 67);
263289
constants.put("SIZEOF_STRUCT_SOCKADDR_STORAGE", 128);
264290
constants.put("SIZEOF_STRUCT_SOCKADDR_IN", 16);
265291
constants.put("OFFSETOF_STRUCT_SOCKADDR_IN_SIN_FAMILY", 0);

scripts/gen_native_cfg.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,35 @@
385385
* i TCP_CONGESTION
386386
* i TCP_USER_TIMEOUT
387387
* i TCP_NOTSENT_LOWAT
388+
389+
[ipv6Options]
390+
* i IPV6_JOIN_GROUP
391+
* i IPV6_LEAVE_GROUP
392+
* i IPV6_MULTICAST_HOPS
393+
* i IPV6_MULTICAST_IF
394+
* i IPV6_MULTICAST_LOOP
395+
* i IPV6_UNICAST_HOPS
396+
* i IPV6_V6ONLY
397+
* i IPV6_CHECKSUM
398+
* i IPV6_DONTFRAG
399+
* i IPV6_DSTOPTS
400+
* i IPV6_HOPLIMIT
401+
* i IPV6_HOPOPTS
402+
* i IPV6_NEXTHOP
403+
* i IPV6_PATHMTU
404+
* i IPV6_PKTINFO
405+
* i IPV6_RECVDSTOPTS
406+
* i IPV6_RECVHOPLIMIT
407+
* i IPV6_RECVHOPOPTS
408+
* i IPV6_RECVPKTINFO
409+
* i IPV6_RECVRTHDR
410+
* i IPV6_RECVTCLASS
411+
* i IPV6_RTHDR
412+
* i IPV6_RTHDRDSTOPTS
413+
* i IPV6_RTHDR_TYPE_0
414+
* i IPV6_RECVPATHMTU
415+
* i IPV6_TCLASS
416+
* i IPV6_USE_MIN_MTU
388417
'''
389418

390419
layout_defs = '''

0 commit comments

Comments
 (0)