# 2.11BSD#431 - /usr/src/sys/netns/ns.h

##### Variables

    ns_broadhost      X
    ns_broadnet       X
    ns_thishost       X
    ns_zerohost       X
    ns_zeronet        X

##### Macros

    NSPORT_ECHO       X
    NSPORT_RE         X
    NSPORT_RESERVED   X
    NSPORT_RI         X
    NSPROTO_ECHO      X
    NSPROTO_ERROR     X
    NSPROTO_MAX       X
    NSPROTO_PE        X
    NSPROTO_RAW       X
    NSPROTO_RI        X
    NSPROTO_SPP       X
    NS_ALLOWBROADCAST X
    NS_FORWARDING     X
    NS_MAXHOPS        X
    NS_ROUTETOIF      X
    SO_ALL_PACKETS    X
    SO_DEFAULT_HEADERSX
    SO_HEADERS_ON_INPUTX
    SO_HEADERS_ON_OUTPUTX
    SO_LAST_HEADER    X
    SO_MTU            X
    SO_NSIP_ROUTE     X
    SO_SEQNO          X
    ns_hosteq         X
    ns_hosteqnh       X
    ns_neteq          X
    ns_neteqnn        X
    ns_netof          X
    ns_nullhost       X
    satons_addr       X
    sns_port          X

##### struct's

    ns_addr           X
    sockaddr_ns       X

##### unions's

    ns_host           X
    ns_net            X
    ns_net_u          X

       1: /*
       2:  * Copyright (c) 1984, 1985, 1986, 1987 Regents of the University of California.
       3:  * All rights reserved.
       4:  *
       5:  * Redistribution and use in source and binary forms are permitted
       6:  * provided that this notice is preserved and that due credit is given
       7:  * to the University of California at Berkeley. The name of the University
       8:  * may not be used to endorse or promote products derived from this
       9:  * software without specific prior written permission. This software
      10:  * is provided ``as is'' without express or implied warranty.
      11:  *
      12:  *      @(#)ns.h	7.3.1 (2.11BSD GTE) 12/31/93
      13:  */
      14:
      15: /*
      16:  * Constants and Structures defined by the Xerox Network Software
      17:  * per "Internet Transport Protocols", XSIS 028112, December 1981
      18:  */
      19:
      20: /*
      21:  * Protocols
      22:  */
      23: #define NSPROTO_RI  1       /* Routing Information */
      24: #define NSPROTO_ECHO    2       /* Echo Protocol */
      25: #define NSPROTO_ERROR   3       /* Error Protocol */
      26: #define NSPROTO_PE  4       /* Packet Exchange */
      27: #define NSPROTO_SPP 5       /* Sequenced Packet */
      28: #define NSPROTO_RAW 255     /* Placemarker*/
      29: #define NSPROTO_MAX 256     /* Placemarker*/
      30:
      31:
      32: /*
      33:  * Port/Socket numbers: network standard functions
      34:  */
      35:
      36: #define NSPORT_RI   1       /* Routing Information */
      37: #define NSPORT_ECHO 2       /* Echo */
      38: #define NSPORT_RE   3       /* Router Error */
      39:
      40: /*
      41:  * Ports < NSPORT_RESERVED are reserved for priveleged
      42:  * processes (e.g. root).
      43:  */
      44: #define NSPORT_RESERVED     3000
      45:
      46: /* flags passed to ns_output as last parameter */
      47:
      48: #define NS_FORWARDING       0x1 /* most of idp header exists */
      49: #define NS_ROUTETOIF        0x10    /* same as SO_DONTROUTE */
      50: #define NS_ALLOWBROADCAST   SO_BROADCAST    /* can send broadcast packets */
      51:
      52: #define NS_MAXHOPS      15
      53:
      54: /* flags passed to get/set socket option */
      55: #define SO_HEADERS_ON_INPUT 1
      56: #define SO_HEADERS_ON_OUTPUT    2
      57: #define SO_DEFAULT_HEADERS  3
      58: #define SO_LAST_HEADER      4
      59: #define SO_NSIP_ROUTE       5
      60: #define SO_SEQNO        6
      61: #define SO_ALL_PACKETS      7
      62: #define SO_MTU          8
      63:
      64:
      65: /*
      66:  * NS addressing
      67:  */
      68: union ns_host {
      69:     u_char  c_host[6];
      70:     u_short s_host[3];
      71: };
      72:
      73: union ns_net {
      74:     u_char  c_net[4];
      75:     u_short s_net[2];
      76: };
      77:
      78: union ns_net_u {
      79:     union ns_net    net_e;
      80:     u_long      long_e;
      81: };
      82:
      83: struct ns_addr {
      84:     union ns_net    x_net;
      85:     union ns_host   x_host;
      86:     u_short x_port;
      87: };
      88:
      89: /*
      90:  * Socket address, Xerox style
      91:  */
      92: struct sockaddr_ns {
      93:     u_short     sns_family;
      94:     struct ns_addr  sns_addr;
      95:     char        sns_zero[2];
      96: };
      97: #define sns_port sns_addr.x_port
      98:
      99: #ifdef vax
     100: #define ns_netof(a) (*(long *) & ((a).x_net)) /* XXX - not needed */
     101: #endif
     102: #define ns_neteqnn(a,b) (((a).s_net[0]==(b).s_net[0]) && \
     103:                     ((a).s_net[1]==(b).s_net[1]))
     104: #define ns_neteq(a,b) ns_neteqnn((a).x_net, (b).x_net)
     105: #define satons_addr(sa) (((struct sockaddr_ns *)&(sa))->sns_addr)
     106: #define ns_hosteqnh(s,t) ((s).s_host[0] == (t).s_host[0] && \
     107:     (s).s_host[1] == (t).s_host[1] && (s).s_host[2] == (t).s_host[2])
     108: #define ns_hosteq(s,t) (ns_hosteqnh((s).x_host,(t).x_host))
     109: #define ns_nullhost(x) (((x).x_host.s_host[0]==0) && \
     110:     ((x).x_host.s_host[1]==0) && ((x).x_host.s_host[2]==0))
     111:
     112: /*
     113:  * Routines for number representation conversion.
     114:  */
     115: u_short ntohs(), htons();
     116: u_long  ntohl(), htonl();
     117:
     118: #ifdef SUPERVISOR
     119: extern struct domain nsdomain;
     120: union ns_host ns_thishost;
     121: union ns_host ns_zerohost;
     122: union ns_host ns_broadhost;
     123: union ns_net ns_zeronet;
     124: union ns_net ns_broadnet;
     125: u_short ns_cksum();
     126: #endif

#### Defined variables

ns_broadhost defined in line 122; used 6 times

- in /usr/src/sys/netns/idp_usrreq.c line 544
- in /usr/src/sys/netns/ns.c line 191, 202
- in /usr/src/sys/netns/ns_input.c line 62, 160
- in /usr/src/sys/pdpif/if_ec.c line 522

ns_broadnet defined in line 124; used 2 times

- in /usr/src/sys/netns/ns_input.c line 63, 162

ns_thishost defined in line 120; used 13 times

- in /usr/src/sys/netns/ns.c line 192, 228, 234-237(3), 243
- in /usr/src/sys/netns/ns_input.c line 149, 183, 461
- in /usr/src/sys/netns/ns_ip.c line 300, 359
- in /usr/src/sys/netns/ns_pcb.c line 172
- in /usr/src/sys/pdpif/if_ec.c line 525

ns_zerohost defined in line 121; used 4 times

- in /usr/src/sys/netns/ns.c line 192, 228, 235
- in /usr/src/sys/netns/ns_ip.c line 300

ns_zeronet defined in line 123; used 5 times

- in /usr/src/new/crash/route.c line 380-385(2)
- in /usr/src/sys/netns/idp_usrreq.c line 58
- in /usr/src/ucb/netstat/route.c line 346-351(2)

#### Defined struct's

ns_addr defined in line 83; used 58 times

- in line 94(2)
- in /usr/src/lib/libc/ns/ns_addr.c line 17-19(4)
- in /usr/src/lib/libc/ns/ns_ntoa.c line 17(2)
- in /usr/src/new/crash/route.c line 334(2)
- in /usr/src/sbin/ifconfig/ifconfig.c line 493(2)
- in /usr/src/sbin/route/route.c line 531(2)
- in /usr/src/sys/netns/idp_usrreq.c line 226(2), 443(2)
- in /usr/src/sys/netns/ns.c line 270-273(4)
- in /usr/src/sys/netns/ns_error.c line 147(2), 284(2)
- in /usr/src/sys/netns/ns_input.c line 235(2), 409(2)
- in /usr/src/sys/netns/ns_pcb.c line 30(2), 105(2), 235(2), 282(2)
- in /usr/src/sys/netns/spp_usrreq.c line 135(2), 524(2)
- in /usr/src/sys/pdpif/if_de.c line 1230(2)
- in /usr/src/sys/pdpif/if_ec.c line 745(2)
- in /usr/src/sys/pdpif/if_il.c line 725(2)
- in /usr/src/sys/pdpif/if_qe.c line 705(2)
- in /usr/src/sys/pdpif/if_qt.c line 703(2)
- in /usr/src/ucb/netstat/ns.c line 322(2)
- in /usr/src/ucb/netstat/route.c line 300(2)
- in /usr/src/usr.sbin/trsp/trsp.c line 345(2)

sockaddr_ns defined in line 92; used 130 times

- in /usr/src/new/crash/if.c line 127-128(4)
- in /usr/src/new/crash/route.c line 98(2), 119(2), 144-146(4), 332(2), 377-379(4)
- in /usr/src/sbin/ifconfig/ifconfig.c line 365(2), 384(2), 394(2), 492(4)
- in /usr/src/sbin/route/route.c line 254(2), 338(2), 529(2)
- in /usr/src/sys/netns/idp_usrreq.c line 39(2)
- in /usr/src/sys/netns/ns.c line 35(2), 53(2), 158(2), 174-176(4)
- in /usr/src/sys/netns/ns_input.c line 248-253(4), 413-416(4)
- in /usr/src/sys/netns/ns_ip.c line 291(4)
- in /usr/src/sys/netns/ns_output.c line 47(2), 63(2), 97(2)
- in /usr/src/sys/netns/ns_pcb.c line 53(2), 60(2), 103-104(6), 205-208(6), 218-221(6)
- in /usr/src/sys/netns/spp_usrreq.c line 134(2), 149-150(4), 530(2), 545(2), 1330-1332(6)
- in /usr/src/sys/pdpif/if_de.c line 798(2)
- in /usr/src/sys/pdpif/if_ec.c line 520(2)
- in /usr/src/sys/pdpif/if_il.c line 595(2)
- in /usr/src/sys/pdpif/if_qe.c line 606(2)
- in /usr/src/sys/pdpif/if_qt.c line 635(2)
- in /usr/src/ucb/netstat/if.c line 137-138(4)
- in /usr/src/ucb/netstat/ns.c line 319(2), 325(2)
- in /usr/src/ucb/netstat/route.c line 123-125(4), 298(2), 343-345(4)

#### Defined union's

ns_host defined in line 68; used 28 times

- in line 85(2), 120-122(6)
- in /usr/src/sys/netns/ns.c line 177(2)
- in /usr/src/sys/netns/ns_input.c line 41-43(6), 62(2)
- in /usr/src/sys/pdpif/if_de.c line 1233(2)
- in /usr/src/sys/pdpif/if_ec.c line 748(2)
- in /usr/src/sys/pdpif/if_il.c line 728(2)
- in /usr/src/sys/pdpif/if_qe.c line 708(2)
- in /usr/src/sys/pdpif/if_qt.c line 728(2)

ns_net defined in line 73; used 36 times

- in line 79-84(4), 123-124(4)
- in /usr/src/lib/libc/ns/ns_ntoa.c line 21(2)
- in /usr/src/new/crash/if.c line 131(2)
- in /usr/src/new/crash/route.c line 335(2), 380(2)
- in /usr/src/sbin/route/route.c line 532(2)
- in /usr/src/sys/netns/ns.c line 41(2), 276(2)
- in /usr/src/sys/netns/ns_input.c line 44-45(4), 63(2), 434(2)
- in /usr/src/ucb/netstat/if.c line 143(2)
- in /usr/src/ucb/netstat/route.c line 301(2), 346(2)

ns_net_u defined in line 78; never used

#### Defined macros

NSPORT_ECHO defined in line 37; never used
NSPORT_RE defined in line 38; never used
NSPORT_RESERVED defined in line 44; used 3 times

- in /usr/src/sys/netns/ns_pcb.c line 75, 84-85(2)

NSPORT_RI defined in line 36; never used
NSPROTO_ECHO defined in line 24; used 1 times

- in /usr/src/sys/netns/ns_error.c line 286

NSPROTO_ERROR defined in line 25; used 3 times

- in /usr/src/sys/netns/ns_error.c line 108, 131
- in /usr/src/sys/netns/ns_proto.c line 63

NSPROTO_MAX defined in line 29; never used
NSPROTO_PE defined in line 26; never used
NSPROTO_RAW defined in line 28; used 1 times

- in /usr/src/sys/netns/ns_proto.c line 58

NSPROTO_RI defined in line 23; never used
NSPROTO_SPP defined in line 27; used 4 times

- in /usr/src/sys/netns/ns_proto.c line 48-53(2)
- in /usr/src/sys/netns/spp_usrreq.c line 1071, 1446

NS_ALLOWBROADCAST defined in line 50; used 2 times

- in /usr/src/sys/netns/ns_input.c line 351
- in /usr/src/sys/netns/ns_output.c line 110

NS_FORWARDING defined in line 48; used 2 times

- in /usr/src/sys/netns/ns_error.c line 300
- in /usr/src/sys/netns/ns_input.c line 296

NS_MAXHOPS defined in line 52; used 4 times

- in /usr/src/sys/netns/ns_input.c line 175, 313, 339-340(2)

NS_ROUTETOIF defined in line 49; used 4 times

- in /usr/src/sys/netns/idp_usrreq.c line 199
- in /usr/src/sys/netns/ns_output.c line 72, 132
- in /usr/src/sys/netns/spp_usrreq.c line 1016

SO_ALL_PACKETS defined in line 61; never used
SO_DEFAULT_HEADERS defined in line 57; never used
SO_HEADERS_ON_INPUT defined in line 55; never used
SO_HEADERS_ON_OUTPUT defined in line 56; never used
SO_LAST_HEADER defined in line 58; never used
SO_MTU defined in line 62; never used
SO_NSIP_ROUTE defined in line 59; used 1 times

- in /usr/src/sbin/ifconfig/ifconfig.c line 190

SO_SEQNO defined in line 60; never used
ns_hosteq defined in line 108; used 5 times

- in /usr/src/sys/netns/idp_usrreq.c line 221
- in /usr/src/sys/netns/ns.c line 283
- in /usr/src/sys/netns/ns_pcb.c line 128, 243, 301

ns_hosteqnh defined in line 106; used 10 times

- in line 108
- in /usr/src/sys/netns/ns.c line 191, 228, 235-236(2), 243
- in /usr/src/sys/netns/ns_input.c line 149, 160, 183
- in /usr/src/sys/netns/ns_ip.c line 300

ns_neteq defined in line 104; used 4 times

- in /usr/src/sys/netns/idp_usrreq.c line 216
- in /usr/src/sys/netns/ns.c line 56
- in /usr/src/sys/netns/ns_input.c line 161
- in /usr/src/sys/netns/ns_pcb.c line 125

ns_neteqnn defined in line 102; used 7 times

- in line 104
- in /usr/src/sys/netns/idp_usrreq.c line 58
- in /usr/src/sys/netns/ns.c line 285-288(2)
- in /usr/src/sys/netns/ns_input.c line 162-164(3)

ns_netof defined in line 100; never used
ns_nullhost defined in line 109; used 23 times

- in /usr/src/new/crash/route.c line 345
- in /usr/src/sbin/route/route.c line 542
- in /usr/src/sys/netns/idp_usrreq.c line 411, 429, 448, 462
- in /usr/src/sys/netns/ns_input.c line 274
- in /usr/src/sys/netns/ns_pcb.c line 56, 63, 111-113(2), 169, 294-298(3)
- in /usr/src/sys/netns/spp_usrreq.c line 154
- in /usr/src/sys/pdpif/if_de.c line 1232
- in /usr/src/sys/pdpif/if_ec.c line 747
- in /usr/src/sys/pdpif/if_il.c line 727
- in /usr/src/sys/pdpif/if_qe.c line 707
- in /usr/src/sys/pdpif/if_qt.c line 726
- in /usr/src/ucb/netstat/ns.c line 94
- in /usr/src/ucb/netstat/route.c line 311

satons_addr defined in line 105; used 6 times

- in /usr/src/sys/netns/idp_usrreq.c line 227
- in /usr/src/sys/netns/ns.c line 282
- in /usr/src/sys/netns/ns_input.c line 467
- in /usr/src/sys/netns/ns_ip.c line 359
- in /usr/src/sys/netns/ns_pcb.c line 121, 164

sns_port defined in line 97; used 5 times

- in /usr/src/sys/netns/ns_pcb.c line 64-71(4), 111

#### Usage of this include

ns.h used 26 times

- in /usr/src/lib/libc/ns/ns_addr.c line 15
- in /usr/src/lib/libc/ns/ns_ntoa.c line 13
- in /usr/src/new/crash/if.c line 18
- in /usr/src/new/crash/route.c line 19
- in /usr/src/sbin/ifconfig/ifconfig.c line 24
- in /usr/src/sbin/route/route.c line 22
- in /usr/src/sys/net/if_loop.c line 41
- in /usr/src/sys/netns/idp_usrreq.c line 28
- in /usr/src/sys/netns/ns.c line 29
- in /usr/src/sys/netns/ns_error.c line 26
- in /usr/src/sys/netns/ns_input.c line 31
- in /usr/src/sys/netns/ns_ip.c line 43
- in /usr/src/sys/netns/ns_output.c line 25
- in /usr/src/sys/netns/ns_pcb.c line 26
- in /usr/src/sys/netns/ns_proto.c line 22
- in /usr/src/sys/netns/spp_debug.c line 28
- in /usr/src/sys/netns/spp_usrreq.c line 29
- in /usr/src/sys/pdpif/if_de.h line 21
- in /usr/src/sys/pdpif/if_ec.c line 73
- in /usr/src/sys/pdpif/if_il.c line 60
- in /usr/src/sys/pdpif/if_qe.c line 138
- in /usr/src/sys/pdpif/if_qt.c line 85
- in /usr/src/ucb/netstat/if.c line 23
- in /usr/src/ucb/netstat/ns.c line 32
- in /usr/src/ucb/netstat/route.c line 28
- in /usr/src/usr.sbin/trsp/trsp.c line 32

Last modified: 1994-01-01 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1052 |