|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights ! 7: * Reserved. This file contains Original Code and/or Modifications of ! 8: * Original Code as defined in and that are subject to the Apple Public ! 9: * Source License Version 1.1 (the "License"). You may not use this file ! 10: * except in compliance with the License. Please obtain a copy of the ! 11: * License at http://www.apple.com/publicsource and read it before using ! 12: * this file. ! 13: * ! 14: * The Original Code and all software distributed under the License are ! 15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the ! 19: * License for the specific language governing rights and limitations ! 20: * under the License. ! 21: * ! 22: * @APPLE_LICENSE_HEADER_END@ ! 23: */ ! 24: ! 25: #include <at/nbp.h> ! 26: #include <at/elap.h> ! 27: #include <at/appletalk.h> ! 28: ! 29: # include <h/lap.h> ! 30: ! 31: #define MAX_PHYS_ADDR_SIZE 6 /* maximum physical addr size */ ! 32: #define MAX_IFS 25 /* max # interfaces */ ! 33: #define IF_NAME_SIZE 6 /* max name length of I/F name */ ! 34: #define DDP_ADDR_SIZE 3 ! 35: #define ZONE_SIZE NBP_NVE_STR_SIZE ! 36: #define OBJECT_SIZE NBP_NVE_STR_SIZE ! 37: #define TYPE_SIZE NBP_NVE_STR_SIZE ! 38: #define PORT_DESC_SIZE 50 ! 39: #define UPDATE_IF_CHANGED 1 /* for ioctls */ ! 40: #define UPDATE_UNCONDITIONAL 2 ! 41: #define SNMP_NBP_HEADER_SIZE (sizeof(snmpNbpTable_t) - sizeof(snmpNbpEntry_t)) ! 42: ! 43: typedef struct snmpIfCfg { ! 44: u_short ifc_aarpSize; /* AARP table size for this I/F */ ! 45: u_short ifc_addrSize; /* Mac address size in bytes */ ! 46: u_short ifc_type; /* port type */ ! 47: at_net_al ifc_start; /* net range start */ ! 48: at_net_al ifc_end; /* net range end */ ! 49: struct atalk_addr ifc_ddpAddr; /* ddp address of port */ ! 50: u_short ifc_status; /* port status */ ! 51: u_short ifc_netCfg; ! 52: u_short ifc_zoneCfg; ! 53: at_nvestr_t ifc_zoneName; ! 54: u_short ifc_index; ! 55: char ifc_name[IF_NAME_SIZE]; /* I/F name (e.g. ent0 */ ! 56: } snmpIfCfg_t; ! 57: ! 58: ! 59: typedef struct snmpCfg { ! 60: int pad; /* pad for UPDATE flag when ioctl issued */ ! 61: u_int cfg_flags; /* at_state flags */ ! 62: int cfg_ifCnt; /* # I/F's up */ ! 63: snmpIfCfg_t cfg_ifCfg[MAX_IFS]; ! 64: } snmpCfg_t; ! 65: ! 66: typedef struct snmpAarpEnt { ! 67: struct atalk_addr ap_ddpAddr; ! 68: u_char ap_physAddr[MAX_PHYS_ADDR_SIZE]; ! 69: }snmpAarpEnt_t; ! 70: ! 71: typedef struct snmpAarp { /* aarp info for 1 I/F */ ! 72: time_t at_time; /* the time() we got this table */ ! 73: int at_ifno; /* the (SNMP) I/F number of this table */ ! 74: int at_maxSize; /* allocated size of as_table in entries */ ! 75: int at_usedSize; /* size of at_table used portion */ ! 76: snmpAarpEnt_t *at_table; ! 77: } snmpAarp_t; ! 78: ! 79: typedef struct snmpFlags { ! 80: int lap_changed; /* set when any I/F state changes */ ! 81: int rtmpAdded; /* set when rtmp entry ADDED */ ! 82: int zipAdded; /* set when zip entry ADDED */ ! 83: } snmpFlags_t; ! 84: ! 85: typedef struct snmpNbpEntry { ! 86: at_nvestr_t nbpe_object; ! 87: at_nvestr_t nbpe_type; ! 88: }snmpNbpEntry_t; ! 89: ! 90: typedef struct snmpNbpTable { ! 91: int nbpt_entries; ! 92: at_nvestr_t nbpt_zone; ! 93: snmpNbpEntry_t nbpt_table[1]; ! 94: }snmpNbpTable_t; ! 95: ! 96: ! 97: ! 98: ! 99: typedef struct snmpStats { ! 100: ! 101: /* ddp group */ ! 102: u_int dd_outReq; ! 103: u_int dd_outShort; ! 104: u_int dd_outLong; ! 105: u_int dd_inTotal; ! 106: u_int dd_fwdReq; ! 107: u_int dd_inLocal; ! 108: u_int dd_noHandler; ! 109: u_int dd_noRoutes; ! 110: u_int dd_tooShort; ! 111: u_int dd_tooLong; ! 112: u_int dd_inBcastErr; ! 113: u_int dd_shortErr; ! 114: u_int dd_hopCount; ! 115: u_int dd_checkSum; ! 116: ! 117: /* ATEcho group */ ! 118: ! 119: u_int ec_echoReq; ! 120: u_int ec_echoReply; ! 121: } snmpStats_t; ! 122: ! 123: #define SNMP_TYPE_OTHER 1 ! 124: #define SNMP_TYPE_LOCAL 2 ! 125: #define SNMP_TYPE_ETHER1 3 ! 126: #define SNMP_TYPE_ETHER2 4 ! 127: #define SNMP_TYPE_TOKEN 5 ! 128: #define SNMP_TYPE_IP 6 ! 129: #define SNMP_TYPE_SERIALPPP 7 ! 130: #define SNMP_TYPE_SERIALNONSTD 8 ! 131: #define SNMP_TYPE_VIRTUAL 9 ! 132: #define SNMP_CFG_CONFIGURED 1 ! 133: #define SNMP_CFG_GARNERED 2 ! 134: #define SNMP_CFG_GUESSED 3 ! 135: #define SNMP_CFG_UNCONFIG 4 ! 136: ! 137: #define SNMP_OBJ_TYPE_AARP 0x0100 ! 138: #define SNMP_OBJ_TYPE_ECHO 0x0200 ! 139: #define SNMP_OBJ_TYPE_PORT 0x0300 ! 140: #define SNMP_OBJ_TYPE_DDP 0x0400 ! 141: #define SNMP_OBJ_TYPE_RTMP 0x0500 ! 142: #define SNMP_OBJ_TYPE_ZIP 0x0600 ! 143: #define SNMP_OBJ_TYPE_NBP 0x0700 ! 144: #define SNMP_OBJ_TYPE_MASK 0x0f00 ! 145: ! 146: #define AARPIFINDEX 2 + SNMP_OBJ_TYPE_AARP ! 147: #define AARPNETADDRESS 3 + SNMP_OBJ_TYPE_AARP ! 148: #define AARPPHYSADDRESS 4 + SNMP_OBJ_TYPE_AARP ! 149: #define ATECHOREPLIES 6 + SNMP_OBJ_TYPE_AARP ! 150: #define ATECHOREQUESTS 7 + SNMP_OBJ_TYPE_AARP ! 151: #define ATPORTDESCR 8 + SNMP_OBJ_TYPE_PORT ! 152: #define ATPORTIFINDEX 10 + SNMP_OBJ_TYPE_PORT ! 153: #define ATPORTINDEX 11 + SNMP_OBJ_TYPE_PORT ! 154: #define ATPORTNETADDRESS 12 + SNMP_OBJ_TYPE_PORT ! 155: #define ATPORTNETCONFIG 13 + SNMP_OBJ_TYPE_PORT ! 156: #define ATPORTNETEND 14 + SNMP_OBJ_TYPE_PORT ! 157: #define ATPORTNETSTART 15 + SNMP_OBJ_TYPE_PORT ! 158: #define ATPORTSTATUS 16 + SNMP_OBJ_TYPE_PORT ! 159: #define ATPORTTYPE 18 + SNMP_OBJ_TYPE_PORT ! 160: #define ATPORTZONE 19 + SNMP_OBJ_TYPE_PORT ! 161: #define ATPORTZONECONFIG 20 + SNMP_OBJ_TYPE_PORT ! 162: #define DDPBROADCASTERRORS 21 + SNMP_OBJ_TYPE_DDP ! 163: #define DDPCHECKSUMERRORS 22 + SNMP_OBJ_TYPE_DDP ! 164: #define DDPFORWREQUESTS 23 + SNMP_OBJ_TYPE_DDP ! 165: #define DDPHOPCOUNTERRORS 24 + SNMP_OBJ_TYPE_DDP ! 166: #define DDPINLOCALDATAGRAMS 25 + SNMP_OBJ_TYPE_DDP ! 167: #define DDPINRECEIVES 26 + SNMP_OBJ_TYPE_DDP ! 168: #define DDPNOPROTOCOLHANDLERS 27 + SNMP_OBJ_TYPE_DDP ! 169: #define DDPOUTLONGS 28 + SNMP_OBJ_TYPE_DDP ! 170: #define DDPOUTNOROUTES 29 + SNMP_OBJ_TYPE_DDP ! 171: #define DDPOUTREQUESTS 30 + SNMP_OBJ_TYPE_DDP ! 172: #define DDPOUTSHORTS 31 + SNMP_OBJ_TYPE_DDP ! 173: #define DDPSHORTDDPERRORS 32 + SNMP_OBJ_TYPE_DDP ! 174: #define DDPTOOLONGERRORS 33 + SNMP_OBJ_TYPE_DDP ! 175: #define DDPTOOSHORTERRORS 34 + SNMP_OBJ_TYPE_DDP ! 176: #define KIPBCASTADDR 35 ! 177: #define KIPCORE 36 ! 178: #define KIPENTRY 37 ! 179: #define KIPHOPCOUNT 38 ! 180: #define KIPNETEND 39 ! 181: #define KIPNETSTART 40 ! 182: #define KIPNEXTHOP 41 ! 183: #define KIPSHARE 42 ! 184: #define KIPSTATE 43 ! 185: #define KIPTABLE 44 ! 186: #define KIPTYPE 45 ! 187: #define LLAPCOLLISIONS 46 ! 188: #define LLAPDEFERS 47 ! 189: #define LLAPENTRY 48 ! 190: #define LLAPFCSERRORS 49 ! 191: #define LLAPIFINDEX 50 ! 192: #define LLAPINERRORS 51 ! 193: #define LLAPINLENGTHERRORS 52 ! 194: #define LLAPINNOHANDLERS 53 ! 195: #define LLAPINPKTS 54 ! 196: #define LLAPNODATAERRORS 55 ! 197: #define LLAPOUTPKTS 56 ! 198: #define LLAPRANDOMCTSERRORS 57 ! 199: #define NBPINDEX 60 + SNMP_OBJ_TYPE_NBP ! 200: #define NBPOBJECT 61 + SNMP_OBJ_TYPE_NBP ! 201: #define NBPSTATE 62 + SNMP_OBJ_TYPE_NBP ! 202: #define NBPTABLE 63 + SNMP_OBJ_TYPE_NBP ! 203: #define NBPTYPE 64 + SNMP_OBJ_TYPE_NBP ! 204: #define NBPZONE 65 + SNMP_OBJ_TYPE_NBP ! 205: #define RTMPHOPS 67 + SNMP_OBJ_TYPE_RTMP ! 206: #define RTMPNEXTHOP 68 + SNMP_OBJ_TYPE_RTMP ! 207: #define RTMPPORT 69 + SNMP_OBJ_TYPE_RTMP ! 208: #define RTMPRANGEEND 70 + SNMP_OBJ_TYPE_RTMP ! 209: #define RTMPRANGESTART 71 + SNMP_OBJ_TYPE_RTMP ! 210: #define RTMPSTATE 72 + SNMP_OBJ_TYPE_RTMP ! 211: #define RTMPTYPE 74 + SNMP_OBJ_TYPE_RTMP ! 212: #define ZIPZONEINDEX 77 + SNMP_OBJ_TYPE_ZIP ! 213: #define ZIPZONENAME 78 + SNMP_OBJ_TYPE_ZIP ! 214: #define ZIPZONENETEND 79 + SNMP_OBJ_TYPE_ZIP ! 215: #define ZIPZONENETSTART 80 + SNMP_OBJ_TYPE_ZIP ! 216: #define ZIPZONESTATE 81 + SNMP_OBJ_TYPE_ZIP ! 217: ! 218: #define SNMP_TYPE(var,type) ((var & SNMP_OBJ_TYPE_MASK) == type)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.