home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
sockpli.zip
/
IN.COP
< prev
next >
Wrap
Text File
|
1995-06-27
|
9KB
|
226 lines
%dcl #_IN_32H char ext;
%if #_IN_32H = '' %then
%do;
%dcl #_IN_32H char ext;
%#_IN_32H = 'Y';
/************************************************************/
/* Copyright (c) 1982, 1986 Regents of the University of */
/* California */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms are */
/* permitted provided that this notice is preserved and */
/* that due credit is given to the University of California */
/* at Berkeley. The name of the University may not be used */
/* to endorse or promote products derived from this software*/
/* without specific prior written permission. This software */
/* is provided 'as is' without express or implied warranty. */
/* */
/* @(#)in.h 7.5 (Berkeley) 2/22/88 */
/* */
/************************************************************/
/*----------------------------------------------------------*/
/* Constants and structures defined by the internet system, */
/* Per RFC 790, September 1981. */
/*----------------------------------------------------------*/
/*----------------------------------------------------------*/
/* Protocols */
/*----------------------------------------------------------*/
dcl IPPROTO_IP /* dummy for IP */
fixed bin(31) value(0);
/* ----------------------- */
dcl IPPROTO_ICMP /* control message protocol */
fixed bin(31) value(1);
/* ----------------------- */
dcl IPPROTO_GGP /* gateway^2 (deprecated) */
fixed bin(31) value(3);
/* ----------------------- */
dcl IPPROTO_TCP /* tcp */
fixed bin(31) value(6);
/* ----------------------- */
dcl IPPROTO_EGP /* exterior gateway protocol */
fixed bin(31) value(8);
/* ----------------------- */
dcl IPPROTO_PUP /* pup */
fixed bin(31) value(12);
/* ------------------------ */
dcl IPPROTO_UDP /* user datagram protocol */
fixed bin(31) value(17);
/* ------------------------ */
dcl IPPROTO_IDP /* xns idp */
fixed bin(31) value(22);
/* ------------------------ */
dcl IPPROTO_RAW /* raw IP packet */
fixed bin(31) value(255);
/* ------------------------- */
dcl IPPROTO_MAX
fixed bin(31) value(256);
/* ------------------------- */
/*----------------------------------------------------------*/
/* Ports < IPPORT_RESERVED are reserved for */
/* privileged processes (e.g. root). */
/* Ports > IPPORT_USERRESERVED are reserved */
/* for servers, not necessarily privileged. */
/*----------------------------------------------------------*/
dcl IPPORT_RESERVED fixed bin(31) value(1024);
dcl IPPORT_USERRESERVED fixed bin(31) value(5000);
/*----------------------------------------------------------*/
/* Link numbers */
/*----------------------------------------------------------*/
dcl IMPLINK_IP fixed bin(31) value(155);
dcl IMPLINK_LOWEXPER fixed bin(31) value(156);
dcl IMPLINK_HIGHEXPER fixed bin(31) value(158);
/*----------------------------------------------------------*/
/* Internet address (a structure for historical reasons) */
/*----------------------------------------------------------*/
define structure
1 in_addr,
2 s_addr
fixed bin(31);
/* -------------- */
/*----------------------------------------------------------*/
/* Definitions of bits in internet address integers. On sub-*/
/* nets, the decomposition of addresses to host and net */
/* parts is done according to subnet mask not the masks here*/
/*----------------------------------------------------------*/
%DCL IN_CLASSA ENTRY;
%IN_CLASSA: PROC(I);
DCL I CHAR;
ANS ('(UNSPEC('││I││') & ''80000000''X) = 0');
%END;
dcl IN_CLASSA_NET fixed bin(31) value('ff000000'xn);
dcl IN_CLASSA_NSHIFT fixed bin(31) value(24);
dcl IN_CLASSA_HOST fixed bin(31) value('00ffffff'xn);
dcl IN_CLASSA_MAX fixed bin(31) value(128);
%DCL IN_CLASSB ENTRY;
%IN_CLASSB: PROC(I);
DCL I CHAR;
ANS ('(UNSPEC('││I││') & ''C0000000''X) = ''80000000''X');
%END;
dcl IN_CLASSB_NET fixed bin(31) value('ffff0000'xn);
dcl IN_CLASSB_NSHIFT fixed bin(31) value(16);
dcl IN_CLASSB_HOST fixed bin(31) value('0000ffff'xn);
dcl IN_CLASSB_MAX fixed bin(31) value(65536);
%DCL IN_CLASSC ENTRY;
%IN_CLASSC: PROC(I);
DCL I CHAR;
ANS ('(UNSPEC('││I││') & ''E0000000''X) = ''C0000000''X');
%END;
dcl IN_CLASSC_NET fixed bin(31) value('ffffff00'xn);
dcl IN_CLASSC_NSHIFT fixed bin(31) value(8);
dcl IN_CLASSC_HOST fixed bin(31) value('000000ff'xn);
%DCL IN_CLASSD ENTRY;
%IN_CLASSD: PROC(I);
DCL I CHAR;
ANS ('(UNSPEC('││I││') & ''F0000000''X) = ''E0000000''X');
%END;
%DCL IN_MULTICAST ENTRY;
%IN_MULTICAST: PROC(I);
DCL I CHAR;
ANS (I);
%END;
%DCL IN_EXPERIMENTAL ENTRY;
%IN_EXPERIMENTAL: PROC(I);
DCL I CHAR;
ANS ('(UNSPEC('││I││') & ''E0000000''X) = ''E0000000''X');
%END;
%DCL IN_BADCLASS ENTRY;
%IN_BADCLASS: PROC(I);
DCL I CHAR;
ANS ('(UNSPEC('││I││') & ''F0000000''X) = ''F0000000''X');
%END;
dcl INADDR_ANY fixed bin(31) value(0);
dcl INADDR_BROADCAST fixed bin(31) value(-1);
/* must be masked */
%dcl KERNEL char ext;
%if KERNEL = '' %then
%do;
dcl INADDR_NONE fixed bin(31) value(-1);
/* -1 return */
%end;
dcl IN_LOOPBACKNET fixed bin(31) value(127);
/* official! */
/*----------------------------------------------------------*/
/* Socket address, internet style. */
/*----------------------------------------------------------*/
define structure
1 sockaddr_in,
2 sin_family
fixed bin(15),
/* -------------- */
2 sin_port
unsigned fixed bin(16),
/* ----------------------- */
2 sin_addr
type in_addr,
/* ------------- */
2 sin_zero
char(8);
/* -------- */
/*----------------------------------------------------------*/
/* Options for use with [gs]etsockopt at the IP level. */
/*----------------------------------------------------------*/
dcl IP_OPTIONS fixed bin(31) value(1);
/*----------------------------------------------------------*/
/* set/get IP per-packet options */
/*----------------------------------------------------------*/
dcl inet_addr entry (
pointer )
returns( unsigned fixed bin(31) byvalue )
options(linkage(system) byvalue nodescriptor) external;
dcl inet_makeaddr entry ( unsigned fixed bin(31),
unsigned fixed bin (31) )
returns( fixed bin(31) byvalue )
options(linkage(system) byvalue nodescriptor) external;
dcl inet_network entry (
pointer )
returns( unsigned fixed bin(31) byvalue )
options(linkage(system) byvalue nodescriptor) external;
dcl inet_ntoa entry (
type in_addr )
returns(ptr byvalue)
options(linkage(system) byvalue nodescriptor) external;
dcl inet_lnaof entry (
type in_addr )
returns( unsigned fixed bin(31) byvalue )
options(linkage(system) byvalue nodescriptor) external;
dcl inet_netof entry (
type in_addr )
returns( unsigned fixed bin(31) byvalue )
options(linkage(system) byvalue nodescriptor) external;
%end;