const-xs.inc

filter: Statementstmt 71.9% 41 / 57 Branchbran 36.3% 8 / 22 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 62.0% 49 / 79 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« blib/lib/Socket.pm ↑ Summary Socket.xs »
1 BOOT:
2 {
3 #if defined(dTHX) && !defined(PERL_NO_GET_CONTEXT)
4 dTHX;
5 #endif
6 8 HV *symbol_table = get_hv("Socket::", GV_ADD);
7  
8 static const struct iv_s values_for_iv[] =
9 {
10 #ifdef AF_802
11 { "AF_802", 6, AF_802 },
12 #endif
13 #ifdef AF_AAL
14 { "AF_AAL", 6, AF_AAL },
15 #endif
16 #ifdef AF_APPLETALK
17 { "AF_APPLETALK", 12, AF_APPLETALK },
18 #endif
19 #ifdef AF_CCITT
20 { "AF_CCITT", 8, AF_CCITT },
21 #endif
22 #ifdef AF_CHAOS
23 { "AF_CHAOS", 8, AF_CHAOS },
24 #endif
25 #ifdef AF_CTF
26 { "AF_CTF", 6, AF_CTF },
27 #endif
28 #ifdef AF_DATAKIT
29 { "AF_DATAKIT", 10, AF_DATAKIT },
30 #endif
31 #ifdef AF_DECnet
32 { "AF_DECnet", 9, AF_DECnet },
33 #endif
34 #ifdef AF_DLI
35 { "AF_DLI", 6, AF_DLI },
36 #endif
37 #ifdef AF_ECMA
38 { "AF_ECMA", 7, AF_ECMA },
39 #endif
40 #ifdef AF_GOSIP
41 { "AF_GOSIP", 8, AF_GOSIP },
42 #endif
43 #ifdef AF_HYLINK
44 { "AF_HYLINK", 9, AF_HYLINK },
45 #endif
46 #ifdef AF_IMPLINK
47 { "AF_IMPLINK", 10, AF_IMPLINK },
48 #endif
49 #ifdef AF_INET
50 { "AF_INET", 7, AF_INET },
51 #endif
52 #ifdef AF_INET6
53 { "AF_INET6", 8, AF_INET6 },
54 #endif
55 #ifdef AF_ISO
56 { "AF_ISO", 6, AF_ISO },
57 #endif
58 #ifdef AF_KEY
59 { "AF_KEY", 6, AF_KEY },
60 #endif
61 #ifdef AF_LAST
62 { "AF_LAST", 7, AF_LAST },
63 #endif
64 #ifdef AF_LAT
65 { "AF_LAT", 6, AF_LAT },
66 #endif
67 #ifdef AF_LINK
68 { "AF_LINK", 7, AF_LINK },
69 #endif
70 #ifdef AF_LOCAL
71 { "AF_LOCAL", 8, AF_LOCAL },
72 #endif
73 #ifdef AF_MAX
74 { "AF_MAX", 6, AF_MAX },
75 #endif
76 #ifdef AF_NBS
77 { "AF_NBS", 6, AF_NBS },
78 #endif
79 #ifdef AF_NIT
80 { "AF_NIT", 6, AF_NIT },
81 #endif
82 #ifdef AF_NS
83 { "AF_NS", 5, AF_NS },
84 #endif
85 #ifdef AF_OSI
86 { "AF_OSI", 6, AF_OSI },
87 #endif
88 #ifdef AF_OSINET
89 { "AF_OSINET", 9, AF_OSINET },
90 #endif
91 #ifdef AF_PUP
92 { "AF_PUP", 6, AF_PUP },
93 #endif
94 #ifdef AF_ROUTE
95 { "AF_ROUTE", 8, AF_ROUTE },
96 #endif
97 #ifdef AF_SNA
98 { "AF_SNA", 6, AF_SNA },
99 #endif
100 #ifdef AF_UNIX
101 { "AF_UNIX", 7, AF_UNIX },
102 #endif
103 #ifdef AF_UNSPEC
104 { "AF_UNSPEC", 9, AF_UNSPEC },
105 #endif
106 #ifdef AF_USER
107 { "AF_USER", 7, AF_USER },
108 #endif
109 #ifdef AF_WAN
110 { "AF_WAN", 6, AF_WAN },
111 #endif
112 #ifdef AF_X25
113 { "AF_X25", 6, AF_X25 },
114 #endif
115 #ifdef AI_ADDRCONFIG
116 { "AI_ADDRCONFIG", 13, AI_ADDRCONFIG },
117 #endif
118 #ifdef AI_ALL
119 { "AI_ALL", 6, AI_ALL },
120 #endif
121 #ifdef AI_CANONIDN
122 { "AI_CANONIDN", 11, AI_CANONIDN },
123 #endif
124 #ifdef AI_CANONNAME
125 { "AI_CANONNAME", 12, AI_CANONNAME },
126 #endif
127 #ifdef AI_IDN
128 { "AI_IDN", 6, AI_IDN },
129 #endif
130 #ifdef AI_NUMERICHOST
131 { "AI_NUMERICHOST", 14, AI_NUMERICHOST },
132 #endif
133 #ifdef AI_NUMERICSERV
134 { "AI_NUMERICSERV", 14, AI_NUMERICSERV },
135 #endif
136 #ifdef AI_PASSIVE
137 { "AI_PASSIVE", 10, AI_PASSIVE },
138 #endif
139 #ifdef AI_V4MAPPED
140 { "AI_V4MAPPED", 11, AI_V4MAPPED },
141 #endif
142 #ifdef EAI_ADDRFAMILY
143 { "EAI_ADDRFAMILY", 14, EAI_ADDRFAMILY },
144 #endif
145 #ifdef EAI_AGAIN
146 { "EAI_AGAIN", 9, EAI_AGAIN },
147 #endif
148 #ifdef EAI_BADFLAGS
149 { "EAI_BADFLAGS", 12, EAI_BADFLAGS },
150 #endif
151 #ifdef EAI_BADHINTS
152 { "EAI_BADHINTS", 12, EAI_BADHINTS },
153 #endif
154 #ifdef EAI_FAIL
155 { "EAI_FAIL", 8, EAI_FAIL },
156 #endif
157 #ifdef EAI_FAMILY
158 { "EAI_FAMILY", 10, EAI_FAMILY },
159 #endif
160 #ifdef EAI_NODATA
161 { "EAI_NODATA", 10, EAI_NODATA },
162 #endif
163 #ifdef EAI_NONAME
164 { "EAI_NONAME", 10, EAI_NONAME },
165 #endif
166 #ifdef EAI_PROTOCOL
167 { "EAI_PROTOCOL", 12, EAI_PROTOCOL },
168 #endif
169 #ifdef EAI_SERVICE
170 { "EAI_SERVICE", 11, EAI_SERVICE },
171 #endif
172 #ifdef EAI_SOCKTYPE
173 { "EAI_SOCKTYPE", 12, EAI_SOCKTYPE },
174 #endif
175 #ifdef EAI_SYSTEM
176 { "EAI_SYSTEM", 10, EAI_SYSTEM },
177 #endif
178 #ifdef IOV_MAX
179 { "IOV_MAX", 7, IOV_MAX },
180 #endif
181 #ifdef IP_ADD_MEMBERSHIP
182 { "IP_ADD_MEMBERSHIP", 17, IP_ADD_MEMBERSHIP },
183 #endif
184 #ifdef IP_ADD_SOURCE_MEMBERSHIP
185 { "IP_ADD_SOURCE_MEMBERSHIP", 24, IP_ADD_SOURCE_MEMBERSHIP },
186 #endif
187 #ifdef IP_BIND_ADDRESS_NO_PORT
188 { "IP_BIND_ADDRESS_NO_PORT", 23, IP_BIND_ADDRESS_NO_PORT },
189 #endif
190 #ifdef IP_DROP_MEMBERSHIP
191 { "IP_DROP_MEMBERSHIP", 18, IP_DROP_MEMBERSHIP },
192 #endif
193 #ifdef IP_DROP_SOURCE_MEMBERSHIP
194 { "IP_DROP_SOURCE_MEMBERSHIP", 25, IP_DROP_SOURCE_MEMBERSHIP },
195 #endif
196 #ifdef IP_FREEBIND
197 { "IP_FREEBIND", 11, IP_FREEBIND },
198 #endif
199 #ifdef IP_HDRINCL
200 { "IP_HDRINCL", 10, IP_HDRINCL },
201 #endif
202 #ifdef IP_MULTICAST_ALL
203 { "IP_MULTICAST_ALL", 16, IP_MULTICAST_ALL },
204 #endif
205 #ifdef IP_MULTICAST_IF
206 { "IP_MULTICAST_IF", 15, IP_MULTICAST_IF },
207 #endif
208 #ifdef IP_MULTICAST_LOOP
209 { "IP_MULTICAST_LOOP", 17, IP_MULTICAST_LOOP },
210 #endif
211 #ifdef IP_MULTICAST_TTL
212 { "IP_MULTICAST_TTL", 16, IP_MULTICAST_TTL },
213 #endif
214 #ifdef IP_MTU
215 { "IP_MTU", 6, IP_MTU },
216 #endif
217 #ifdef IP_MTU_DISCOVER
218 { "IP_MTU_DISCOVER", 15, IP_MTU_DISCOVER },
219 #endif
220 #ifdef IP_NODEFRAG
221 { "IP_NODEFRAG", 11, IP_NODEFRAG },
222 #endif
223 #ifdef IP_OPTIONS
224 { "IP_OPTIONS", 10, IP_OPTIONS },
225 #endif
226 #ifdef IP_RECVERR
227 { "IP_RECVERR", 10, IP_RECVERR },
228 #endif
229 #ifdef IP_RECVOPTS
230 { "IP_RECVOPTS", 11, IP_RECVOPTS },
231 #endif
232 #ifdef IP_RECVRETOPTS
233 { "IP_RECVRETOPTS", 14, IP_RECVRETOPTS },
234 #endif
235 #ifdef IP_RETOPTS
236 { "IP_RETOPTS", 10, IP_RETOPTS },
237 #endif
238 #ifdef IP_TOS
239 { "IP_TOS", 6, IP_TOS },
240 #endif
241 #ifdef IP_TRANSPARENT
242 { "IP_TRANSPARENT", 14, IP_TRANSPARENT },
243 #endif
244 #ifdef IP_TTL
245 { "IP_TTL", 6, IP_TTL },
246 #endif
247 #ifdef IP_PMTUDISC_DO
248 { "IP_PMTUDISC_DO", 14, IP_PMTUDISC_DO },
249 #endif
250 #ifdef IP_PMTUDISC_DONT
251 { "IP_PMTUDISC_DONT", 16, IP_PMTUDISC_DONT },
252 #endif
253 #ifdef IP_PMTUDISC_PROBE
254 { "IP_PMTUDISC_PROBE", 17, IP_PMTUDISC_PROBE },
255 #endif
256 #ifdef IP_PMTUDISC_WANT
257 { "IP_PMTUDISC_WANT", 16, IP_PMTUDISC_WANT },
258 #endif
259 #ifdef IPTOS_LOWDELAY
260 { "IPTOS_LOWDELAY", 14, IPTOS_LOWDELAY },
261 #endif
262 #ifdef IPTOS_THROUGHPUT
263 { "IPTOS_THROUGHPUT", 16, IPTOS_THROUGHPUT },
264 #endif
265 #ifdef IPTOS_RELIABILITY
266 { "IPTOS_RELIABILITY", 17, IPTOS_RELIABILITY },
267 #endif
268 #ifdef IPTOS_MINCOST
269 { "IPTOS_MINCOST", 13, IPTOS_MINCOST },
270 #endif
271 #ifdef IPV6_ADDRFROM
272 { "IPV6_ADDRFROM", 13, IPV6_ADDRFROM },
273 #endif
274 #ifdef IPV6_ADD_MEMBERSHIP
275 { "IPV6_ADD_MEMBERSHIP", 19, IPV6_ADD_MEMBERSHIP },
276 #endif
277 #ifdef IPV6_DROP_MEMBERSHIP
278 { "IPV6_DROP_MEMBERSHIP", 20, IPV6_DROP_MEMBERSHIP },
279 #endif
280 #ifdef IPV6_JOIN_GROUP
281 { "IPV6_JOIN_GROUP", 15, IPV6_JOIN_GROUP },
282 #endif
283 #ifdef IPV6_LEAVE_GROUP
284 { "IPV6_LEAVE_GROUP", 16, IPV6_LEAVE_GROUP },
285 #endif
286 #ifdef IPV6_MTU
287 { "IPV6_MTU", 8, IPV6_MTU },
288 #endif
289 #ifdef IPV6_MTU_DISCOVER
290 { "IPV6_MTU_DISCOVER", 17, IPV6_MTU_DISCOVER },
291 #endif
292 #ifdef IPV6_MULTICAST_HOPS
293 { "IPV6_MULTICAST_HOPS", 19, IPV6_MULTICAST_HOPS },
294 #endif
295 #ifdef IPV6_MULTICAST_IF
296 { "IPV6_MULTICAST_IF", 17, IPV6_MULTICAST_IF },
297 #endif
298 #ifdef IPV6_MULTICAST_LOOP
299 { "IPV6_MULTICAST_LOOP", 19, IPV6_MULTICAST_LOOP },
300 #endif
301 #ifdef IPV6_RECVERR
302 { "IPV6_RECVERR", 12, IPV6_RECVERR },
303 #endif
304 #ifdef IPV6_ROUTER_ALERT
305 { "IPV6_ROUTER_ALERT", 17, IPV6_ROUTER_ALERT },
306 #endif
307 #ifdef IPV6_TCLASS
308 { "IPV6_TCLASS", 11, IPV6_TCLASS },
309 #endif
310 #ifdef IPV6_UNICAST_HOPS
311 { "IPV6_UNICAST_HOPS", 17, IPV6_UNICAST_HOPS },
312 #endif
313 #ifdef IPV6_V6ONLY
314 { "IPV6_V6ONLY", 11, IPV6_V6ONLY },
315 #endif
316 #ifdef LOCAL_CONNWAIT
317 { "LOCAL_CONNWAIT", 14, LOCAL_CONNWAIT },
318 #endif
319 #ifdef LOCAL_CREDS
320 { "LOCAL_CREDS", 11, LOCAL_CREDS },
321 #endif
322 #ifdef LOCAL_OCREDS
323 { "LOCAL_OCREDS", 12, LOCAL_OCREDS },
324 #endif
325 #ifdef LOCAL_PEEREID
326 { "LOCAL_PEEREID", 13, LOCAL_PEEREID },
327 #endif
328 #ifdef MSG_BCAST
329 { "MSG_BCAST", 9, MSG_BCAST },
330 #endif
331 #ifdef MSG_BTAG
332 { "MSG_BTAG", 8, MSG_BTAG },
333 #endif
334 #ifdef MSG_CTLFLAGS
335 { "MSG_CTLFLAGS", 12, MSG_CTLFLAGS },
336 #endif
337 #ifdef MSG_CTLIGNORE
338 { "MSG_CTLIGNORE", 13, MSG_CTLIGNORE },
339 #endif
340 #ifdef MSG_DONTWAIT
341 { "MSG_DONTWAIT", 12, MSG_DONTWAIT },
342 #endif
343 #ifdef MSG_EOF
344 { "MSG_EOF", 7, MSG_EOF },
345 #endif
346 #ifdef MSG_EOR
347 { "MSG_EOR", 7, MSG_EOR },
348 #endif
349 #ifdef MSG_ERRQUEUE
350 { "MSG_ERRQUEUE", 12, MSG_ERRQUEUE },
351 #endif
352 #ifdef MSG_ETAG
353 { "MSG_ETAG", 8, MSG_ETAG },
354 #endif
355 #ifdef MSG_FASTOPEN
356 { "MSG_FASTOPEN", 12, MSG_FASTOPEN },
357 #endif
358 #ifdef MSG_FIN
359 { "MSG_FIN", 7, MSG_FIN },
360 #endif
361 #ifdef MSG_MAXIOVLEN
362 { "MSG_MAXIOVLEN", 13, MSG_MAXIOVLEN },
363 #endif
364 #ifdef MSG_MCAST
365 { "MSG_MCAST", 9, MSG_MCAST },
366 #endif
367 #ifdef MSG_NOSIGNAL
368 { "MSG_NOSIGNAL", 12, MSG_NOSIGNAL },
369 #endif
370 #ifdef MSG_RST
371 { "MSG_RST", 7, MSG_RST },
372 #endif
373 #ifdef MSG_SYN
374 { "MSG_SYN", 7, MSG_SYN },
375 #endif
376 #ifdef MSG_TRUNC
377 { "MSG_TRUNC", 9, MSG_TRUNC },
378 #endif
379 #ifdef MSG_URG
380 { "MSG_URG", 7, MSG_URG },
381 #endif
382 #ifdef MSG_WAITALL
383 { "MSG_WAITALL", 11, MSG_WAITALL },
384 #endif
385 #ifdef MSG_WIRE
386 { "MSG_WIRE", 8, MSG_WIRE },
387 #endif
388 #ifdef NI_DGRAM
389 { "NI_DGRAM", 8, NI_DGRAM },
390 #endif
391 #ifdef NI_IDN
392 { "NI_IDN", 6, NI_IDN },
393 #endif
394 #ifdef NI_NAMEREQD
395 { "NI_NAMEREQD", 11, NI_NAMEREQD },
396 #endif
397 #ifdef NI_NOFQDN
398 { "NI_NOFQDN", 9, NI_NOFQDN },
399 #endif
400 #ifdef NI_NUMERICHOST
401 { "NI_NUMERICHOST", 14, NI_NUMERICHOST },
402 #endif
403 #ifdef NI_NUMERICSERV
404 { "NI_NUMERICSERV", 14, NI_NUMERICSERV },
405 #endif
406 #ifdef PF_802
407 { "PF_802", 6, PF_802 },
408 #endif
409 #ifdef PF_AAL
410 { "PF_AAL", 6, PF_AAL },
411 #endif
412 #ifdef PF_APPLETALK
413 { "PF_APPLETALK", 12, PF_APPLETALK },
414 #endif
415 #ifdef PF_CCITT
416 { "PF_CCITT", 8, PF_CCITT },
417 #endif
418 #ifdef PF_CHAOS
419 { "PF_CHAOS", 8, PF_CHAOS },
420 #endif
421 #ifdef PF_CTF
422 { "PF_CTF", 6, PF_CTF },
423 #endif
424 #ifdef PF_DATAKIT
425 { "PF_DATAKIT", 10, PF_DATAKIT },
426 #endif
427 #ifdef PF_DECnet
428 { "PF_DECnet", 9, PF_DECnet },
429 #endif
430 #ifdef PF_DLI
431 { "PF_DLI", 6, PF_DLI },
432 #endif
433 #ifdef PF_ECMA
434 { "PF_ECMA", 7, PF_ECMA },
435 #endif
436 #ifdef PF_GOSIP
437 { "PF_GOSIP", 8, PF_GOSIP },
438 #endif
439 #ifdef PF_HYLINK
440 { "PF_HYLINK", 9, PF_HYLINK },
441 #endif
442 #ifdef PF_IMPLINK
443 { "PF_IMPLINK", 10, PF_IMPLINK },
444 #endif
445 #ifdef PF_INET
446 { "PF_INET", 7, PF_INET },
447 #endif
448 #ifdef PF_INET6
449 { "PF_INET6", 8, PF_INET6 },
450 #endif
451 #ifdef PF_ISO
452 { "PF_ISO", 6, PF_ISO },
453 #endif
454 #ifdef PF_KEY
455 { "PF_KEY", 6, PF_KEY },
456 #endif
457 #ifdef PF_LAST
458 { "PF_LAST", 7, PF_LAST },
459 #endif
460 #ifdef PF_LAT
461 { "PF_LAT", 6, PF_LAT },
462 #endif
463 #ifdef PF_LINK
464 { "PF_LINK", 7, PF_LINK },
465 #endif
466 #ifdef PF_LOCAL
467 { "PF_LOCAL", 8, PF_LOCAL },
468 #endif
469 #ifdef PF_MAX
470 { "PF_MAX", 6, PF_MAX },
471 #endif
472 #ifdef PF_NBS
473 { "PF_NBS", 6, PF_NBS },
474 #endif
475 #ifdef PF_NIT
476 { "PF_NIT", 6, PF_NIT },
477 #endif
478 #ifdef PF_NS
479 { "PF_NS", 5, PF_NS },
480 #endif
481 #ifdef PF_OSI
482 { "PF_OSI", 6, PF_OSI },
483 #endif
484 #ifdef PF_OSINET
485 { "PF_OSINET", 9, PF_OSINET },
486 #endif
487 #ifdef PF_PUP
488 { "PF_PUP", 6, PF_PUP },
489 #endif
490 #ifdef PF_ROUTE
491 { "PF_ROUTE", 8, PF_ROUTE },
492 #endif
493 #ifdef PF_SNA
494 { "PF_SNA", 6, PF_SNA },
495 #endif
496 #ifdef PF_UNIX
497 { "PF_UNIX", 7, PF_UNIX },
498 #endif
499 #ifdef PF_UNSPEC
500 { "PF_UNSPEC", 9, PF_UNSPEC },
501 #endif
502 #ifdef PF_USER
503 { "PF_USER", 7, PF_USER },
504 #endif
505 #ifdef PF_WAN
506 { "PF_WAN", 6, PF_WAN },
507 #endif
508 #ifdef PF_X25
509 { "PF_X25", 6, PF_X25 },
510 #endif
511 #ifdef SCM_CONNECT
512 { "SCM_CONNECT", 11, SCM_CONNECT },
513 #endif
514 #ifdef SCM_CREDENTIALS
515 { "SCM_CREDENTIALS", 15, SCM_CREDENTIALS },
516 #endif
517 #ifdef SCM_CREDS
518 { "SCM_CREDS", 9, SCM_CREDS },
519 #endif
520 #ifdef SCM_TIMESTAMP
521 { "SCM_TIMESTAMP", 13, SCM_TIMESTAMP },
522 #endif
523 #ifdef SOCK_DGRAM
524 { "SOCK_DGRAM", 10, SOCK_DGRAM },
525 #endif
526 #ifdef SOCK_RAW
527 { "SOCK_RAW", 8, SOCK_RAW },
528 #endif
529 #ifdef SOCK_RDM
530 { "SOCK_RDM", 8, SOCK_RDM },
531 #endif
532 #ifdef SOCK_SEQPACKET
533 { "SOCK_SEQPACKET", 14, SOCK_SEQPACKET },
534 #endif
535 #ifdef SOCK_STREAM
536 { "SOCK_STREAM", 11, SOCK_STREAM },
537 #endif
538 #ifdef SOCK_NONBLOCK
539 { "SOCK_NONBLOCK", 13, SOCK_NONBLOCK },
540 #endif
541 #ifdef SOCK_CLOEXEC
542 { "SOCK_CLOEXEC", 12, SOCK_CLOEXEC },
543 #endif
544 #ifdef SOL_SOCKET
545 { "SOL_SOCKET", 10, SOL_SOCKET },
546 #endif
547 #ifdef SOMAXCONN
548 { "SOMAXCONN", 9, SOMAXCONN },
549 #endif
550 #ifdef SO_ACCEPTCONN
551 { "SO_ACCEPTCONN", 13, SO_ACCEPTCONN },
552 #endif
553 #ifdef SO_ATTACH_FILTER
554 { "SO_ATTACH_FILTER", 16, SO_ATTACH_FILTER },
555 #endif
556 #ifdef SO_BACKLOG
557 { "SO_BACKLOG", 10, SO_BACKLOG },
558 #endif
559 #ifdef SO_BINDTODEVICE
560 { "SO_BINDTODEVICE", 15, SO_BINDTODEVICE },
561 #endif
562 #ifdef SO_BROADCAST
563 { "SO_BROADCAST", 12, SO_BROADCAST },
564 #endif
565 #ifdef SO_BSDCOMPAT
566 { "SO_BSDCOMPAT", 12, SO_BSDCOMPAT },
567 #endif
568 #ifdef SO_BUSY_POLL
569 { "SO_BUSY_POLL", 12, SO_BUSY_POLL },
570 #endif
571 #ifdef SO_CHAMELEON
572 { "SO_CHAMELEON", 12, SO_CHAMELEON },
573 #endif
574 #ifdef SO_DEBUG
575 { "SO_DEBUG", 8, SO_DEBUG },
576 #endif
577 #ifdef SO_DETACH_FILTER
578 { "SO_DETACH_FILTER", 16, SO_DETACH_FILTER },
579 #endif
580 #ifdef SO_DGRAM_ERRIND
581 { "SO_DGRAM_ERRIND", 15, SO_DGRAM_ERRIND },
582 #endif
583 #ifdef SO_DOMAIN
584 { "SO_DOMAIN", 9, SO_DOMAIN },
585 #endif
586 #ifdef SO_DONTLINGER
587 { "SO_DONTLINGER", 13, SO_DONTLINGER },
588 #endif
589 #ifdef SO_DONTROUTE
590 { "SO_DONTROUTE", 12, SO_DONTROUTE },
591 #endif
592 #ifdef SO_ERROR
593 { "SO_ERROR", 8, SO_ERROR },
594 #endif
595 #ifdef SO_FAMILY
596 { "SO_FAMILY", 9, SO_FAMILY },
597 #endif
598 #ifdef SO_INCOMING_CPU
599 { "SO_INCOMING_CPU", 15, SO_INCOMING_CPU },
600 #endif
601 #ifdef SO_INCOMING_NAPI_ID
602 { "SO_INCOMING_NAPI_ID", 19, SO_INCOMING_NAPI_ID },
603 #endif
604 #ifdef SO_KEEPALIVE
605 { "SO_KEEPALIVE", 12, SO_KEEPALIVE },
606 #endif
607 #ifdef SO_LINGER
608 { "SO_LINGER", 9, SO_LINGER },
609 #endif
610 #ifdef SO_LOCK_FILTER
611 { "SO_LOCK_FILTER", 14, SO_LOCK_FILTER },
612 #endif
613 #ifdef SO_MARK
614 { "SO_MARK", 7, SO_MARK },
615 #endif
616 #ifdef SO_OOBINLINE
617 { "SO_OOBINLINE", 12, SO_OOBINLINE },
618 #endif
619 #ifdef SO_PASSCRED
620 { "SO_PASSCRED", 11, SO_PASSCRED },
621 #endif
622 #ifdef SO_PASSIFNAME
623 { "SO_PASSIFNAME", 13, SO_PASSIFNAME },
624 #endif
625 #ifdef SO_PEEK_OFF
626 { "SO_PEEK_OFF", 11, SO_PEEK_OFF },
627 #endif
628 #ifdef SO_PEERCRED
629 { "SO_PEERCRED", 11, SO_PEERCRED },
630 #endif
631 #ifdef SO_PRIORITY
632 { "SO_PRIORITY", 11, SO_PRIORITY },
633 #endif
634 #ifdef SO_PROTOCOL
635 { "SO_PROTOCOL", 11, SO_PROTOCOL },
636 #endif
637 #ifdef SO_PROTOTYPE
638 { "SO_PROTOTYPE", 12, SO_PROTOTYPE },
639 #endif
640 #ifdef SO_RCVBUF
641 { "SO_RCVBUF", 9, SO_RCVBUF },
642 #endif
643 #ifdef SO_RCVBUFFORCE
644 { "SO_RCVBUFFORCE", 14, SO_RCVBUFFORCE },
645 #endif
646 #ifdef SO_RCVLOWAT
647 { "SO_RCVLOWAT", 11, SO_RCVLOWAT },
648 #endif
649 #ifdef SO_RCVTIMEO
650 { "SO_RCVTIMEO", 11, SO_RCVTIMEO },
651 #endif
652 #ifdef SO_REUSEADDR
653 { "SO_REUSEADDR", 12, SO_REUSEADDR },
654 #endif
655 #ifdef SO_REUSEPORT
656 { "SO_REUSEPORT", 12, SO_REUSEPORT },
657 #endif
658 #ifdef SO_RXQ_OVFL
659 { "SO_RXQ_OVFL", 11, SO_RXQ_OVFL },
660 #endif
661 #ifdef SO_SECURITY_AUTHENTICATION
662 { "SO_SECURITY_AUTHENTICATION", 26, SO_SECURITY_AUTHENTICATION },
663 #endif
664 #ifdef SO_SECURITY_ENCRYPTION_NETWORK
665 { "SO_SECURITY_ENCRYPTION_NETWORK", 30, SO_SECURITY_ENCRYPTION_NETWORK },
666 #endif
667 #ifdef SO_SECURITY_ENCRYPTION_TRANSPORT
668 { "SO_SECURITY_ENCRYPTION_TRANSPORT", 32, SO_SECURITY_ENCRYPTION_TRANSPORT },
669 #endif
670 #ifdef SO_SNDBUF
671 { "SO_SNDBUF", 9, SO_SNDBUF },
672 #endif
673 #ifdef SO_SNDBUFFORCE
674 { "SO_SNDBUFFORCE", 14, SO_SNDBUFFORCE },
675 #endif
676 #ifdef SO_SNDLOWAT
677 { "SO_SNDLOWAT", 11, SO_SNDLOWAT },
678 #endif
679 #ifdef SO_SNDTIMEO
680 { "SO_SNDTIMEO", 11, SO_SNDTIMEO },
681 #endif
682 #ifdef SO_STATE
683 { "SO_STATE", 8, SO_STATE },
684 #endif
685 #ifdef SO_TIMESTAMP
686 { "SO_TIMESTAMP", 12, SO_TIMESTAMP },
687 #endif
688 #ifdef SO_TYPE
689 { "SO_TYPE", 7, SO_TYPE },
690 #endif
691 #ifdef SO_USELOOPBACK
692 { "SO_USELOOPBACK", 14, SO_USELOOPBACK },
693 #endif
694 #ifdef SO_XOPEN
695 { "SO_XOPEN", 8, SO_XOPEN },
696 #endif
697 #ifdef SO_XSE
698 { "SO_XSE", 6, SO_XSE },
699 #endif
700 #ifdef TCP_CC_INFO
701 { "TCP_CC_INFO", 11, TCP_CC_INFO },
702 #endif
703 #ifdef TCP_CONGESTION
704 { "TCP_CONGESTION", 14, TCP_CONGESTION },
705 #endif
706 #ifdef TCP_CONNECTIONTIMEOUT
707 { "TCP_CONNECTIONTIMEOUT", 21, TCP_CONNECTIONTIMEOUT },
708 #endif
709 #ifdef TCP_CORK
710 { "TCP_CORK", 8, TCP_CORK },
711 #endif
712 #ifdef TCP_DEFER_ACCEPT
713 { "TCP_DEFER_ACCEPT", 16, TCP_DEFER_ACCEPT },
714 #endif
715 #ifdef TCP_FASTOPEN
716 { "TCP_FASTOPEN", 12, TCP_FASTOPEN },
717 #endif
718 #ifdef TCP_FASTOPEN_CONNECT
719 { "TCP_FASTOPEN_CONNECT", 20, TCP_FASTOPEN_CONNECT },
720 #endif
721 #ifdef TCP_FASTOPEN_KEY
722 { "TCP_FASTOPEN_KEY", 16, TCP_FASTOPEN_KEY },
723 #endif
724 #ifdef TCP_FASTOPEN_NO_COOKIE
725 { "TCP_FASTOPEN_NO_COOKIE", 22, TCP_FASTOPEN_NO_COOKIE },
726 #endif
727 #ifdef TCP_INFO
728 { "TCP_INFO", 8, TCP_INFO },
729 #endif
730 #ifdef TCP_INIT_CWND
731 { "TCP_INIT_CWND", 13, TCP_INIT_CWND },
732 #endif
733 #ifdef TCP_KEEPALIVE
734 { "TCP_KEEPALIVE", 13, TCP_KEEPALIVE },
735 #endif
736 #ifdef TCP_KEEPCNT
737 { "TCP_KEEPCNT", 11, TCP_KEEPCNT },
738 #endif
739 #ifdef TCP_KEEPIDLE
740 { "TCP_KEEPIDLE", 12, TCP_KEEPIDLE },
741 #endif
742 #ifdef TCP_KEEPINTVL
743 { "TCP_KEEPINTVL", 13, TCP_KEEPINTVL },
744 #endif
745 #ifdef TCP_LINGER2
746 { "TCP_LINGER2", 11, TCP_LINGER2 },
747 #endif
748 #ifdef TCP_MAXRT
749 { "TCP_MAXRT", 9, TCP_MAXRT },
750 #endif
751 #ifdef TCP_MAXSEG
752 { "TCP_MAXSEG", 10, TCP_MAXSEG },
753 #endif
754 #ifdef TCP_MD5SIG
755 { "TCP_MD5SIG", 10, TCP_MD5SIG },
756 #endif
757 #ifdef TCP_MD5SIG_EXT
758 { "TCP_MD5SIG_EXT", 14, TCP_MD5SIG_EXT },
759 #endif
760 #ifdef TCP_NODELAY
761 { "TCP_NODELAY", 11, TCP_NODELAY },
762 #endif
763 #ifdef TCP_NOOPT
764 { "TCP_NOOPT", 9, TCP_NOOPT },
765 #endif
766 #ifdef TCP_NOPUSH
767 { "TCP_NOPUSH", 10, TCP_NOPUSH },
768 #endif
769 #ifdef TCP_NOTSENT_LOWAT
770 { "TCP_NOTSENT_LOWAT", 17, TCP_NOTSENT_LOWAT },
771 #endif
772 #ifdef TCP_QUICKACK
773 { "TCP_QUICKACK", 12, TCP_QUICKACK },
774 #endif
775 #ifdef TCP_SACK_ENABLE
776 { "TCP_SACK_ENABLE", 15, TCP_SACK_ENABLE },
777 #endif
778 #ifdef TCP_STDURG
779 { "TCP_STDURG", 10, TCP_STDURG },
780 #endif
781 #ifdef TCP_SYNCNT
782 { "TCP_SYNCNT", 10, TCP_SYNCNT },
783 #endif
784 #ifdef TCP_TIMESTAMP
785 { "TCP_TIMESTAMP", 13, TCP_TIMESTAMP },
786 #endif
787 #ifdef TCP_TX_DELAY
788 { "TCP_TX_DELAY", 12, TCP_TX_DELAY },
789 #endif
790 #ifdef TCP_USER_TIMEOUT
791 { "TCP_USER_TIMEOUT", 16, TCP_USER_TIMEOUT },
792 #endif
793 #ifdef TCP_WINDOW_CLAMP
794 { "TCP_WINDOW_CLAMP", 16, TCP_WINDOW_CLAMP },
795 #endif
796 #ifdef UIO_MAXIOV
797 { "UIO_MAXIOV", 10, UIO_MAXIOV },
798 #endif
799 #ifdef IPPROTO_IP
800 { "IPPROTO_IP", 10, IPPROTO_IP },
801 #endif
802 #ifdef IPPROTO_IPV6
803 { "IPPROTO_IPV6", 12, IPPROTO_IPV6 },
804 #endif
805 #ifdef IPPROTO_RAW
806 { "IPPROTO_RAW", 11, IPPROTO_RAW },
807 #endif
808 #ifdef IPPROTO_ICMP
809 { "IPPROTO_ICMP", 12, IPPROTO_ICMP },
810 #endif
811 #ifdef IPPROTO_IGMP
812 { "IPPROTO_IGMP", 12, IPPROTO_IGMP },
813 #endif
814 #ifdef IPPROTO_TCP
815 { "IPPROTO_TCP", 11, IPPROTO_TCP },
816 #endif
817 #ifdef IPPROTO_UDP
818 { "IPPROTO_UDP", 11, IPPROTO_UDP },
819 #endif
820 #ifdef IPPROTO_GRE
821 { "IPPROTO_GRE", 11, IPPROTO_GRE },
822 #endif
823 #ifdef IPPROTO_ESP
824 { "IPPROTO_ESP", 11, IPPROTO_ESP },
825 #endif
826 #ifdef IPPROTO_AH
827 { "IPPROTO_AH", 10, IPPROTO_AH },
828 #endif
829 #ifdef IPPROTO_ICMPV6
830 { "IPPROTO_ICMPV6", 14, IPPROTO_ICMPV6 },
831 #endif
832 #ifdef IPPROTO_SCTP
833 { "IPPROTO_SCTP", 12, IPPROTO_SCTP },
834 #endif
835 #ifdef SHUT_RD
836 { "SHUT_RD", 7, SHUT_RD },
837 #endif
838 #ifdef SHUT_WR
839 { "SHUT_WR", 7, SHUT_WR },
840 #endif
841 #ifdef SHUT_RDWR
842 { "SHUT_RDWR", 9, SHUT_RDWR },
843 #endif
844 #if defined(MSG_CTRUNC) || defined(HAS_MSG_CTRUNC) /* might be an enum */
845 { "MSG_CTRUNC", 10, MSG_CTRUNC },
846 #endif
847 #if defined(MSG_DONTROUTE) || defined(HAS_MSG_DONTROUTE) /* might be an enum */
848 { "MSG_DONTROUTE", 13, MSG_DONTROUTE },
849 #endif
850 #if defined(MSG_OOB) || defined(HAS_MSG_OOB) /* might be an enum */
851 { "MSG_OOB", 7, MSG_OOB },
852 #endif
853 #if defined(MSG_PEEK) || defined(HAS_MSG_PEEK) /* might be an enum */
854 { "MSG_PEEK", 8, MSG_PEEK },
855 #endif
856 #if defined(MSG_PROXY) || defined(HAS_MSG_PROXY) /* might be an enum */
857 { "MSG_PROXY", 9, MSG_PROXY },
858 #endif
859 #if defined(SCM_RIGHTS) || defined(HAS_SCM_RIGHTS) /* might be an enum */
860 { "SCM_RIGHTS", 10, SCM_RIGHTS },
861 #endif
862 #ifndef IPPROTO_IP
863 /* This is the default value: */
864 { "IPPROTO_IP", 10, 0 },
865 #endif
866 #ifndef IPPROTO_IPV6
867 /* This is the default value: */
868 { "IPPROTO_IPV6", 12, 41 },
869 #endif
870 #ifndef IPPROTO_RAW
871 /* This is the default value: */
872 { "IPPROTO_RAW", 11, 255 },
873 #endif
874 #ifndef IPPROTO_ICMP
875 /* This is the default value: */
876 { "IPPROTO_ICMP", 12, 1 },
877 #endif
878 #ifndef IPPROTO_IGMP
879 /* This is the default value: */
880 { "IPPROTO_IGMP", 12, 2 },
881 #endif
882 #ifndef IPPROTO_TCP
883 /* This is the default value: */
884 { "IPPROTO_TCP", 11, 6 },
885 #endif
886 #ifndef IPPROTO_UDP
887 /* This is the default value: */
888 { "IPPROTO_UDP", 11, 17 },
889 #endif
890 #ifndef IPPROTO_GRE
891 /* This is the default value: */
892 { "IPPROTO_GRE", 11, 47 },
893 #endif
894 #ifndef IPPROTO_ESP
895 /* This is the default value: */
896 { "IPPROTO_ESP", 11, 50 },
897 #endif
898 #ifndef IPPROTO_AH
899 /* This is the default value: */
900 { "IPPROTO_AH", 10, 51 },
901 #endif
902 #ifndef IPPROTO_ICMPV6
903 /* This is the default value: */
904 { "IPPROTO_ICMPV6", 14, 58 },
905 #endif
906 #ifndef IPPROTO_SCTP
907 /* This is the default value: */
908 { "IPPROTO_SCTP", 12, 132 },
909 #endif
910 #ifndef SHUT_RD
911 /* This is the default value: */
912 { "SHUT_RD", 7, 0 },
913 #endif
914 #ifndef SHUT_WR
915 /* This is the default value: */
916 { "SHUT_WR", 7, 1 },
917 #endif
918 #ifndef SHUT_RDWR
919 /* This is the default value: */
920 { "SHUT_RDWR", 9, 2 },
921 #endif
922 { NULL, 0, 0 } };
923 8 const struct iv_s *value_for_iv = values_for_iv;
924 1608 ▶ while (value_for_iv->name) {
Branch: 1 branch
BranchTrueFalseTotal
while (value_for_iv->name) { 1600 8 1608
925 3200 constant_add_symbol(aTHX_ symbol_table, value_for_iv->name,
926 1600 value_for_iv->namelen, newSViv(value_for_iv->value));
927 1600 ++value_for_iv;
928 }
929 if (C_ARRAY_LENGTH(values_for_notfound) > 1) {
930 #ifndef SYMBIAN
931 8 HV *const constant_missing = get_missing_hash(aTHX);
932 #endif
933 8 const struct notfound_s *value_for_notfound = values_for_notfound;
934 do {
935  
936 /* Need to add prototypes, else parsing will vary by platform. */
937 672 HE *he = (HE*) hv_common_key_len(symbol_table,
938 value_for_notfound->name,
939 value_for_notfound->namelen,
940 HV_FETCH_LVALUE, NULL, 0);
941 SV *sv;
942 #ifndef SYMBIAN
943 HEK *hek;
944 #endif
945 672 ▶ if (!he) {
Branch: 1 branch
BranchTrueFalseTotal
if (!he) { 0 672 672
946 0 croak("Couldn't add key '%s' to %%Socket::",
947 value_for_notfound->name);
948 }
949 672 sv = HeVAL(he);
950 672 ▶ if (!SvOK(sv) && SvTYPE(sv) != SVt_PVGV) {
Branch: 2 branches
BranchTrueFalseTotal
if (!SvOK(sv) && SvTYPE(sv) != SVt_PVGV) { 672 0 672
if (!SvOK(sv) && SvTYPE(sv) != SVt_PVGV) { 672 0 672
951 /* Nothing was here before, so mark a prototype of "" */
952 672 sv_setpvn(sv, "", 0);
953 0 ▶ } else if (SvPOK(sv) && SvCUR(sv) == 0) {
Branch: 2 branches
BranchTrueFalseTotal
} else if (SvPOK(sv) && SvCUR(sv) == 0) { 0 0 0
} else if (SvPOK(sv) && SvCUR(sv) == 0) { 0 0 0
954 /* There is already a prototype of "" - do nothing */
955 } else {
956 /* Someone has been here before us - have to make a real
957 typeglob. */
958 /* It turns out to be incredibly hard to deal with all the
959 corner cases of sub foo (); and reporting errors correctly,
960 so lets cheat a bit. Start with a constant subroutine */
961 0 CV *cv = newCONSTSUB(symbol_table,
962 value_for_notfound->name,
963 &PL_sv_yes);
964 /* and then turn it into a non constant declaration only. */
965 0 SvREFCNT_dec(CvXSUBANY(cv).any_ptr);
966 0 CvCONST_off(cv);
967 0 CvXSUB(cv) = NULL;
968 0 CvXSUBANY(cv).any_ptr = NULL;
969 }
970 #ifndef SYMBIAN
971 672 hek = HeKEY_hek(he);
972 672 ▶ if (!hv_common(constant_missing, NULL, HEK_KEY(hek),
Branch: 1 branch
BranchTrueFalseTotal
if (!hv_common(constant_missing, NULL, HEK_KEY(hek), 0 672 672
973 HEK_LEN(hek), HEK_FLAGS(hek), HV_FETCH_ISSTORE,
974 &PL_sv_yes, HEK_HASH(hek)))
975 0 croak("Couldn't add key '%s' to missing_hash",
976 value_for_notfound->name);
977 #endif
978 672 ▶ } while ((++value_for_notfound)->name);
Branch: 1 branch
BranchTrueFalseTotal
} while ((++value_for_notfound)->name); 664 8 672
979 }
980 #ifdef INADDR_ANY
981 {
982 SV * temp0;
983 8 struct in_addr ip_address; ip_address.s_addr = htonl(INADDR_ANY);
984 8 temp0 = newSVpvn_flags((char *)&ip_address,sizeof(ip_address), SVs_TEMP);
985 8 constant_add_symbol(aTHX_ symbol_table, "INADDR_ANY",
986 8 10, SvREFCNT_inc(temp0));
987 }
988 #endif
989 #ifdef INADDR_LOOPBACK
990 {
991 SV * temp0;
992 8 struct in_addr ip_address; ip_address.s_addr = htonl(INADDR_LOOPBACK);
993 8 temp0 = newSVpvn_flags((char *)&ip_address,sizeof(ip_address), SVs_TEMP);
994 8 constant_add_symbol(aTHX_ symbol_table, "INADDR_LOOPBACK",
995 8 15, SvREFCNT_inc(temp0));
996 }
997 #endif
998 #ifdef INADDR_NONE
999 {
1000 SV * temp0;
1001 8 struct in_addr ip_address; ip_address.s_addr = htonl(INADDR_NONE);
1002 8 temp0 = newSVpvn_flags((char *)&ip_address,sizeof(ip_address), SVs_TEMP);
1003 8 constant_add_symbol(aTHX_ symbol_table, "INADDR_NONE",
1004 8 11, SvREFCNT_inc(temp0));
1005 }
1006 #endif
1007 #ifdef INADDR_BROADCAST
1008 {
1009 SV * temp0;
1010 8 struct in_addr ip_address; ip_address.s_addr = htonl(INADDR_BROADCAST);
1011 8 temp0 = newSVpvn_flags((char *)&ip_address,sizeof(ip_address), SVs_TEMP);
1012 8 constant_add_symbol(aTHX_ symbol_table, "INADDR_BROADCAST",
1013 8 16, SvREFCNT_inc(temp0));
1014 }
1015 #endif
1016 #ifdef IN6ADDR_ANY_INIT
1017 {
1018 SV * temp0;
1019 8 struct in6_addr ip6_address = IN6ADDR_ANY_INIT;
1020 8 temp0 = newSVpvn_flags((char *)&ip6_address,sizeof(ip6_address), SVs_TEMP);
1021 8 constant_add_symbol(aTHX_ symbol_table, "IN6ADDR_ANY",
1022 8 11, SvREFCNT_inc(temp0));
1023 }
1024 #endif
1025 #ifdef IN6ADDR_LOOPBACK_INIT
1026 {
1027 SV * temp0;
1028 8 struct in6_addr ip6_address = IN6ADDR_LOOPBACK_INIT;
1029 8 temp0 = newSVpvn_flags((char *)&ip6_address,sizeof(ip6_address), SVs_TEMP);
1030 8 constant_add_symbol(aTHX_ symbol_table, "IN6ADDR_LOOPBACK",
1031 8 16, SvREFCNT_inc(temp0));
1032 }
1033 #endif
1034 /* As we've been creating subroutines, we better invalidate any cached
1035 methods */
1036 8 mro_method_changed_in(symbol_table);
1037 }
1038  
1039 void
1040 AUTOLOAD()
1041 PROTOTYPE: DISABLE
1042 PREINIT:
1043 0 SV *sv = newSVpvn_flags(SvPVX(cv), SvCUR(cv), SVs_TEMP | SvUTF8(cv));
1044 0 const COP *cop = PL_curcop;
1045 PPCODE:
1046 #ifndef SYMBIAN
1047 /* It's not obvious how to calculate this at C pre-processor time.
1048 However, any compiler optimiser worth its salt should be able to
1049 remove the dead code, and hopefully the now-obviously-unused static
1050 function too. */
1051 HV *constant_missing = (C_ARRAY_LENGTH(values_for_notfound) > 1)
1052 0 ? get_missing_hash(aTHX) : NULL;
1053 0 ▶ if ((C_ARRAY_LENGTH(values_for_notfound) > 1)
Branch: 1 branch
BranchTrueFalseTotal
if ((C_ARRAY_LENGTH(values_for_notfound) > 1) 0 0 0
1054 0 ? hv_exists_ent(constant_missing, sv, 0) : 0) {
1055 0 ▶ sv = newSVpvf("Your vendor has not defined Socket macro %" SVf
Branch: 1 branch
BranchTrueFalseTotal
sv = newSVpvf("Your vendor has not defined Socket macro %" SVf 0 0 0
1056 ", used at %" COP_FILE_F " line %" UVuf "\n",
1057 sv, COP_FILE(cop), (UV)CopLINE(cop));
1058 } else
1059 #endif
1060 {
1061 0 ▶ sv = newSVpvf("%" SVf
Branch: 1 branch
BranchTrueFalseTotal
sv = newSVpvf("%" SVf 0 0 0
1062 " is not a valid Socket macro at %"
1063 COP_FILE_F " line %" UVuf "\n",
1064 sv, COP_FILE(cop), (UV)CopLINE(cop));
1065 }
1066 0 croak_sv(sv_2mortal(sv));
« blib/lib/Socket.pm ↑ Summary Socket.xs »