2022-08-02 14:04:25 +00:00
|
|
|
#ifndef _BIRD_SNMP_BGP_MIB_H_
|
|
|
|
#define _BIRD_SNMP_BGP_MIB_H_
|
|
|
|
|
2022-09-30 07:36:09 +00:00
|
|
|
#include "snmp.h"
|
2022-11-29 15:30:20 +00:00
|
|
|
#include "subagent.h"
|
2022-09-30 07:36:09 +00:00
|
|
|
|
2022-08-02 14:04:25 +00:00
|
|
|
/* peers attributes */
|
2022-09-06 16:04:29 +00:00
|
|
|
enum BGP4_MIB {
|
2022-09-20 12:28:57 +00:00
|
|
|
SNMP_BGP_IDENTIFIER = 1,
|
|
|
|
SNMP_BGP_STATE = 2,
|
|
|
|
SNMP_BGP_ADMIN_STATUS = 3, /* in read-only mode */
|
2022-11-05 15:29:00 +00:00
|
|
|
SNMP_BGP_NEGOTIATED_VERSION = 4,
|
2022-09-20 12:28:57 +00:00
|
|
|
SNMP_BGP_LOCAL_ADDR = 5,
|
|
|
|
SNMP_BGP_LOCAL_PORT = 6,
|
|
|
|
SNMP_BGP_REMOTE_ADDR = 7,
|
|
|
|
SNMP_BGP_REMOTE_PORT = 8,
|
|
|
|
SNMP_BGP_REMOTE_AS = 9,
|
|
|
|
SNMP_BGP_RX_UPDATES = 10, /* in updates */
|
|
|
|
SNMP_BGP_TX_UPDATES = 11, /* out updates */
|
|
|
|
SNMP_BGP_RX_MESSAGES = 12, /* in total messages */
|
|
|
|
SNMP_BGP_TX_MESSAGES = 13, /* out total messages */
|
|
|
|
SNMP_BGP_LAST_ERROR = 14,
|
|
|
|
SNMP_BGP_FSM_TRANSITIONS = 15, /* FSM established transitions */
|
|
|
|
SNMP_BGP_FSM_ESTABLISHED_TIME = 16, /* UNSUPPORTED FSM established time */
|
|
|
|
SNMP_BGP_RETRY_INTERVAL = 17,
|
|
|
|
SNMP_BGP_HOLD_TIME = 18,
|
|
|
|
SNMP_BGP_KEEPALIVE = 19,
|
|
|
|
SNMP_BGP_HOLD_TIME_CONFIGURED = 20,
|
|
|
|
SNMP_BGP_KEEPALIVE_CONFIGURED = 21,
|
|
|
|
SNMP_BGP_ORIGINATION_INTERVAL = 22, /* UNSUPPORTED - 0 */
|
|
|
|
SNMP_BGP_MIN_ROUTE_ADVERTISEMENT = 23, /* UNSUPPORTED - 0 */
|
|
|
|
SNMP_BGP_IN_UPDATE_ELAPSED_TIME = 24, /* UNSUPPORTED */
|
2022-09-06 16:04:29 +00:00
|
|
|
} PACKED;
|
2022-08-02 14:04:25 +00:00
|
|
|
|
2022-09-20 12:28:57 +00:00
|
|
|
//void snmp_init_bgp_table(void);
|
|
|
|
//void snmp_del_bgp_table(void);
|
|
|
|
|
2022-11-05 15:29:00 +00:00
|
|
|
struct oid;
|
|
|
|
|
2022-12-10 17:08:00 +00:00
|
|
|
void snmp_bgp_register(struct snmp_proto *p);
|
2022-11-15 15:29:03 +00:00
|
|
|
// - int snmp_bgp_is_supported(struct oid *o);
|
2022-09-20 12:28:57 +00:00
|
|
|
|
2022-11-05 15:29:00 +00:00
|
|
|
int snmp_bgp_valid_ip4(struct oid *o);
|
|
|
|
u8 snmp_bgp_state(struct oid *o);
|
|
|
|
u8 snmp_bgp_get_valid(u8 state);
|
|
|
|
u8 snmp_bgp_getnext_valid(u8 state);
|
|
|
|
|
|
|
|
struct oid *search_bgp_mib(struct snmp_proto *p , struct oid *o_start, struct oid *o_end, uint contid);
|
2022-11-19 22:00:02 +00:00
|
|
|
byte * snmp_bgp_fill(struct snmp_proto *p, struct agentx_varbind *vb, byte *buf, uint size, uint contid UNUSED, int byte_ord);
|
2022-11-05 15:29:00 +00:00
|
|
|
|
|
|
|
#define BGP4_MIB_VERSION 1
|
2022-09-20 12:28:57 +00:00
|
|
|
#define BGP4_MIB_LOCAL_AS 2
|
|
|
|
#define BGP4_PEER_TABLE 3
|
|
|
|
#define BGP4_PEER_ENTRY 1
|
2022-08-02 14:04:25 +00:00
|
|
|
|
2022-11-05 15:29:00 +00:00
|
|
|
#define SNMP_BGP_VERSION 1
|
|
|
|
#define SNMP_BGP_LOCAL_AS 2
|
|
|
|
#define SNMP_BGP_PEER_TABLE 3
|
|
|
|
#define SNMP_BGP_PEER_ENTRY 1
|
|
|
|
|
|
|
|
/* BGP linearized state */
|
|
|
|
enum BGP_INTERNAL_STATES {
|
|
|
|
BGP_INTERNAL_INVALID = 0,
|
|
|
|
BGP_INTERNAL_BGP = 1,
|
|
|
|
BGP_INTERNAL_VERSION,
|
|
|
|
BGP_INTERNAL_LOCAL_AS,
|
|
|
|
BGP_INTERNAL_PEER_TABLE,
|
|
|
|
BGP_INTERNAL_PEER_ENTRY,
|
|
|
|
BGP_INTERNAL_IDENTIFIER,
|
|
|
|
BGP_INTERNAL_STATE,
|
|
|
|
BGP_INTERNAL_ADMIN_STATUS,
|
2023-03-14 13:09:45 +00:00
|
|
|
BGP_INTERNAL_NEGOTIATED_VERSION,
|
2022-11-05 15:29:00 +00:00
|
|
|
BGP_INTERNAL_LOCAL_ADDR,
|
2023-03-14 13:09:45 +00:00
|
|
|
BGP_INTERNAL_LOCAL_PORT,
|
2022-11-05 15:29:00 +00:00
|
|
|
BGP_INTERNAL_REMOTE_ADDR,
|
2023-03-14 13:09:45 +00:00
|
|
|
BGP_INTERNAL_REMOTE_PORT,
|
2022-11-05 15:29:00 +00:00
|
|
|
BGP_INTERNAL_REMOTE_AS,
|
|
|
|
BGP_INTERNAL_RX_UPDATES,
|
|
|
|
BGP_INTERNAL_TX_UPDATES,
|
|
|
|
BGP_INTERNAL_RX_MESSAGES,
|
|
|
|
BGP_INTERNAL_TX_MESSAGES,
|
2023-03-14 13:09:45 +00:00
|
|
|
BGP_INTERNAL_LAST_ERROR,
|
2022-11-05 15:29:00 +00:00
|
|
|
BGP_INTERNAL_FSM_TRANSITIONS,
|
|
|
|
BGP_INTERNAL_FSM_ESTABLISHED_TIME,
|
|
|
|
BGP_INTERNAL_RETRY_INTERVAL,
|
|
|
|
BGP_INTERNAL_HOLD_TIME,
|
|
|
|
BGP_INTERNAL_KEEPALIVE,
|
|
|
|
BGP_INTERNAL_HOLD_TIME_CONFIGURED,
|
2023-03-14 13:09:45 +00:00
|
|
|
BGP_INTERNAL_KEEPALIVE_CONFIGURED,
|
2022-11-05 15:29:00 +00:00
|
|
|
BGP_INTERNAL_ORIGINATION_INTERVAL,
|
|
|
|
BGP_INTERNAL_MIN_ROUTE_ADVERTISEMENT,
|
|
|
|
BGP_INTERNAL_IN_UPDATE_ELAPSED_TIME,
|
|
|
|
BGP_INTERNAL_END,
|
|
|
|
BGP_INTERNAL_NO_VALUE = 255,
|
|
|
|
} PACKED;
|
|
|
|
|
2022-08-02 14:04:25 +00:00
|
|
|
#endif
|