| 1 |
|
| /* |
| 2 |
|
| |
| 3 |
|
| # Copyright 1995,2002 Spider Boardman. |
| 4 |
|
| # All rights reserved. |
| 5 |
|
| # |
| 6 |
|
| # Automatic licensing for this software is available. This software |
| 7 |
|
| # can be copied and used under the terms of the GNU Public License, |
| 8 |
|
| # version 1 or (at your option) any later version, or under the |
| 9 |
|
| # terms of the Artistic license. Both of these can be found with |
| 10 |
|
| # the Perl distribution, which this software is intended to augment. |
| 11 |
|
| # |
| 12 |
|
| # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR |
| 13 |
|
| # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED |
| 14 |
|
| # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
| 15 |
|
| |
| 16 |
|
| */ |
| 17 |
|
| |
| 18 |
|
| /* |
| 19 |
|
| * Can't rely on #ifdef to keep some compilers from griping about a #pragma |
| 20 |
|
| * which they don't recognize, so do it the old-fashioned way. |
| 21 |
|
| */ |
| 22 |
|
| |
| 23 |
|
| static char const rcsid[] = "@(#) $Id: Gen.xs,v 1.24 2002/04/10 11:05:58 spider Exp $"; |
| 24 |
|
| |
| 25 |
|
| #ifdef __cplusplus |
| 26 |
|
| extern "C" { |
| 27 |
|
| #endif |
| 28 |
|
| #include "EXTERN.h" |
| 29 |
|
| #include "perl.h" |
| 30 |
|
| #include "XSUB.h" |
| 31 |
|
| |
| 32 |
|
| #ifdef I_FCNTL |
| 33 |
|
| #include <fcntl.h> |
| 34 |
|
| #endif |
| 35 |
|
| #ifdef I_SYS_FILE |
| 36 |
|
| #include <sys/file.h> |
| 37 |
|
| #endif |
| 38 |
|
| |
| 39 |
|
| #ifndef VMS |
| 40 |
|
| # ifdef I_SYS_TYPES |
| 41 |
|
| # include <sys/types.h> |
| 42 |
|
| # endif |
| 43 |
|
| #include <sys/socket.h> |
| 44 |
|
| #ifdef I_SYS_UN |
| 45 |
|
| #include <sys/un.h> |
| 46 |
|
| #endif |
| 47 |
|
| # ifdef I_NETINET_IN |
| 48 |
|
| # include <netinet/in.h> |
| 49 |
|
| # endif |
| 50 |
|
| #include <netdb.h> |
| 51 |
|
| #else |
| 52 |
|
| #include "sockadapt.h" |
| 53 |
|
| #endif |
| 54 |
|
| |
| 55 |
|
| #include "netgen.h" |
| 56 |
|
| |
| 57 |
|
| #ifdef BAD_TCP_MSS |
| 58 |
|
| # undef TCP_MSS |
| 59 |
|
| # define TCP_MSS TCP_MSS_IETF |
| 60 |
|
| #endif |
| 61 |
|
| |
| 62 |
|
| #ifndef SHUT_RD |
| 63 |
|
| #ifdef O_RDONLY |
| 64 |
|
| #define SHUT_RD O_RDONLY |
| 65 |
|
| #else |
| 66 |
|
| #define SHUT_RD 0 |
| 67 |
|
| #endif |
| 68 |
|
| #endif |
| 69 |
|
| |
| 70 |
|
| #ifndef SHUT_WR |
| 71 |
|
| #ifdef O_WRONLY |
| 72 |
|
| #define SHUT_WR O_WRONLY |
| 73 |
|
| #else |
| 74 |
|
| #define SHUT_WR 1 |
| 75 |
|
| #endif |
| 76 |
|
| #endif |
| 77 |
|
| |
| 78 |
|
| #ifndef SHUT_RDWR |
| 79 |
|
| #ifdef O_RDWR |
| 80 |
|
| #define SHUT_RDWR O_RDWR |
| 81 |
|
| #else |
| 82 |
|
| #define SHUT_RDWR 2 |
| 83 |
|
| #endif |
| 84 |
|
| #endif |
| 85 |
|
| |
| 86 |
|
| #if !defined(PATCHLEVEL) |
| 87 |
|
| #include <patchlevel.h> |
| 88 |
|
| #endif |
| 89 |
|
| #if (PATCHLEVEL < 5) |
| 90 |
|
| #ifndef PL_sv_undef |
| 91 |
|
| #define PL_dowarn dowarn |
| 92 |
|
| #define PL_sv_no sv_no |
| 93 |
|
| #define PL_sv_undef sv_undef |
| 94 |
|
| #endif |
| 95 |
|
| #endif |
| 96 |
|
| |
| 97 |
|
| #ifndef dTHX |
| 98 |
|
| #define dTHX dTHR |
| 99 |
|
| #define pTHX_ |
| 100 |
|
| #define _pTHX |
| 101 |
|
| #define pTHX |
| 102 |
|
| #define aTHX |
| 103 |
|
| #define aTHX_ |
| 104 |
|
| #define _aTHX |
| 105 |
|
| #define NV double |
| 106 |
|
| #endif |
| 107 |
|
| |
| 108 |
|
| #ifndef dTHR |
| 109 |
|
| #define dTHR extern int Perl___notused |
| 110 |
|
| #endif |
| 111 |
|
| |
| 112 |
|
| #ifdef __cplusplus |
| 113 |
|
| } |
| 114 |
|
| #endif |
| 115 |
|
| |
| 116 |
|
| /* Just in case still don't have MIN and we need it for TCP_MSS.... */ |
| 117 |
|
| #ifndef MIN |
| 118 |
|
| #define MIN(_A,_B) (((_A)<(_B))?(_A):(_B)) |
| 119 |
|
| #endif |
| 120 |
|
| |
| 121 |
|
| /* Default EAGAIN and EWOULDBLOCK from each other, punting to 0 if neither |
| 122 |
|
| * is available. |
| 123 |
|
| */ |
| 124 |
|
| #ifndef EAGAIN |
| 125 |
|
| #ifndef EWOULDBLOCK |
| 126 |
|
| #define EWOULDBLOCK 0 |
| 127 |
|
| #endif |
| 128 |
|
| #define EAGAIN EWOULDBLOCK |
| 129 |
|
| #endif |
| 130 |
|
| #ifndef EWOULDBLOCK |
| 131 |
|
| #define EWOULDBLOCK EAGAIN |
| 132 |
|
| #endif |
| 133 |
|
| |
| 134 |
|
| static void |
| 135 |
|
| #ifdef CAN_PROTOTYPE |
| 136 |
|
| #define newmissing(_hv,_nm,_fl) S_newmissing(aTHX_ _hv, _nm, _fl) |
| 137 |
104 |
| S_newmissing(pTHX_ HV *missing, char *name, char *file) |
| 138 |
|
| #else |
| 139 |
|
| newmissing(missing, name, file) |
| 140 |
|
| HV *missing; |
| 141 |
|
| char *name; |
| 142 |
|
| char *file; |
| 143 |
|
| #endif |
| 144 |
|
| { |
| 145 |
|
| STRLEN klen; |
| 146 |
|
| CV *cv; |
| 147 |
104 |
| klen = strlen(name); |
| 148 |
104 |
| (void) hv_fetch(missing, name, klen, TRUE); |
| 149 |
104 |
| cv = newXS(name, NULL, file); /* newSUB with no block */ |
| 150 |
104 |
| sv_setsv((SV*)cv, &PL_sv_no); /* prototype it as "()" */ |
| 151 |
104 |
| } |
| 152 |
|
| |
| 153 |
|
| #ifndef CVf_CONST |
| 154 |
|
| /* |
| 155 |
|
| * cv_constant() exists so that the constant XSUBs will return their |
| 156 |
|
| * proper values even when not inlined. |
| 157 |
|
| */ |
| 158 |
|
| |
| 159 |
|
| static |
| 160 |
|
| XS(cv_constant) |
| 161 |
|
| { |
| 162 |
|
| dXSARGS; |
| 163 |
|
| if (items != 0) { |
| 164 |
|
| ST(0) = sv_newmortal(); |
| 165 |
|
| gv_efullname3(ST(0), CvGV(cv), Nullch); |
| 166 |
|
| croak("Usage: %s()", SvPVX(ST(0))); |
| 167 |
|
| } |
| 168 |
|
| if (CvSTART(cv)) { |
| 169 |
|
| ST(0) = ((SVOP*)CvSTART(cv))->op_sv; |
| 170 |
|
| XSRETURN(1); |
| 171 |
|
| } |
| 172 |
|
| XSRETURN_UNDEF; |
| 173 |
|
| } |
| 174 |
|
| |
| 175 |
|
| /* |
| 176 |
|
| * Create a new 'constant' XSUB, suitable for inlining as a constant. |
| 177 |
|
| * Depends on the behaviour of cv_const_sv(). |
| 178 |
|
| */ |
| 179 |
|
| |
| 180 |
|
| static void |
| 181 |
|
| #ifdef CAN_PROTOTYPE |
| 182 |
|
| #define newXSconst(_nm,_vsv,_fl) S_newXSconst(aTHX_ _nm, _vsv, _fl) |
| 183 |
|
| S_newXSconst(pTHX_ char *name, SV *valsv, char *file) |
| 184 |
|
| #else |
| 185 |
|
| newXSconst(name, valsv, file) |
| 186 |
|
| char * name; |
| 187 |
|
| SV * valsv; |
| 188 |
|
| char * file; |
| 189 |
|
| #endif |
| 190 |
|
| { |
| 191 |
|
| CV *cv; |
| 192 |
|
| OP *svop; |
| 193 |
|
| cv = newXS(name, cv_constant, file); |
| 194 |
|
| sv_setsv((SV*)cv, &PL_sv_no); /* prototype it as () */ |
| 195 |
|
| if (SvTEMP(valsv)) /* Don't let mortality get you down. */ |
| 196 |
|
| SvREFCNT_inc(valsv); /* Give it an afterlife. :-> */ |
| 197 |
|
| svop = newSVOP(OP_CONST, 0, valsv); /* does SvREADONLY_on */ |
| 198 |
|
| svop->op_next = Nullop; /* terminate search in cv_const_sv() */ |
| 199 |
|
| CvSTART(cv) = svop; /* voila! we're a constant! */ |
| 200 |
|
| } |
| 201 |
|
| #else /* !defined CVf_CONST, now defined */ |
| 202 |
|
| #define newXSconst(_nm,_vsv,_fl) Perl_newCONSTSUB(aTHX_ Nullhv, _nm, _vsv) |
| 203 |
|
| #endif /* defined CVf_CONST */ |
| 204 |
|
| |
| 205 |
|
| /* |
| 206 |
|
| * Auxiliary routines to create constant XSUBs of various types. |
| 207 |
|
| */ |
| 208 |
|
| |
| 209 |
|
| static void |
| 210 |
|
| #ifdef CAN_PROTOTYPE |
| 211 |
|
| #define newXSconstPV(_nm,_st,_fl) S_newXSconstPV(aTHX_ _nm, _st, _fl) |
| 212 |
0 |
| S_newXSconstPV(pTHX_ char *name, char *string, char *file) |
| 213 |
|
| #else |
| 214 |
|
| newXSconstPV(name, string, file) |
| 215 |
|
| char *name; |
| 216 |
|
| char *string; |
| 217 |
|
| char *file; |
| 218 |
|
| #endif |
| 219 |
|
| { |
| 220 |
0 |
| SV *valsv = newSVpv(string, strlen(string)); |
| 221 |
0 |
| newXSconst(name, valsv, file); |
| 222 |
0 |
| } |
| 223 |
|
| |
| 224 |
|
| static void |
| 225 |
|
| #ifdef CAN_PROTOTYPE |
| 226 |
|
| #define newXSconstPVN(_nm,_st,_ln,_fl) S_newXSconstPVN(aTHX_ _nm, _st, _ln, _fl) |
| 227 |
8 |
| S_newXSconstPVN(pTHX_ char *name, char *string, STRLEN len, char *file) |
| 228 |
|
| #else |
| 229 |
|
| newXSconstPVN(name, string, len, file) |
| 230 |
|
| char *name; |
| 231 |
|
| char *string; |
| 232 |
|
| STRLEN len; |
| 233 |
|
| char *file; |
| 234 |
|
| #endif |
| 235 |
|
| { |
| 236 |
8 |
| SV *valsv = newSVpv(string, len); |
| 237 |
8 |
| newXSconst(name, valsv, file); |
| 238 |
8 |
| } |
| 239 |
|
| |
| 240 |
|
| static void |
| 241 |
|
| #ifdef CAN_PROTOTYPE |
| 242 |
|
| #define newXSconstIV(_nm,_iv,_fl) S_newXSconstIV(aTHX_ _nm, _iv, _fl) |
| 243 |
10 |
| S_newXSconstIV(pTHX_ char *name, IV ival, char *file) |
| 244 |
|
| #else |
| 245 |
|
| newXSconstIV(name, ival, file) |
| 246 |
|
| char *name; |
| 247 |
|
| IV ival; |
| 248 |
|
| char *file; |
| 249 |
|
| #endif |
| 250 |
|
| { |
| 251 |
10 |
| newXSconst(name, newSViv(ival), file); |
| 252 |
10 |
| } |
| 253 |
|
| |
| 254 |
|
| static void |
| 255 |
|
| #ifdef CAN_PROTOTYPE |
| 256 |
|
| #define newXSconstUV(_nm,_uv,_fl) S_newXSconstUV(aTHX_ _nm, _uv, _fl) |
| 257 |
456 |
| S_newXSconstUV(pTHX_ char *name, UV uval, char *file) |
| 258 |
|
| #else |
| 259 |
|
| newXSconstUV(name, uval, file) |
| 260 |
|
| char * name; |
| 261 |
|
| UV uval; |
| 262 |
|
| char * file; |
| 263 |
|
| #endif |
| 264 |
|
| { |
| 265 |
456 |
| SV * valsv = newSVsv(&PL_sv_undef); /* missing newSVuv()! */ |
| 266 |
456 |
| sv_setuv(valsv, uval); |
| 267 |
456 |
| newXSconst(name, valsv, file); |
| 268 |
456 |
| } |
| 269 |
|
| |
| 270 |
|
| static void |
| 271 |
|
| #ifdef CAN_PROTOTYPE |
| 272 |
|
| #define newXSconstNV(_nm,_nv,_fl) S_newXSconstNV(aTHX_ _nm, _nv, _fl) |
| 273 |
0 |
| S_newXSconstNV(pTHX_ char *name, NV nval, char *file) |
| 274 |
|
| #else |
| 275 |
|
| newXSconstNV(name, nval, file) |
| 276 |
|
| char * name; |
| 277 |
|
| double nval; |
| 278 |
|
| char * file; |
| 279 |
|
| #endif |
| 280 |
|
| { |
| 281 |
0 |
| newXSconst(name, newSVnv(nval), file); |
| 282 |
0 |
| } |
| 283 |
|
| |
| 284 |
|
| |
| 285 |
|
| typedef U32 sv_inaddr_t; |
| 286 |
|
| /* |
| 287 |
|
| * typemap helper for T_INADDR inputs |
| 288 |
|
| */ |
| 289 |
|
| |
| 290 |
|
| static sv_inaddr_t |
| 291 |
|
| #ifdef CAN_PROTOTYPE |
| 292 |
|
| #define sv2inaddr(_sv) S_sv2inaddr(aTHX_ _sv) |
| 293 |
0 |
| S_sv2inaddr(pTHX_ SV *sv) |
| 294 |
|
| #else |
| 295 |
|
| sv2inaddr(sv) |
| 296 |
|
| SV *sv; |
| 297 |
|
| #endif |
| 298 |
|
| { |
| 299 |
|
| struct in_addr ina; |
| 300 |
|
| char *cp; |
| 301 |
|
| STRLEN len; |
| 302 |
0 |
▶ | if (!sv) |
Branch: 1 branch
| Branch | True | False | Total |
| if (!sv) |
0 |
0 |
0 |
|
| 303 |
0 |
| return 0; |
| 304 |
0 |
▶ | if (SvGMAGICAL(sv)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (SvGMAGICAL(sv)) { |
0 |
0 |
0 |
|
| 305 |
0 |
| mg_get(sv); |
| 306 |
0 |
▶ | if (SvIOKp(sv)) |
Branch: 1 branch
| Branch | True | False | Total |
| if (SvIOKp(sv)) |
0 |
0 |
0 |
|
| 307 |
0 |
| return (sv_inaddr_t)SvUVX(sv); |
| 308 |
0 |
▶ | if (SvNOKp(sv)) |
Branch: 1 branch
| Branch | True | False | Total |
| if (SvNOKp(sv)) |
0 |
0 |
0 |
|
| 309 |
0 |
| return (sv_inaddr_t)U_V(SvNVX(sv)); |
| 310 |
0 |
▶ | if (!SvPOKp(sv) || SvCUR(sv) != sizeof ina) |
Branch: 2 branches
| Branch | True | False | Total |
| if (!SvPOKp(sv) || SvCUR(sv) != sizeof ina) |
0 |
0 |
0 |
| if (!SvPOKp(sv) || SvCUR(sv) != sizeof ina) |
0 |
0 |
0 |
|
| 311 |
0 |
| return (sv_inaddr_t)sv_2uv(sv); |
| 312 |
|
| } |
| 313 |
0 |
▶ | else if (SvROK(sv)) |
Branch: 1 branch
| Branch | True | False | Total |
| else if (SvROK(sv)) |
0 |
0 |
0 |
|
| 314 |
0 |
| return (sv_inaddr_t)sv_2uv(sv); |
| 315 |
0 |
▶ | else if (SvNIOK(sv)) { |
Branch: 1 branch
| Branch | True | False | Total |
| else if (SvNIOK(sv)) { |
0 |
0 |
0 |
|
| 316 |
0 |
▶ | if (SvIOK(sv)) |
Branch: 1 branch
| Branch | True | False | Total |
| if (SvIOK(sv)) |
0 |
0 |
0 |
|
| 317 |
0 |
| return (sv_inaddr_t)SvUVX(sv); |
| 318 |
0 |
| return (sv_inaddr_t)U_V(SvNVX(sv)); |
| 319 |
|
| } |
| 320 |
0 |
▶ | else if (!SvPOK(sv) || SvCUR(sv) != sizeof ina) |
Branch: 2 branches
| Branch | True | False | Total |
| else if (!SvPOK(sv) || SvCUR(sv) != sizeof ina) |
0 |
0 |
0 |
| else if (!SvPOK(sv) || SvCUR(sv) != sizeof ina) |
0 |
0 |
0 |
|
| 321 |
0 |
| return (sv_inaddr_t)sv_2uv(sv); |
| 322 |
|
| /* Here for apparent inaddr's, perhaps from unpack_sockaddr_in(). */ |
| 323 |
0 |
| cp = SvPV(sv,len); |
| 324 |
0 |
| Copy(cp, (char*)&ina, len, char); |
| 325 |
0 |
| return (sv_inaddr_t)ntohl(ina.s_addr); |
| 326 |
|
| } |
| 327 |
|
| |
| 328 |
|
| |
| 329 |
|
| /* |
| 330 |
|
| * In the XS sections which follow, the sections with f_?c_ prefixes |
| 331 |
|
| * are generated from the list of exportable constants. |
| 332 |
|
| */ |
| 333 |
|
| |
| 334 |
|
| MODULE = Net::Gen PACKAGE = Net::Gen |
| 335 |
|
| |
| 336 |
|
| PROTOTYPES: ENABLE |
| 337 |
|
| |
| 338 |
|
| BOOT: |
| 339 |
|
| { |
| 340 |
2 |
| HV *missing = perl_get_hv("Net::Gen::_missing", GV_ADDMULTI); |
| 341 |
|
| |
| 342 |
|
| |
| 343 |
|
| MODULE = Net::Gen PACKAGE = Net::TCP PREFIX = f_uc_ |
| 344 |
|
| |
| 345 |
|
| BOOT: |
| 346 |
2 |
| newXSconstUV("Net::TCP::TCPOPT_EOL", TCPOPT_EOL, file); |
| 347 |
2 |
| newXSconstUV("Net::TCP::TCPOPT_MAXSEG", TCPOPT_MAXSEG, file); |
| 348 |
2 |
| newXSconstUV("Net::TCP::TCPOPT_NOP", TCPOPT_NOP, file); |
| 349 |
2 |
| newXSconstUV("Net::TCP::TCPOPT_WINDOW", TCPOPT_WINDOW, file); |
| 350 |
|
| #ifdef TCP_MAXSEG |
| 351 |
2 |
| newXSconstUV("Net::TCP::TCP_MAXSEG", TCP_MAXSEG, file); |
| 352 |
|
| #else |
| 353 |
|
| newmissing(missing, "Net::TCP::TCP_MAXSEG", file); |
| 354 |
|
| #endif |
| 355 |
2 |
| newXSconstUV("Net::TCP::TCP_MAXWIN", TCP_MAXWIN, file); |
| 356 |
2 |
| newXSconstUV("Net::TCP::TCP_MAX_WINSHIFT", TCP_MAX_WINSHIFT, file); |
| 357 |
2 |
| newXSconstUV("Net::TCP::TCP_MSS", TCP_MSS, file); |
| 358 |
|
| #ifdef TCP_NODELAY |
| 359 |
2 |
| newXSconstUV("Net::TCP::TCP_NODELAY", TCP_NODELAY, file); |
| 360 |
|
| #else |
| 361 |
|
| newmissing(missing, "Net::TCP::TCP_NODELAY", file); |
| 362 |
|
| #endif |
| 363 |
|
| #ifdef TCP_RPTR2RXT |
| 364 |
|
| newXSconstUV("Net::TCP::TCP_RPTR2RXT", TCP_RPTR2RXT, file); |
| 365 |
|
| #else |
| 366 |
2 |
| newmissing(missing, "Net::TCP::TCP_RPTR2RXT", file); |
| 367 |
|
| #endif |
| 368 |
2 |
| newXSconstUV("Net::TCP::TH_ACK", TH_ACK, file); |
| 369 |
2 |
| newXSconstUV("Net::TCP::TH_FIN", TH_FIN, file); |
| 370 |
2 |
| newXSconstUV("Net::TCP::TH_PUSH", TH_PUSH, file); |
| 371 |
2 |
| newXSconstUV("Net::TCP::TH_RST", TH_RST, file); |
| 372 |
2 |
| newXSconstUV("Net::TCP::TH_SYN", TH_SYN, file); |
| 373 |
2 |
| newXSconstUV("Net::TCP::TH_URG", TH_URG, file); |
| 374 |
|
| |
| 375 |
|
| |
| 376 |
|
| MODULE = Net::Gen PACKAGE = Net::Inet PREFIX = f_uc_ |
| 377 |
|
| |
| 378 |
|
| BOOT: |
| 379 |
2 |
| newXSconstUV("Net::Inet::DEFTTL", DEFTTL, file); |
| 380 |
2 |
| newXSconstUV("Net::Inet::ICMP_ADVLENMIN", ICMP_ADVLENMIN, file); |
| 381 |
2 |
| newXSconstUV("Net::Inet::ICMP_ECHO", ICMP_ECHO, file); |
| 382 |
2 |
| newXSconstUV("Net::Inet::ICMP_ECHOREPLY", ICMP_ECHOREPLY, file); |
| 383 |
2 |
| newXSconstUV("Net::Inet::ICMP_IREQ", ICMP_IREQ, file); |
| 384 |
2 |
| newXSconstUV("Net::Inet::ICMP_IREQREPLY", ICMP_IREQREPLY, file); |
| 385 |
2 |
| newXSconstUV("Net::Inet::ICMP_MASKLEN", ICMP_MASKLEN, file); |
| 386 |
2 |
| newXSconstUV("Net::Inet::ICMP_MASKREPLY", ICMP_MASKREPLY, file); |
| 387 |
2 |
| newXSconstUV("Net::Inet::ICMP_MASKREQ", ICMP_MASKREQ, file); |
| 388 |
2 |
| newXSconstUV("Net::Inet::ICMP_MAXTYPE", ICMP_MAXTYPE, file); |
| 389 |
2 |
| newXSconstUV("Net::Inet::ICMP_MINLEN", ICMP_MINLEN, file); |
| 390 |
2 |
| newXSconstUV("Net::Inet::ICMP_PARAMPROB", ICMP_PARAMPROB, file); |
| 391 |
2 |
| newXSconstUV("Net::Inet::ICMP_REDIRECT", ICMP_REDIRECT, file); |
| 392 |
2 |
| newXSconstUV("Net::Inet::ICMP_REDIRECT_HOST", ICMP_REDIRECT_HOST, file); |
| 393 |
2 |
| newXSconstUV("Net::Inet::ICMP_REDIRECT_NET", ICMP_REDIRECT_NET, file); |
| 394 |
2 |
| newXSconstUV("Net::Inet::ICMP_REDIRECT_TOSHOST", ICMP_REDIRECT_TOSHOST, file); |
| 395 |
2 |
| newXSconstUV("Net::Inet::ICMP_REDIRECT_TOSNET", ICMP_REDIRECT_TOSNET, file); |
| 396 |
2 |
| newXSconstUV("Net::Inet::ICMP_SOURCEQUENCH", ICMP_SOURCEQUENCH, file); |
| 397 |
2 |
| newXSconstUV("Net::Inet::ICMP_TIMXCEED", ICMP_TIMXCEED, file); |
| 398 |
2 |
| newXSconstUV("Net::Inet::ICMP_TIMXCEED_INTRANS", ICMP_TIMXCEED_INTRANS, file); |
| 399 |
2 |
| newXSconstUV("Net::Inet::ICMP_TIMXCEED_REASS", ICMP_TIMXCEED_REASS, file); |
| 400 |
2 |
| newXSconstUV("Net::Inet::ICMP_TSLEN", ICMP_TSLEN, file); |
| 401 |
2 |
| newXSconstUV("Net::Inet::ICMP_TSTAMP", ICMP_TSTAMP, file); |
| 402 |
2 |
| newXSconstUV("Net::Inet::ICMP_TSTAMPREPLY", ICMP_TSTAMPREPLY, file); |
| 403 |
2 |
| newXSconstUV("Net::Inet::ICMP_UNREACH", ICMP_UNREACH, file); |
| 404 |
2 |
| newXSconstUV("Net::Inet::ICMP_UNREACH_HOST", ICMP_UNREACH_HOST, file); |
| 405 |
2 |
| newXSconstUV("Net::Inet::ICMP_UNREACH_NEEDFRAG", ICMP_UNREACH_NEEDFRAG, file); |
| 406 |
2 |
| newXSconstUV("Net::Inet::ICMP_UNREACH_NET", ICMP_UNREACH_NET, file); |
| 407 |
2 |
| newXSconstUV("Net::Inet::ICMP_UNREACH_PORT", ICMP_UNREACH_PORT, file); |
| 408 |
2 |
| newXSconstUV("Net::Inet::ICMP_UNREACH_PROTOCOL", ICMP_UNREACH_PROTOCOL, file); |
| 409 |
2 |
| newXSconstUV("Net::Inet::ICMP_UNREACH_SRCFAIL", ICMP_UNREACH_SRCFAIL, file); |
| 410 |
2 |
| newXSconstUV("Net::Inet::IN_CLASSA_HOST", IN_CLASSA_HOST, file); |
| 411 |
2 |
| newXSconstUV("Net::Inet::IN_CLASSA_MAX", IN_CLASSA_MAX, file); |
| 412 |
2 |
| newXSconstUV("Net::Inet::IN_CLASSA_NET", IN_CLASSA_NET, file); |
| 413 |
2 |
| newXSconstUV("Net::Inet::IN_CLASSA_NSHIFT", IN_CLASSA_NSHIFT, file); |
| 414 |
|
| #ifdef IN_CLASSA_SUBHOST |
| 415 |
|
| newXSconstUV("Net::Inet::IN_CLASSA_SUBHOST", IN_CLASSA_SUBHOST, file); |
| 416 |
|
| #else |
| 417 |
2 |
| newmissing(missing, "Net::Inet::IN_CLASSA_SUBHOST", file); |
| 418 |
|
| #endif |
| 419 |
|
| #ifdef IN_CLASSA_SUBNET |
| 420 |
|
| newXSconstUV("Net::Inet::IN_CLASSA_SUBNET", IN_CLASSA_SUBNET, file); |
| 421 |
|
| #else |
| 422 |
2 |
| newmissing(missing, "Net::Inet::IN_CLASSA_SUBNET", file); |
| 423 |
|
| #endif |
| 424 |
|
| #ifdef IN_CLASSA_SUBNSHIFT |
| 425 |
|
| newXSconstUV("Net::Inet::IN_CLASSA_SUBNSHIFT", IN_CLASSA_SUBNSHIFT, file); |
| 426 |
|
| #else |
| 427 |
2 |
| newmissing(missing, "Net::Inet::IN_CLASSA_SUBNSHIFT", file); |
| 428 |
|
| #endif |
| 429 |
2 |
| newXSconstUV("Net::Inet::IN_CLASSB_HOST", IN_CLASSB_HOST, file); |
| 430 |
2 |
| newXSconstUV("Net::Inet::IN_CLASSB_MAX", IN_CLASSB_MAX, file); |
| 431 |
2 |
| newXSconstUV("Net::Inet::IN_CLASSB_NET", IN_CLASSB_NET, file); |
| 432 |
2 |
| newXSconstUV("Net::Inet::IN_CLASSB_NSHIFT", IN_CLASSB_NSHIFT, file); |
| 433 |
|
| #ifdef IN_CLASSB_SUBHOST |
| 434 |
|
| newXSconstUV("Net::Inet::IN_CLASSB_SUBHOST", IN_CLASSB_SUBHOST, file); |
| 435 |
|
| #else |
| 436 |
2 |
| newmissing(missing, "Net::Inet::IN_CLASSB_SUBHOST", file); |
| 437 |
|
| #endif |
| 438 |
|
| #ifdef IN_CLASSB_SUBNET |
| 439 |
|
| newXSconstUV("Net::Inet::IN_CLASSB_SUBNET", IN_CLASSB_SUBNET, file); |
| 440 |
|
| #else |
| 441 |
2 |
| newmissing(missing, "Net::Inet::IN_CLASSB_SUBNET", file); |
| 442 |
|
| #endif |
| 443 |
|
| #ifdef IN_CLASSB_SUBNSHIFT |
| 444 |
|
| newXSconstUV("Net::Inet::IN_CLASSB_SUBNSHIFT", IN_CLASSB_SUBNSHIFT, file); |
| 445 |
|
| #else |
| 446 |
2 |
| newmissing(missing, "Net::Inet::IN_CLASSB_SUBNSHIFT", file); |
| 447 |
|
| #endif |
| 448 |
2 |
| newXSconstUV("Net::Inet::IN_CLASSC_HOST", IN_CLASSC_HOST, file); |
| 449 |
2 |
| newXSconstUV("Net::Inet::IN_CLASSC_MAX", IN_CLASSC_MAX, file); |
| 450 |
2 |
| newXSconstUV("Net::Inet::IN_CLASSC_NET", IN_CLASSC_NET, file); |
| 451 |
2 |
| newXSconstUV("Net::Inet::IN_CLASSC_NSHIFT", IN_CLASSC_NSHIFT, file); |
| 452 |
2 |
| newXSconstUV("Net::Inet::IN_CLASSD_HOST", IN_CLASSD_HOST, file); |
| 453 |
2 |
| newXSconstUV("Net::Inet::IN_CLASSD_NET", IN_CLASSD_NET, file); |
| 454 |
2 |
| newXSconstUV("Net::Inet::IN_CLASSD_NSHIFT", IN_CLASSD_NSHIFT, file); |
| 455 |
2 |
| newXSconstUV("Net::Inet::IN_LOOPBACKNET", IN_LOOPBACKNET, file); |
| 456 |
|
| #ifdef IPFRAGTTL |
| 457 |
2 |
| newXSconstUV("Net::Inet::IPFRAGTTL", IPFRAGTTL, file); |
| 458 |
|
| #else |
| 459 |
|
| newmissing(missing, "Net::Inet::IPFRAGTTL", file); |
| 460 |
|
| #endif |
| 461 |
2 |
| newXSconstUV("Net::Inet::IPOPT_CIPSO", IPOPT_CIPSO, file); |
| 462 |
2 |
| newXSconstUV("Net::Inet::IPOPT_CONTROL", IPOPT_CONTROL, file); |
| 463 |
2 |
| newXSconstUV("Net::Inet::IPOPT_DEBMEAS", IPOPT_DEBMEAS, file); |
| 464 |
2 |
| newXSconstUV("Net::Inet::IPOPT_EOL", IPOPT_EOL, file); |
| 465 |
2 |
| newXSconstUV("Net::Inet::IPOPT_LSRR", IPOPT_LSRR, file); |
| 466 |
2 |
| newXSconstUV("Net::Inet::IPOPT_MINOFF", IPOPT_MINOFF, file); |
| 467 |
2 |
| newXSconstUV("Net::Inet::IPOPT_NOP", IPOPT_NOP, file); |
| 468 |
2 |
| newXSconstUV("Net::Inet::IPOPT_OFFSET", IPOPT_OFFSET, file); |
| 469 |
2 |
| newXSconstUV("Net::Inet::IPOPT_OLEN", IPOPT_OLEN, file); |
| 470 |
2 |
| newXSconstUV("Net::Inet::IPOPT_OPTVAL", IPOPT_OPTVAL, file); |
| 471 |
2 |
| newXSconstUV("Net::Inet::IPOPT_RESERVED1", IPOPT_RESERVED1, file); |
| 472 |
2 |
| newXSconstUV("Net::Inet::IPOPT_RESERVED2", IPOPT_RESERVED2, file); |
| 473 |
2 |
| newXSconstUV("Net::Inet::IPOPT_RIPSO_AUX", IPOPT_RIPSO_AUX, file); |
| 474 |
2 |
| newXSconstUV("Net::Inet::IPOPT_RR", IPOPT_RR, file); |
| 475 |
2 |
| newXSconstUV("Net::Inet::IPOPT_SATID", IPOPT_SATID, file); |
| 476 |
2 |
| newXSconstUV("Net::Inet::IPOPT_SECURITY", IPOPT_SECURITY, file); |
| 477 |
2 |
| newXSconstUV("Net::Inet::IPOPT_SECUR_CONFID", IPOPT_SECUR_CONFID, file); |
| 478 |
2 |
| newXSconstUV("Net::Inet::IPOPT_SECUR_EFTO", IPOPT_SECUR_EFTO, file); |
| 479 |
2 |
| newXSconstUV("Net::Inet::IPOPT_SECUR_MMMM", IPOPT_SECUR_MMMM, file); |
| 480 |
2 |
| newXSconstUV("Net::Inet::IPOPT_SECUR_RESTR", IPOPT_SECUR_RESTR, file); |
| 481 |
2 |
| newXSconstUV("Net::Inet::IPOPT_SECUR_SECRET", IPOPT_SECUR_SECRET, file); |
| 482 |
2 |
| newXSconstUV("Net::Inet::IPOPT_SECUR_TOPSECRET", IPOPT_SECUR_TOPSECRET, file); |
| 483 |
2 |
| newXSconstUV("Net::Inet::IPOPT_SECUR_UNCLASS", IPOPT_SECUR_UNCLASS, file); |
| 484 |
2 |
| newXSconstUV("Net::Inet::IPOPT_SSRR", IPOPT_SSRR, file); |
| 485 |
2 |
| newXSconstUV("Net::Inet::IPOPT_TS", IPOPT_TS, file); |
| 486 |
2 |
| newXSconstUV("Net::Inet::IPOPT_TS_PRESPEC", IPOPT_TS_PRESPEC, file); |
| 487 |
2 |
| newXSconstUV("Net::Inet::IPOPT_TS_TSANDADDR", IPOPT_TS_TSANDADDR, file); |
| 488 |
2 |
| newXSconstUV("Net::Inet::IPOPT_TS_TSONLY", IPOPT_TS_TSONLY, file); |
| 489 |
2 |
| newXSconstUV("Net::Inet::IPPORT_RESERVED", IPPORT_RESERVED, file); |
| 490 |
|
| #ifdef IPPORT_TIMESERVER |
| 491 |
|
| newXSconstUV("Net::Inet::IPPORT_TIMESERVER", IPPORT_TIMESERVER, file); |
| 492 |
|
| #else |
| 493 |
2 |
| newmissing(missing, "Net::Inet::IPPORT_TIMESERVER", file); |
| 494 |
|
| #endif |
| 495 |
2 |
| newXSconstUV("Net::Inet::IPPORT_USERRESERVED", IPPORT_USERRESERVED, file); |
| 496 |
2 |
| newXSconstUV("Net::Inet::IPPROTO_EGP", IPPROTO_EGP, file); |
| 497 |
2 |
| newXSconstUV("Net::Inet::IPPROTO_EON", IPPROTO_EON, file); |
| 498 |
2 |
| newXSconstUV("Net::Inet::IPPROTO_GGP", IPPROTO_GGP, file); |
| 499 |
2 |
| newXSconstUV("Net::Inet::IPPROTO_HELLO", IPPROTO_HELLO, file); |
| 500 |
2 |
| newXSconstUV("Net::Inet::IPPROTO_ICMP", IPPROTO_ICMP, file); |
| 501 |
2 |
| newXSconstUV("Net::Inet::IPPROTO_IDP", IPPROTO_IDP, file); |
| 502 |
2 |
| newXSconstUV("Net::Inet::IPPROTO_IGMP", IPPROTO_IGMP, file); |
| 503 |
2 |
| newXSconstUV("Net::Inet::IPPROTO_IP", IPPROTO_IP, file); |
| 504 |
2 |
| newXSconstUV("Net::Inet::IPPROTO_IPIP", IPPROTO_IPIP, file); |
| 505 |
2 |
| newXSconstUV("Net::Inet::IPPROTO_MAX", IPPROTO_MAX, file); |
| 506 |
2 |
| newXSconstUV("Net::Inet::IPPROTO_PUP", IPPROTO_PUP, file); |
| 507 |
2 |
| newXSconstUV("Net::Inet::IPPROTO_RAW", IPPROTO_RAW, file); |
| 508 |
2 |
| newXSconstUV("Net::Inet::IPPROTO_RSVP", IPPROTO_RSVP, file); |
| 509 |
2 |
| newXSconstUV("Net::Inet::IPPROTO_TCP", IPPROTO_TCP, file); |
| 510 |
2 |
| newXSconstUV("Net::Inet::IPPROTO_TP", IPPROTO_TP, file); |
| 511 |
2 |
| newXSconstUV("Net::Inet::IPPROTO_UDP", IPPROTO_UDP, file); |
| 512 |
2 |
| newXSconstUV("Net::Inet::IPTOS_LOWDELAY", IPTOS_LOWDELAY, file); |
| 513 |
2 |
| newXSconstUV("Net::Inet::IPTOS_PREC_CRITIC_ECP", IPTOS_PREC_CRITIC_ECP, file); |
| 514 |
2 |
| newXSconstUV("Net::Inet::IPTOS_PREC_FLASH", IPTOS_PREC_FLASH, file); |
| 515 |
2 |
| newXSconstUV("Net::Inet::IPTOS_PREC_FLASHOVERRIDE", IPTOS_PREC_FLASHOVERRIDE, file); |
| 516 |
2 |
| newXSconstUV("Net::Inet::IPTOS_PREC_IMMEDIATE", IPTOS_PREC_IMMEDIATE, file); |
| 517 |
2 |
| newXSconstUV("Net::Inet::IPTOS_PREC_INTERNETCONTROL", IPTOS_PREC_INTERNETCONTROL, file); |
| 518 |
2 |
| newXSconstUV("Net::Inet::IPTOS_PREC_NETCONTROL", IPTOS_PREC_NETCONTROL, file); |
| 519 |
2 |
| newXSconstUV("Net::Inet::IPTOS_PREC_PRIORITY", IPTOS_PREC_PRIORITY, file); |
| 520 |
2 |
| newXSconstUV("Net::Inet::IPTOS_PREC_ROUTINE", IPTOS_PREC_ROUTINE, file); |
| 521 |
2 |
| newXSconstUV("Net::Inet::IPTOS_RELIABILITY", IPTOS_RELIABILITY, file); |
| 522 |
2 |
| newXSconstUV("Net::Inet::IPTOS_THROUGHPUT", IPTOS_THROUGHPUT, file); |
| 523 |
2 |
| newXSconstUV("Net::Inet::IPTTLDEC", IPTTLDEC, file); |
| 524 |
2 |
| newXSconstUV("Net::Inet::IPVERSION", IPVERSION, file); |
| 525 |
|
| #ifdef IP_ADD_MEMBERSHIP |
| 526 |
2 |
| newXSconstUV("Net::Inet::IP_ADD_MEMBERSHIP", IP_ADD_MEMBERSHIP, file); |
| 527 |
|
| #else |
| 528 |
|
| newmissing(missing, "Net::Inet::IP_ADD_MEMBERSHIP", file); |
| 529 |
|
| #endif |
| 530 |
|
| #ifdef IP_DEFAULT_MULTICAST_LOOP |
| 531 |
2 |
| newXSconstUV("Net::Inet::IP_DEFAULT_MULTICAST_LOOP", IP_DEFAULT_MULTICAST_LOOP, file); |
| 532 |
|
| #else |
| 533 |
|
| newmissing(missing, "Net::Inet::IP_DEFAULT_MULTICAST_LOOP", file); |
| 534 |
|
| #endif |
| 535 |
|
| #ifdef IP_DEFAULT_MULTICAST_TTL |
| 536 |
2 |
| newXSconstUV("Net::Inet::IP_DEFAULT_MULTICAST_TTL", IP_DEFAULT_MULTICAST_TTL, file); |
| 537 |
|
| #else |
| 538 |
|
| newmissing(missing, "Net::Inet::IP_DEFAULT_MULTICAST_TTL", file); |
| 539 |
|
| #endif |
| 540 |
2 |
| newXSconstUV("Net::Inet::IP_DF", IP_DF, file); |
| 541 |
|
| #ifdef IP_DROP_MEMBERSHIP |
| 542 |
2 |
| newXSconstUV("Net::Inet::IP_DROP_MEMBERSHIP", IP_DROP_MEMBERSHIP, file); |
| 543 |
|
| #else |
| 544 |
|
| newmissing(missing, "Net::Inet::IP_DROP_MEMBERSHIP", file); |
| 545 |
|
| #endif |
| 546 |
|
| #ifdef IP_HDRINCL |
| 547 |
2 |
| newXSconstUV("Net::Inet::IP_HDRINCL", IP_HDRINCL, file); |
| 548 |
|
| #else |
| 549 |
|
| newmissing(missing, "Net::Inet::IP_HDRINCL", file); |
| 550 |
|
| #endif |
| 551 |
2 |
| newXSconstUV("Net::Inet::IP_MAXPACKET", IP_MAXPACKET, file); |
| 552 |
|
| #ifdef IP_MAX_MEMBERSHIPS |
| 553 |
2 |
| newXSconstUV("Net::Inet::IP_MAX_MEMBERSHIPS", IP_MAX_MEMBERSHIPS, file); |
| 554 |
|
| #else |
| 555 |
|
| newmissing(missing, "Net::Inet::IP_MAX_MEMBERSHIPS", file); |
| 556 |
|
| #endif |
| 557 |
2 |
| newXSconstUV("Net::Inet::IP_MF", IP_MF, file); |
| 558 |
2 |
| newXSconstUV("Net::Inet::IP_MSS", IP_MSS, file); |
| 559 |
|
| #ifdef IP_MULTICAST_IF |
| 560 |
2 |
| newXSconstUV("Net::Inet::IP_MULTICAST_IF", IP_MULTICAST_IF, file); |
| 561 |
|
| #else |
| 562 |
|
| newmissing(missing, "Net::Inet::IP_MULTICAST_IF", file); |
| 563 |
|
| #endif |
| 564 |
|
| #ifdef IP_MULTICAST_LOOP |
| 565 |
2 |
| newXSconstUV("Net::Inet::IP_MULTICAST_LOOP", IP_MULTICAST_LOOP, file); |
| 566 |
|
| #else |
| 567 |
|
| newmissing(missing, "Net::Inet::IP_MULTICAST_LOOP", file); |
| 568 |
|
| #endif |
| 569 |
|
| #ifdef IP_MULTICAST_TTL |
| 570 |
2 |
| newXSconstUV("Net::Inet::IP_MULTICAST_TTL", IP_MULTICAST_TTL, file); |
| 571 |
|
| #else |
| 572 |
|
| newmissing(missing, "Net::Inet::IP_MULTICAST_TTL", file); |
| 573 |
|
| #endif |
| 574 |
|
| #ifdef IP_OPTIONS |
| 575 |
2 |
| newXSconstUV("Net::Inet::IP_OPTIONS", IP_OPTIONS, file); |
| 576 |
|
| #else |
| 577 |
|
| newmissing(missing, "Net::Inet::IP_OPTIONS", file); |
| 578 |
|
| #endif |
| 579 |
|
| #ifdef IP_RECVDSTADDR |
| 580 |
|
| newXSconstUV("Net::Inet::IP_RECVDSTADDR", IP_RECVDSTADDR, file); |
| 581 |
|
| #else |
| 582 |
2 |
| newmissing(missing, "Net::Inet::IP_RECVDSTADDR", file); |
| 583 |
|
| #endif |
| 584 |
|
| #ifdef IP_RECVOPTS |
| 585 |
2 |
| newXSconstUV("Net::Inet::IP_RECVOPTS", IP_RECVOPTS, file); |
| 586 |
|
| #else |
| 587 |
|
| newmissing(missing, "Net::Inet::IP_RECVOPTS", file); |
| 588 |
|
| #endif |
| 589 |
|
| #ifdef IP_RECVRETOPTS |
| 590 |
2 |
| newXSconstUV("Net::Inet::IP_RECVRETOPTS", IP_RECVRETOPTS, file); |
| 591 |
|
| #else |
| 592 |
|
| newmissing(missing, "Net::Inet::IP_RECVRETOPTS", file); |
| 593 |
|
| #endif |
| 594 |
|
| #ifdef IP_RETOPTS |
| 595 |
2 |
| newXSconstUV("Net::Inet::IP_RETOPTS", IP_RETOPTS, file); |
| 596 |
|
| #else |
| 597 |
|
| newmissing(missing, "Net::Inet::IP_RETOPTS", file); |
| 598 |
|
| #endif |
| 599 |
|
| #ifdef IP_TOS |
| 600 |
2 |
| newXSconstUV("Net::Inet::IP_TOS", IP_TOS, file); |
| 601 |
|
| #else |
| 602 |
|
| newmissing(missing, "Net::Inet::IP_TOS", file); |
| 603 |
|
| #endif |
| 604 |
|
| #ifdef IP_TTL |
| 605 |
2 |
| newXSconstUV("Net::Inet::IP_TTL", IP_TTL, file); |
| 606 |
|
| #else |
| 607 |
|
| newmissing(missing, "Net::Inet::IP_TTL", file); |
| 608 |
|
| #endif |
| 609 |
2 |
| newXSconstUV("Net::Inet::MAXTTL", MAXTTL, file); |
| 610 |
2 |
| newXSconstUV("Net::Inet::MAX_IPOPTLEN", MAX_IPOPTLEN, file); |
| 611 |
2 |
| newXSconstUV("Net::Inet::MINTTL", MINTTL, file); |
| 612 |
|
| #ifdef SUBNETSHIFT |
| 613 |
|
| newXSconstUV("Net::Inet::SUBNETSHIFT", SUBNETSHIFT, file); |
| 614 |
|
| #else |
| 615 |
2 |
| newmissing(missing, "Net::Inet::SUBNETSHIFT", file); |
| 616 |
|
| #endif |
| 617 |
|
| { |
| 618 |
|
| struct in_addr ina; |
| 619 |
2 |
| ina.s_addr = htonl(INADDR_ALLHOSTS_GROUP); |
| 620 |
2 |
| newXSconstPVN("Net::Inet::INADDR_ALLHOSTS_GROUP", |
| 621 |
|
| (char*)&ina, sizeof ina, file); |
| 622 |
2 |
| ina.s_addr = htonl(INADDR_ALLRTRS_GROUP); |
| 623 |
2 |
| newXSconstPVN("Net::Inet::INADDR_ALLRTRS_GROUP", |
| 624 |
|
| (char*)&ina, sizeof ina, file); |
| 625 |
2 |
| ina.s_addr = htonl(INADDR_MAX_LOCAL_GROUP); |
| 626 |
2 |
| newXSconstPVN("Net::Inet::INADDR_MAX_LOCAL_GROUP", |
| 627 |
|
| (char*)&ina, sizeof ina, file); |
| 628 |
2 |
| ina.s_addr = htonl(INADDR_UNSPEC_GROUP); |
| 629 |
2 |
| newXSconstPVN("Net::Inet::INADDR_UNSPEC_GROUP", |
| 630 |
|
| (char*)&ina, sizeof ina, file); |
| 631 |
|
| } |
| 632 |
|
| |
| 633 |
|
| |
| 634 |
|
| MODULE = Net::Gen PACKAGE = Net::Inet |
| 635 |
|
| |
| 636 |
|
| bool |
| 637 |
|
| IN_CLASSA(hostaddr) |
| 638 |
|
| sv_inaddr_t hostaddr |
| 639 |
|
| |
| 640 |
|
| bool |
| 641 |
|
| IN_CLASSB(hostaddr) |
| 642 |
|
| sv_inaddr_t hostaddr |
| 643 |
|
| |
| 644 |
|
| bool |
| 645 |
|
| IN_CLASSC(hostaddr) |
| 646 |
|
| sv_inaddr_t hostaddr |
| 647 |
|
| |
| 648 |
|
| bool |
| 649 |
|
| IN_CLASSD(hostaddr) |
| 650 |
|
| sv_inaddr_t hostaddr |
| 651 |
|
| |
| 652 |
|
| bool |
| 653 |
|
| IN_MULTICAST(hostaddr) |
| 654 |
|
| sv_inaddr_t hostaddr |
| 655 |
|
| |
| 656 |
|
| bool |
| 657 |
|
| IN_EXPERIMENTAL(hostaddr) |
| 658 |
|
| sv_inaddr_t hostaddr |
| 659 |
|
| |
| 660 |
|
| bool |
| 661 |
|
| IN_BADCLASS(hostaddr) |
| 662 |
|
| sv_inaddr_t hostaddr |
| 663 |
|
| |
| 664 |
|
| bool |
| 665 |
|
| IPOPT_COPIED(ipopt) |
| 666 |
|
| U8 ipopt |
| 667 |
|
| |
| 668 |
|
| U8 |
| 669 |
|
| IPOPT_CLASS(ipopt) |
| 670 |
|
| U8 ipopt |
| 671 |
|
| |
| 672 |
|
| U8 |
| 673 |
|
| IPOPT_NUMBER(ipopt) |
| 674 |
|
| U8 ipopt |
| 675 |
|
| |
| 676 |
|
| bool |
| 677 |
|
| ICMP_INFOTYPE(icmp_code) |
| 678 |
|
| U8 icmp_code |
| 679 |
|
| |
| 680 |
|
| void |
| 681 |
|
| _pack_sockaddr_in(family,port,address) |
| 682 |
|
| U8 family |
| 683 |
|
| U16 port |
| 684 |
|
| SV * address |
| 685 |
|
| PREINIT: |
| 686 |
|
| struct sockaddr_in sin; |
| 687 |
|
| char * adata; |
| 688 |
|
| STRLEN adlen; |
| 689 |
|
| PPCODE: |
| 690 |
0 |
| Zero(&sin, sizeof sin, char); |
| 691 |
0 |
| sin.sin_family = family; |
| 692 |
0 |
| adata = SvPV(address, adlen); |
| 693 |
0 |
| sin.sin_port = htons(port); |
| 694 |
0 |
▶ | if (adlen == sizeof sin.sin_addr) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (adlen == sizeof sin.sin_addr) { |
0 |
0 |
0 |
|
| 695 |
0 |
| Copy(adata, &sin.sin_addr, sizeof sin.sin_addr, char); |
| 696 |
0 |
| ST(0) = sv_2mortal(newSVpv((char*)&sin, sizeof sin)); |
| 697 |
|
| } |
| 698 |
|
| else { |
| 699 |
0 |
| SV *adsv = sv_2mortal(newSVpv((char*)&sin, |
| 700 |
|
| STRUCT_OFFSET(struct sockaddr_in, |
| 701 |
|
| sin_addr))); |
| 702 |
0 |
| sv_catpvn(adsv, adata, adlen); |
| 703 |
0 |
| ST(0) = adsv; |
| 704 |
|
| } |
| 705 |
0 |
| XSRETURN(1); |
| 706 |
|
| |
| 707 |
|
| void |
| 708 |
|
| unpack_sockaddr_in(sad) |
| 709 |
|
| SV * sad |
| 710 |
|
| PREINIT: |
| 711 |
|
| char * cp; |
| 712 |
|
| struct sockaddr_in sin; |
| 713 |
|
| STRLEN len; |
| 714 |
|
| PPCODE: |
| 715 |
0 |
▶ | if ((cp = SvPV(sad, len)) != (char*)0 && len >= sizeof sin) { |
Branch: 2 branches
| Branch | True | False | Total |
| if ((cp = SvPV(sad, len)) != (char*)0 && len >= sizeof sin) { |
0 |
0 |
0 |
| if ((cp = SvPV(sad, len)) != (char*)0 && len >= sizeof sin) { |
0 |
0 |
0 |
|
| 716 |
|
| U16 family; |
| 717 |
|
| U16 port; |
| 718 |
|
| char * adata; |
| 719 |
|
| STRLEN addrlen; |
| 720 |
|
| |
| 721 |
0 |
| Copy(cp, &sin, sizeof sin, char); |
| 722 |
0 |
| family = sin.sin_family; |
| 723 |
0 |
▶ | if (family > 255) { /* 4.4BSD anyone? */ |
Branch: 1 branch
| Branch | True | False | Total |
| if (family > 255) { /* 4.4BSD anyone? */ |
0 |
0 |
0 |
|
| 724 |
|
| U8 famlen1, famlen2; |
| 725 |
0 |
| famlen1 = family & 255; |
| 726 |
0 |
| famlen2 = (family >> 8) & 255; |
| 727 |
0 |
▶ | if (famlen1 == famlen2) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (famlen1 == famlen2) { |
0 |
0 |
0 |
|
| 728 |
0 |
| family = famlen1; |
| 729 |
|
| } |
| 730 |
0 |
▶ | else if (famlen1 == len) { |
Branch: 1 branch
| Branch | True | False | Total |
| else if (famlen1 == len) { |
0 |
0 |
0 |
|
| 731 |
0 |
| family = famlen2; |
| 732 |
|
| } |
| 733 |
0 |
▶ | else if (famlen2 == len) { |
Branch: 1 branch
| Branch | True | False | Total |
| else if (famlen2 == len) { |
0 |
0 |
0 |
|
| 734 |
0 |
| family = famlen1; |
| 735 |
|
| } |
| 736 |
0 |
▶ | else if (famlen1 == AF_INET || famlen2 == AF_INET) { |
Branch: 2 branches
| Branch | True | False | Total |
| else if (famlen1 == AF_INET || famlen2 == AF_INET) { |
0 |
0 |
0 |
| else if (famlen1 == AF_INET || famlen2 == AF_INET) { |
0 |
0 |
0 |
|
| 737 |
0 |
| family = AF_INET; |
| 738 |
|
| } |
| 739 |
0 |
▶ | else if (famlen1 < famlen2) { |
Branch: 1 branch
| Branch | True | False | Total |
| else if (famlen1 < famlen2) { |
0 |
0 |
0 |
|
| 740 |
0 |
| family = famlen1; |
| 741 |
|
| } |
| 742 |
|
| else { |
| 743 |
0 |
| family = famlen2; |
| 744 |
|
| } |
| 745 |
|
| } |
| 746 |
0 |
| port = ntohs(sin.sin_port); |
| 747 |
|
| /* now work on the address */ |
| 748 |
0 |
| cp += STRUCT_OFFSET(struct sockaddr_in, sin_addr); |
| 749 |
0 |
| addrlen = len - STRUCT_OFFSET(struct sockaddr_in, sin_addr); |
| 750 |
0 |
▶ | if (family == AF_INET && len == sizeof sin) |
Branch: 2 branches
| Branch | True | False | Total |
| if (family == AF_INET && len == sizeof sin) |
0 |
0 |
0 |
| if (family == AF_INET && len == sizeof sin) |
0 |
0 |
0 |
|
| 751 |
0 |
| addrlen = sizeof sin.sin_addr; |
| 752 |
|
| |
| 753 |
0 |
▶ | EXTEND(sp,3); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(sp,3); |
0 |
0 |
0 |
|
| 754 |
0 |
| PUSHs(sv_2mortal(newSViv((IV)family))); |
| 755 |
0 |
| PUSHs(sv_2mortal(newSViv((IV)port))); |
| 756 |
0 |
| PUSHs(sv_2mortal(newSVpv(cp, addrlen))); |
| 757 |
|
| } |
| 758 |
|
| |
| 759 |
|
| |
| 760 |
|
| MODULE = Net::Gen PACKAGE = Net::Gen PREFIX = f_ic_ |
| 761 |
|
| |
| 762 |
|
| BOOT: |
| 763 |
|
| #ifdef EOF_NONBLOCK |
| 764 |
|
| #define f_ic_EOF_NONBLOCK 1 |
| 765 |
|
| #else |
| 766 |
|
| #define f_ic_EOF_NONBLOCK 0 |
| 767 |
|
| #endif |
| 768 |
2 |
| newXSconstIV("Net::Gen::EOF_NONBLOCK", f_ic_EOF_NONBLOCK, file); |
| 769 |
|
| #ifdef RD_NODATA |
| 770 |
2 |
| newXSconstIV("Net::Gen::RD_NODATA", RD_NODATA, file); |
| 771 |
|
| #else |
| 772 |
|
| newmissing(missing, "Net::Gen::RD_NODATA", file); |
| 773 |
|
| #endif |
| 774 |
2 |
| newXSconstIV("Net::Gen::SHUT_RD", SHUT_RD, file); |
| 775 |
2 |
| newXSconstIV("Net::Gen::SHUT_WR", SHUT_WR, file); |
| 776 |
2 |
| newXSconstIV("Net::Gen::SHUT_RDWR", SHUT_RDWR, file); |
| 777 |
|
| |
| 778 |
|
| |
| 779 |
|
| MODULE = Net::Gen PACKAGE = Net::Gen PREFIX = f_uc_ |
| 780 |
|
| |
| 781 |
|
| BOOT: |
| 782 |
|
| #ifdef VAL_O_NONBLOCK |
| 783 |
2 |
| newXSconstUV("Net::Gen::VAL_O_NONBLOCK", VAL_O_NONBLOCK, file); |
| 784 |
|
| #else |
| 785 |
|
| newmissing(missing, "Net::Gen::VAL_O_NONBLOCK", file); |
| 786 |
|
| #endif |
| 787 |
|
| #ifdef VAL_EAGAIN |
| 788 |
2 |
| newXSconstUV("Net::Gen::VAL_EAGAIN", VAL_EAGAIN, file); |
| 789 |
|
| #else |
| 790 |
|
| newmissing(missing, "Net::Gen::VAL_EAGAIN", file); |
| 791 |
|
| #endif |
| 792 |
2 |
| newXSconstUV("Net::Gen::MSG_OOB", MSG_OOB, file); |
| 793 |
|
| #ifdef SO_ACCEPTCONN |
| 794 |
2 |
| newXSconstUV("Net::Gen::SO_ACCEPTCONN", SO_ACCEPTCONN, file); |
| 795 |
|
| #else |
| 796 |
|
| newmissing(missing, "Net::Gen::SO_ACCEPTCONN", file); |
| 797 |
|
| #endif |
| 798 |
|
| #ifdef SO_BROADCAST |
| 799 |
2 |
| newXSconstUV("Net::Gen::SO_BROADCAST", SO_BROADCAST, file); |
| 800 |
|
| #else |
| 801 |
|
| newmissing(missing, "Net::Gen::SO_BROADCAST", file); |
| 802 |
|
| #endif |
| 803 |
|
| #ifdef SO_DEBUG |
| 804 |
2 |
| newXSconstUV("Net::Gen::SO_DEBUG", SO_DEBUG, file); |
| 805 |
|
| #else |
| 806 |
|
| newmissing(missing, "Net::Gen::SO_DEBUG", file); |
| 807 |
|
| #endif |
| 808 |
|
| #ifdef SO_DONTROUTE |
| 809 |
2 |
| newXSconstUV("Net::Gen::SO_DONTROUTE", SO_DONTROUTE, file); |
| 810 |
|
| #else |
| 811 |
|
| newmissing(missing, "Net::Gen::SO_DONTROUTE", file); |
| 812 |
|
| #endif |
| 813 |
|
| #ifdef SO_ERROR |
| 814 |
2 |
| newXSconstUV("Net::Gen::SO_ERROR", SO_ERROR, file); |
| 815 |
|
| #else |
| 816 |
|
| newmissing(missing, "Net::Gen::SO_ERROR", file); |
| 817 |
|
| #endif |
| 818 |
|
| #ifdef SO_EXPANDED_RIGHTS |
| 819 |
|
| newXSconstUV("Net::Gen::SO_EXPANDED_RIGHTS", SO_EXPANDED_RIGHTS, file); |
| 820 |
|
| #else |
| 821 |
2 |
| newmissing(missing, "Net::Gen::SO_EXPANDED_RIGHTS", file); |
| 822 |
|
| #endif |
| 823 |
|
| #ifdef SO_KEEPALIVE |
| 824 |
2 |
| newXSconstUV("Net::Gen::SO_KEEPALIVE", SO_KEEPALIVE, file); |
| 825 |
|
| #else |
| 826 |
|
| newmissing(missing, "Net::Gen::SO_KEEPALIVE", file); |
| 827 |
|
| #endif |
| 828 |
|
| #ifdef SO_OOBINLINE |
| 829 |
2 |
| newXSconstUV("Net::Gen::SO_OOBINLINE", SO_OOBINLINE, file); |
| 830 |
|
| #else |
| 831 |
|
| newmissing(missing, "Net::Gen::SO_OOBINLINE", file); |
| 832 |
|
| #endif |
| 833 |
|
| #ifdef SO_PAIRABLE |
| 834 |
|
| newXSconstUV("Net::Gen::SO_PAIRABLE", SO_PAIRABLE, file); |
| 835 |
|
| #else |
| 836 |
2 |
| newmissing(missing, "Net::Gen::SO_PAIRABLE", file); |
| 837 |
|
| #endif |
| 838 |
|
| #ifdef SO_REUSEADDR |
| 839 |
2 |
| newXSconstUV("Net::Gen::SO_REUSEADDR", SO_REUSEADDR, file); |
| 840 |
|
| #else |
| 841 |
|
| newmissing(missing, "Net::Gen::SO_REUSEADDR", file); |
| 842 |
|
| #endif |
| 843 |
|
| #ifdef SO_REUSEPORT |
| 844 |
2 |
| newXSconstUV("Net::Gen::SO_REUSEPORT", SO_REUSEPORT, file); |
| 845 |
|
| #else |
| 846 |
|
| newmissing(missing, "Net::Gen::SO_REUSEPORT", file); |
| 847 |
|
| #endif |
| 848 |
|
| #ifdef SO_USELOOPBACK |
| 849 |
|
| newXSconstUV("Net::Gen::SO_USELOOPBACK", SO_USELOOPBACK, file); |
| 850 |
|
| #else |
| 851 |
2 |
| newmissing(missing, "Net::Gen::SO_USELOOPBACK", file); |
| 852 |
|
| #endif |
| 853 |
|
| #ifdef SO_XSE |
| 854 |
|
| newXSconstUV("Net::Gen::SO_XSE", SO_XSE, file); |
| 855 |
|
| #else |
| 856 |
2 |
| newmissing(missing, "Net::Gen::SO_XSE", file); |
| 857 |
|
| #endif |
| 858 |
|
| #ifdef SO_RCVBUF |
| 859 |
2 |
| newXSconstUV("Net::Gen::SO_RCVBUF", SO_RCVBUF, file); |
| 860 |
|
| #else |
| 861 |
|
| newmissing(missing, "Net::Gen::SO_RCVBUF", file); |
| 862 |
|
| #endif |
| 863 |
|
| #ifdef SO_SNDBUF |
| 864 |
2 |
| newXSconstUV("Net::Gen::SO_SNDBUF", SO_SNDBUF, file); |
| 865 |
|
| #else |
| 866 |
|
| newmissing(missing, "Net::Gen::SO_SNDBUF", file); |
| 867 |
|
| #endif |
| 868 |
|
| #ifdef SO_RCVTIMEO |
| 869 |
2 |
| newXSconstUV("Net::Gen::SO_RCVTIMEO", SO_RCVTIMEO, file); |
| 870 |
|
| #else |
| 871 |
|
| newmissing(missing, "Net::Gen::SO_RCVTIMEO", file); |
| 872 |
|
| #endif |
| 873 |
|
| #ifdef SO_SNDTIMEO |
| 874 |
2 |
| newXSconstUV("Net::Gen::SO_SNDTIMEO", SO_SNDTIMEO, file); |
| 875 |
|
| #else |
| 876 |
|
| newmissing(missing, "Net::Gen::SO_SNDTIMEO", file); |
| 877 |
|
| #endif |
| 878 |
|
| #ifdef SO_RCVLOWAT |
| 879 |
2 |
| newXSconstUV("Net::Gen::SO_RCVLOWAT", SO_RCVLOWAT, file); |
| 880 |
|
| #else |
| 881 |
|
| newmissing(missing, "Net::Gen::SO_RCVLOWAT", file); |
| 882 |
|
| #endif |
| 883 |
|
| #ifdef SO_SNDLOWAT |
| 884 |
2 |
| newXSconstUV("Net::Gen::SO_SNDLOWAT", SO_SNDLOWAT, file); |
| 885 |
|
| #else |
| 886 |
|
| newmissing(missing, "Net::Gen::SO_SNDLOWAT", file); |
| 887 |
|
| #endif |
| 888 |
|
| #ifdef SO_TYPE |
| 889 |
2 |
| newXSconstUV("Net::Gen::SO_TYPE", SO_TYPE, file); |
| 890 |
|
| #else |
| 891 |
|
| newmissing(missing, "Net::Gen::SO_TYPE", file); |
| 892 |
|
| #endif |
| 893 |
|
| #ifdef SO_STATE |
| 894 |
|
| newXSconstUV("Net::Gen::SO_STATE", SO_STATE, file); |
| 895 |
|
| #else |
| 896 |
2 |
| newmissing(missing, "Net::Gen::SO_STATE", file); |
| 897 |
|
| #endif |
| 898 |
|
| #ifdef SO_FAMILY |
| 899 |
|
| newXSconstUV("Net::Gen::SO_FAMILY", SO_FAMILY, file); |
| 900 |
|
| #else |
| 901 |
2 |
| newmissing(missing, "Net::Gen::SO_FAMILY", file); |
| 902 |
|
| #endif |
| 903 |
|
| #ifdef SO_LINGER |
| 904 |
2 |
| newXSconstUV("Net::Gen::SO_LINGER", SO_LINGER, file); |
| 905 |
|
| #else |
| 906 |
|
| newmissing(missing, "Net::Gen::SO_LINGER", file); |
| 907 |
|
| #endif |
| 908 |
|
| #ifdef SOL_SOCKET |
| 909 |
2 |
| newXSconstUV("Net::Gen::SOL_SOCKET", SOL_SOCKET, file); |
| 910 |
|
| #else |
| 911 |
|
| newmissing(missing, "Net::Gen::SOL_SOCKET", file); |
| 912 |
|
| #endif |
| 913 |
|
| #ifdef SOCK_STREAM |
| 914 |
2 |
| newXSconstUV("Net::Gen::SOCK_STREAM", SOCK_STREAM, file); |
| 915 |
|
| #else |
| 916 |
|
| newmissing(missing, "Net::Gen::SOCK_STREAM", file); |
| 917 |
|
| #endif |
| 918 |
|
| #ifdef SOCK_DGRAM |
| 919 |
2 |
| newXSconstUV("Net::Gen::SOCK_DGRAM", SOCK_DGRAM, file); |
| 920 |
|
| #else |
| 921 |
|
| newmissing(missing, "Net::Gen::SOCK_DGRAM", file); |
| 922 |
|
| #endif |
| 923 |
|
| #ifdef SOCK_RAW |
| 924 |
2 |
| newXSconstUV("Net::Gen::SOCK_RAW", SOCK_RAW, file); |
| 925 |
|
| #else |
| 926 |
|
| newmissing(missing, "Net::Gen::SOCK_RAW", file); |
| 927 |
|
| #endif |
| 928 |
|
| #ifdef SOCK_RDM |
| 929 |
2 |
| newXSconstUV("Net::Gen::SOCK_RDM", SOCK_RDM, file); |
| 930 |
|
| #else |
| 931 |
|
| newmissing(missing, "Net::Gen::SOCK_RDM", file); |
| 932 |
|
| #endif |
| 933 |
|
| #ifdef SOCK_SEQPACKET |
| 934 |
2 |
| newXSconstUV("Net::Gen::SOCK_SEQPACKET", SOCK_SEQPACKET, file); |
| 935 |
|
| #else |
| 936 |
|
| newmissing(missing, "Net::Gen::SOCK_SEQPACKET", file); |
| 937 |
|
| #endif |
| 938 |
|
| #ifndef AF_UNSPEC |
| 939 |
|
| #define AF_UNSPEC 0 |
| 940 |
|
| #endif |
| 941 |
2 |
| newXSconstUV("Net::Gen::AF_UNSPEC", AF_UNSPEC, file); |
| 942 |
|
| #ifndef PF_UNSPEC |
| 943 |
|
| #define PF_UNSPEC 0 |
| 944 |
|
| #endif |
| 945 |
2 |
| newXSconstUV("Net::Gen::PF_UNSPEC", PF_UNSPEC, file); |
| 946 |
|
| #ifdef AF_INET |
| 947 |
2 |
| newXSconstUV("Net::Gen::AF_INET", AF_INET, file); |
| 948 |
|
| #else |
| 949 |
|
| newmissing(missing, "Net::Gen::AF_INET", file); |
| 950 |
|
| #endif |
| 951 |
|
| #ifdef PF_INET |
| 952 |
2 |
| newXSconstUV("Net::Gen::PF_INET", PF_INET, file); |
| 953 |
|
| #else |
| 954 |
|
| newmissing(missing, "Net::Gen::PF_INET", file); |
| 955 |
|
| #endif |
| 956 |
|
| #ifndef AF_UNIX |
| 957 |
|
| #ifdef AF_LOCAL |
| 958 |
|
| #define AF_UNIX AF_LOCAL |
| 959 |
|
| #endif |
| 960 |
|
| #endif |
| 961 |
|
| #ifndef PF_UNIX |
| 962 |
|
| #ifdef PF_LOCAL |
| 963 |
|
| #define PF_UNIX PF_LOCAL |
| 964 |
|
| #endif |
| 965 |
|
| #endif |
| 966 |
|
| #ifndef AF_LOCAL |
| 967 |
|
| #ifdef AF_UNIX |
| 968 |
|
| #define AF_LOCAL AF_UNIX |
| 969 |
|
| #endif |
| 970 |
|
| #endif |
| 971 |
|
| #ifndef PF_LOCAL |
| 972 |
|
| #ifdef PF_UNIX |
| 973 |
|
| #define PF_LOCAL PF_UNIX |
| 974 |
|
| #endif |
| 975 |
|
| #endif |
| 976 |
|
| #ifdef AF_UNIX |
| 977 |
2 |
| newXSconstUV("Net::Gen::AF_UNIX", AF_UNIX, file); |
| 978 |
|
| #else |
| 979 |
|
| newmissing(missing, "Net::Gen::AF_UNIX", file); |
| 980 |
|
| #endif |
| 981 |
|
| #ifdef PF_UNIX |
| 982 |
2 |
| newXSconstUV("Net::Gen::PF_UNIX", PF_UNIX, file); |
| 983 |
|
| #else |
| 984 |
|
| newmissing(missing, "Net::Gen::PF_UNIX", file); |
| 985 |
|
| #endif |
| 986 |
|
| #ifdef AF_LOCAL |
| 987 |
2 |
| newXSconstUV("Net::Gen::AF_LOCAL", AF_LOCAL, file); |
| 988 |
|
| #else |
| 989 |
|
| newmissing(missing, "Net::Gen::AF_LOCAL", file); |
| 990 |
|
| #endif |
| 991 |
|
| #ifdef PF_LOCAL |
| 992 |
2 |
| newXSconstUV("Net::Gen::PF_LOCAL", PF_LOCAL, file); |
| 993 |
|
| #else |
| 994 |
|
| newmissing(missing, "Net::Gen::PF_LOCAL", file); |
| 995 |
|
| #endif |
| 996 |
|
| #ifdef AF_IMPLINK |
| 997 |
|
| newXSconstUV("Net::Gen::AF_IMPLINK", AF_IMPLINK, file); |
| 998 |
|
| #else |
| 999 |
2 |
| newmissing(missing, "Net::Gen::AF_IMPLINK", file); |
| 1000 |
|
| #endif |
| 1001 |
|
| #ifdef PF_IMPLINK |
| 1002 |
|
| newXSconstUV("Net::Gen::PF_IMPLINK", PF_IMPLINK, file); |
| 1003 |
|
| #else |
| 1004 |
2 |
| newmissing(missing, "Net::Gen::PF_IMPLINK", file); |
| 1005 |
|
| #endif |
| 1006 |
|
| #ifdef AF_PUP |
| 1007 |
|
| newXSconstUV("Net::Gen::AF_PUP", AF_PUP, file); |
| 1008 |
|
| #else |
| 1009 |
2 |
| newmissing(missing, "Net::Gen::AF_PUP", file); |
| 1010 |
|
| #endif |
| 1011 |
|
| #ifdef PF_PUP |
| 1012 |
|
| newXSconstUV("Net::Gen::PF_PUP", PF_PUP, file); |
| 1013 |
|
| #else |
| 1014 |
2 |
| newmissing(missing, "Net::Gen::PF_PUP", file); |
| 1015 |
|
| #endif |
| 1016 |
|
| #ifdef AF_CHAOS |
| 1017 |
|
| newXSconstUV("Net::Gen::AF_CHAOS", AF_CHAOS, file); |
| 1018 |
|
| #else |
| 1019 |
2 |
| newmissing(missing, "Net::Gen::AF_CHAOS", file); |
| 1020 |
|
| #endif |
| 1021 |
|
| #ifdef PF_CHAOS |
| 1022 |
|
| newXSconstUV("Net::Gen::PF_CHAOS", PF_CHAOS, file); |
| 1023 |
|
| #else |
| 1024 |
2 |
| newmissing(missing, "Net::Gen::PF_CHAOS", file); |
| 1025 |
|
| #endif |
| 1026 |
|
| #ifdef AF_NS |
| 1027 |
|
| newXSconstUV("Net::Gen::AF_NS", AF_NS, file); |
| 1028 |
|
| #else |
| 1029 |
2 |
| newmissing(missing, "Net::Gen::AF_NS", file); |
| 1030 |
|
| #endif |
| 1031 |
|
| #ifdef PF_NS |
| 1032 |
|
| newXSconstUV("Net::Gen::PF_NS", PF_NS, file); |
| 1033 |
|
| #else |
| 1034 |
2 |
| newmissing(missing, "Net::Gen::PF_NS", file); |
| 1035 |
|
| #endif |
| 1036 |
|
| #ifdef AF_ISO |
| 1037 |
|
| newXSconstUV("Net::Gen::AF_ISO", AF_ISO, file); |
| 1038 |
|
| #else |
| 1039 |
2 |
| newmissing(missing, "Net::Gen::AF_ISO", file); |
| 1040 |
|
| #endif |
| 1041 |
|
| #ifdef PF_ISO |
| 1042 |
|
| newXSconstUV("Net::Gen::PF_ISO", PF_ISO, file); |
| 1043 |
|
| #else |
| 1044 |
2 |
| newmissing(missing, "Net::Gen::PF_ISO", file); |
| 1045 |
|
| #endif |
| 1046 |
|
| #ifdef AF_OSI |
| 1047 |
|
| newXSconstUV("Net::Gen::AF_OSI", AF_OSI, file); |
| 1048 |
|
| #else |
| 1049 |
2 |
| newmissing(missing, "Net::Gen::AF_OSI", file); |
| 1050 |
|
| #endif |
| 1051 |
|
| #ifdef PF_OSI |
| 1052 |
|
| newXSconstUV("Net::Gen::PF_OSI", PF_OSI, file); |
| 1053 |
|
| #else |
| 1054 |
2 |
| newmissing(missing, "Net::Gen::PF_OSI", file); |
| 1055 |
|
| #endif |
| 1056 |
|
| #ifdef AF_ECMA |
| 1057 |
|
| newXSconstUV("Net::Gen::AF_ECMA", AF_ECMA, file); |
| 1058 |
|
| #else |
| 1059 |
2 |
| newmissing(missing, "Net::Gen::AF_ECMA", file); |
| 1060 |
|
| #endif |
| 1061 |
|
| #ifdef PF_ECMA |
| 1062 |
|
| newXSconstUV("Net::Gen::PF_ECMA", PF_ECMA, file); |
| 1063 |
|
| #else |
| 1064 |
2 |
| newmissing(missing, "Net::Gen::PF_ECMA", file); |
| 1065 |
|
| #endif |
| 1066 |
|
| #ifdef AF_DATAKIT |
| 1067 |
|
| newXSconstUV("Net::Gen::AF_DATAKIT", AF_DATAKIT, file); |
| 1068 |
|
| #else |
| 1069 |
2 |
| newmissing(missing, "Net::Gen::AF_DATAKIT", file); |
| 1070 |
|
| #endif |
| 1071 |
|
| #ifdef PF_DATAKIT |
| 1072 |
|
| newXSconstUV("Net::Gen::PF_DATAKIT", PF_DATAKIT, file); |
| 1073 |
|
| #else |
| 1074 |
2 |
| newmissing(missing, "Net::Gen::PF_DATAKIT", file); |
| 1075 |
|
| #endif |
| 1076 |
|
| #ifdef AF_CCITT |
| 1077 |
|
| newXSconstUV("Net::Gen::AF_CCITT", AF_CCITT, file); |
| 1078 |
|
| #else |
| 1079 |
2 |
| newmissing(missing, "Net::Gen::AF_CCITT", file); |
| 1080 |
|
| #endif |
| 1081 |
|
| #ifdef PF_CCITT |
| 1082 |
|
| newXSconstUV("Net::Gen::PF_CCITT", PF_CCITT, file); |
| 1083 |
|
| #else |
| 1084 |
2 |
| newmissing(missing, "Net::Gen::PF_CCITT", file); |
| 1085 |
|
| #endif |
| 1086 |
|
| #ifdef AF_SNA |
| 1087 |
2 |
| newXSconstUV("Net::Gen::AF_SNA", AF_SNA, file); |
| 1088 |
|
| #else |
| 1089 |
|
| newmissing(missing, "Net::Gen::AF_SNA", file); |
| 1090 |
|
| #endif |
| 1091 |
|
| #ifdef PF_SNA |
| 1092 |
2 |
| newXSconstUV("Net::Gen::PF_SNA", PF_SNA, file); |
| 1093 |
|
| #else |
| 1094 |
|
| newmissing(missing, "Net::Gen::PF_SNA", file); |
| 1095 |
|
| #endif |
| 1096 |
|
| #ifdef AF_DECnet |
| 1097 |
2 |
| newXSconstUV("Net::Gen::AF_DECnet", AF_DECnet, file); |
| 1098 |
|
| #else |
| 1099 |
|
| newmissing(missing, "Net::Gen::AF_DECnet", file); |
| 1100 |
|
| #endif |
| 1101 |
|
| #ifdef PF_DECnet |
| 1102 |
2 |
| newXSconstUV("Net::Gen::PF_DECnet", PF_DECnet, file); |
| 1103 |
|
| #else |
| 1104 |
|
| newmissing(missing, "Net::Gen::PF_DECnet", file); |
| 1105 |
|
| #endif |
| 1106 |
|
| #ifdef AF_DLI |
| 1107 |
|
| newXSconstUV("Net::Gen::AF_DLI", AF_DLI, file); |
| 1108 |
|
| #else |
| 1109 |
2 |
| newmissing(missing, "Net::Gen::AF_DLI", file); |
| 1110 |
|
| #endif |
| 1111 |
|
| #ifdef PF_DLI |
| 1112 |
|
| newXSconstUV("Net::Gen::PF_DLI", PF_DLI, file); |
| 1113 |
|
| #else |
| 1114 |
2 |
| newmissing(missing, "Net::Gen::PF_DLI", file); |
| 1115 |
|
| #endif |
| 1116 |
|
| #ifdef AF_LAT |
| 1117 |
|
| newXSconstUV("Net::Gen::AF_LAT", AF_LAT, file); |
| 1118 |
|
| #else |
| 1119 |
2 |
| newmissing(missing, "Net::Gen::AF_LAT", file); |
| 1120 |
|
| #endif |
| 1121 |
|
| #ifdef PF_LAT |
| 1122 |
|
| newXSconstUV("Net::Gen::PF_LAT", PF_LAT, file); |
| 1123 |
|
| #else |
| 1124 |
2 |
| newmissing(missing, "Net::Gen::PF_LAT", file); |
| 1125 |
|
| #endif |
| 1126 |
|
| #ifdef AF_HYLINK |
| 1127 |
|
| newXSconstUV("Net::Gen::AF_HYLINK", AF_HYLINK, file); |
| 1128 |
|
| #else |
| 1129 |
2 |
| newmissing(missing, "Net::Gen::AF_HYLINK", file); |
| 1130 |
|
| #endif |
| 1131 |
|
| #ifdef PF_HYLINK |
| 1132 |
|
| newXSconstUV("Net::Gen::PF_HYLINK", PF_HYLINK, file); |
| 1133 |
|
| #else |
| 1134 |
2 |
| newmissing(missing, "Net::Gen::PF_HYLINK", file); |
| 1135 |
|
| #endif |
| 1136 |
|
| #ifdef AF_APPLETALK |
| 1137 |
2 |
| newXSconstUV("Net::Gen::AF_APPLETALK", AF_APPLETALK, file); |
| 1138 |
|
| #else |
| 1139 |
|
| newmissing(missing, "Net::Gen::AF_APPLETALK", file); |
| 1140 |
|
| #endif |
| 1141 |
|
| #ifdef PF_APPLETALK |
| 1142 |
2 |
| newXSconstUV("Net::Gen::PF_APPLETALK", PF_APPLETALK, file); |
| 1143 |
|
| #else |
| 1144 |
|
| newmissing(missing, "Net::Gen::PF_APPLETALK", file); |
| 1145 |
|
| #endif |
| 1146 |
|
| #ifdef AF_ROUTE |
| 1147 |
2 |
| newXSconstUV("Net::Gen::AF_ROUTE", AF_ROUTE, file); |
| 1148 |
|
| #else |
| 1149 |
|
| newmissing(missing, "Net::Gen::AF_ROUTE", file); |
| 1150 |
|
| #endif |
| 1151 |
|
| #ifdef PF_ROUTE |
| 1152 |
2 |
| newXSconstUV("Net::Gen::PF_ROUTE", PF_ROUTE, file); |
| 1153 |
|
| #else |
| 1154 |
|
| newmissing(missing, "Net::Gen::PF_ROUTE", file); |
| 1155 |
|
| #endif |
| 1156 |
|
| #ifdef AF_LINK |
| 1157 |
|
| newXSconstUV("Net::Gen::AF_LINK", AF_LINK, file); |
| 1158 |
|
| #else |
| 1159 |
2 |
| newmissing(missing, "Net::Gen::AF_LINK", file); |
| 1160 |
|
| #endif |
| 1161 |
|
| #ifdef PF_LINK |
| 1162 |
|
| newXSconstUV("Net::Gen::PF_LINK", PF_LINK, file); |
| 1163 |
|
| #else |
| 1164 |
2 |
| newmissing(missing, "Net::Gen::PF_LINK", file); |
| 1165 |
|
| #endif |
| 1166 |
|
| #ifdef AF_NETMAN |
| 1167 |
|
| newXSconstUV("Net::Gen::AF_NETMAN", AF_NETMAN, file); |
| 1168 |
|
| #else |
| 1169 |
2 |
| newmissing(missing, "Net::Gen::AF_NETMAN", file); |
| 1170 |
|
| #endif |
| 1171 |
|
| #ifdef PF_NETMAN |
| 1172 |
|
| newXSconstUV("Net::Gen::PF_NETMAN", PF_NETMAN, file); |
| 1173 |
|
| #else |
| 1174 |
2 |
| newmissing(missing, "Net::Gen::PF_NETMAN", file); |
| 1175 |
|
| #endif |
| 1176 |
|
| #ifdef AF_X25 |
| 1177 |
2 |
| newXSconstUV("Net::Gen::AF_X25", AF_X25, file); |
| 1178 |
|
| #else |
| 1179 |
|
| newmissing(missing, "Net::Gen::AF_X25", file); |
| 1180 |
|
| #endif |
| 1181 |
|
| #ifdef PF_X25 |
| 1182 |
2 |
| newXSconstUV("Net::Gen::PF_X25", PF_X25, file); |
| 1183 |
|
| #else |
| 1184 |
|
| newmissing(missing, "Net::Gen::PF_X25", file); |
| 1185 |
|
| #endif |
| 1186 |
|
| #ifdef AF_CTF |
| 1187 |
|
| newXSconstUV("Net::Gen::AF_CTF", AF_CTF, file); |
| 1188 |
|
| #else |
| 1189 |
2 |
| newmissing(missing, "Net::Gen::AF_CTF", file); |
| 1190 |
|
| #endif |
| 1191 |
|
| #ifdef PF_CTF |
| 1192 |
|
| newXSconstUV("Net::Gen::PF_CTF", PF_CTF, file); |
| 1193 |
|
| #else |
| 1194 |
2 |
| newmissing(missing, "Net::Gen::PF_CTF", file); |
| 1195 |
|
| #endif |
| 1196 |
|
| #ifdef AF_WAN |
| 1197 |
|
| newXSconstUV("Net::Gen::AF_WAN", AF_WAN, file); |
| 1198 |
|
| #else |
| 1199 |
2 |
| newmissing(missing, "Net::Gen::AF_WAN", file); |
| 1200 |
|
| #endif |
| 1201 |
|
| #ifdef PF_WAN |
| 1202 |
|
| newXSconstUV("Net::Gen::PF_WAN", PF_WAN, file); |
| 1203 |
|
| #else |
| 1204 |
2 |
| newmissing(missing, "Net::Gen::PF_WAN", file); |
| 1205 |
|
| #endif |
| 1206 |
|
| #ifdef AF_USER |
| 1207 |
|
| newXSconstUV("Net::Gen::AF_USER", AF_USER, file); |
| 1208 |
|
| #else |
| 1209 |
2 |
| newmissing(missing, "Net::Gen::AF_USER", file); |
| 1210 |
|
| #endif |
| 1211 |
|
| #ifdef PF_USER |
| 1212 |
|
| newXSconstUV("Net::Gen::PF_USER", PF_USER, file); |
| 1213 |
|
| #else |
| 1214 |
2 |
| newmissing(missing, "Net::Gen::PF_USER", file); |
| 1215 |
|
| #endif |
| 1216 |
|
| #ifdef AF_LAST |
| 1217 |
|
| newXSconstUV("Net::Gen::AF_LAST", AF_LAST, file); |
| 1218 |
|
| #else |
| 1219 |
2 |
| newmissing(missing, "Net::Gen::AF_LAST", file); |
| 1220 |
|
| #endif |
| 1221 |
|
| #ifdef PF_LAST |
| 1222 |
|
| newXSconstUV("Net::Gen::PF_LAST", PF_LAST, file); |
| 1223 |
|
| #else |
| 1224 |
2 |
| newmissing(missing, "Net::Gen::PF_LAST", file); |
| 1225 |
|
| #endif |
| 1226 |
2 |
| newXSconstUV("Net::Gen::ENOENT", ENOENT, file); |
| 1227 |
2 |
| newXSconstUV("Net::Gen::EINVAL", EINVAL, file); |
| 1228 |
2 |
| newXSconstUV("Net::Gen::EBADF", EBADF, file); |
| 1229 |
2 |
| newXSconstUV("Net::Gen::EAGAIN", EAGAIN, file); |
| 1230 |
2 |
| newXSconstUV("Net::Gen::EWOULDBLOCK", EWOULDBLOCK, file); |
| 1231 |
2 |
| newXSconstUV("Net::Gen::EINPROGRESS", EINPROGRESS, file); |
| 1232 |
2 |
| newXSconstUV("Net::Gen::EALREADY", EALREADY, file); |
| 1233 |
2 |
| newXSconstUV("Net::Gen::ENOTSOCK", ENOTSOCK, file); |
| 1234 |
2 |
| newXSconstUV("Net::Gen::EDESTADDRREQ", EDESTADDRREQ, file); |
| 1235 |
2 |
| newXSconstUV("Net::Gen::EMSGSIZE", EMSGSIZE, file); |
| 1236 |
2 |
| newXSconstUV("Net::Gen::EPROTOTYPE", EPROTOTYPE, file); |
| 1237 |
2 |
| newXSconstUV("Net::Gen::ENOPROTOOPT", ENOPROTOOPT, file); |
| 1238 |
2 |
| newXSconstUV("Net::Gen::EPROTONOSUPPORT", EPROTONOSUPPORT, file); |
| 1239 |
2 |
| newXSconstUV("Net::Gen::ESOCKTNOSUPPORT", ESOCKTNOSUPPORT, file); |
| 1240 |
2 |
| newXSconstUV("Net::Gen::EOPNOTSUPP", EOPNOTSUPP, file); |
| 1241 |
2 |
| newXSconstUV("Net::Gen::EPFNOSUPPORT", EPFNOSUPPORT, file); |
| 1242 |
2 |
| newXSconstUV("Net::Gen::EAFNOSUPPORT", EAFNOSUPPORT, file); |
| 1243 |
2 |
| newXSconstUV("Net::Gen::EADDRINUSE", EADDRINUSE, file); |
| 1244 |
2 |
| newXSconstUV("Net::Gen::EADDRNOTAVAIL", EADDRNOTAVAIL, file); |
| 1245 |
2 |
| newXSconstUV("Net::Gen::ENETDOWN", ENETDOWN, file); |
| 1246 |
2 |
| newXSconstUV("Net::Gen::ENETUNREACH", ENETUNREACH, file); |
| 1247 |
2 |
| newXSconstUV("Net::Gen::ENETRESET", ENETRESET, file); |
| 1248 |
2 |
| newXSconstUV("Net::Gen::ECONNABORTED", ECONNABORTED, file); |
| 1249 |
2 |
| newXSconstUV("Net::Gen::ECONNRESET", ECONNRESET, file); |
| 1250 |
2 |
| newXSconstUV("Net::Gen::ENOBUFS", ENOBUFS, file); |
| 1251 |
2 |
| newXSconstUV("Net::Gen::EISCONN", EISCONN, file); |
| 1252 |
2 |
| newXSconstUV("Net::Gen::ENOTCONN", ENOTCONN, file); |
| 1253 |
2 |
| newXSconstUV("Net::Gen::ESHUTDOWN", ESHUTDOWN, file); |
| 1254 |
2 |
| newXSconstUV("Net::Gen::ETOOMANYREFS", ETOOMANYREFS, file); |
| 1255 |
2 |
| newXSconstUV("Net::Gen::ETIMEDOUT", ETIMEDOUT, file); |
| 1256 |
2 |
| newXSconstUV("Net::Gen::ECONNREFUSED", ECONNREFUSED, file); |
| 1257 |
2 |
| newXSconstUV("Net::Gen::EHOSTDOWN", EHOSTDOWN, file); |
| 1258 |
2 |
| newXSconstUV("Net::Gen::EHOSTUNREACH", EHOSTUNREACH, file); |
| 1259 |
2 |
| newXSconstUV("Net::Gen::ENOSR", ENOSR, file); |
| 1260 |
2 |
| newXSconstUV("Net::Gen::ETIME", ETIME, file); |
| 1261 |
2 |
| newXSconstUV("Net::Gen::EBADMSG", EBADMSG, file); |
| 1262 |
2 |
| newXSconstUV("Net::Gen::EPROTO", EPROTO, file); |
| 1263 |
2 |
| newXSconstUV("Net::Gen::ENODATA", ENODATA, file); |
| 1264 |
2 |
| newXSconstUV("Net::Gen::ENOSTR", ENOSTR, file); |
| 1265 |
2 |
| newXSconstUV("Net::Gen::SOMAXCONN", SOMAXCONN, file); |
| 1266 |
|
| |
| 1267 |
|
| |
| 1268 |
|
| MODULE = Net::Gen PACKAGE = Net::Gen |
| 1269 |
|
| |
| 1270 |
|
| BOOT: |
| 1271 |
|
| } |
| 1272 |
|
| |
| 1273 |
|
| void |
| 1274 |
|
| pack_sockaddr(family,address) |
| 1275 |
|
| U8 family |
| 1276 |
|
| SV * address |
| 1277 |
|
| PREINIT: |
| 1278 |
|
| struct sockaddr sad; |
| 1279 |
|
| char * adata; |
| 1280 |
|
| STRLEN adlen; |
| 1281 |
|
| PPCODE: |
| 1282 |
5 |
| Zero(&sad, sizeof sad, char); |
| 1283 |
5 |
| sad.sa_family = family; |
| 1284 |
5 |
| adata = SvPV(address, adlen); |
| 1285 |
5 |
▶ | if (adlen > sizeof(sad.sa_data)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (adlen > sizeof(sad.sa_data)) { |
5 |
0 |
5 |
|
| 1286 |
5 |
| SV * rval = sv_newmortal(); |
| 1287 |
5 |
| sv_setpvn(rval, (char*)&sad, sizeof sad - sizeof sad.sa_data); |
| 1288 |
5 |
| sv_catpvn(rval, adata, adlen); |
| 1289 |
5 |
| ST(0) = rval; |
| 1290 |
|
| } |
| 1291 |
|
| else { |
| 1292 |
0 |
| Copy(adata, &sad.sa_data, adlen, char); |
| 1293 |
0 |
| ST(0) = sv_2mortal(newSVpv((char*)&sad, sizeof sad)); |
| 1294 |
|
| } |
| 1295 |
5 |
| XSRETURN(1); |
| 1296 |
|
| |
| 1297 |
|
| void |
| 1298 |
|
| unpack_sockaddr(sad) |
| 1299 |
|
| SV * sad |
| 1300 |
|
| PREINIT: |
| 1301 |
|
| char * cp; |
| 1302 |
|
| STRLEN len; |
| 1303 |
|
| PPCODE: |
| 1304 |
0 |
▶ | if ((cp = SvPV(sad, len)) != (char*)0) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ((cp = SvPV(sad, len)) != (char*)0) { |
0 |
0 |
0 |
|
| 1305 |
|
| struct sockaddr sa; |
| 1306 |
|
| U16 family; |
| 1307 |
|
| SV * famsv; |
| 1308 |
|
| SV * datsv; |
| 1309 |
|
| |
| 1310 |
0 |
▶ | if (len < sizeof sa - sizeof sa.sa_data) |
Branch: 1 branch
| Branch | True | False | Total |
| if (len < sizeof sa - sizeof sa.sa_data) |
0 |
0 |
0 |
|
| 1311 |
0 |
| Zero(&sa, sizeof sa - sizeof sa.sa_data, char); |
| 1312 |
0 |
| Copy(cp, &sa, len < sizeof sa ? len : sizeof sa, char); |
| 1313 |
0 |
| family = sa.sa_family; |
| 1314 |
0 |
▶ | if (family > 255) { /* 4.4bsd anyone? */ |
Branch: 1 branch
| Branch | True | False | Total |
| if (family > 255) { /* 4.4bsd anyone? */ |
0 |
0 |
0 |
|
| 1315 |
|
| U8 famlen1, famlen2; |
| 1316 |
0 |
| famlen1 = family & 255; |
| 1317 |
0 |
| famlen2 = family >> 8; |
| 1318 |
0 |
▶ | if (famlen1 == famlen2) |
Branch: 1 branch
| Branch | True | False | Total |
| if (famlen1 == famlen2) |
0 |
0 |
0 |
|
| 1319 |
0 |
| family = famlen1; |
| 1320 |
0 |
▶ | else if (famlen1 == len) |
Branch: 1 branch
| Branch | True | False | Total |
| else if (famlen1 == len) |
0 |
0 |
0 |
|
| 1321 |
0 |
| family = famlen2; |
| 1322 |
0 |
▶ | else if (famlen2 == len) |
Branch: 1 branch
| Branch | True | False | Total |
| else if (famlen2 == len) |
0 |
0 |
0 |
|
| 1323 |
0 |
| family = famlen1; |
| 1324 |
|
| } |
| 1325 |
0 |
| famsv = sv_2mortal(newSViv(family)); |
| 1326 |
0 |
▶ | if (len >= sizeof sa - sizeof sa.sa_data) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (len >= sizeof sa - sizeof sa.sa_data) { |
0 |
0 |
0 |
|
| 1327 |
0 |
| len -= sizeof sa - sizeof sa.sa_data; |
| 1328 |
0 |
| datsv = sv_2mortal(newSVpv(cp + (sizeof sa - sizeof sa.sa_data), |
| 1329 |
|
| len)); |
| 1330 |
|
| } |
| 1331 |
|
| else { |
| 1332 |
0 |
| datsv = sv_mortalcopy(&PL_sv_undef); |
| 1333 |
|
| } |
| 1334 |
0 |
▶ | EXTEND(sp, 2); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(sp, 2); |
0 |
0 |
0 |
|
| 1335 |
0 |
| PUSHs(famsv); |
| 1336 |
0 |
| PUSHs(datsv); |
| 1337 |
|
| } |
| 1338 |
|
| |