Annotation of 43BSDReno/contrib/isode-beta/snmp/clnp.c, revision 1.1

1.1     ! root        1: /* clnp.c - MIB realization of the experimental CLNP group */
        !             2: 
        !             3: #ifndef        lint
        !             4: static char *rcsid = "$Header: /f/osi/snmp/RCS/clnp.c,v 7.5 90/07/09 14:48:34 mrose Exp $";
        !             5: #endif
        !             6: 
        !             7: /* 
        !             8:  * $Header: /f/osi/snmp/RCS/clnp.c,v 7.5 90/07/09 14:48:34 mrose Exp $
        !             9:  *
        !            10:  * Contributed by NYSERNet Inc.  This work was partially supported by the
        !            11:  * U.S. Defense Advanced Research Projects Agency and the Rome Air Development
        !            12:  * Center of the U.S. Air Force Systems Command under contract number
        !            13:  * F30602-88-C-0016.
        !            14:  *
        !            15:  *
        !            16:  * $Log:       clnp.c,v $
        !            17:  * Revision 7.5  90/07/09  14:48:34  mrose
        !            18:  * sync
        !            19:  * 
        !            20:  * Revision 7.4  90/05/22  20:30:21  mrose
        !            21:  * cache
        !            22:  * 
        !            23:  * Revision 7.3  90/02/27  18:49:28  mrose
        !            24:  * unix stuff
        !            25:  * 
        !            26:  * Revision 7.2  90/02/17  10:37:37  mrose
        !            27:  * smux
        !            28:  * 
        !            29:  * Revision 7.1  90/01/11  18:33:54  mrose
        !            30:  * real-sync
        !            31:  * 
        !            32:  * Revision 7.0  89/11/23  22:22:55  mrose
        !            33:  * Release 6.0
        !            34:  * 
        !            35:  */
        !            36: 
        !            37: /*
        !            38:  *                               NOTICE
        !            39:  *
        !            40:  *    Acquisition, use, and distribution of this module and related
        !            41:  *    materials are subject to the restrictions of a license agreement.
        !            42:  *    Consult the Preface in the User's Manual for the full terms of
        !            43:  *    this agreement.
        !            44:  *
        !            45:  */
        !            46: 
        !            47: 
        !            48: #include <stdio.h>
        !            49: #include "mib.h"
        !            50: #include "interfaces.h"
        !            51: #include "routes.h"
        !            52: 
        !            53: #ifdef BSD44
        !            54: #include <sys/kinfo.h>
        !            55: #include <net/if_dl.h>
        !            56: #include <netiso/iso_snpac.h>
        !            57: #define        CLNP_ER_CODES
        !            58: #include <netiso/clnp.h>
        !            59: #include <netiso/clnp_stat.h>
        !            60: #include <netiso/esis.h>
        !            61: 
        !            62: /*  */
        !            63: 
        !            64: #define        FORW_IS         1               /* clnpForwarding */
        !            65: #define        FORW_ES         2
        !            66: static int     iso_systype;
        !            67: 
        !            68: static struct clnp_stat clnp_stat;
        !            69: 
        !            70: /*  */
        !            71: 
        !            72: #define        clnpForwarding  0
        !            73: #define        clnpDefaultLifeTime 1
        !            74: #define        clnpInReceives  2
        !            75: #define        clnpInHdrErrors 3
        !            76: #define        clnpInAddrErrors 4
        !            77: #define        clnpForwPDUs    5
        !            78: #undef clnpInUnknownNLPs 6             /* NOT IMPLEMENTED */
        !            79: #define        clnpInUnknownULPs 7
        !            80: #undef clnpInDiscards  8               /* NOT IMPLEMENTED */
        !            81: #define        clnpInDelivers  9
        !            82: #define        clnpOutRequests 10
        !            83: #define        clnpOutDiscards 11
        !            84: #define        clnpOutNoRoutes 12
        !            85: #define        clnpReasmTimeout 13
        !            86: #define        clnpReasmReqds  14
        !            87: #define        clnpReasmOKs    15
        !            88: #define        clnpReasmFails  16
        !            89: #define        clnpSegOKs      17
        !            90: #define        clnpSegFails    18
        !            91: #define        clnpSegCreates  19
        !            92: #undef clnpInOpts      20              /* NOT IMPLEMENTED */
        !            93: #undef clnpInOpts      21              /* NOT IMPLEMENTED */
        !            94: 
        !            95: #define        clnpInErrors    (100 + 0)
        !            96: #define        clnpOutErrors   (100 + 1)
        !            97: #define        clnpInErrUnspecs (100 + 2)
        !            98: #define        clnpInErrProcs  (100 + 3)
        !            99: #define        clnpInErrCksums (100 + 4)
        !           100: #define        clnpInErrCongests (100 + 5)
        !           101: #define        clnpInErrHdrs   (100 + 6)
        !           102: #define        clnpInErrSegs   (100 + 7)
        !           103: #define        clnpInErrIncomps (100 + 8)
        !           104: #define        clnpInErrDups   (100 + 9)
        !           105: #define        clnpInErrUnreachDsts (100 + 10)
        !           106: #define        clnpInErrUnknownDsts (100 + 11)
        !           107: #define        clnpInErrSRUnspecs (100 + 12)
        !           108: #define        clnpInErrSRSyntaxes (100 + 13)
        !           109: #define        clnpInErrSRUnkAddrs (100 + 14)
        !           110: #define        clnpInErrSRBadPaths (100 + 15)
        !           111: #define        clnpInErrHops   (100 + 16)
        !           112: #define        clnpInErrHopReassms (100 + 17)
        !           113: #define        clnpInErrUnsOptions (100 + 18)
        !           114: #define        clnpInErrUnsVersions (100 + 19)
        !           115: #define        clnpInErrUnsSecurities (100 + 20)
        !           116: #define        clnpInErrUnsSRs (100 + 21)
        !           117: #define        clnpInErrUnsRRs (100 + 22)
        !           118: #define        clnpInErrInterferences (100 + 23)
        !           119: #define        clnpOutErrUnspecs       (100 + 24)
        !           120: #define        clnpOutErrProcs (100 + 25)
        !           121: #define        clnpOutErrCksums (100 + 26)
        !           122: #define        clnpOutErrCongests (100 + 27)
        !           123: #define        clnpOutErrHdrs  (100 + 28)
        !           124: #define        clnpOutErrSegs  (100 + 29)
        !           125: #define        clnpOutErrIncomps (100 + 30)
        !           126: #define        clnpOutErrDups  (100 + 31)
        !           127: #define        clnpOutErrUnreachDsts (100 + 32)
        !           128: #define        clnpOutErrUnknownDsts (100 + 33)
        !           129: #define        clnpOutErrSRUnspecs (100 + 34)
        !           130: #define        clnpOutErrSRSyntaxes (100 + 35)
        !           131: #define        clnpOutErrSRUnkAddrs (100 + 36)
        !           132: #define        clnpOutErrSRBadPaths (100 + 37)
        !           133: #define        clnpOutErrHops  (100 + 38)
        !           134: #define        clnpOutErrHopReassms (100 + 39)
        !           135: #define        clnpOutErrUnsOptions (100 + 40)
        !           136: #define        clnpOutErrUnsVersions (100 + 41)
        !           137: #define        clnpOutErrUnsSecurities (100 + 42)
        !           138: #define        clnpOutErrUnsSRs (100 + 43)
        !           139: #define        clnpOutErrUnsRRs (100 + 44)
        !           140: #define        clnpOutErrInterferences (100 + 45)
        !           141: 
        !           142: 
        !           143: static int  o_clnp (oi, v, offset)
        !           144: OI     oi;
        !           145: register struct type_SNMP_VarBind *v;
        !           146: int    offset;
        !           147: {
        !           148:     register int   *dp,
        !           149:                   *ep,
        !           150:                    j;
        !           151:     int            ifvar;
        !           152:     register struct clnp_stat *cns = &clnp_stat;
        !           153:     register OID    oid = oi -> oi_name;
        !           154:     register OT            ot = oi -> oi_type;
        !           155:     static   int lastq = -1;
        !           156: 
        !           157:     ifvar = (int) ot -> ot_info;
        !           158:     switch (offset) {
        !           159:        case type_SNMP_PDUs_get__request:
        !           160:            if (oid -> oid_nelem != ot -> ot_name -> oid_nelem + 1
        !           161:                    || oid -> oid_elements[oid -> oid_nelem - 1] != 0)
        !           162:                return int_SNMP_error__status_noSuchName;
        !           163:            break;
        !           164: 
        !           165:        case type_SNMP_PDUs_get__next__request:
        !           166:            if (oid -> oid_nelem == ot -> ot_name -> oid_nelem) {
        !           167:                OID     new;
        !           168: 
        !           169:                if ((new = oid_extend (oid, 1)) == NULLOID)
        !           170:                    return int_SNMP_error__status_genErr;
        !           171:                new -> oid_elements[new -> oid_nelem - 1] = 0;
        !           172: 
        !           173:                if (v -> name)
        !           174:                    free_SNMP_ObjectName (v -> name);
        !           175:                v -> name = new;
        !           176:            }
        !           177:            else
        !           178:                return NOTOK;
        !           179:            break;
        !           180: 
        !           181:        default:
        !           182:            return int_SNMP_error__status_genErr;
        !           183:     }
        !           184: 
        !           185:     switch (ifvar) {
        !           186:        case clnpDefaultLifeTime:
        !           187:        case clnpReasmTimeout:
        !           188:            break;
        !           189:            
        !           190:        default:
        !           191:            if (quantum != lastq) {
        !           192:                lastq = quantum;
        !           193: 
        !           194:                if (getkmem (nl + N_ISO_SYSTYPE, (caddr_t) &iso_systype,
        !           195:                             sizeof iso_systype) == NOTOK
        !           196:                        || getkmem (nl + N_CLNP_STAT, (caddr_t) cns,
        !           197:                                    sizeof *cns) == NOTOK)
        !           198:                    return int_SNMP_error__status_genErr;
        !           199:            }
        !           200:            break;
        !           201:     }
        !           202: 
        !           203:     switch (ifvar) {
        !           204:        case clnpForwarding:
        !           205:            return o_integer (oi, v,
        !           206:                              iso_systype & SNPA_ES ? FORW_ES : FORW_IS);
        !           207: 
        !           208:        case clnpDefaultLifeTime:
        !           209:            return o_integer (oi, v, CLNP_TTL);
        !           210: 
        !           211:        case clnpInReceives:
        !           212:            return o_integer (oi, v, cns -> cns_total);
        !           213: 
        !           214:        case clnpInHdrErrors:
        !           215:            return o_integer (oi, v, cns -> cns_toosmall
        !           216:                                   + cns -> cns_badhlen
        !           217:                                   + cns -> cns_badcsum
        !           218:                                   + cns -> cns_noseg
        !           219:                                   + cns -> cns_badvers);
        !           220: 
        !           221:        case clnpInAddrErrors:
        !           222:            return o_integer (oi, v, cns -> cns_badaddr);
        !           223: 
        !           224:        case clnpForwPDUs:
        !           225:            return o_integer (oi, v, cns -> cns_forward);
        !           226: 
        !           227:        case clnpInUnknownULPs:
        !           228:            return o_integer (oi, v, cns -> cns_noproto);
        !           229: 
        !           230:        case clnpInDelivers:
        !           231:            return o_integer (oi, v, cns -> cns_delivered);
        !           232: 
        !           233:        case clnpOutRequests:
        !           234:            return o_integer (oi, v, cns -> cns_sent - cns -> cns_forward);
        !           235: 
        !           236:        case clnpOutDiscards:
        !           237:            return o_integer (oi, v, cns -> cns_odropped);
        !           238: 
        !           239:        case clnpOutNoRoutes:
        !           240:            return o_integer (oi, v, cns -> cns_cantforward);
        !           241: 
        !           242:        case clnpReasmTimeout:
        !           243:            return o_integer (oi, v, CLNP_TTL);
        !           244: 
        !           245:        case clnpReasmReqds:
        !           246:            return o_integer (oi, v, cns -> cns_fragments);
        !           247: 
        !           248:        case clnpReasmOKs:
        !           249:            return o_integer (oi, v, cns -> cns_reassembled);
        !           250: 
        !           251:        case clnpReasmFails:
        !           252:            return o_integer (oi, v, cns -> cns_fragdropped
        !           253:                                   + cns -> cns_fragtimeout);
        !           254: 
        !           255:        case clnpSegOKs:
        !           256:            return o_integer (oi, v, cns -> cns_fragmented);
        !           257: 
        !           258:        case clnpSegFails:
        !           259:            return o_integer (oi, v, cns -> cns_cantfrag);
        !           260: 
        !           261:        case clnpSegCreates:
        !           262:            return o_integer (oi, v, cns -> cns_ofragments);
        !           263: 
        !           264:        case clnpInErrors:
        !           265:            j = 0;
        !           266:            for (ep = (dp = cns -> cns_er_inhist) + CLNP_ERRORS; dp <= ep; )
        !           267:                j += *dp++;
        !           268:            return o_integer (oi, v, j);
        !           269: 
        !           270:        case clnpOutErrors:
        !           271:            j = 0;
        !           272:            for (ep = (dp = cns -> cns_er_outhist) + CLNP_ERRORS; dp <= ep; )
        !           273:                j += *dp++;
        !           274:            return o_integer (oi, v, j);
        !           275: 
        !           276: #define        clnpInputError(r)       cns -> cns_er_inhist[clnp_er_index (r)]
        !           277: 
        !           278:        case clnpInErrUnspecs:
        !           279:            return o_integer (oi, v, clnpInputError (GEN_NOREAS));
        !           280: 
        !           281:        case clnpInErrProcs:
        !           282:            return o_integer (oi, v, clnpInputError (GEN_PROTOERR));
        !           283: 
        !           284:        case clnpInErrCksums:
        !           285:            return o_integer (oi, v, clnpInputError (GEN_BADCSUM));
        !           286: 
        !           287:        case clnpInErrCongests:
        !           288:            return o_integer (oi, v, clnpInputError (GEN_CONGEST));
        !           289: 
        !           290:        case clnpInErrHdrs:
        !           291:            return o_integer (oi, v, clnpInputError (GEN_HDRSYNTAX));
        !           292: 
        !           293:        case clnpInErrSegs:
        !           294:            return o_integer (oi, v, clnpInputError (GEN_SEGNEEDED));
        !           295: 
        !           296:        case clnpInErrIncomps:
        !           297:            return o_integer (oi, v, clnpInputError (GEN_INCOMPLETE));
        !           298: 
        !           299:        case clnpInErrDups:
        !           300:            return o_integer (oi, v, clnpInputError (GEN_DUPOPT));
        !           301: 
        !           302:        case clnpInErrUnreachDsts:
        !           303:            return o_integer (oi, v, clnpInputError (ADDR_DESTUNREACH));
        !           304: 
        !           305:        case clnpInErrUnknownDsts:
        !           306:            return o_integer (oi, v, clnpInputError (ADDR_DESTUNKNOWN));
        !           307: 
        !           308:        case clnpInErrSRUnspecs:
        !           309:            return o_integer (oi, v, clnpInputError (SRCRT_UNSPECERR));
        !           310: 
        !           311:        case clnpInErrSRSyntaxes:
        !           312:            return o_integer (oi, v, clnpInputError (SRCRT_SYNTAX));
        !           313: 
        !           314:        case clnpInErrSRUnkAddrs:
        !           315:            return o_integer (oi, v, clnpInputError (SRCRT_UNKNOWNADDR));
        !           316: 
        !           317:        case clnpInErrSRBadPaths:
        !           318:            return o_integer (oi, v, clnpInputError (SRCRT_BADPATH));
        !           319: 
        !           320:        case clnpInErrHops:
        !           321:            return o_integer (oi, v, clnpInputError (TTL_EXPTRANSIT));
        !           322: 
        !           323:        case clnpInErrHopReassms:
        !           324:            return o_integer (oi, v, clnpInputError (TTL_EXPREASS));
        !           325: 
        !           326:        case clnpInErrUnsOptions:
        !           327:            return o_integer (oi, v, clnpInputError (DISC_UNSUPPOPT));
        !           328: 
        !           329:        case clnpInErrUnsVersions:
        !           330:            return o_integer (oi, v, clnpInputError (DISC_UNSUPPVERS));
        !           331: 
        !           332:        case clnpInErrUnsSecurities:
        !           333:            return o_integer (oi, v, clnpInputError (DISC_UNSUPPSECURE));
        !           334: 
        !           335:        case clnpInErrUnsSRs:
        !           336:            return o_integer (oi, v, clnpInputError (DISC_UNSUPPSRCRT));
        !           337: 
        !           338:        case clnpInErrUnsRRs:
        !           339:            return o_integer (oi, v, clnpInputError (DISC_UNSUPPRECRT));
        !           340: 
        !           341:        case clnpInErrInterferences:
        !           342:            return o_integer (oi, v, clnpInputError (REASS_INTERFERE));
        !           343: 
        !           344: #undef clnpInputError
        !           345: #define        clnpOutputError(r)      cns -> cns_er_outhist[clnp_er_index (r)]
        !           346: 
        !           347:        case clnpOutErrUnspecs:
        !           348:            return o_integer (oi, v, clnpOutputError (GEN_NOREAS));
        !           349: 
        !           350:        case clnpOutErrProcs:
        !           351:            return o_integer (oi, v, clnpOutputError (GEN_PROTOERR));
        !           352: 
        !           353:        case clnpOutErrCksums:
        !           354:            return o_integer (oi, v, clnpOutputError (GEN_BADCSUM));
        !           355: 
        !           356:        case clnpOutErrCongests:
        !           357:            return o_integer (oi, v, clnpOutputError (GEN_CONGEST));
        !           358: 
        !           359:        case clnpOutErrHdrs:
        !           360:            return o_integer (oi, v, clnpOutputError (GEN_HDRSYNTAX));
        !           361: 
        !           362:        case clnpOutErrSegs:
        !           363:            return o_integer (oi, v, clnpOutputError (GEN_SEGNEEDED));
        !           364: 
        !           365:        case clnpOutErrIncomps:
        !           366:            return o_integer (oi, v, clnpOutputError (GEN_INCOMPLETE));
        !           367: 
        !           368:        case clnpOutErrDups:
        !           369:            return o_integer (oi, v, clnpOutputError (GEN_DUPOPT));
        !           370: 
        !           371:        case clnpOutErrUnreachDsts:
        !           372:            return o_integer (oi, v, clnpOutputError (ADDR_DESTUNREACH));
        !           373: 
        !           374:        case clnpOutErrUnknownDsts:
        !           375:            return o_integer (oi, v, clnpOutputError (ADDR_DESTUNKNOWN));
        !           376: 
        !           377:        case clnpOutErrSRUnspecs:
        !           378:            return o_integer (oi, v, clnpOutputError (SRCRT_UNSPECERR));
        !           379: 
        !           380:        case clnpOutErrSRSyntaxes:
        !           381:            return o_integer (oi, v, clnpOutputError (SRCRT_SYNTAX));
        !           382: 
        !           383:        case clnpOutErrSRUnkAddrs:
        !           384:            return o_integer (oi, v, clnpOutputError (SRCRT_UNKNOWNADDR));
        !           385: 
        !           386:        case clnpOutErrSRBadPaths:
        !           387:            return o_integer (oi, v, clnpOutputError (SRCRT_BADPATH));
        !           388: 
        !           389:        case clnpOutErrHops:
        !           390:            return o_integer (oi, v, clnpOutputError (TTL_EXPTRANSIT));
        !           391: 
        !           392:        case clnpOutErrHopReassms:
        !           393:            return o_integer (oi, v, clnpOutputError (TTL_EXPREASS));
        !           394: 
        !           395:        case clnpOutErrUnsOptions:
        !           396:            return o_integer (oi, v, clnpOutputError (DISC_UNSUPPOPT));
        !           397: 
        !           398:        case clnpOutErrUnsVersions:
        !           399:            return o_integer (oi, v, clnpOutputError (DISC_UNSUPPVERS));
        !           400: 
        !           401:        case clnpOutErrUnsSecurities:
        !           402:            return o_integer (oi, v, clnpOutputError (DISC_UNSUPPSECURE));
        !           403: 
        !           404:        case clnpOutErrUnsSRs:
        !           405:            return o_integer (oi, v, clnpOutputError (DISC_UNSUPPSRCRT));
        !           406: 
        !           407:        case clnpOutErrUnsRRs:
        !           408:            return o_integer (oi, v, clnpOutputError (DISC_UNSUPPRECRT));
        !           409: 
        !           410:        case clnpOutErrInterferences:
        !           411:            return o_integer (oi, v, clnpOutputError (REASS_INTERFERE));
        !           412: 
        !           413: #undef clnpOutputError
        !           414: 
        !           415:        default:
        !           416:            return int_SNMP_error__status_noSuchName;
        !           417:     }
        !           418: }
        !           419: 
        !           420: /*  */
        !           421: 
        !           422: static int  clnp_er_index (p)
        !           423: u_char p;
        !           424: {
        !           425:     register u_char *cp = clnp_er_codes + CLNP_ERRORS;
        !           426: 
        !           427:     while (cp-- > clnp_er_codes)
        !           428:        if (*cp == p)
        !           429:            return (cp - clnp_er_codes);
        !           430: 
        !           431:     return (CLNP_ERRORS + 1);
        !           432: }
        !           433: 
        !           434: /*  */
        !           435: 
        !           436: #define        CLNP_MAXPACKET  65535           /* clnpAdEntReasmMaxSize */
        !           437:                                        /* equivalent of IP_MAXPACKET */
        !           438: 
        !           439: 
        !           440: #define        clnpAdEntAddr   0
        !           441: #define        clnpAdEntIfIndex 1
        !           442: #define        clnpAdEntNetMask 2
        !           443: #define        clnpAdEntReasmMaxSize 3
        !           444: 
        !           445: 
        !           446: static int  o_clnp_addr (oi, v, offset)
        !           447: OI     oi;
        !           448: register struct type_SNMP_VarBind *v;
        !           449: int    offset;
        !           450: {
        !           451:     register int   i;
        !           452:     int            ifvar;
        !           453:     register unsigned int *ip,
        !           454:                          *jp;
        !           455:     register struct address   *as;
        !           456:     register OID    oid = oi -> oi_name;
        !           457:     register OT            ot = oi -> oi_type;
        !           458: 
        !           459:     if (sort_interfaces () == NOTOK)
        !           460:        return int_SNMP_error__status_genErr;
        !           461: 
        !           462:     ifvar = (int) ot -> ot_info;
        !           463:     switch (offset) {
        !           464:        case type_SNMP_PDUs_get__request:
        !           465:            if (oid -> oid_nelem <= ot -> ot_name -> oid_nelem)
        !           466:                return int_SNMP_error__status_noSuchName;
        !           467:            if ((as = get_addrent (oid -> oid_elements
        !           468:                                        + ot -> ot_name -> oid_nelem,
        !           469:                                   oid -> oid_nelem
        !           470:                                        - ot -> ot_name -> oid_nelem,
        !           471:                                   afs_iso, 0)) == NULL)
        !           472:                return int_SNMP_error__status_noSuchName;
        !           473:            break;
        !           474: 
        !           475:        case type_SNMP_PDUs_get__next__request:
        !           476:            if (oid -> oid_nelem < ot -> ot_name -> oid_nelem)
        !           477:                return int_SNMP_error__status_noSuchName;
        !           478:            if (oid -> oid_nelem == ot -> ot_name -> oid_nelem) {
        !           479:                OID     new;
        !           480: 
        !           481:                if ((as = afs_iso) == NULL)
        !           482:                    return NOTOK;
        !           483: 
        !           484:                if ((new = oid_extend (oid, as -> adr_insize)) == NULLOID)
        !           485:                    return int_SNMP_error__status_genErr;
        !           486:                ip = new -> oid_elements + new -> oid_nelem - as -> adr_insize;
        !           487:                jp = as -> adr_instance;
        !           488:                for (i = as -> adr_insize; i > 0; i--)
        !           489:                    *ip++ = *jp++;
        !           490:                
        !           491:                if (v -> name)
        !           492:                    free_SNMP_ObjectName (v -> name);
        !           493:                v -> name = new;
        !           494:            }
        !           495:            else {
        !           496:                int     j;
        !           497:                
        !           498:                if ((as = get_addrent (oid -> oid_elements
        !           499:                                           + ot -> ot_name -> oid_nelem,
        !           500:                                       j = oid -> oid_nelem
        !           501:                                               - ot -> ot_name -> oid_nelem,
        !           502:                                       afs_iso, 1)) == NULL)
        !           503:                    return NOTOK;
        !           504: 
        !           505:                if ((i = j - as -> adr_insize) < 0) {
        !           506:                    OID     new;
        !           507: 
        !           508:                    if ((new = oid_extend (oid, -i)) == NULLOID)
        !           509:                        return int_SNMP_error__status_genErr;
        !           510:                    if (v -> name)
        !           511:                        free_SNMP_ObjectName (v -> name);
        !           512:                    v -> name = new;
        !           513: 
        !           514:                    oid = new;
        !           515:                }
        !           516:                else
        !           517:                    if (i > 0)
        !           518:                        oid -> oid_nelem -= i;
        !           519: 
        !           520:                ip = oid -> oid_elements + ot -> ot_name -> oid_nelem;
        !           521:                jp = as -> adr_instance;
        !           522:                for (i = as -> adr_insize; i > 0; i--)
        !           523:                    *ip++ = *jp++;
        !           524:            }
        !           525:            break;
        !           526: 
        !           527:        default:
        !           528:            return int_SNMP_error__status_genErr;
        !           529:     }
        !           530: 
        !           531:     switch (ifvar) {
        !           532:        case clnpAdEntAddr:
        !           533:            return o_clnpaddr (oi, v,
        !           534:                               (struct sockaddr_iso *) &as -> adr_address);
        !           535: 
        !           536:        case clnpAdEntIfIndex:
        !           537:            return o_integer (oi, v, ffs (as -> adr_indexmask));
        !           538: 
        !           539:        case clnpAdEntNetMask:
        !           540:            return o_clnpaddr (oi, v,
        !           541:                               (struct sockaddr_iso *) &as -> adr_netmask);
        !           542: 
        !           543:        case clnpAdEntReasmMaxSize:
        !           544:            return o_integer (oi, v, CLNP_MAXPACKET);
        !           545: 
        !           546:        default:
        !           547:            return int_SNMP_error__status_noSuchName;
        !           548:     }
        !           549: }
        !           550: 
        !           551: /*  */
        !           552: 
        !           553: #define        clnpRouteDest   0
        !           554: #define        clnpRouteIfIndex 1
        !           555: #define        clnpRouteMetric1 2
        !           556: #define        clnpRouteMetric2 3
        !           557: #define        clnpRouteMetric3 4
        !           558: #define        clnpRouteMetric4 5
        !           559: #define        clnpRouteNextHop 6
        !           560: #define        clnpRouteType   7
        !           561: #define        clnpRouteProto  8
        !           562: #define        clnpRouteAge    9
        !           563: #define        unixClnpRouteFlags 10
        !           564: #define        unixClnpRouteRefCnt 11
        !           565: #define        unixClnpRouteUses       12
        !           566: 
        !           567: 
        !           568: static int  o_clnp_route (oi, v, offset)
        !           569: OI     oi;
        !           570: register struct type_SNMP_VarBind *v;
        !           571: int    offset;
        !           572: {
        !           573:     int            ifvar;
        !           574:     register int    i;
        !           575:     register unsigned int *ip,
        !           576:                          *jp;
        !           577:     register struct rtetab *rt;
        !           578:     register OID    oid = oi -> oi_name;
        !           579:     register OT            ot = oi -> oi_type;
        !           580: 
        !           581:     if (get_routes (offset) == NOTOK)
        !           582:        return int_SNMP_error__status_genErr;
        !           583: 
        !           584:     ifvar = (int) ot -> ot_info;
        !           585:     switch (offset) {
        !           586:        case type_SNMP_PDUs_get__request:
        !           587:            if (oid -> oid_nelem <= ot -> ot_name -> oid_nelem)
        !           588:                return int_SNMP_error__status_noSuchName;
        !           589:            if ((rt = get_rtent (oid -> oid_elements
        !           590:                                     + ot -> ot_name -> oid_nelem,
        !           591:                                 oid -> oid_nelem
        !           592:                                     - ot -> ot_name -> oid_nelem,
        !           593:                                 rts_iso, 0)) == NULL)
        !           594:                return int_SNMP_error__status_noSuchName;
        !           595:            break;
        !           596: 
        !           597:        case type_SNMP_PDUs_get__next__request:
        !           598:            if (oid -> oid_nelem < ot -> ot_name -> oid_nelem)
        !           599:                return int_SNMP_error__status_noSuchName;
        !           600:            if (oid -> oid_nelem == ot -> ot_name -> oid_nelem) {
        !           601:                OID     new;
        !           602: 
        !           603:                if ((rt = rts_iso) == NULL)
        !           604:                    return NOTOK;
        !           605: 
        !           606:                if ((new = oid_extend (oid, rt -> rt_insize)) == NULLOID)
        !           607:                    return int_SNMP_error__status_genErr;
        !           608:                ip = new -> oid_elements + new -> oid_nelem - rt -> rt_insize;
        !           609:                jp = rt -> rt_instance;
        !           610:                for (i = rt -> rt_insize; i > 0; i--)
        !           611:                    *ip++ = *jp++;
        !           612:                
        !           613:                if (v -> name)
        !           614:                    free_SNMP_ObjectName (v -> name);
        !           615:                v -> name = new;
        !           616:            }
        !           617:            else {
        !           618:                int     j;
        !           619: 
        !           620:                if ((rt = get_rtent (oid -> oid_elements
        !           621:                                         + ot -> ot_name -> oid_nelem,
        !           622:                                     j = oid -> oid_nelem
        !           623:                                             - ot -> ot_name -> oid_nelem,
        !           624:                                     rts_iso, 1)) == NULL)
        !           625:                    return NOTOK;
        !           626: 
        !           627:                if ((i = j - rt -> rt_insize) < 0) {
        !           628:                    OID     new;
        !           629: 
        !           630:                    if ((new = oid_extend (oid, -i)) == NULLOID)
        !           631:                        return int_SNMP_error__status_genErr;
        !           632:                    if (v -> name)
        !           633:                        free_SNMP_ObjectName (v -> name);
        !           634:                    v -> name = new;
        !           635: 
        !           636:                    oid = new;
        !           637:                }
        !           638:                else
        !           639:                    if (i > 0)
        !           640:                        oid -> oid_nelem -= i;
        !           641: 
        !           642:                ip = oid -> oid_elements + ot -> ot_name -> oid_nelem;
        !           643:                jp = rt -> rt_instance;
        !           644:                for (i = rt -> rt_insize; i > 0; i--)
        !           645:                    *ip++ = *jp++;
        !           646:            }
        !           647:            break;
        !           648: 
        !           649:        default:
        !           650:            return int_SNMP_error__status_genErr;
        !           651:     }
        !           652: 
        !           653:     switch (ifvar) {
        !           654:        case clnpRouteDest:
        !           655:            return o_clnpaddr (oi, v,
        !           656:                             (struct sockaddr_iso *) &rt -> rt_dst);
        !           657: 
        !           658:        case clnpRouteIfIndex:
        !           659:            {
        !           660:                register struct interface *is;
        !           661: 
        !           662:                for (is = ifs; is; is = is -> ifn_next)
        !           663:                    if ((caddr_t) is -> ifn_offset
        !           664:                                == (caddr_t) rt -> rt_rt.rt_ifp) {
        !           665:                        if (is -> ifn_ready)
        !           666:                            return o_integer (oi, v, is -> ifn_index);
        !           667:                        break;
        !           668:                    }
        !           669: 
        !           670:                if (offset == type_SNMP_PDUs_get__next__request)
        !           671:                    return NOTOK;
        !           672:                return int_SNMP_error__status_noSuchName;
        !           673:            }
        !           674:            
        !           675:        case clnpRouteMetric1:
        !           676:        case clnpRouteMetric2:
        !           677:        case clnpRouteMetric3:
        !           678:        case clnpRouteMetric4:
        !           679:            return o_integer (oi, v, METRIC_NONE);
        !           680: 
        !           681:        case clnpRouteNextHop:
        !           682:            return o_clnpaddr (oi, v,
        !           683:                               (struct sockaddr_iso *) &rt -> rt_gateway);
        !           684: 
        !           685:        case clnpRouteType:
        !           686:            switch (rt -> rt_rt.rt_flags & (RTF_GATEWAY | RTF_HOST)) {
        !           687:                case RTF_GATEWAY:
        !           688:                case RTF_HOST:
        !           689:                    return o_integer (oi, v, TYPE_REMOTE);
        !           690: 
        !           691:                case 0:
        !           692:                    return o_integer (oi, v, TYPE_DIRECT);
        !           693: 
        !           694:                default:
        !           695:                    return o_integer (oi, v, TYPE_OTHER);
        !           696:            }
        !           697: 
        !           698:        case clnpRouteProto:
        !           699:            if (rt -> rt_rt.rt_flags & (RTF_DYNAMIC | RTF_MODIFIED))
        !           700:                return o_integer (oi, v, PROTO_ESIS);
        !           701:            else
        !           702:                return o_integer (oi, v, PROTO_OTHER);
        !           703: 
        !           704:        case clnpRouteAge:
        !           705:            return o_integer (oi, v, 0);
        !           706: 
        !           707:        case unixClnpRouteFlags:
        !           708:            return o_integer (oi, v, rt -> rt_rt.rt_flags & 0xffff);
        !           709: 
        !           710:        case unixClnpRouteRefCnt:
        !           711:            return o_integer (oi, v, rt -> rt_rt.rt_refcnt & 0xffff);
        !           712: 
        !           713:        case unixClnpRouteUses:
        !           714:            return o_integer (oi, v, rt -> rt_rt.rt_use);
        !           715: 
        !           716:        default:
        !           717:            return int_SNMP_error__status_noSuchName;
        !           718:     }
        !           719: }
        !           720: 
        !           721: /*  */
        !           722: 
        !           723: struct adrtab {
        !           724: #define        ADN_SIZE        ADR_SIZE                /* ClnpAddress instance */
        !           725:     unsigned int    adn_instance[ADN_SIZE];    
        !           726:     int            adn_insize;                         
        !           727: 
        !           728:     struct iso_addr adn_address;               /* ClnpAddress */
        !           729: 
        !           730: 
        !           731: #define        ADM_SIZE        ADR_SIZE                /* PhysAddress instance */
        !           732:     unsigned int    adm_instance[ADM_SIZE];    
        !           733:     int            adm_insize;                         
        !           734: 
        !           735:     u_char     adm_address[ADM_SIZE];          /* PhysAddress */
        !           736:     u_char     adm_addrlen;                    /*   .. */
        !           737: 
        !           738: 
        !           739:     int            adr_index;                          /* ifIndex */
        !           740: 
        !           741:     int            adr_type;                           /* clnpNetToMediaType */
        !           742:                                                /* clnpMediaToNetType */
        !           743: #define        DYNAMIC_MAPPING 3
        !           744: #define        STATIC_MAPPING  4
        !           745: 
        !           746: 
        !           747:     struct adrtab *adn_next;                   /* next ClnpAddress */
        !           748:     struct adrtab *adm_next;                   /* next PhysAddress */
        !           749: };
        !           750: 
        !           751: static struct adrtab *adn = NULL;
        !           752: static struct adrtab *adm = NULL;
        !           753: 
        !           754: 
        !           755: static struct adrtab *get_arpent ();
        !           756: 
        !           757: /*  */
        !           758: 
        !           759: #define        clnpNetToMediaIfIndex 0
        !           760: #define        clnpNetToMediaPhysAddress 1
        !           761: #define        clnpNetToMediaNetAddress 2
        !           762: #define        clnpNetToMediaType 3
        !           763: #undef clnpNetToMediaAge 4             /* NOT IMPLEMENTED */
        !           764: #undef clnpNetToMediaHoldTime 5        /* NOT IMPLEMENTED */
        !           765: 
        !           766: #define        clnpMediaToNetIfIndex 6
        !           767: #define        clnpMediaToNetNetAddress 7
        !           768: #define        clnpMediaToNetPhysAddress 8
        !           769: #define        clnpMediaToNetType 9
        !           770: #undef clnpMediaToNetAge 10            /* NOT IMPLEMENTED */
        !           771: #undef clnpMediaToNetHoldTime 11       /* NOT IMPLEMENTED */
        !           772: 
        !           773: static int  o_address (oi, v, offset)
        !           774: OI     oi;
        !           775: register struct type_SNMP_VarBind *v;
        !           776: int    offset;
        !           777: {
        !           778:     register int    i;
        !           779:     int            ifvar,
        !           780:            isnpa;
        !           781:     register unsigned int *ip,
        !           782:                          *jp;
        !           783:     register struct adrtab *at;
        !           784:     struct sockaddr_iso netaddr;
        !           785:     register OID    oid = oi -> oi_name;
        !           786:     register OT            ot = oi -> oi_type;
        !           787: 
        !           788:     if (get_arptab () == NOTOK)
        !           789:        return int_SNMP_error__status_genErr;
        !           790: 
        !           791:     switch (ifvar = (int) ot -> ot_info) {
        !           792:        case clnpNetToMediaIfIndex:
        !           793:        case clnpNetToMediaPhysAddress:
        !           794:        case clnpNetToMediaNetAddress:
        !           795:        case clnpNetToMediaType:
        !           796:            isnpa = 0;
        !           797:            break;
        !           798: 
        !           799:        case clnpMediaToNetIfIndex:
        !           800:        case clnpMediaToNetNetAddress:
        !           801:        case clnpMediaToNetPhysAddress:
        !           802:        case clnpMediaToNetType:
        !           803:            isnpa = 1;
        !           804:            break;
        !           805:     }
        !           806:     
        !           807:     switch (offset) {
        !           808:        case type_SNMP_PDUs_get__request:
        !           809:            if (oid -> oid_nelem <= ot -> ot_name -> oid_nelem)
        !           810:                return int_SNMP_error__status_noSuchName;
        !           811:            if ((at = get_arpent (oid -> oid_elements
        !           812:                                        + ot -> ot_name -> oid_nelem,
        !           813:                                  oid -> oid_nelem
        !           814:                                        - ot -> ot_name -> oid_nelem,
        !           815:                                  isnpa, 0)) == NULL)
        !           816:                return int_SNMP_error__status_noSuchName;
        !           817:            break;
        !           818: 
        !           819:        case type_SNMP_PDUs_get__next__request:
        !           820:            if (oid -> oid_nelem < ot -> ot_name -> oid_nelem)
        !           821:                return int_SNMP_error__status_noSuchName;
        !           822:            if (oid -> oid_nelem == ot -> ot_name -> oid_nelem) {
        !           823:                OID     new;
        !           824: 
        !           825:                if ((at = isnpa ? adm : adn) == NULL)
        !           826:                    return NOTOK;
        !           827:                if (isnpa)
        !           828:                    jp = at -> adm_instance, i = at -> adm_insize;
        !           829:                else
        !           830:                    jp = at -> adn_instance, i = at -> adn_insize;
        !           831: 
        !           832:                if ((new = oid_extend (oid, i)) == NULLOID)
        !           833:                    return int_SNMP_error__status_genErr;
        !           834:                ip = new -> oid_elements + new -> oid_nelem - i;
        !           835:                for (; i > 0; i--)
        !           836:                    *ip++ = *jp++;
        !           837: 
        !           838:                if (v -> name)
        !           839:                    free_SNMP_ObjectName (v -> name);
        !           840:                v -> name = new;
        !           841:            }
        !           842:            else {
        !           843:                int     j;
        !           844: 
        !           845:                if ((at = get_arpent (oid -> oid_elements
        !           846:                                          + ot -> ot_name -> oid_nelem,
        !           847:                                      j = oid -> oid_nelem
        !           848:                                              - ot -> ot_name -> oid_nelem,
        !           849:                                      isnpa, 1)) == NULL)
        !           850:                    return NOTOK;
        !           851:                i = isnpa ? at -> adm_insize : at -> adn_insize;
        !           852: 
        !           853:                if ((i = j - i) < 0) {
        !           854:                    OID     new;
        !           855: 
        !           856:                    if ((new = oid_extend (oid, -i)) == NULLOID)
        !           857:                        return int_SNMP_error__status_genErr;
        !           858:                    if (v -> name)
        !           859:                        free_SNMP_ObjectName (v -> name);
        !           860:                    v -> name = new;
        !           861: 
        !           862:                    oid = new;
        !           863:                }
        !           864:                else
        !           865:                    if (i > 0)
        !           866:                        oid -> oid_nelem -= i;
        !           867: 
        !           868:                ip = oid -> oid_elements + ot -> ot_name -> oid_nelem;
        !           869:                if (isnpa)
        !           870:                    jp = at -> adm_instance, i = at -> adm_insize;
        !           871:                else
        !           872:                    jp = at -> adn_instance, i = at -> adn_insize;
        !           873:                for (; i > 0; i--)
        !           874:                    *ip++ = *jp++;
        !           875:            }
        !           876:            break;
        !           877: 
        !           878:        default:
        !           879:            return int_SNMP_error__status_genErr;
        !           880:     }
        !           881: 
        !           882:     switch (ifvar) {
        !           883:        case clnpNetToMediaIfIndex:
        !           884:        case clnpMediaToNetIfIndex:
        !           885:            return o_integer (oi, v, at -> adr_index);
        !           886: 
        !           887:        case clnpNetToMediaPhysAddress:
        !           888:        case clnpMediaToNetPhysAddress:
        !           889:            return o_string (oi, v, (char *) at -> adm_address,
        !           890:                             (int) at -> adm_addrlen);
        !           891: 
        !           892:        case clnpNetToMediaNetAddress:
        !           893:        case clnpMediaToNetNetAddress:
        !           894:            netaddr.siso_addr = at -> adn_address;      /* struct copy */
        !           895:            return o_clnpaddr (oi, v, &netaddr);
        !           896: 
        !           897:        case clnpNetToMediaType:
        !           898:        case clnpMediaToNetType:
        !           899:            return o_integer (oi, v, at -> adr_type);
        !           900: 
        !           901:        default:
        !           902:            return int_SNMP_error__status_noSuchName;
        !           903:     }
        !           904: }
        !           905: 
        !           906: /*  */
        !           907: 
        !           908: static int  adn_compar (a, b)
        !           909: register struct adrtab **a,
        !           910:                       **b;
        !           911: {
        !           912:     return elem_cmp ((*a) -> adn_instance, (*a) -> adn_insize,
        !           913:                     (*b) -> adn_instance, (*b) -> adn_insize);
        !           914: }
        !           915: 
        !           916: 
        !           917: static int  adm_compar (a, b)
        !           918: register struct adrtab **a,
        !           919:                       **b;
        !           920: {
        !           921:     return elem_cmp ((*a) -> adm_instance, (*a) -> adm_insize,
        !           922:                     (*b) -> adm_instance, (*b) -> adm_insize);
        !           923: }
        !           924: 
        !           925: 
        !           926: #define        ROUND(a)        (1 + (((a) - 1) | (sizeof (long) - 1)))
        !           927: 
        !           928: static int  get_arptab () {
        !           929:     int            adrNumber = 0,
        !           930:            rlen,
        !           931:            tblsize;
        !           932:     char   *snpac;
        !           933:     register char *sc,
        !           934:                  *se;
        !           935:     register struct adrtab *at,
        !           936:                           *ap,
        !           937:                          **base,
        !           938:                          **afe,
        !           939:                          **afp;
        !           940:     register struct interface *is;
        !           941:     register struct rt_msghdr *rtm;
        !           942:     static  int first_time = 1;
        !           943:     static  int lastq = -1;
        !           944: 
        !           945:     if (quantum == lastq)
        !           946:        return OK;
        !           947:     lastq = quantum;
        !           948: 
        !           949:     for (at = adn; at; at = ap) {
        !           950:        ap = at -> adn_next;
        !           951: 
        !           952:        free ((char *) at);
        !           953:     }
        !           954:     adn = adm = NULL;
        !           955: 
        !           956:     if ((tblsize = getkerninfo (KINFO_RT_DUMP, NULLCP, NULLIP, 0)) == NOTOK)
        !           957:        return NOTOK;
        !           958:     if ((snpac = malloc ((unsigned) tblsize)) == NULL)
        !           959:        adios (NULLCP, "out of memory");
        !           960:     if ((rlen = getkerninfo (KINFO_RT_DUMP, snpac, &tblsize, 0)) == NOTOK) {
        !           961:        free (snpac);
        !           962:        return NOTOK;
        !           963:     }
        !           964: 
        !           965:     afp = &adn;
        !           966:     for (se = (sc = snpac) + rlen; sc < se; sc += rtm -> rtm_msglen) {
        !           967:        register struct sockaddr_dl *sdl;
        !           968:        register struct sockaddr *sa;
        !           969:        struct iso_addr nsap;
        !           970: 
        !           971:        rtm = (struct rt_msghdr *) sc;
        !           972:        sa = (struct sockaddr *) (rtm + 1);
        !           973:        if (sa -> sa_family != AF_ISO)
        !           974:            continue;
        !           975: 
        !           976:        sdl = (struct sockaddr_dl *) (((caddr_t) sa) + ROUND (sa -> sa_len));
        !           977:        if (sdl -> sdl_family != AF_LINK)
        !           978:            continue;
        !           979: 
        !           980:        nsap = ((struct sockaddr_iso *) sa) -> siso_addr;    /* struct copy */
        !           981:        if (nsap.isoa_len == 0)
        !           982:            continue;
        !           983: 
        !           984:        for (is = ifs; is; is = is -> ifn_next)
        !           985:            if (is -> ifn_interface.ac_if.if_index == rtm -> rtm_index)
        !           986:                break;
        !           987:        if (!is) {
        !           988:            if (first_time)
        !           989:                advise (LLOG_EXCEPTIONS, NULLCP,
        !           990:                        "unable to find interface for SNPA in cache");
        !           991:            continue;
        !           992:        }
        !           993: 
        !           994:        if ((at = (struct adrtab *) calloc (1, sizeof *at)) == NULL)
        !           995:            adios (NULLCP, "out of memory");
        !           996:        *afp = at, afp = &at -> adn_next, adrNumber++;
        !           997: 
        !           998:        at -> adr_index = is -> ifn_index;
        !           999: 
        !          1000:        at -> adr_type = rtm -> rtm_flags & (RTF_DYNAMIC | RTF_MODIFIED)
        !          1001:                                ? DYNAMIC_MAPPING : STATIC_MAPPING;
        !          1002: 
        !          1003:        at -> adn_address = nsap;       /* struct copy */
        !          1004:        at -> adn_instance[0] = at -> adr_index, at -> adn_insize = 1;
        !          1005:        at -> adn_insize += clnpaddr2oid (at -> adn_instance + 1,
        !          1006:                                          &at -> adn_address);
        !          1007: 
        !          1008:        bcopy ((char *) LLADDR (sdl), (char *) at -> adm_address,
        !          1009:               (int) (at -> adm_addrlen = sdl -> sdl_alen));
        !          1010:        at -> adm_instance[0] = at -> adr_index, at -> adm_insize = 1;
        !          1011:        at -> adm_insize += mediaddr2oid (at -> adm_instance + 1,
        !          1012:                                          at -> adm_address,
        !          1013:                                          (int) at -> adm_addrlen, 0);
        !          1014: 
        !          1015:        if (debug && first_time) {
        !          1016:            char    buffer[BUFSIZ];
        !          1017:            OIDentifier oids;
        !          1018: 
        !          1019:            oids.oid_elements = at -> adn_instance;
        !          1020:            oids.oid_nelem = at -> adn_insize;
        !          1021:            (void) strcpy (buffer, sprintoid (&oids));
        !          1022:            oids.oid_elements = at -> adm_instance;
        !          1023:            oids.oid_nelem = at -> adm_insize;
        !          1024:            advise (LLOG_DEBUG, NULLCP,
        !          1025:                    "add mapping on interface %d: %s -> %s",
        !          1026:                    at -> adr_index, buffer, sprintoid (&oids));
        !          1027:        }
        !          1028:     }
        !          1029:     first_time = 0;
        !          1030:     free ((char *) snpac);
        !          1031: 
        !          1032:     if (adrNumber <= 1) {
        !          1033:        adm = adn;
        !          1034:        return OK;
        !          1035:     }
        !          1036: 
        !          1037:     if ((base = (struct adrtab **)
        !          1038:                    malloc ((unsigned) (adrNumber * sizeof *base))) == NULL)
        !          1039:        adios (NULLCP, "out of memory");
        !          1040: 
        !          1041:     afe = base;
        !          1042:     for (at = adn; at; at = at -> adn_next)
        !          1043:        *afe++ = at;
        !          1044: 
        !          1045:     qsort ((char *) base, adrNumber, sizeof *base, adn_compar);
        !          1046: 
        !          1047:     afp = base;
        !          1048:     at = adn = *afp++;
        !          1049:     while (afp < afe) {
        !          1050:        at -> adn_next = *afp;
        !          1051:        at = *afp++;
        !          1052:     }
        !          1053:     at -> adn_next = NULL;
        !          1054: 
        !          1055:     qsort ((char *) base, adrNumber, sizeof *base, adm_compar);
        !          1056: 
        !          1057:     afp = base;
        !          1058:     at = adm = *afp++;
        !          1059:     while (afp < afe) {
        !          1060:        at -> adm_next = *afp;
        !          1061:        at = *afp++;
        !          1062:     }
        !          1063:     at -> adm_next = NULL;
        !          1064: 
        !          1065:     free ((char *) base);
        !          1066: 
        !          1067:     return OK;
        !          1068: }
        !          1069: #undef ROUND
        !          1070: 
        !          1071: /*  */
        !          1072: 
        !          1073: static struct adrtab *get_arpent (ip, len, isnpa, isnext)
        !          1074: register unsigned int *ip;
        !          1075: int    len;
        !          1076: int    isnpa,
        !          1077:        isnext;
        !          1078: {
        !          1079:     register struct adrtab *at;
        !          1080: 
        !          1081:     if (isnpa)
        !          1082:        for (at = adm; at; at = at -> adm_next)
        !          1083:            switch (elem_cmp (at -> adm_instance, at -> adm_insize, ip, len)) {
        !          1084:                case 0:
        !          1085:                    return (isnext ? at -> adm_next : at);
        !          1086: 
        !          1087:                case 1:
        !          1088:                    return (isnext ? at : NULL);
        !          1089:            }
        !          1090:     else
        !          1091:        for (at = adn; at; at = at -> adn_next)
        !          1092:            switch (elem_cmp (at -> adn_instance, at -> adn_insize, ip, len)) {
        !          1093:                case 0:
        !          1094:                    return (isnext ? at -> adn_next : at);
        !          1095: 
        !          1096:                case 1:
        !          1097:                    return (isnext ? at : NULL);
        !          1098:            }
        !          1099: 
        !          1100:     return NULL;
        !          1101: }
        !          1102: 
        !          1103: /*  */
        !          1104: 
        !          1105: static struct esis_stat esis_stat;
        !          1106: 
        !          1107: /*  */
        !          1108: 
        !          1109: #define        esisESHins      0
        !          1110: #define        esisESHouts     1
        !          1111: #define        esisISHins      2
        !          1112: #define        esisISHouts     3
        !          1113: #define        esisRDUins      4
        !          1114: #define        esisRDUouts     5
        !          1115: 
        !          1116: 
        !          1117: static int  o_esis (oi, v, offset)
        !          1118: OI     oi;
        !          1119: register struct type_SNMP_VarBind *v;
        !          1120: int    offset;
        !          1121: {
        !          1122:     int            ifvar;
        !          1123:     register struct esis_stat *es = &esis_stat;
        !          1124:     register OID    oid = oi -> oi_name;
        !          1125:     register OT            ot = oi -> oi_type;
        !          1126:     static   int lastq = -1;
        !          1127: 
        !          1128:     ifvar = (int) ot -> ot_info;
        !          1129:     switch (offset) {
        !          1130:        case type_SNMP_PDUs_get__request:
        !          1131:            if (oid -> oid_nelem != ot -> ot_name -> oid_nelem + 1
        !          1132:                    || oid -> oid_elements[oid -> oid_nelem - 1] != 0)
        !          1133:                return int_SNMP_error__status_noSuchName;
        !          1134:            break;
        !          1135: 
        !          1136:        case type_SNMP_PDUs_get__next__request:
        !          1137:            if (oid -> oid_nelem == ot -> ot_name -> oid_nelem) {
        !          1138:                OID     new;
        !          1139: 
        !          1140:                if ((new = oid_extend (oid, 1)) == NULLOID)
        !          1141:                    return int_SNMP_error__status_genErr;
        !          1142:                new -> oid_elements[new -> oid_nelem - 1] = 0;
        !          1143: 
        !          1144:                if (v -> name)
        !          1145:                    free_SNMP_ObjectName (v -> name);
        !          1146:                v -> name = new;
        !          1147:            }
        !          1148:            else
        !          1149:                return NOTOK;
        !          1150:            break;
        !          1151: 
        !          1152:        default:
        !          1153:            return int_SNMP_error__status_genErr;
        !          1154:     }
        !          1155: 
        !          1156:     if (quantum != lastq) {
        !          1157:        lastq = quantum;
        !          1158: 
        !          1159:        if (getkmem (nl + N_ESIS_STAT, (caddr_t) &esis_stat, sizeof esis_stat)
        !          1160:                == NOTOK)
        !          1161:            return int_SNMP_error__status_genErr;
        !          1162:     }
        !          1163: 
        !          1164:     switch (ifvar) {
        !          1165:        case esisESHins:
        !          1166:            return o_integer (oi, v, es -> es_eshrcvd);
        !          1167: 
        !          1168:        case esisESHouts:
        !          1169:            return o_integer (oi, v, es -> es_eshsent);
        !          1170: 
        !          1171:        case esisISHins:
        !          1172:            return o_integer (oi, v, es -> es_ishrcvd);
        !          1173: 
        !          1174:        case esisISHouts:
        !          1175:            return o_integer (oi, v, es -> es_ishsent);
        !          1176: 
        !          1177:        case esisRDUins:
        !          1178:            return o_integer (oi, v, es -> es_rdrcvd);
        !          1179: 
        !          1180:        case esisRDUouts:
        !          1181:            return o_integer (oi, v, es -> es_rdsent);
        !          1182: 
        !          1183:        default:
        !          1184:            return int_SNMP_error__status_noSuchName;
        !          1185:     }
        !          1186: }
        !          1187: 
        !          1188: /*  */
        !          1189: 
        !          1190: init_clnp () {
        !          1191:     register OT            ot;
        !          1192: 
        !          1193:     if (nl[N_ISO_SYSTYPE].n_value == 0)
        !          1194:        return;
        !          1195: 
        !          1196:     if (ot = text2obj ("clnpForwarding"))
        !          1197:        ot -> ot_getfnx = o_clnp,
        !          1198:        ot -> ot_info = (caddr_t) clnpForwarding;
        !          1199:     if (ot = text2obj ("clnpDefaultLifeTime"))
        !          1200:        ot -> ot_getfnx = o_clnp,
        !          1201:        ot -> ot_info = (caddr_t) clnpDefaultLifeTime;
        !          1202:     if (ot = text2obj ("clnpInReceives"))
        !          1203:        ot -> ot_getfnx = o_clnp,
        !          1204:        ot -> ot_info = (caddr_t) clnpInReceives;
        !          1205:     if (ot = text2obj ("clnpInHdrErrors"))
        !          1206:        ot -> ot_getfnx = o_clnp,
        !          1207:        ot -> ot_info = (caddr_t) clnpInHdrErrors;
        !          1208:     if (ot = text2obj ("clnpInAddrErrors"))
        !          1209:        ot -> ot_getfnx = o_clnp,
        !          1210:        ot -> ot_info = (caddr_t) clnpInAddrErrors;
        !          1211:     if (ot = text2obj ("clnpForwPDUs"))
        !          1212:        ot -> ot_getfnx = o_clnp,
        !          1213:        ot -> ot_info = (caddr_t) clnpForwPDUs;
        !          1214: #ifdef clnpInUnknownNLPs
        !          1215:     if (ot = text2obj ("clnpInUnknownNLPs"))
        !          1216:        ot -> ot_getfnx = o_clnp,
        !          1217:        ot -> ot_info = (caddr_t) clnpInUnknownNLPs;
        !          1218: #endif
        !          1219:     if (ot = text2obj ("clnpInUnknownULPs"))
        !          1220:        ot -> ot_getfnx = o_clnp,
        !          1221:        ot -> ot_info = (caddr_t) clnpInUnknownULPs;
        !          1222: #ifdef clnpInDiscards
        !          1223:     if (ot = text2obj ("clnpInDiscards"))
        !          1224:        ot -> ot_getfnx = o_clnp,
        !          1225:        ot -> ot_info = (caddr_t) clnpInDiscards;
        !          1226: #endif
        !          1227:     if (ot = text2obj ("clnpInDelivers"))
        !          1228:        ot -> ot_getfnx = o_clnp,
        !          1229:        ot -> ot_info = (caddr_t) clnpInDelivers;
        !          1230:     if (ot = text2obj ("clnpOutRequests"))
        !          1231:        ot -> ot_getfnx = o_clnp,
        !          1232:        ot -> ot_info = (caddr_t) clnpOutRequests;
        !          1233:     if (ot = text2obj ("clnpOutDiscards"))
        !          1234:        ot -> ot_getfnx = o_clnp,
        !          1235:        ot -> ot_info = (caddr_t) clnpOutDiscards;
        !          1236:     if (ot = text2obj ("clnpOutNoRoutes"))
        !          1237:        ot -> ot_getfnx = o_clnp,
        !          1238:        ot -> ot_info = (caddr_t) clnpOutNoRoutes;
        !          1239:     if (ot = text2obj ("clnpReasmTimeout"))
        !          1240:        ot -> ot_getfnx = o_clnp,
        !          1241:        ot -> ot_info = (caddr_t) clnpReasmTimeout;
        !          1242:     if (ot = text2obj ("clnpReasmReqds"))
        !          1243:        ot -> ot_getfnx = o_clnp,
        !          1244:        ot -> ot_info = (caddr_t) clnpReasmReqds;
        !          1245:     if (ot = text2obj ("clnpReasmOKs"))
        !          1246:        ot -> ot_getfnx = o_clnp,
        !          1247:        ot -> ot_info = (caddr_t) clnpReasmOKs;
        !          1248:     if (ot = text2obj ("clnpReasmFails"))
        !          1249:        ot -> ot_getfnx = o_clnp,
        !          1250:        ot -> ot_info = (caddr_t) clnpReasmFails;
        !          1251:     if (ot = text2obj ("clnpSegOKs"))
        !          1252:        ot -> ot_getfnx = o_clnp,
        !          1253:        ot -> ot_info = (caddr_t) clnpSegOKs;
        !          1254:     if (ot = text2obj ("clnpSegFails"))
        !          1255:        ot -> ot_getfnx = o_clnp,
        !          1256:        ot -> ot_info = (caddr_t) clnpSegFails;
        !          1257:     if (ot = text2obj ("clnpSegCreates"))
        !          1258:        ot -> ot_getfnx = o_clnp,
        !          1259:        ot -> ot_info = (caddr_t) clnpSegCreates;
        !          1260: #ifdef clnpInOpts
        !          1261:     if (ot = text2obj ("clnpInOpts"))
        !          1262:        ot -> ot_getfnx = o_clnp,
        !          1263:        ot -> ot_info = (caddr_t) clnpInOpts;
        !          1264: #endif
        !          1265: #ifdef clnpOutOpts
        !          1266:     if (ot = text2obj ("clnpOutOpts"))
        !          1267:        ot -> ot_getfnx = o_clnp,
        !          1268:        ot -> ot_info = (caddr_t) clnpOutOpts;
        !          1269: #endif
        !          1270: 
        !          1271:     if (ot = text2obj ("clnpAdEntAddr"))
        !          1272:        ot -> ot_getfnx = o_clnp_addr,
        !          1273:        ot -> ot_info = (caddr_t) clnpAdEntAddr;
        !          1274:     if (ot = text2obj ("clnpAdEntIfIndex"))
        !          1275:        ot -> ot_getfnx = o_clnp_addr,
        !          1276:        ot -> ot_info = (caddr_t) clnpAdEntIfIndex;
        !          1277:     if (ot = text2obj ("clnpAdEntNetMask"))
        !          1278:        ot -> ot_getfnx = o_clnp_addr,
        !          1279:        ot -> ot_info = (caddr_t) clnpAdEntNetMask;
        !          1280:     if (ot = text2obj ("clnpAdEntReasmMaxSize"))
        !          1281:        ot -> ot_getfnx = o_clnp_addr,
        !          1282:        ot -> ot_info = (caddr_t) clnpAdEntReasmMaxSize;
        !          1283: 
        !          1284:     if (ot = text2obj ("clnpRouteDest"))
        !          1285:        ot -> ot_getfnx = o_clnp_route,
        !          1286:        ot -> ot_info = (caddr_t) clnpRouteDest;
        !          1287:     if (ot = text2obj ("clnpRouteIfIndex"))
        !          1288:        ot -> ot_getfnx = o_clnp_route,
        !          1289:        ot -> ot_info = (caddr_t) clnpRouteIfIndex;
        !          1290:     if (ot = text2obj ("clnpRouteMetric1"))
        !          1291:        ot -> ot_getfnx = o_clnp_route,
        !          1292:        ot -> ot_info = (caddr_t) clnpRouteMetric1;
        !          1293:     if (ot = text2obj ("clnpRouteMetric2"))
        !          1294:        ot -> ot_getfnx = o_clnp_route,
        !          1295:        ot -> ot_info = (caddr_t) clnpRouteMetric2;
        !          1296:     if (ot = text2obj ("clnpRouteMetric3"))
        !          1297:        ot -> ot_getfnx = o_clnp_route,
        !          1298:        ot -> ot_info = (caddr_t) clnpRouteMetric3;
        !          1299:     if (ot = text2obj ("clnpRouteMetric4"))
        !          1300:        ot -> ot_getfnx = o_clnp_route,
        !          1301:        ot -> ot_info = (caddr_t) clnpRouteMetric4;
        !          1302:     if (ot = text2obj ("clnpRouteNextHop"))
        !          1303:        ot -> ot_getfnx = o_clnp_route,
        !          1304:        ot -> ot_info = (caddr_t) clnpRouteNextHop;
        !          1305:     if (ot = text2obj ("clnpRouteType"))
        !          1306:        ot -> ot_getfnx = o_clnp_route,
        !          1307:        ot -> ot_info = (caddr_t) clnpRouteType;
        !          1308:     if (ot = text2obj ("clnpRouteProto"))
        !          1309:        ot -> ot_getfnx = o_clnp_route,
        !          1310:        ot -> ot_info = (caddr_t) clnpRouteProto;
        !          1311:     if (ot = text2obj ("clnpRouteAge"))
        !          1312:        ot -> ot_getfnx = o_clnp_route,
        !          1313:        ot -> ot_info = (caddr_t) clnpRouteAge;
        !          1314: 
        !          1315:     if (ot = text2obj ("unixClnpRouteFlags"))
        !          1316:        ot -> ot_getfnx = o_clnp_route,
        !          1317:        ot -> ot_info = (caddr_t) unixClnpRouteFlags;
        !          1318:     if (ot = text2obj ("unixClnpRouteRefCnt"))
        !          1319:        ot -> ot_getfnx = o_clnp_route,
        !          1320:        ot -> ot_info = (caddr_t) unixClnpRouteRefCnt;
        !          1321:     if (ot = text2obj ("unixClnpRouteUses"))
        !          1322:        ot -> ot_getfnx = o_clnp_route,
        !          1323:        ot -> ot_info = (caddr_t) unixClnpRouteUses;
        !          1324: 
        !          1325:     if (ot = text2obj ("clnpNetToMediaIfIndex"))
        !          1326:        ot -> ot_getfnx = o_address,
        !          1327:        ot -> ot_info = (caddr_t) clnpNetToMediaIfIndex;
        !          1328:     if (ot = text2obj ("clnpNetToMediaPhysAddress"))
        !          1329:        ot -> ot_getfnx = o_address,
        !          1330:        ot -> ot_info = (caddr_t) clnpNetToMediaPhysAddress;
        !          1331:     if (ot = text2obj ("clnpNetToMediaNetAddress"))
        !          1332:        ot -> ot_getfnx = o_address,
        !          1333:        ot -> ot_info = (caddr_t) clnpNetToMediaNetAddress;
        !          1334:     if (ot = text2obj ("clnpNetToMediaType"))
        !          1335:        ot -> ot_getfnx = o_address,
        !          1336:        ot -> ot_info = (caddr_t) clnpNetToMediaType;
        !          1337: #ifdef clnpNetToMediaAge
        !          1338:     if (ot = text2obj ("clnpNetToMediaAge"))
        !          1339:        ot -> ot_getfnx = o_address,
        !          1340:        ot -> ot_info = (caddr_t) clnpNetToMediaAge;
        !          1341: #endif
        !          1342: #ifdef clnpNetToMediaHoldTime
        !          1343:     if (ot = text2obj ("clnpNetToMediaHoldTime"))
        !          1344:        ot -> ot_getfnx = o_address,
        !          1345:        ot -> ot_info = (caddr_t) clnpNetToMediaHoldTime;
        !          1346: #endif
        !          1347:     if (ot = text2obj ("clnpMediaToNetIfIndex"))
        !          1348:        ot -> ot_getfnx = o_address,
        !          1349:        ot -> ot_info = (caddr_t) clnpMediaToNetIfIndex;
        !          1350:     if (ot = text2obj ("clnpMediaToNetNetAddress"))
        !          1351:        ot -> ot_getfnx = o_address,
        !          1352:        ot -> ot_info = (caddr_t) clnpMediaToNetNetAddress;
        !          1353:     if (ot = text2obj ("clnpMediaToNetPhysAddress"))
        !          1354:        ot -> ot_getfnx = o_address,
        !          1355:        ot -> ot_info = (caddr_t) clnpMediaToNetPhysAddress;
        !          1356:     if (ot = text2obj ("clnpMediaToNetType"))
        !          1357:        ot -> ot_getfnx = o_address,
        !          1358:        ot -> ot_info = (caddr_t) clnpMediaToNetType;
        !          1359: #ifdef clnpMediaToNetAge
        !          1360:     if (ot = text2obj ("clnpMediaToNetAge"))
        !          1361:        ot -> ot_getfnx = o_address,
        !          1362:        ot -> ot_info = (caddr_t) clnpMediaToNetAge;
        !          1363: #endif
        !          1364: #ifdef clnpMediaToNetHoldTime
        !          1365:     if (ot = text2obj ("clnpMediaToNetHoldTime"))
        !          1366:        ot -> ot_getfnx = o_address,
        !          1367:        ot -> ot_info = (caddr_t) clnpMediaToNetHoldTime;
        !          1368: #endif
        !          1369: 
        !          1370:     if (ot = text2obj ("clnpInErrors"))
        !          1371:        ot -> ot_getfnx = o_clnp,
        !          1372:        ot -> ot_info = (caddr_t) clnpInErrors;
        !          1373:     if (ot = text2obj ("clnpOutErrors"))
        !          1374:        ot -> ot_getfnx = o_clnp,
        !          1375:        ot -> ot_info = (caddr_t) clnpOutErrors;
        !          1376:     if (ot = text2obj ("clnpInErrUnspecs"))
        !          1377:        ot -> ot_getfnx = o_clnp,
        !          1378:        ot -> ot_info = (caddr_t) clnpInErrUnspecs;
        !          1379:     if (ot = text2obj ("clnpInErrProcs"))
        !          1380:        ot -> ot_getfnx = o_clnp,
        !          1381:        ot -> ot_info = (caddr_t) clnpInErrProcs;
        !          1382:     if (ot = text2obj ("clnpInErrCksums"))
        !          1383:        ot -> ot_getfnx = o_clnp,
        !          1384:        ot -> ot_info = (caddr_t) clnpInErrCksums;
        !          1385:     if (ot = text2obj ("clnpInErrCongests"))
        !          1386:        ot -> ot_getfnx = o_clnp,
        !          1387:        ot -> ot_info = (caddr_t) clnpInErrCongests;
        !          1388:     if (ot = text2obj ("clnpInErrHdrs"))
        !          1389:        ot -> ot_getfnx = o_clnp,
        !          1390:        ot -> ot_info = (caddr_t) clnpInErrHdrs;
        !          1391:     if (ot = text2obj ("clnpInErrSegs"))
        !          1392:        ot -> ot_getfnx = o_clnp,
        !          1393:        ot -> ot_info = (caddr_t) clnpInErrSegs;
        !          1394:     if (ot = text2obj ("clnpInErrIncomps"))
        !          1395:        ot -> ot_getfnx = o_clnp,
        !          1396:        ot -> ot_info = (caddr_t) clnpInErrIncomps;
        !          1397:     if (ot = text2obj ("clnpInErrDups"))
        !          1398:        ot -> ot_getfnx = o_clnp,
        !          1399:        ot -> ot_info = (caddr_t) clnpInErrDups;
        !          1400:     if (ot = text2obj ("clnpInErrUnreachDsts"))
        !          1401:        ot -> ot_getfnx = o_clnp,
        !          1402:        ot -> ot_info = (caddr_t) clnpInErrUnreachDsts;
        !          1403:     if (ot = text2obj ("clnpInErrUnknownDsts"))
        !          1404:        ot -> ot_getfnx = o_clnp,
        !          1405:        ot -> ot_info = (caddr_t) clnpInErrUnknownDsts;
        !          1406:     if (ot = text2obj ("clnpInErrSRUnspecs"))
        !          1407:        ot -> ot_getfnx = o_clnp,
        !          1408:        ot -> ot_info = (caddr_t) clnpInErrSRUnspecs;
        !          1409:     if (ot = text2obj ("clnpInErrSRSyntaxes"))
        !          1410:        ot -> ot_getfnx = o_clnp,
        !          1411:        ot -> ot_info = (caddr_t) clnpInErrSRSyntaxes;
        !          1412:     if (ot = text2obj ("clnpInErrSRUnkAddrs"))
        !          1413:        ot -> ot_getfnx = o_clnp,
        !          1414:        ot -> ot_info = (caddr_t) clnpInErrSRUnkAddrs;
        !          1415:     if (ot = text2obj ("clnpInErrSRBadPaths"))
        !          1416:        ot -> ot_getfnx = o_clnp,
        !          1417:        ot -> ot_info = (caddr_t) clnpInErrSRBadPaths;
        !          1418:     if (ot = text2obj ("clnpInErrHops"))
        !          1419:        ot -> ot_getfnx = o_clnp,
        !          1420:        ot -> ot_info = (caddr_t) clnpInErrHops;
        !          1421:     if (ot = text2obj ("clnpInErrHopReassms"))
        !          1422:        ot -> ot_getfnx = o_clnp,
        !          1423:        ot -> ot_info = (caddr_t) clnpInErrHopReassms;
        !          1424:     if (ot = text2obj ("clnpInErrUnsOptions"))
        !          1425:        ot -> ot_getfnx = o_clnp,
        !          1426:        ot -> ot_info = (caddr_t) clnpInErrUnsOptions;
        !          1427:     if (ot = text2obj ("clnpInErrUnsVersions"))
        !          1428:        ot -> ot_getfnx = o_clnp,
        !          1429:        ot -> ot_info = (caddr_t) clnpInErrUnsVersions;
        !          1430:     if (ot = text2obj ("clnpInErrUnsSecurities"))
        !          1431:        ot -> ot_getfnx = o_clnp,
        !          1432:        ot -> ot_info = (caddr_t) clnpInErrUnsSecurities;
        !          1433:     if (ot = text2obj ("clnpInErrUnsSRs"))
        !          1434:        ot -> ot_getfnx = o_clnp,
        !          1435:        ot -> ot_info = (caddr_t) clnpInErrUnsSRs;
        !          1436:     if (ot = text2obj ("clnpInErrUnsRRs"))
        !          1437:        ot -> ot_getfnx = o_clnp,
        !          1438:        ot -> ot_info = (caddr_t) clnpInErrUnsRRs;
        !          1439:     if (ot = text2obj ("clnpInErrInterferences"))
        !          1440:        ot -> ot_getfnx = o_clnp,
        !          1441:        ot -> ot_info = (caddr_t) clnpInErrInterferences;
        !          1442:     if (ot = text2obj ("clnpOutErrUnspecs"))
        !          1443:        ot -> ot_getfnx = o_clnp,
        !          1444:        ot -> ot_info = (caddr_t) clnpOutErrUnspecs;
        !          1445:     if (ot = text2obj ("clnpOutErrProcs"))
        !          1446:        ot -> ot_getfnx = o_clnp,
        !          1447:        ot -> ot_info = (caddr_t) clnpOutErrProcs;
        !          1448:     if (ot = text2obj ("clnpOutErrCksums"))
        !          1449:        ot -> ot_getfnx = o_clnp,
        !          1450:        ot -> ot_info = (caddr_t) clnpOutErrCksums;
        !          1451:     if (ot = text2obj ("clnpOutErrCongests"))
        !          1452:        ot -> ot_getfnx = o_clnp,
        !          1453:        ot -> ot_info = (caddr_t) clnpOutErrCongests;
        !          1454:     if (ot = text2obj ("clnpOutErrHdrs"))
        !          1455:        ot -> ot_getfnx = o_clnp,
        !          1456:        ot -> ot_info = (caddr_t) clnpOutErrHdrs;
        !          1457:     if (ot = text2obj ("clnpOutErrSegs"))
        !          1458:        ot -> ot_getfnx = o_clnp,
        !          1459:        ot -> ot_info = (caddr_t) clnpOutErrSegs;
        !          1460:     if (ot = text2obj ("clnpOutErrIncomps"))
        !          1461:        ot -> ot_getfnx = o_clnp,
        !          1462:        ot -> ot_info = (caddr_t) clnpOutErrIncomps;
        !          1463:     if (ot = text2obj ("clnpOutErrDups"))
        !          1464:        ot -> ot_getfnx = o_clnp,
        !          1465:        ot -> ot_info = (caddr_t) clnpOutErrDups;
        !          1466:     if (ot = text2obj ("clnpOutErrUnreachDsts"))
        !          1467:        ot -> ot_getfnx = o_clnp,
        !          1468:        ot -> ot_info = (caddr_t) clnpOutErrUnreachDsts;
        !          1469:     if (ot = text2obj ("clnpOutErrUnknownDsts"))
        !          1470:        ot -> ot_getfnx = o_clnp,
        !          1471:        ot -> ot_info = (caddr_t) clnpOutErrUnknownDsts;
        !          1472:     if (ot = text2obj ("clnpOutErrSRUnspecs"))
        !          1473:        ot -> ot_getfnx = o_clnp,
        !          1474:        ot -> ot_info = (caddr_t) clnpOutErrSRUnspecs;
        !          1475:     if (ot = text2obj ("clnpOutErrSRSyntaxes"))
        !          1476:        ot -> ot_getfnx = o_clnp,
        !          1477:        ot -> ot_info = (caddr_t) clnpOutErrSRSyntaxes;
        !          1478:     if (ot = text2obj ("clnpOutErrSRUnkAddrs"))
        !          1479:        ot -> ot_getfnx = o_clnp,
        !          1480:        ot -> ot_info = (caddr_t) clnpOutErrSRUnkAddrs;
        !          1481:     if (ot = text2obj ("clnpOutErrSRBadPaths"))
        !          1482:        ot -> ot_getfnx = o_clnp,
        !          1483:        ot -> ot_info = (caddr_t) clnpOutErrSRBadPaths;
        !          1484:     if (ot = text2obj ("clnpOutErrHops"))
        !          1485:        ot -> ot_getfnx = o_clnp,
        !          1486:        ot -> ot_info = (caddr_t) clnpOutErrHops;
        !          1487:     if (ot = text2obj ("clnpOutErrHopReassms"))
        !          1488:        ot -> ot_getfnx = o_clnp,
        !          1489:        ot -> ot_info = (caddr_t) clnpOutErrHopReassms;
        !          1490:     if (ot = text2obj ("clnpOutErrUnsOptions"))
        !          1491:        ot -> ot_getfnx = o_clnp,
        !          1492:        ot -> ot_info = (caddr_t) clnpOutErrUnsOptions;
        !          1493:     if (ot = text2obj ("clnpOutErrUnsVersions"))
        !          1494:        ot -> ot_getfnx = o_clnp,
        !          1495:        ot -> ot_info = (caddr_t) clnpOutErrUnsVersions;
        !          1496:     if (ot = text2obj ("clnpOutErrUnsSecurities"))
        !          1497:        ot -> ot_getfnx = o_clnp,
        !          1498:        ot -> ot_info = (caddr_t) clnpOutErrUnsSecurities;
        !          1499:     if (ot = text2obj ("clnpOutErrUnsSRs"))
        !          1500:        ot -> ot_getfnx = o_clnp,
        !          1501:        ot -> ot_info = (caddr_t) clnpOutErrUnsSRs;
        !          1502:     if (ot = text2obj ("clnpOutErrUnsRRs"))
        !          1503:        ot -> ot_getfnx = o_clnp,
        !          1504:        ot -> ot_info = (caddr_t) clnpOutErrUnsRRs;
        !          1505:     if (ot = text2obj ("clnpOutErrInterferences"))
        !          1506:        ot -> ot_getfnx = o_clnp,
        !          1507:        ot -> ot_info = (caddr_t) clnpOutErrInterferences;
        !          1508: 
        !          1509:     if (ot = text2obj ("esisESHins"))
        !          1510:        ot -> ot_getfnx = o_esis,
        !          1511:        ot -> ot_info = (caddr_t) esisESHins;
        !          1512:     if (ot = text2obj ("esisESHouts"))
        !          1513:        ot -> ot_getfnx = o_esis,
        !          1514:        ot -> ot_info = (caddr_t) esisESHouts;
        !          1515:     if (ot = text2obj ("esisISHins"))
        !          1516:        ot -> ot_getfnx = o_esis,
        !          1517:        ot -> ot_info = (caddr_t) esisISHins;
        !          1518:     if (ot = text2obj ("esisISHouts"))
        !          1519:        ot -> ot_getfnx = o_esis,
        !          1520:        ot -> ot_info = (caddr_t) esisISHouts;
        !          1521:     if (ot = text2obj ("esisRDUins"))
        !          1522:        ot -> ot_getfnx = o_esis,
        !          1523:        ot -> ot_info = (caddr_t) esisRDUins;
        !          1524:     if (ot = text2obj ("esisRDUouts"))
        !          1525:        ot -> ot_getfnx = o_esis,
        !          1526:        ot -> ot_info = (caddr_t) esisRDUouts;
        !          1527: }
        !          1528: #else
        !          1529: 
        !          1530: init_clnp () {}
        !          1531: 
        !          1532: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.