3 * A table of numbers, generated by a script, is supposedly not copyrightable.
6 static int os_socket_pf(int idx, ajla_error_t *err)
10 case 1: return PF_UNIX;
13 case 2: return PF_INET;
16 case 3: return PF_AX25;
19 case 4: return PF_IPX;
22 case 5: return PF_APPLETALK;
25 case 6: return PF_NETROM;
28 case 7: return PF_BRIDGE;
31 case 8: return PF_ATMPVC;
34 case 9: return PF_X25;
37 case 10: return PF_INET6;
40 case 11: return PF_ROSE;
43 case 12: return PF_DECnet;
46 case 13: return PF_NETBEUI;
49 case 14: return PF_SECURITY;
52 case 15: return PF_KEY;
55 case 16: return PF_NETLINK;
58 case 17: return PF_PACKET;
61 case 18: return PF_ASH;
64 case 19: return PF_ECONET;
67 case 20: return PF_ATMSVC;
70 case 21: return PF_RDS;
73 case 22: return PF_SNA;
76 case 23: return PF_IRDA;
79 case 24: return PF_PPPOX;
82 case 25: return PF_WANPIPE;
85 case 26: return PF_LLC;
88 case 27: return PF_IB;
91 case 28: return PF_MPLS;
94 case 29: return PF_CAN;
97 case 30: return PF_TIPC;
100 case 31: return PF_BLUETOOTH;
103 case 32: return PF_IUCV;
106 case 33: return PF_RXRPC;
109 case 34: return PF_ISDN;
112 case 35: return PF_PHONET;
115 case 36: return PF_IEEE802154;
118 case 37: return PF_CAIF;
121 case 38: return PF_ALG;
124 case 39: return PF_NFC;
127 case 40: return PF_VSOCK;
130 case 41: return PF_KCM;
133 case 42: return PF_QIPCRTR;
136 case 43: return PF_SMC;
139 fatal_mayfail(error_ajla(EC_SYNC, AJLA_ERROR_INVALID_OPERATION), err, "invalid value");
144 static int os_socket_af(int idx, ajla_error_t *err)
148 case 1: return AF_UNIX;
151 case 2: return AF_INET;
154 case 3: return AF_AX25;
157 case 4: return AF_IPX;
160 case 5: return AF_APPLETALK;
163 case 6: return AF_NETROM;
166 case 7: return AF_BRIDGE;
169 case 8: return AF_ATMPVC;
172 case 9: return AF_X25;
175 case 10: return AF_INET6;
178 case 11: return AF_ROSE;
181 case 12: return AF_DECnet;
184 case 13: return AF_NETBEUI;
187 case 14: return AF_SECURITY;
190 case 15: return AF_KEY;
193 case 16: return AF_NETLINK;
196 case 17: return AF_PACKET;
199 case 18: return AF_ASH;
202 case 19: return AF_ECONET;
205 case 20: return AF_ATMSVC;
208 case 21: return AF_RDS;
211 case 22: return AF_SNA;
214 case 23: return AF_IRDA;
217 case 24: return AF_PPPOX;
220 case 25: return AF_WANPIPE;
223 case 26: return AF_LLC;
226 case 27: return AF_IB;
229 case 28: return AF_MPLS;
232 case 29: return AF_CAN;
235 case 30: return AF_TIPC;
238 case 31: return AF_BLUETOOTH;
241 case 32: return AF_IUCV;
244 case 33: return AF_RXRPC;
247 case 34: return AF_ISDN;
250 case 35: return AF_PHONET;
253 case 36: return AF_IEEE802154;
256 case 37: return AF_CAIF;
259 case 38: return AF_ALG;
262 case 39: return AF_NFC;
265 case 40: return AF_VSOCK;
268 case 41: return AF_KCM;
271 case 42: return AF_QIPCRTR;
274 case 43: return AF_SMC;
277 fatal_mayfail(error_ajla(EC_SYNC, AJLA_ERROR_INVALID_OPERATION), err, "invalid value");
282 static int os_af_socket(int idx, ajla_error_t *err)
286 case AF_UNIX: return 1;
289 case AF_INET: return 2;
292 case AF_AX25: return 3;
295 case AF_IPX: return 4;
298 case AF_APPLETALK: return 5;
301 case AF_NETROM: return 6;
304 case AF_BRIDGE: return 7;
307 case AF_ATMPVC: return 8;
310 case AF_X25: return 9;
313 case AF_INET6: return 10;
316 case AF_ROSE: return 11;
319 case AF_DECnet: return 12;
322 case AF_NETBEUI: return 13;
325 case AF_SECURITY: return 14;
328 case AF_KEY: return 15;
331 case AF_NETLINK: return 16;
334 case AF_PACKET: return 17;
337 case AF_ASH: return 18;
340 case AF_ECONET: return 19;
343 case AF_ATMSVC: return 20;
346 case AF_RDS: return 21;
349 case AF_SNA: return 22;
352 case AF_IRDA: return 23;
355 case AF_PPPOX: return 24;
358 case AF_WANPIPE: return 25;
361 case AF_LLC: return 26;
364 case AF_IB: return 27;
367 case AF_MPLS: return 28;
370 case AF_CAN: return 29;
373 case AF_TIPC: return 30;
376 case AF_BLUETOOTH: return 31;
379 case AF_IUCV: return 32;
382 case AF_RXRPC: return 33;
385 case AF_ISDN: return 34;
388 case AF_PHONET: return 35;
391 case AF_IEEE802154: return 36;
394 case AF_CAIF: return 37;
397 case AF_ALG: return 38;
400 case AF_NFC: return 39;
403 case AF_VSOCK: return 40;
406 case AF_KCM: return 41;
409 case AF_QIPCRTR: return 42;
412 case AF_SMC: return 43;
415 fatal_mayfail(error_ajla(EC_SYNC, AJLA_ERROR_SYSTEM_RETURNED_INVALID_DATA), err, "invalid value");
420 static int os_socket_type(int idx, ajla_error_t *err)
424 case 1: return SOCK_STREAM;
427 case 2: return SOCK_DGRAM;
429 #ifdef SOCK_SEQPACKET
430 case 3: return SOCK_SEQPACKET;
433 case 4: return SOCK_RAW;
436 case 5: return SOCK_RDM;
439 fatal_mayfail(error_ajla(EC_SYNC, AJLA_ERROR_INVALID_OPERATION), err, "invalid value");
444 static int os_socket_msg(int idx, ajla_error_t *err)
448 case 1: return MSG_OOB;
451 case 2: return MSG_PEEK;
454 case 4: return MSG_DONTROUTE;
457 case 8: return MSG_DONTWAIT;
460 case 16: return MSG_EOR;
463 case 32: return MSG_CONFIRM;
466 case 64: return MSG_ERRQUEUE;
469 case 128: return MSG_MORE;
472 case 256: return MSG_BATCH;
475 case 512: return MSG_FASTOPEN;
478 fatal_mayfail(error_ajla(EC_SYNC, AJLA_ERROR_INVALID_OPERATION), err, "invalid value");
483 static int os_socket_level(int idx, ajla_error_t *err)
487 case 1: return SOL_SOCKET;
490 fatal_mayfail(error_ajla(EC_SYNC, AJLA_ERROR_INVALID_OPERATION), err, "invalid value");
495 static int os_socket_option(int idx, ajla_error_t *err)
499 case 1: return SO_DEBUG;
502 case 2: return SO_REUSEADDR;
505 case 3: return SO_TYPE;
508 case 4: return SO_ERROR;
511 case 5: return SO_DONTROUTE;
514 case 6: return SO_BROADCAST;
517 case 7: return SO_SNDBUF;
520 case 8: return SO_RCVBUF;
523 case 9: return SO_KEEPALIVE;
526 case 10: return SO_OOBINLINE;
529 case 11: return SO_NO_CHECK;
532 case 12: return SO_PRIORITY;
535 case 13: return SO_LINGER;
538 case 14: return SO_BSDCOMPAT;
541 case 15: return SO_REUSEPORT;
544 case 16: return SO_PASSCRED;
547 case 17: return SO_PEERCRED;
550 case 18: return SO_RCVLOWAT;
553 case 19: return SO_SNDLOWAT;
556 case 20: return SO_RCVTIMEO;
559 case 21: return SO_SNDTIMEO;
561 #ifdef SO_SECURITY_AUTHENTICATION
562 case 22: return SO_SECURITY_AUTHENTICATION;
564 #ifdef SO_SECURITY_ENCRYPTION_TRANSPORT
565 case 23: return SO_SECURITY_ENCRYPTION_TRANSPORT;
567 #ifdef SO_SECURITY_ENCRYPTION_NETWORK
568 case 24: return SO_SECURITY_ENCRYPTION_NETWORK;
570 #ifdef SO_BINDTODEVICE
571 case 25: return SO_BINDTODEVICE;
573 #ifdef SO_ATTACH_FILTER
574 case 26: return SO_ATTACH_FILTER;
576 #ifdef SO_DETACH_FILTER
577 case 27: return SO_DETACH_FILTER;
580 case 28: return SO_PEERNAME;
583 case 29: return SO_TIMESTAMP;
586 case 30: return SO_ACCEPTCONN;
589 case 31: return SO_PEERSEC;
591 #ifdef SO_SNDBUFFORCE
592 case 32: return SO_SNDBUFFORCE;
594 #ifdef SO_RCVBUFFORCE
595 case 33: return SO_RCVBUFFORCE;
598 case 34: return SO_PASSSEC;
600 #ifdef SO_TIMESTAMPNS
601 case 35: return SO_TIMESTAMPNS;
604 case 36: return SO_MARK;
606 #ifdef SO_TIMESTAMPING
607 case 37: return SO_TIMESTAMPING;
610 case 38: return SO_PROTOCOL;
613 case 39: return SO_DOMAIN;
616 case 40: return SO_RXQ_OVFL;
618 #ifdef SO_WIFI_STATUS
619 case 41: return SO_WIFI_STATUS;
622 case 42: return SO_PEEK_OFF;
625 case 43: return SO_NOFCS;
627 #ifdef SO_LOCK_FILTER
628 case 44: return SO_LOCK_FILTER;
630 #ifdef SO_SELECT_ERR_QUEUE
631 case 45: return SO_SELECT_ERR_QUEUE;
634 case 46: return SO_BUSY_POLL;
636 #ifdef SO_MAX_PACING_RATE
637 case 47: return SO_MAX_PACING_RATE;
639 #ifdef SO_BPF_EXTENSIONS
640 case 48: return SO_BPF_EXTENSIONS;
642 #ifdef SO_INCOMING_CPU
643 case 49: return SO_INCOMING_CPU;
646 case 50: return SO_ATTACH_BPF;
648 #ifdef SO_ATTACH_REUSEPORT_CBPF
649 case 51: return SO_ATTACH_REUSEPORT_CBPF;
651 #ifdef SO_ATTACH_REUSEPORT_EBPF
652 case 52: return SO_ATTACH_REUSEPORT_EBPF;
655 case 53: return SO_CNX_ADVICE;
657 #ifdef SCM_TIMESTAMPING_OPT_STATS
658 case 54: return SCM_TIMESTAMPING_OPT_STATS;
661 case 55: return SO_MEMINFO;
663 #ifdef SO_INCOMING_NAPI_ID
664 case 56: return SO_INCOMING_NAPI_ID;
667 case 57: return SO_COOKIE;
669 #ifdef SCM_TIMESTAMPING_PKTINFO
670 case 58: return SCM_TIMESTAMPING_PKTINFO;
673 case 59: return SO_PEERGROUPS;
676 case 60: return SO_ZEROCOPY;
679 case 61: return SO_TXTIME;
681 #ifdef SO_BINDTOIFINDEX
682 case 62: return SO_BINDTOIFINDEX;
684 #ifdef SO_DETACH_REUSEPORT_BPF
685 case 63: return SO_DETACH_REUSEPORT_BPF;
687 #ifdef SO_PREFER_BUSY_POLL
688 case 64: return SO_PREFER_BUSY_POLL;
690 #ifdef SO_BUSY_POLL_BUDGET
691 case 65: return SO_BUSY_POLL_BUDGET;
693 #ifdef SO_NETNS_COOKIE
694 case 66: return SO_NETNS_COOKIE;
697 fatal_mayfail(error_ajla(EC_SYNC, AJLA_ERROR_INVALID_OPERATION), err, "invalid value");