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

VxWorks

开发平台:

C/C++

  1. /* m2RipLib.h - VxWorks MIB-II interface for RIP to SNMP Agent */
  2. /* Copyright 1984 - 2001 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01e,28apr02,rae  added extern C jazz (SPR #76303)
  7. 01d,12oct01,rae  merge from truestack (M2_rip2IfConfAuthType_md5)
  8. 01c,30jun98,spm  corrected size of storage for authentication key
  9. 01b,17apr97,gnn  changed variables to follow coding convention.
  10.                  added varToSet defines.
  11. 01a,01apr97,gnn  written.
  12. */
  13.  
  14. #ifndef __INCm2RipLibh
  15. #define __INCm2RipLibh
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /* defines for local structures */
  20. #define AUTHKEYLEN 16
  21. /* defines for errors */
  22. #define S_m2RipLib_IFACE_NOT_FOUND            (M_m2RipLib | 1)
  23. /* defines for enumerated types */
  24. /* enumerated values for rip2IfStatStatus */
  25. #define M2_rip2IfStatStatus_valid       1
  26. #define M2_rip2IfStatStatus_invalid     2
  27. /* enumerated values for rip2IfConfAuthType */
  28. #define M2_rip2IfConfAuthType_noAuthentication 1
  29. #define M2_rip2IfConfAuthType_simplePassword 2
  30. #define M2_rip2IfConfAuthType_md5 3
  31. /* enumerated values for rip2IfConfSend */
  32. #define M2_rip2IfConfSend_doNotSend     1
  33. #define M2_rip2IfConfSend_ripVersion1   2
  34. #define M2_rip2IfConfSend_rip1Compatible 3
  35. #define M2_rip2IfConfSend_ripVersion2   4
  36. /* enumerated values for rip2IfConfReceive */
  37. #define M2_rip2IfConfReceive_rip1       1
  38. #define M2_rip2IfConfReceive_rip2       2
  39. #define M2_rip2IfConfReceive_rip1OrRip2 3
  40. /* enumerated values for rip2IfConfStatus */
  41. #define M2_rip2IfConfStatus_valid       1
  42. #define M2_rip2IfConfStatus_invalid     2
  43. #if ((CPU_FAMILY==I960) && (defined __GNUC__))
  44. #pragma align 1                 /* tell gcc960 not to optimize alignments */
  45. #endif  /* CPU_FAMILY==I960 */
  46. /*
  47.  * The rip2GlobalGroup family. 
  48.  */
  49. typedef struct
  50.     {
  51.     unsigned long   rip2GlobalRouteChanges;
  52.     unsigned long   rip2GlobalQueries;
  53.     } M2_RIP2_GLOBAL_GROUP;
  54. /*
  55.  * The rip2IfStatEntry family. 
  56.  */
  57. typedef struct
  58.     {
  59.     unsigned long   rip2IfStatAddress;
  60.     unsigned long   rip2IfStatRcvBadPackets;
  61.     unsigned long   rip2IfStatRcvBadRoutes;
  62.     unsigned long   rip2IfStatSentUpdates;
  63.     long            rip2IfStatStatus;
  64.     } M2_RIP2_IFSTAT_ENTRY;
  65. /*
  66.  * The rip2IfConfEntry family. 
  67.  */
  68. /* Defines for the fields that can be set. */
  69. #define M2_RIP2_IF_CONF_DOMAIN 0x1
  70. #define M2_RIP2_IF_CONF_AUTH_TYPE 0x2
  71. #define M2_RIP2_IF_CONF_AUTH_KEY 0x4
  72. #define M2_RIP2_IF_CONF_SEND 0x8
  73. #define M2_RIP2_IF_CONF_RECEIVE 0x10
  74. #define M2_RIP2_IF_CONF_DEFAULT_METRIC 0x20
  75. #define M2_RIP2_IF_CONF_STATUS 0x40
  76. typedef struct
  77.     {
  78.     unsigned long   rip2IfConfAddress;
  79.     char            rip2IfConfDomain[2];
  80.     long            rip2IfConfAuthType;
  81.     char            rip2IfConfAuthKey[AUTHKEYLEN];
  82.     long            rip2IfConfSend;
  83.     long            rip2IfConfReceive;
  84.     long            rip2IfConfDefaultMetric;
  85.     long            rip2IfConfStatus;
  86.     } M2_RIP2_IFCONF_ENTRY;
  87. /*
  88.  * The rip2PeerEntry family. 
  89.  */
  90. typedef struct
  91.     {
  92.     unsigned long   rip2PeerAddress;
  93.     char*           rip2PeerDomain;
  94.     unsigned long   rip2PeerLastUpdate;
  95.     long            rip2PeerVersion;
  96.     unsigned long   rip2PeerRcvBadPackets;
  97.     unsigned long   rip2PeerRcvBadRoutes;
  98.     } M2_RIP2_PEER_ENTRY;
  99. #if ((CPU_FAMILY==I960) && (defined __GNUC__))
  100. #pragma align 0                 /* turn off alignment requirement */
  101. #endif  /* CPU_FAMILY==I960 */
  102. /* function declarations */
  103. STATUS m2RipInit (void);
  104. STATUS m2RipDelete (void);
  105. STATUS m2RipGlobalCountersGet(M2_RIP2_GLOBAL_GROUP* pRipGlobal);
  106. STATUS m2RipIfStatEntryGet(int search, M2_RIP2_IFSTAT_ENTRY* pRipIfStat);
  107. STATUS m2RipIfConfEntryGet(int search, M2_RIP2_IFCONF_ENTRY* pRipIfConf);
  108. STATUS m2RipIfConfEntrySet(unsigned int varToSet,
  109.                            M2_RIP2_IFCONF_ENTRY* pRipIfConf);
  110. #ifdef __cplusplus
  111. }
  112. #endif
  113. #endif /* INCm2RipLibh */