m2Lib.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:43k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* m2Lib.h - VxWorks MIB-II interface to SNMP Agent */
  2. /* Copyright 1984 - 2002 Wind River Systems, Inc. */
  3. #include "copyright_wrs.h"
  4. /*
  5. modification history
  6. --------------------
  7. 01i,22apr02,rae  Fixed MAXOIDLENGH typo (SPR #73303)
  8. 01h,05dec01,vvv  changed M2_IFSTACKTBL index to unsigned (SPR #71316)
  9. 01g,10oct01,rae  merge from truestack ver 01n, base o1f
  10. 01f,25oct00,niq  Merge RFC2233 changes from open_stack-p1-r1 branch
  11. 01j,18may00,ann  merging from post R1 to include RFC2233 and the ipRouteMask
  12.                  bug fix
  13. 01i,14apr00,ann  adding changes to make ipRouteMask writeable
  14. 01h,28mar00,rae  merging in IGMPv2 changes
  15. 01g,10mar00,ead  added function declaration for m2IfStackTblUpdate
  16. 01f,11feb00,ann  making changes for RFC 2233 implementation
  17. 01e,24mar99,ead  added m2SetIfLastChange() declaration (SPR #23290)
  18. 01d,10sep98,ann  added doc to M2_INTERFACETBL fields spr# 21078
  19. 01c,11apr97,rjc  fixed bad value of error define
  20. 01b,05feb97,rjc  added new error codes to support phase-2 ospf mib  
  21. 01a,08dec93,jag  written
  22. */
  23. #ifndef __INCm2Libh
  24. #define __INCm2Libh
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. #include "net/if.h"
  29. #include "avlLib.h"
  30. #if ((CPU_FAMILY==I960) && (defined __GNUC__))
  31. #pragma align 1                 /* tell gcc960 not to optimize alignments */
  32. #endif  /* CPU_FAMILY==I960 */
  33. /* m2Lib.c Error Codes */
  34. #define S_m2Lib_INVALID_PARAMETER               (M_m2Lib | 1)
  35. #define S_m2Lib_ENTRY_NOT_FOUND (M_m2Lib | 2)
  36. #define S_m2Lib_TCPCONN_FD_NOT_FOUND (M_m2Lib | 3)
  37. #define S_m2Lib_INVALID_VAR_TO_SET (M_m2Lib | 4)
  38. #define S_m2Lib_CANT_CREATE_SYS_SEM (M_m2Lib | 5)
  39. #define S_m2Lib_CANT_CREATE_IF_SEM (M_m2Lib | 6)
  40. #define S_m2Lib_CANT_CREATE_ROUTE_SEM (M_m2Lib | 7)
  41. #define S_m2Lib_ARP_PHYSADDR_NOT_SPECIFIED (M_m2Lib | 8)
  42. #define S_m2Lib_IF_TBL_IS_EMPTY (M_m2Lib | 9)
  43. #define S_m2Lib_IF_CNFG_CHANGED (M_m2Lib | 10)
  44. #define S_m2Lib_TOO_BIG                         (M_m2Lib | 11)
  45. #define S_m2Lib_BAD_VALUE                       (M_m2Lib | 12)
  46. #define S_m2Lib_READ_ONLY                       (M_m2Lib | 13)
  47. #define S_m2Lib_GEN_ERR                         (M_m2Lib | 14)
  48. #define   ETHERADDRLEN            6
  49. #define   M2DISPLAYSTRSIZE 256
  50. #define   MAXOIDLENGTH           40
  51. #define   MAXIFPHYADDR  16
  52. /* defines for enumerated types as specified by RFC 1213 */
  53. /* possible values for ifType (found in IANA-MIB) */
  54. #define M2_ifType_other                  1   /* none of the following */
  55. #define M2_ifType_regular1822            2
  56. #define M2_ifType_hdh1822                3
  57. #define M2_ifType_ddnX25                 4
  58. #define M2_ifType_rfc877x25              5
  59. #define M2_ifType_ethernetCsmacd         6
  60. #define M2_ifType_ethernet_csmacd        M2_ifType_ethernetCsmacd
  61. #define M2_ifType_iso88023Csmacd         7
  62. #define M2_ifType_iso88023_csmacd        M2_ifType_iso88023Csmacd
  63. #define M2_ifType_iso88024TokenBus       8
  64. #define M2_ifType_iso88024_tokenBus      M2_ifType_iso88024TokenBus
  65. #define M2_ifType_iso88025TokenRing      9
  66. #define M2_ifType_iso88025_tokenRing     M2_ifType_iso88025TokenRing
  67. #define M2_ifType_iso88026Man            10
  68. #define M2_ifType_iso88026_man           M2_ifType_iso88026Man
  69. #define M2_ifType_starLan                11
  70. #define M2_ifType_proteon10Mbit          12
  71. #define M2_ifType_proteon80Mbit          13
  72. #define M2_ifType_hyperchannel           14
  73. #define M2_ifType_fddi                   15
  74. #define M2_ifType_lapb                   16
  75. #define M2_ifType_sdlc                   17
  76. #define M2_ifType_ds1                    18  /* DS1-MIB */
  77. #define M2_ifType_e1                     19  /* Obsolete see DS1-MIB */
  78. #define M2_ifType_basicISDN              20
  79. #define M2_ifType_primaryISDN            21
  80. #define M2_ifType_propPointToPointSerial 22  /* proprietary serial */
  81. #define M2_ifType_ppp                    23
  82. #define M2_ifType_softwareLoopback       24
  83. #define M2_ifType_eon                    25  /* CLNP over IP */
  84. #define M2_ifType_ethernet3Mbit          26
  85. #define M2_ifType_nsip                   27  /* XNS over IP */
  86. #define M2_ifType_slip                   28  /* generic SLIP */
  87. #define M2_ifType_ultra                  29  /* ULTRA technologies */
  88. #define M2_ifType_ds3                    30  /* DS3-MIB */
  89. #define M2_ifType_sip                    31  /* SMDS, coffee */
  90. #define M2_ifType_frameRelay             32  /* DTE only. */
  91. #define M2_ifType_rs232                  33
  92. #define M2_ifType_para                   34  /* parallel-port */
  93. #define M2_ifType_arcnet                 35  /* arcnet */
  94. #define M2_ifType_arcnetPlus             36  /* arcnet plus */
  95. #define M2_ifType_atm                    37  /* ATM cells */
  96. #define M2_ifType_miox25                 38
  97. #define M2_ifType_sonet                  39  /* SONET or SDH */
  98. #define M2_ifType_x25ple                 40
  99. #define M2_ifType_iso88022llc            41
  100. #define M2_ifType_localTalk              42
  101. #define M2_ifType_smdsDxi                43
  102. #define M2_ifType_frameRelayService      44  /* FRNETSERV-MIB */
  103. #define M2_ifType_v35                    45
  104. #define M2_ifType_hssi                   46
  105. #define M2_ifType_hippi                  47
  106. #define M2_ifType_modem                  48  /* Generic modem */
  107. #define M2_ifType_aal5                   49  /* AAL5 over ATM */
  108. #define M2_ifType_sonetPath              50
  109. #define M2_ifType_sonetVT                51
  110. #define M2_ifType_smdsIcip               52  /* SMDS InterCarrier Interface */
  111. #define M2_ifType_propVirtual            53  /* proprietary virtual/internal */
  112. #define M2_ifType_propMultiplexor        54  /* proprietary multiplexing */
  113. #define M2_ifType_ieee80212              55  /* 100BaseVG */
  114. #define M2_ifType_fibreChannel           56  /* Fibre Channel */
  115. #define M2_ifType_hippiInterface         57  /* HIPPI interfaces */
  116. #define M2_ifType_frameRelayInterconnect 58  /* Obsolete use either 32 or 44 */
  117. #define M2_ifType_aflane8023             59  /* ATM Emulated LAN for 802.3 */
  118. #define M2_ifType_aflane8025             60  /* ATM Emulated LAN for 802.5 */
  119. #define M2_ifType_cctEmul                61  /* ATM Emulated circuit */
  120. #define M2_ifType_fastEther              62  /* Fast Ethernet (100BaseT) */
  121. #define M2_ifType_isdn                   63  /* ISDN and X.25 */
  122. #define M2_ifType_v11                    64  /* CCITT V.11/X.21 */
  123. #define M2_ifType_v36                    65  /* CCITT V.36 */
  124. #define M2_ifType_g703at64k              66  /* CCITT G703 at 64Kbps */
  125. #define M2_ifType_g703at2mb              67  /* Obsolete see DS1-MIB */
  126. #define M2_ifType_qllc                   68  /* SNA QLLC */
  127. #define M2_ifType_fastEtherFX            69  /* Fast Ethernet (100BaseFX) */
  128. #define M2_ifType_channel                70  /* channel */
  129. #define M2_ifType_ieee80211              71  /* radio spread spectrum */
  130. #define M2_ifType_ibm370parChan          72  /* IBM 360/370 OEMI Channel */
  131. #define M2_ifType_escon                  73  /* IBM Enterprise Systems Cnx */
  132. #define M2_ifType_dlsw                   74  /* Data Link Switching */
  133. #define M2_ifType_isdns                  75  /* ISDN S/T interface */
  134. #define M2_ifType_isdnu                  76  /* ISDN U interface */
  135. #define M2_ifType_lapd                   77  /* Link Access Protocol D */
  136. #define M2_ifType_ipSwitch               78  /* IP Switching Objects */
  137. #define M2_ifType_rsrb                   79  /* Remote Source Route Bridging */
  138. #define M2_ifType_atmLogical             80  /* ATM Logical Port */
  139. #define M2_ifType_ds0                    81  /* Digital Signal Level 0 */
  140. #define M2_ifType_ds0Bundle              82  /* ds0s on the same ds1 */
  141. #define M2_ifType_bsc                    83  /* Bisynchronous Protocol */
  142. #define M2_ifType_async                  84  /* Asynchronous Protocol */
  143. #define M2_ifType_cnr                    85  /* Combat Net Radio */
  144. #define M2_ifType_iso88025Dtr            86  /* ISO 802.5r DTR */
  145. #define M2_ifType_eplrs                  87  /* Ext Pos Loc Report Sys */
  146. #define M2_ifType_arap                   88  /* Appletalk Remote Access Proto */
  147. #define M2_ifType_propCnls               89  /* Proprietary Cnx-less Proto */
  148. #define M2_ifType_hostPad                90  /* CCITT-ITU X.29 PAD Protocol */
  149. #define M2_ifType_termPad                91  /* CCITT-ITU X.3 PAD Facility */
  150. #define M2_ifType_frameRelayMPI          92  /* Multiproto Interconnect FR */
  151. #define M2_ifType_x213                   93  /* CCITT-ITU X213 */
  152. #define M2_ifType_adsl                   94  /* Asymmetric DSL */
  153. #define M2_ifType_radsl                  95  /* Rate-Adapt. DSL */
  154. #define M2_ifType_sdsl                   96  /* Symmetric DSL */
  155. #define M2_ifType_vdsl                   97  /* Very H-Speed DSL */
  156. #define M2_ifType_iso88025CRFPInt        98  /* ISO 802.5 CRFP */
  157. #define M2_ifType_myrinet                99  /* Myricom Myrinet */
  158. #define M2_ifType_voiceEM                100 /* voice recEive and transMit */
  159. #define M2_ifType_voiceFXO               101 /* voice Foreign Exchg Office */
  160. #define M2_ifType_voiceFXS               102 /* voice Foreign Exchg Station */
  161. #define M2_ifType_voiceEncap             103 /* voice encapsulation */
  162. #define M2_ifType_voiceOverIp            104 /* voice over IP encapsulation */
  163. #define M2_ifType_atmDxi                 105 /* ATM DXI */
  164. #define M2_ifType_atmFuni                106 /* ATM FUNI */
  165. #define M2_ifType_atmIma                 107 /* ATM IMA */
  166. #define M2_ifType_pppMultilinkBundle     108 /* PPP Multilink Bundle */
  167. #define M2_ifType_ipOverCdlc             109 /* IBM ipOverCdlc */
  168. #define M2_ifType_ipOverClaw             110 /* IBM Common Link Access */
  169. #define M2_ifType_stackToStack           111 /* IBM stackToStack */
  170. #define M2_ifType_virtualIpAddress       112 /* IBM VIPA */
  171. #define M2_ifType_mpc                    113 /* IBM multi-protocol channel */
  172. #define M2_ifType_ipOverAtm              114 /* IBM ipOverAtm */
  173. #define M2_ifType_iso88025Fiber          115 /* ISO 802.5j Fiber Token Ring */
  174. #define M2_ifType_tdlc                   116 /* IBM twinaxial data link */
  175. #define M2_ifType_gigabitEthernet        117 /* Gigabit Ethernet */
  176. #define M2_ifType_hdlc                   118 /* HDLC */
  177. #define M2_ifType_lapf                   119 /* LAP F */
  178. #define M2_ifType_v37                    120 /* V.37 */
  179. #define M2_ifType_x25mlp                 121 /* Multi-Link Protocol */
  180. #define M2_ifType_x25huntGroup           122 /* X25 Hunt Group */
  181. #define M2_ifType_trasnpHdlc             123 /* Transp HDLC */
  182. #define M2_ifType_interleave             124 /* Interleave channel */
  183. #define M2_ifType_fast                   125 /* Fast channel */
  184. #define M2_ifType_ip                     126 /* IP (APPN HPR in IP networks) */
  185. #define M2_ifType_docsCableMaclayer      127 /* CATV Mac Layer */
  186. #define M2_ifType_docsCableDownstream    128 /* CATV Downstream interface */
  187. #define M2_ifType_docsCableUpstream      129 /* CATV Upstream interface */
  188. #define M2_ifType_a12MppSwitch           130 /* Avalon Parallel Processor */
  189. #define M2_ifType_tunnel                 131 /* Encapsulation interface */
  190. #define M2_ifType_coffee                 132 /* coffee pot */
  191. #define M2_ifType_ces                    133 /* Circuit Emulation Service */
  192. #define M2_ifType_atmSubInterface        134 /* ATM Sub Interface */
  193. #define M2_ifType_l2vlan                 135 /* Layer 2 V-LAN using 802.1Q */
  194. #define M2_ifType_l3ipvlan               136 /* Layer 3 V-LAN using IP */
  195. #define M2_ifType_l3ipxvlan              137 /* Layer 3 V-LAN using IPX */
  196. #define M2_ifType_digitalPowerline       138 /* IP over Power Lines */
  197. #define M2_ifType_mediaMailOverIp        139 /* Multimedia Mail over IP */
  198. #define M2_ifType_dtm                    140 /* Dynamic sync Transfer Mode */
  199. #define M2_ifType_dcn                    141 /* Data Communications Network */
  200. #define M2_ifType_ipForward              142 /* IP Forwarding Interface */
  201. #define M2_ifType_msdsl                  143 /* Multi-rate Symmetric DSL */
  202. #define M2_ifType_ieee1394               144 /* IEEE1394 High Perf Serial Bus */
  203. #define M2_ifType_if_gsn                 145 /* HIPPI-6400 */
  204. #define M2_ifType_dvbRccMacLayer         146 /* DVB-RCC MAC Layer */
  205. #define M2_ifType_dvbRccDownstream       147 /* DVB-RCC Downstream Channel */
  206. #define M2_ifType_dvbRccUpstream         148 /* DVB-RCC Upstream Channel */
  207. #define M2_ifType_atmVirtual             149 /* ATM Virtual Interface */
  208. #define M2_ifType_mplsTunnel             150 /* MPLS Tunnel Virtual Interface */
  209. #define M2_ifType_srp                    151 /* Spatial Reuse Protocol */
  210. #define M2_ifType_voiceOverAtm           152 /* Voice Over ATM */
  211. #define M2_ifType_voiceOverFrameRelay    153 /* Voice Over Frame Relay */
  212. #define M2_ifType_idsl                   154 /* DSL over ISDN */
  213. #define M2_ifType_compositeLink          155 /* Avici Composite Link */
  214. #define M2_ifType_ss7SigLink             156 /* SS7 Signaling Link */
  215. #define M2_ifType_pmp                    157 /* Point to Multipoint */
  216. /* packet control used for stat counting routines (in or out) */
  217. #define M2_PACKET_IN    1
  218. #define M2_PACKET_OUT   2
  219. /* interface attach/insert and detach/remove */
  220. #define M2_IF_TABLE_INSERT 1
  221. #define M2_IF_TABLE_REMOVE 2
  222. /* stack layer insert/remove */
  223. #define M2_STACK_TABLE_INSERT 1
  224. #define M2_STACK_TABLE_REMOVE 2
  225. /* interface mib styles used by the MUX/drivers */
  226. #define MIB_STYLE_1213 1
  227. #define MIB_STYLE_2233 2
  228. /* interface counter IDs */
  229. #define M2_ctrId_ifInOctets            1
  230. #define M2_ctrId_ifInUcastPkts         2
  231. #define M2_ctrId_ifInNUcastPkts        3
  232. #define M2_ctrId_ifInDiscards          4
  233. #define M2_ctrId_ifInErrors            5
  234. #define M2_ctrId_ifInUnknownProtos     6
  235. #define M2_ctrId_ifOutOctets           7
  236. #define M2_ctrId_ifOutUcastPkts        8
  237. #define M2_ctrId_ifOutNUcastPkts       9
  238. #define M2_ctrId_ifOutDiscards         10
  239. #define M2_ctrId_ifOutErrors           11
  240. #define M2_ctrId_ifInMulticastPkts     12
  241. #define M2_ctrId_ifInBroadcastPkts     13
  242. #define M2_ctrId_ifOutMulticastPkts    14
  243. #define M2_ctrId_ifOutBroadcastPkts    15
  244. #define M2_ctrId_ifHCInOctets          16
  245. #define M2_ctrId_ifHCInUcastPkts       17
  246. #define M2_ctrId_ifHCInMulticastPkts   18
  247. #define M2_ctrId_ifHCInBroadcastPkts   19
  248. #define M2_ctrId_ifHCOutOctets         20
  249. #define M2_ctrId_ifHCOutUcastPkts      21
  250. #define M2_ctrId_ifHCOutMulticastPkts  22
  251. #define M2_ctrId_ifHCOutBroadcastPkts  23
  252. /* interface variable IDs */
  253. #define M2_varId_ifAdminStatus               1
  254. #define M2_varId_ifLinkUpDownTrapEnable      2
  255. #define M2_varId_ifMtu                       3
  256. #define M2_varId_ifPromiscuousMode           4
  257. #define M2_varId_ifPhysAddress               5
  258. #define M2_varId_ifDescr                     6
  259. #define M2_varId_ifOperStatus                7
  260. #define M2_varId_ifAlias                     8
  261. #define M2_varId_ifOutQLen                   9
  262. #define M2_varId_ifSpecific                  10
  263. #define M2_varId_ifName                      11
  264. #define M2_varId_ifType                      12
  265. #define M2_varId_ifHighSpeed                 13
  266. #define M2_varId_ifSpeed                     14
  267. #define M2_varId_ifConnectorPresent          15
  268. #define M2_varId_ifLastChange                16
  269. /* possible values for ifAdminStatus */
  270. #define M2_ifAdminStatus_up            1
  271. #define M2_ifAdminStatus_down 2
  272. #define M2_ifAdminStatus_testing         3
  273. /* possible values for ifOperStatus */
  274. #define M2_ifOperStatus_up               1
  275. #define M2_ifOperStatus_down             2
  276. #define M2_ifOperStatus_testing          3
  277. /* possible values for ifPromiscuousMode */
  278. #define M2_ifPromiscuousMode_on                         1
  279. #define M2_ifPromiscuousMode_off                        2
  280. /* Row Status defines */
  281. #define ROW_ACTIVE                                      1
  282. #define ROW_NOTINSERVICE                                2
  283. #define ROW_NOTREADY                                    3
  284. #define ROW_CREATEANDGO                                 4
  285. #define ROW_CREATEANDWAIT                               5
  286. #define ROW_DESTROY                                     6
  287. /* Storage type defines */
  288. #define STORAGE_OTHER                                   1
  289. #define STORAGE_VOLATILE                                2
  290. #define STORAGE_NONVOLATILE                             3    
  291. /* Boolean Values */
  292. #define M2_TRUE                                         1
  293. #define M2_FALSE                                        2
  294. /* defines for all the objects in the interface table */
  295. #define M2_IFLASTCHANGE                                 1
  296. #define M2_IFINOCTETS                                   2
  297. #define M2_IFINUCASTPKTS                                3
  298. #define M2_IFINNUCASTPKTS                               4
  299. #define M2_IFINDISCARDS                                 5
  300. #define M2_IFINERRORS                                   6
  301. #define M2_IFINUNKNOWNPROTOS                            7
  302. #define M2_IFOUTOCTETS                                  8
  303. #define M2_IFOUTUCASTPKTS                               9
  304. #define M2_IFOUTNUCASTPKTS                              10
  305. #define M2_IFOUTDISCARDS                                11
  306. #define M2_IFOUTERRORS                                  12
  307. #define M2_IFOUTQLEN                                    13
  308. #define M2_IFINMULTICASTPKTS                            14
  309. #define M2_IFINBROADCASTPKTS                            15
  310. #define M2_IFOUTMULTICASTPKTS                           16
  311. #define M2_IFOUTBROADCASTPKTS                           17
  312. #define M2_IFHCINOCTETS                                 18
  313. #define M2_IFHCINUCASTPKTS                              19
  314. #define M2_IFHCINMULTICASTPKTS                          20
  315. #define M2_IFHCINBROADCASTPKTS                          21
  316. #define M2_IFHCOUTOCTETS                                22
  317. #define M2_IFHCOUTUCASTPKTS                             23
  318. #define M2_IFHCOUTMULTICASTPKTS                         24
  319. #define M2_IFHCOUTBROADCASTPKTS                         25
  320. #define M2_IFLINKUPDOWNTRAPENABLE                       26
  321. #define M2_IFHIGHSPEED                                  27
  322. #define M2_IFPROMISCUOUSMODE                            28
  323. #define M2_IFCONNECTORPRESENT                           29
  324. /* defines for rcvAddr table entries */
  325. #define M2_IFRCVADDRSTATUS                              1
  326. #define M2_IFRCVADDRTYPE                                2
  327. /* possible values for  ipForwarding */
  328. #define M2_ipForwarding_forwarding       1
  329. #define M2_ipForwarding_not_forwarding   2
  330. /* possible values for ipRouteType */
  331. #define M2_ipRouteType_other             1
  332. #define M2_ipRouteType_invalid           2
  333. #define M2_ipRouteType_direct            3
  334. #define M2_ipRouteType_indirect          4
  335. /* possible values for ipRouteProto */
  336. #define M2_ipRouteProto_other            1
  337. #define M2_ipRouteProto_local            2
  338. #define M2_ipRouteProto_netmgmt          3
  339. #define M2_ipRouteProto_icmp             4
  340. #define M2_ipRouteProto_egp              5
  341. #define M2_ipRouteProto_ggp              6
  342. #define M2_ipRouteProto_hello            7
  343. #define M2_ipRouteProto_rip              8
  344. #define M2_ipRouteProto_is_is            9
  345. #define M2_ipRouteProto_es_is 10
  346. #define M2_ipRouteProto_ciscoIgrp 11
  347. #define M2_ipRouteProto_bbnSpfIgp 12
  348. #define M2_ipRouteProto_ospf 13
  349. #define M2_ipRouteProto_bgp      14
  350. /* possible values for ipNetToMediaType */
  351. #define M2_ipNetToMediaType_other 1
  352. #define M2_ipNetToMediaType_invalid      2
  353. #define M2_ipNetToMediaType_dynamic      3
  354. #define M2_ipNetToMediaType_static       4
  355. /* possible values for tcpRtoAlgorithm */
  356. #define M2_tcpRtoAlgorithm_other         1
  357. #define M2_tcpRtoAlgorithm_constant      2
  358. #define M2_tcpRtoAlgorithm_rsre          3
  359. #define M2_tcpRtoAlgorithm_vanj          4
  360. /* possible values for tcpConnState */
  361. #define M2_tcpConnState_closed           1
  362. #define M2_tcpConnState_listen           2
  363. #define M2_tcpConnState_synSent          3
  364. #define M2_tcpConnState_synReceived      4
  365. #define M2_tcpConnState_established      5
  366. #define M2_tcpConnState_finWait1         6
  367. #define M2_tcpConnState_finWait2         7
  368. #define M2_tcpConnState_closeWait        8
  369. #define M2_tcpConnState_lastAck          9
  370. #define M2_tcpConnState_closing          10
  371. #define M2_tcpConnState_timeWait         11
  372. #define M2_tcpConnState_deleteTCB        12
  373. /*
  374.  * When using vxWorks SNMP this constants must have the same value as NEXT and
  375.  * EXACT
  376.  */
  377. #define M2_EXACT_VALUE       0xA0
  378. #define M2_NEXT_VALUE           0xA1 
  379.                                              /* defines for IGMP varToSet */
  380. #define M2_var_igmpInterfaceQueryInterval                1
  381. #define M2_var_igmpInterfaceStatus                       2
  382. #define M2_var_igmpInterfaceVersion                      4
  383. #define M2_var_igmpInterfaceQueryMaxResponseTime         8
  384. #define M2_var_igmpInterfaceRobustness                  16 
  385. #define M2_var_igmpInterfaceLastMembQueryIntvl          32
  386. /* IGMP defines from leaf.h generated file */
  387. #define LEAF_igmpInterfaceIfIndex 1
  388. #define MIN_igmpInterfaceIfIndex 1L
  389. #define MAX_igmpInterfaceIfIndex 2147483647L
  390. #define LEAF_igmpInterfaceQueryInterval 2
  391. #define LEAF_igmpInterfaceStatus 3
  392. #define VAL_igmpInterfaceStatus_active 1L
  393. #define VAL_igmpInterfaceStatus_notInService 2L
  394. #define VAL_igmpInterfaceStatus_notReady 3L
  395. #define VAL_igmpInterfaceStatus_createAndGo 4L
  396. #define VAL_igmpInterfaceStatus_createAndWait 5L
  397. #define VAL_igmpInterfaceStatus_destroy 6L
  398. #define LEAF_igmpInterfaceVersion 4
  399. #define LEAF_igmpInterfaceQuerier 5
  400. #define LEAF_igmpInterfaceQueryMaxResponseTime 6
  401. #define LEAF_igmpInterfaceVersion1QuerierTimer 9
  402. #define LEAF_igmpInterfaceWrongVersionQueries 10
  403. #define LEAF_igmpInterfaceJoins 11
  404. #define LEAF_igmpInterfaceGroups 13
  405. #define LEAF_igmpInterfaceRobustness 14
  406. #define LEAF_igmpInterfaceLastMembQueryIntvl 15
  407. #define LEAF_igmpInterfaceProxyIfIndex 16
  408. #define MIN_igmpInterfaceProxyIfIndex 0L
  409. #define MAX_igmpInterfaceProxyIfIndex 2147483647L
  410. #define LEAF_igmpInterfaceQuerierUpTime 17
  411. #define LEAF_igmpInterfaceQuerierExpiryTime 18
  412. #define LEAF_igmpCacheAddress 1
  413. #define LEAF_igmpCacheIfIndex 2
  414. #define MIN_igmpCacheIfIndex 1L
  415. #define MAX_igmpCacheIfIndex 2147483647L
  416. #define LEAF_igmpCacheSelf 3
  417. #define VAL_igmpCacheSelf_true 1L
  418. #define VAL_igmpCacheSelf_false 2L
  419. #define LEAF_igmpCacheLastReporter 4
  420. #define LEAF_igmpCacheUpTime 5
  421. #define LEAF_igmpCacheExpiryTime 6
  422. #define LEAF_igmpCacheStatus 7
  423. #define VAL_igmpCacheStatus_active 1L
  424. #define VAL_igmpCacheStatus_notInService 2L
  425. #define VAL_igmpCacheStatus_notReady 3L
  426. #define VAL_igmpCacheStatus_createAndGo 4L
  427. #define VAL_igmpCacheStatus_createAndWait 5L
  428. #define VAL_igmpCacheStatus_destroy 6L
  429. #define LEAF_igmpCacheVersion1HostTimer 8
  430. /* simple type used for imitating 64 bit integers */
  431. typedef struct ui64
  432.     {
  433.     UINT high;
  434.     UINT low;
  435.     } UI64;
  436. /*
  437.  * UI64_ZERO - Zero a UI64 struct
  438.  *
  439.  * PARAMETERS:  UI64 * Pointer to the object to be zeroed.
  440.  */
  441. #define UI64_ZERO(N) (N)->high = (N)->low = 0L
  442. /*
  443.  * UI64_ADD32 - Add a UINT to a UI64
  444.  * 
  445.  * PARAMETERS:  UI64 * pointer to the object to be updated
  446.  *              UINT   the quantity to add in.
  447.  * 
  448.  * RESTRICTIONS: This routine will wrap the object if necessary and not give
  449.  *               any warning about having done so.
  450.  */
  451. #define UI64_ADD32(N, I) (N)->low += I; if ((N)->low < I) (N)->high++
  452. /*
  453.  * UI64_SUB64 - Subtract two UI64s
  454.  *
  455.  * PARAMETERS:  UI64 * the result goes here
  456.  *              UI64 * Subtract from this object
  457.  *              UI64 * the object to subtract
  458.  *
  459.  * RESTRICTIONS: This routine will wrap the object if necessary and not give
  460.  *               any warning about having done so.
  461.  */
  462. #define UI64_SUB64(X, Y, Z)  (X)->low = (Y)->low - (Z)->low; 
  463.                                    (X)->high = (Y)->high - (Z)->high; 
  464.                                    if ((X)->low > (Y)->low) (X)->high-- 
  465. /*
  466.  * UI64_COPY - Copy one UI64 to another
  467.  *
  468.  * PARAMETERS:  UI64 * the result goes here
  469.  *              UI64 * copy from this object
  470.  */
  471. #define UI64_COPY(X, Y)  (X)->low = (Y)->low; (X)->high = (Y)->high
  472. /*
  473.  * UI64_COMP - Compare two UI64s
  474.  *
  475.  * PARAMETERS:  UI64 * The two objects to compare
  476.  *              UI64 * 
  477.  *
  478.  * RETURNS:  < 0 if the first is smaller than the second
  479.  *           > 0 if the first is greater than the second
  480.  *             0 if they are equal.
  481.  */
  482. #define UI64_COMP(X, Y) 
  483.   (((X)->high == (Y)->high) ? 
  484.    (((X)->low == (Y)->low)  ? (0) : (((X)->low > (Y)->low) ? (1) : (-1))) : 
  485.    (((X)->high > (Y)->high) ? (1) : (-1)))
  486. typedef struct
  487.     {
  488.     long   idLength; /* Length of the object identifier */
  489.     long   idArray [MAXOIDLENGTH]; /* Object Id numbers */
  490.  
  491.     } M2_OBJECTID;
  492. typedef struct
  493.     {
  494.     long           addrLength; /* Length of address */
  495.     unsigned char  phyAddress [MAXIFPHYADDR];   /* physical address value */
  496.     } M2_PHYADDR;
  497. /*
  498.  * The structures that follow are based on the MIB-II RFC-1213.  Each field in
  499.  * each of the structures has the same name as the name specified in by the RFC.
  500.  * Please refer to the RFC for a complete description of the variable and its
  501.  * semantics.
  502.  */
  503. /* System Group bit fields that map to variables that can be set */
  504. #define    M2SYSNAME     0x01
  505. #define    M2SYSCONTACT  0x02
  506. #define    M2SYSLOCATION 0x04
  507. typedef struct
  508.     {
  509.     unsigned char   sysDescr     [M2DISPLAYSTRSIZE];
  510.     M2_OBJECTID     sysObjectID;
  511.     unsigned long   sysUpTime;
  512.     unsigned char   sysContact   [M2DISPLAYSTRSIZE];
  513.     unsigned char   sysName      [M2DISPLAYSTRSIZE];
  514.     unsigned char   sysLocation  [M2DISPLAYSTRSIZE];
  515.     long            sysServices;
  516.     }  M2_SYSTEM;
  517. /* Interface group variables */
  518. typedef struct
  519.     {
  520.     long  ifNumber;         /* Number of Interfaces in the System */
  521.     ULONG ifTableLastChange; /* Time the ifTable was last changed */
  522.     ULONG ifStackLastChange; /* Time the stackTable was last changed */
  523.     }  M2_INTERFACE;
  524. /* values as per RFC 1215 */
  525. #define M2_LINK_DOWN_TRAP 2
  526. #define M2_LINK_UP_TRAP 3
  527. #define M2_LINK_UP_DOWN_TRAP_ENABLED   1
  528. #define M2_LINK_UP_DOWN_TRAP_DISABLED  2
  529. #define M2_PROMISCUOUS_MODE_ON   1
  530. #define M2_PROMISCUOUS_MODE_OFF  2
  531. #define M2_CONNECTOR_PRESENT      1
  532. #define M2_CONNECTOR_NOT_PRESENT  2
  533. typedef struct
  534.     {
  535.     int       ifIndex;  /* Unique value for each interface */
  536.     char      ifDescr  [M2DISPLAYSTRSIZE]; /* Information about the interface */
  537.     long            ifType;            /* Type of interface */
  538.     long            ifMtu;             /* Max size of datagram for the interface */
  539.     unsigned long   ifSpeed;           /* Interface's current bandwidth in bits/sec */
  540.     M2_PHYADDR      ifPhysAddress;     /* Mac layer address of the interface */
  541.     long            ifAdminStatus;     /* Desired state for the interface */
  542.     long            ifOperStatus;      /* Current operational status of the interface */
  543.     unsigned long   ifLastChange;      /* Value of sysUpTime when interface entered 
  544.                                           its current operational state */
  545.     unsigned long   ifInOctets;        /* Number of octets received on the interface */
  546.     unsigned long   ifInUcastPkts;     /* Number of subnetwork-unicast packets
  547.                                           delivered to a higher-layer protocol */
  548.     unsigned long   ifInNUcastPkts;    /* Number of non-unicast packets delivered
  549.                                           to a higher layer protocol */
  550.     unsigned long   ifInDiscards;      /* Number of inbound packets discarded */
  551.     unsigned long   ifInErrors;        /* Inbound packets that contained errors */
  552.     unsigned long   ifInUnknownProtos; /* Inbound packets discarded due to unknown 
  553.                                           or unsupported protocol */
  554.     unsigned long   ifOutOctets;       /* Number of octets transmitted on the interface */
  555.     unsigned long   ifOutUcastPkts;    /* Number of packets transmitted to subnet 
  556.                                           unicast address */
  557.     unsigned long   ifOutNUcastPkts;   /* Number of packets sent to non-unicast
  558.                                           address */
  559.     unsigned long   ifOutDiscards;     /* Number of outbound packets discarded */
  560.     unsigned long   ifOutErrors;       /* Number of outbound packets that could not
  561.                                           be transmitted due to errors */
  562.     unsigned long   ifOutQLen;         /* Length of output packet queue */
  563.     M2_OBJECTID     ifSpecific;        /* Reference to MIB definitions specific to
  564.                                           particular media being used */
  565.     }  M2_INTERFACETBL;
  566. /* The RFC 2233 additions to the ifTable */
  567. typedef struct 
  568.     {
  569.     char         ifName [M2DISPLAYSTRSIZE];
  570.     ULONG        ifInMulticastPkts;
  571.     ULONG        ifInBroadcastPkts;
  572.     ULONG        ifOutMulticastPkts;
  573.     ULONG        ifOutBroadcastPkts;
  574.     UI64         ifHCInOctets;
  575.     UI64         ifHCInUcastPkts;
  576.     UI64         ifHCInMulticastPkts;
  577.     UI64         ifHCInBroadcastPkts;
  578.     UI64         ifHCOutOctets;
  579.     UI64         ifHCOutUcastPkts;
  580.     UI64         ifHCOutMulticastPkts;
  581.     UI64         ifHCOutBroadcastPkts;
  582.     UINT         ifLinkUpDownTrapEnable;
  583.     ULONG        ifHighSpeed;
  584.     UINT         ifPromiscuousMode;
  585.     UINT         ifConnectorPresent;
  586.     char         ifAlias [M2DISPLAYSTRSIZE];
  587.     ULONG        ifCounterDiscontinuityTime;
  588.     } M2_2233TBL;
  589. /* Update Routines */
  590. typedef struct M2_ID_S M2_ID;
  591. typedef struct M2_IFSTACKTBL_S M2_IFSTACKTBL;
  592. typedef STATUS (* M2_PKT_COUNT_RTN) (M2_ID *, UINT, UCHAR *, ULONG);
  593. typedef STATUS (* M2_CTR_UPDATE_RTN) (M2_ID *, UINT, ULONG);
  594. typedef STATUS (* M2_VAR_UPDATE_RTN) (M2_ID *, UINT, caddr_t);
  595. /* Combination of the above interface structs */
  596. typedef struct
  597.     {
  598.     M2_INTERFACETBL   mibIfTbl;         /* the RFC 1213 objects */
  599.     M2_2233TBL        mibXIfTbl;        /* the RFC 2233 extension */
  600.     } M2_DATA;
  601. /* The interface table struct for RFC 2233 compliance */
  602. struct M2_ID_S
  603.     {
  604.     M2_DATA           m2Data;           /* the interface table */
  605.     M2_PKT_COUNT_RTN  m2PktCountRtn;    /* packet counter function */
  606.     M2_CTR_UPDATE_RTN m2CtrUpdateRtn;   /* counter increment function */
  607.     M2_VAR_UPDATE_RTN m2VarUpdateRtn;   /* variable update routine */
  608.     };
  609. /* The structure for the ifStack table as described in RFC 2233 */
  610. struct M2_IFSTACKTBL_S
  611.     {
  612.     UINT                     index;      /* The ifIndex */ 
  613.     int                      status;     /* status of relationship */
  614.     struct M2_IFSTACKTBL_S * pNextLower; /* Pointer to the next relation */
  615.     };
  616. /* The structure for the ifRcv address table as described in RFC 2233 */
  617. typedef struct M2_IFRCVADDRTBL_S 
  618.     {
  619.     M2_PHYADDR                 ifRcvAddrAddr;/* The physical address for which
  620.                                               * system will accept pkts/frames
  621.                                               */
  622.     int                        ifRcvAddrStatus; /* The rowStatus */
  623.     int                        ifRcvAddrType;   /* The address type */
  624.     struct M2_IFRCVADDRTBL_S * pNextEntry;      /* Next pointer */
  625.     } M2_IFRCVADDRTBL;
  626.     
  627. /* The structure for the ifIndex value and corresponding ifnet pointer */
  628.     
  629. typedef struct M2_IFINDEX_S
  630.     {
  631.     AVL_NODE          ifNode;       /* Node representing an if in AVL tree */ 
  632.     int               ifType;       /* Interface type */
  633.     int               ifIndex;      /* Unique value for each interface */
  634.     M2_OBJECTID       ifOid;        /* I/F Object Id */
  635.     void *            pIfStats;     /* Pointer to the driver specific
  636.                                      * structure
  637.                                      */
  638.     M2_IFSTACKTBL *   pNextLower;   /* List of lower sub-layers */
  639.     M2_IFRCVADDRTBL * pRcvAddr;     /* rcvAddr list */
  640.       /* Ioctl to munge interface flags */
  641.       /* Called from m2IfTblEntrySet to change the values in */
  642.       /* the ifnet structure in a non-protocol-specific way. */
  643.       /* Callbacks are bad for tor3 (so I've heard). */
  644.     int               (*ifIoctl) (struct socket*, u_long, caddr_t);
  645.     STATUS            (*rcvAddrGet) (struct ifnet *, struct M2_IFINDEX_S *);
  646.     BOOL              mibStyle;     /* RFC2233 supported if true */
  647.     } M2_IFINDEX;
  648. /* Structure to perform the set operation for if table */
  649.     
  650. typedef struct ifSetentry
  651.     {
  652.     unsigned int    varToSet;
  653.     int             ifIndex;
  654.     long            ifAdminStatus;
  655.     UINT            ifPromiscuousMode;
  656.     UINT            ifLinkUpDownTrapEnable;
  657.     char            ifAlias[M2DISPLAYSTRSIZE];
  658.     } IF_SETENTRY;
  659. /* IP group bit fields that map to variables that can be set */
  660. #define M2_IPFORWARDING 0x01
  661. #define M2_IPDEFAULTTTL 0x02
  662. typedef struct
  663.     {
  664.     long            ipForwarding;
  665.     long            ipDefaultTTL;
  666.     unsigned long   ipInReceives;
  667.     unsigned long   ipInHdrErrors;
  668.     unsigned long   ipInAddrErrors;
  669.     unsigned long   ipForwDatagrams;
  670.     unsigned long   ipInUnknownProtos;
  671.     unsigned long   ipInDiscards;
  672.     unsigned long   ipInDelivers;
  673.     unsigned long   ipOutRequests;
  674.     unsigned long   ipOutDiscards;
  675.     unsigned long   ipOutNoRoutes;
  676.     long            ipReasmTimeout;
  677.     unsigned long   ipReasmReqds;
  678.     unsigned long   ipReasmOKs;
  679.     unsigned long   ipReasmFails;
  680.     unsigned long   ipFragOKs;
  681.     unsigned long   ipFragFails;
  682.     unsigned long   ipFragCreates;
  683.     unsigned long   ipRoutingDiscards;
  684.     } M2_IP;
  685. /* IP Address Table group */
  686. typedef struct
  687.     {
  688.     unsigned long   ipAdEntAddr;
  689.     long            ipAdEntIfIndex;
  690.     unsigned long   ipAdEntNetMask;
  691.     long            ipAdEntBcastAddr;
  692.     long            ipAdEntReasmMaxSize;
  693.     } M2_IPADDRTBL;
  694. /* IP Routing Table group */
  695. typedef struct
  696.     {
  697.     unsigned long   ipRouteDest;
  698.     long            ipRouteIfIndex;
  699.     long            ipRouteMetric1;
  700.     long            ipRouteMetric2;
  701.     long            ipRouteMetric3;
  702.     long            ipRouteMetric4;
  703.     unsigned long   ipRouteNextHop;
  704.     long            ipRouteType;   
  705.     long            ipRouteProto;
  706.     long            ipRouteAge;
  707.     unsigned long   ipRouteMask;
  708.     long            ipRouteMetric5;
  709.     M2_OBJECTID     ipRouteInfo;
  710.     } M2_IPROUTETBL;
  711. /* IP route table entry bit fields that map to variables that can be set */
  712. #define M2_IP_ROUTE_DEST  1
  713. #define M2_IP_ROUTE_NEXT_HOP 2
  714. #define M2_IP_ROUTE_TYPE 4
  715. #define M2_IP_ROUTE_MASK                8
  716. /* IP Address Translation Table group */
  717. typedef struct
  718.     {
  719.     long            ipNetToMediaIfIndex;
  720.     M2_PHYADDR      ipNetToMediaPhysAddress;
  721.     unsigned long   ipNetToMediaNetAddress;
  722.     long            ipNetToMediaType; 
  723.     } M2_IPATRANSTBL;
  724. /* ICMP group */
  725. typedef struct
  726.     {
  727.     unsigned long   icmpInMsgs;
  728.     unsigned long   icmpInErrors;
  729.     unsigned long   icmpInDestUnreachs;
  730.     unsigned long   icmpInTimeExcds;
  731.     unsigned long   icmpInParmProbs;
  732.     unsigned long   icmpInSrcQuenchs;
  733.     unsigned long   icmpInRedirects;
  734.     unsigned long   icmpInEchos;
  735.     unsigned long   icmpInEchoReps;
  736.     unsigned long   icmpInTimestamps;
  737.     unsigned long   icmpInTimestampReps;
  738.     unsigned long   icmpInAddrMasks;
  739.     unsigned long   icmpInAddrMaskReps;
  740.     unsigned long   icmpOutMsgs;
  741.     unsigned long   icmpOutErrors;
  742.     unsigned long   icmpOutDestUnreachs;
  743.     unsigned long   icmpOutTimeExcds;
  744.     unsigned long   icmpOutParmProbs;
  745.     unsigned long   icmpOutSrcQuenchs;
  746.     unsigned long   icmpOutRedirects;
  747.     unsigned long   icmpOutEchos;
  748.     unsigned long   icmpOutEchoReps;
  749.     unsigned long   icmpOutTimestamps;
  750.     unsigned long   icmpOutTimestampReps;
  751.     unsigned long   icmpOutAddrMasks;
  752.     unsigned long   icmpOutAddrMaskReps;
  753.     } M2_ICMP;
  754. /* TCP Group */
  755. typedef struct 
  756.     {
  757.     long            tcpRtoAlgorithm;
  758.     long            tcpRtoMin;
  759.     long            tcpRtoMax;
  760.     long            tcpMaxConn;
  761.     unsigned long   tcpActiveOpens;
  762.     unsigned long   tcpPassiveOpens;
  763.     unsigned long   tcpAttemptFails;
  764.     unsigned long   tcpEstabResets;
  765.     unsigned long   tcpCurrEstab;
  766.     unsigned long   tcpInSegs;
  767.     unsigned long   tcpOutSegs;
  768.     unsigned long   tcpRetransSegs;
  769.     unsigned long   tcpInErrs;
  770.     unsigned long   tcpOutRsts;
  771.     } M2_TCPINFO;
  772. /* TCP Connection Table Entry */
  773. typedef struct
  774.     {
  775.     long            tcpConnState;
  776.     unsigned long   tcpConnLocalAddress;
  777.     long            tcpConnLocalPort;
  778.     unsigned long   tcpConnRemAddress;
  779.     long            tcpConnRemPort;
  780.     } M2_TCPCONNTBL;
  781. /* User Datagram Protocol Group */
  782. typedef struct
  783.     {
  784.     unsigned long   udpInDatagrams;
  785.     unsigned long   udpNoPorts;
  786.     unsigned long   udpInErrors;
  787.     unsigned long   udpOutDatagrams;
  788.     } M2_UDP;
  789. /* UDP Connection Table Entry */
  790. typedef struct
  791.     {
  792.     unsigned long   udpLocalAddress;
  793.     long            udpLocalPort;
  794.     } M2_UDPTBL;
  795. /* IGMP  */
  796. typedef struct
  797.     {
  798.     ULONG       igmpInterfaceIfIndex; 
  799.     ULONG       igmpInterfaceQueryInterval; 
  800.     ULONG       igmpInterfaceStatus; 
  801.     ULONG       igmpInterfaceVersion;
  802.     ULONG       igmpInterfaceQuerier;
  803.     ULONG       igmpInterfaceQueryMaxResponseTime;
  804.     ULONG       igmpInterfaceQuerierPresentTimeout;
  805.     ULONG       igmpInterfaceLeaveEnabled;
  806.     ULONG       igmpInterfaceVersion1QuerierTimer;
  807.     ULONG       igmpInterfaceWrongVersionQueries;
  808.     ULONG       igmpInterfaceJoins;
  809.     ULONG       igmpInterfaceLeaves;
  810.     ULONG igmpInterfaceGroups;
  811.     ULONG       igmpInterfaceRobustness;
  812.     ULONG       igmpInterfaceQuerierUpTime;
  813.     ULONG       igmpInterfaceLastMembQueryIntvl;
  814.     } M2_IGMP;
  815.     
  816. typedef struct 
  817.     {
  818.     ULONG       igmpCacheAddress;
  819.     ULONG       igmpCacheIfIndex;
  820.     ULONG       igmpCacheSelf;               /* was BOOLEAN */
  821.     ULONG       igmpCacheLastReporter;
  822.     ULONG       igmpCacheUpTime;
  823.     ULONG       igmpCacheExpiryTime;
  824.     ULONG       igmpCacheStatus;
  825.     ULONG       igmpCacheVersion1HostTimer;
  826.     } M2_IGMP_CACHE;
  827.         
  828.     
  829. /* function declarations */
  830.  
  831. #if defined(__STDC__) || defined(__cplusplus)
  832. extern STATUS m2SysInit (char * mib2SysDescr, char * mib2SysContact,
  833.  char * mib2SysLocation, M2_OBJECTID * pObjectId);
  834. extern STATUS m2SysGroupInfoGet (M2_SYSTEM * pSysInfo);
  835. extern STATUS m2SysGroupInfoSet (unsigned int varToSet, M2_SYSTEM * pSysInfo);
  836. extern STATUS m2SysDelete (void);
  837. extern M2_ID * m2IfAlloc (ULONG, UCHAR *, ULONG, ULONG, ULONG, char *, int);
  838. extern STATUS  m2IfFree (M2_ID *);
  839. extern STATUS  m2IfGenericPacketCount (M2_ID *, UINT, UCHAR *, ULONG);
  840. extern STATUS  m2IfCounterUpdate (M2_ID *, UINT, ULONG);
  841. extern STATUS  m2IfVariableUpdate (M2_ID *, UINT, caddr_t);
  842. extern STATUS  m2IfPktCountRtnInstall (M2_ID *, M2_PKT_COUNT_RTN);
  843. extern STATUS  m2IfCtrUpdateRtnInstall (M2_ID *, M2_CTR_UPDATE_RTN);
  844. extern STATUS  m2IfVarUpdateRtnInstall (M2_ID *, M2_VAR_UPDATE_RTN);
  845. extern STATUS  m2If8023PacketCount (M2_ID *, UINT, UCHAR *, ULONG);
  846. extern STATUS m2IfInit (FUNCPTR pTrapRtn, void * pTrapArg);
  847. extern STATUS m2IfTableUpdate (struct ifnet *, UINT,
  848.  int (*func) (struct socket*, u_long, caddr_t),
  849.  STATUS (func2) (struct ifnet*, M2_IFINDEX*));
  850. extern STATUS m2IfGroupInfoGet (M2_INTERFACE * pIfInfo);
  851. extern STATUS m2IfTblEntryGet (int search, void * pIfTblEntry);
  852. extern STATUS m2IfTblEntrySet (void *);
  853. extern STATUS m2IfStackTblUpdate (UINT lowerIndex, UINT higherIndex, int action);
  854. extern STATUS m2IfStackEntryGet (int, int *,  M2_IFSTACKTBL *);
  855. extern STATUS m2IfStackEntrySet (int, M2_IFSTACKTBL *);
  856. extern STATUS m2IfRcvAddrEntryGet (int, int *, M2_IFRCVADDRTBL *);
  857. extern STATUS m2IfRcvAddrEntrySet (int, int, M2_IFRCVADDRTBL *);
  858. extern STATUS m2IfDelete (void);
  859. extern STATUS m2IpInit (int maxRouteTableSize);
  860. extern STATUS m2IpGroupInfoGet (M2_IP * pIpInfo);
  861. extern STATUS m2IpGroupInfoSet (unsigned int varToSet, M2_IP * pIpInfo);
  862. extern STATUS
  863.    m2IpAddrTblEntryGet (int search, M2_IPADDRTBL * pIpAddrTblEnry);
  864. extern STATUS
  865. m2IpRouteTblEntryGet (int   search, M2_IPROUTETBL * pIpRouteTblEntry);
  866. extern STATUS
  867. m2IpRouteTblEntrySet (int varToSet, M2_IPROUTETBL * pIpRouteTblEntry);
  868. extern STATUS
  869.     m2IpAtransTblEntryGet (int search, M2_IPATRANSTBL * pIpAtEntry);
  870. extern STATUS
  871.     m2IpAtransTblEntrySet (M2_IPATRANSTBL * pIpAtEntry);
  872. extern STATUS m2IpDelete (void);
  873. extern STATUS m2IcmpInit (void);
  874. extern STATUS m2IcmpGroupInfoGet (M2_ICMP * pIcmpInfo);
  875. extern STATUS m2TcpInit (void);
  876. extern STATUS m2TcpGroupInfoGet (M2_TCPINFO * pTcpInfo);
  877. extern STATUS m2TcpConnEntryGet (int search, M2_TCPCONNTBL * pTcpConnEntry);
  878. extern STATUS m2TcpConnEntrySet (M2_TCPCONNTBL * pTcpConnEntry);
  879. extern STATUS m2UdpInit (void);
  880. extern STATUS m2UdpGroupInfoGet (M2_UDP * pUdpInfo);
  881. extern STATUS m2UdpTblEntryGet (int search, M2_UDPTBL * pUdpEntry);
  882. STATUS m2Init (char * mib2SysDescr, char * mib2SysContact, 
  883.                char * mib2SysLocation, M2_OBJECTID * pMib2SysObjectId,
  884.        FUNCPTR pTrapRtn, void * pTrapArg, int maxRouteTableSize);
  885. extern STATUS m2Delete (void);
  886. extern STATUS m2TcpDelete (void);
  887. extern STATUS m2UdpDelete (void);
  888. extern STATUS m2IcmpDelete (void);
  889. extern STATUS m2SetIfLastChange (int ifIndex);
  890. extern STATUS m2IgmpInterfaceEntrySet(M2_IGMP *data, int varsToSet);
  891. extern STATUS m2IgmpInterfaceEntryGet(M2_IGMP *data);
  892. extern STATUS m2IgmpInterfaceEntryNextGet(M2_IGMP *data);
  893. extern STATUS m2IgmpCacheEntryGet(M2_IGMP_CACHE *data);
  894. extern STATUS m2IgmpCacheEntryNextGet(M2_IGMP_CACHE *data);
  895. extern M2_IGMP_CACHE * igmpCacheEntry_first(void);
  896. extern M2_IGMP_CACHE * igmpCacheEntry_next_inst(M2_IGMP_CACHE * data);
  897. extern unsigned igmpCacheEntry_build_instance(M2_IGMP_CACHE * data, int * inst);
  898. #else   /* __STDC__ */
  899. extern STATUS m2SysInit ();
  900. extern STATUS m2SysGroupInfoGet ();
  901. extern STATUS m2SysGroupInfoSet ();
  902. extern STATUS m2SysDelete ();
  903. extern M2_ID * m2IfAlloc ();
  904. extern STATUS m2IfFree ();
  905. extern STATUS m2IfGenericPacketCount ();
  906. extern STATUS m2IfCounterUpdate ();
  907. extern STATUS m2IfVariableUpdate ();
  908. extern STATUS m2IfPktCountRtnInstall ();
  909. extern STATUS m2IfCtrUpdateRtnInstall ();
  910. extern STATUS m2IfVarUpdateRtnInstall ();
  911. extern STATUS m2If8023PacketCount ();
  912. extern STATUS m2IfInit ();
  913. extern STATUS m2IfTableUpdate ();
  914. extern STATUS m2IfGroupInfoGet ();
  915. extern STATUS m2IfTblEntryGet ();
  916. extern STATUS m2IfTblEntrySet ();
  917. extern STATUS m2IfStackTblUpdate ();
  918. extern STATUS m2IfStackEntryGet ();
  919. extern STATUS m2IfStackEntrySet ();
  920. extern STATUS m2IfRcvAddrEntryGet ();
  921. extern STATUS m2IfRcvAddrEntrySet ();
  922. extern STATUS m2IfDelete ();
  923. extern STATUS m2IpInit ();
  924. extern STATUS m2IpGroupInfoGet ();
  925. extern STATUS m2IpGroupInfoSet ();
  926. extern STATUS m2IpAddrTblEntryGet ();
  927. extern STATUS m2IpRouteTblEntryGet ();
  928. extern STATUS m2IpRouteTblEntrySet ();
  929. extern STATUS m2IpAtransTblEntryGet ();
  930. extern STATUS m2IpAtransTblEntrySet ();
  931. extern STATUS m2IpDelete ();
  932. extern STATUS m2IcmpInit ();
  933. extern STATUS m2IcmpGroupInfoGet ();
  934. extern STATUS m2TcpInit ();
  935. extern STATUS m2TcpGroupInfoGet ();
  936. extern STATUS m2TcpConnEntryGet ();
  937. extern STATUS m2TcpConnEntrySet ();
  938. extern STATUS m2UdpInit ();
  939. extern STATUS m2UdpGroupInfoGet ();
  940. extern STATUS m2UdpTblEntryGet ();
  941. extern STATUS m2Init ();
  942. extern STATUS m2Delete ();
  943. extern STATUS m2TcpDelete ();
  944. extern STATUS m2UdpDelete ();
  945. extern STATUS m2IcmpDelete ();
  946. extern STATUS m2SetIfLastChange ();
  947. extern STATUS m2IgmpInterfaceEntrySet();
  948. extern STATUS m2IgmpInterfaceEntryGet();
  949. extern STATUS m2IgmpInterfaceEntryNextGet();
  950. extern STATUS m2IgmpCacheEntryGet();
  951. extern STATUS m2IgmpCacheEntryNextGet();
  952. extern M2_IGMP_CACHE * igmpCacheEntry_first();
  953. extern M2_IGMP_CACHE * igmpCacheEntry_next_inst();
  954. extern unsigned igmpCacheEntry_build_instance();
  955. #endif  /* __STDC__ */
  956. #if ((CPU_FAMILY==I960) && (defined __GNUC__))
  957. #pragma align 0                 /* turn off alignment requirement */
  958. #endif  /* CPU_FAMILY==I960 */
  959. #ifdef __cplusplus
  960. }
  961. #endif
  962. #endif /* __INCm2Libh */