* \class MsgBusInterface * * \brief Abstract class for the message bus interface. * \details Internal memory schema and all expected methods are * defined here. * * It is required that the implementing class follow the * internal schema to store the data as needed. */
| 30 | * internal schema to store the data as needed. |
| 31 | */ |
| 32 | class MsgBusInterface { |
| 33 | public: |
| 34 | |
| 35 | /* --------------------------------------------------------------------------- |
| 36 | * Msg data schema |
| 37 | * --------------------------------------------------------------------------- |
| 38 | */ |
| 39 | uint64_t ribSeq; ///< RIB Message Seq |
| 40 | |
| 41 | /** |
| 42 | * OBJECT: collector |
| 43 | * |
| 44 | * Router table schema |
| 45 | */ |
| 46 | struct obj_collector { |
| 47 | u_char hash_id[16]; ///< Hash ID for collector (is the unique ID) |
| 48 | char admin_id[64]; ///< Admin ID for collector |
| 49 | u_char descr[255]; ///< Description of collector |
| 50 | |
| 51 | char routers[4096]; ///< List of connected routers hash ID's delimited by PIPE |
| 52 | uint32_t router_count; ///< Count of active/connected routers |
| 53 | uint32_t timestamp_secs; ///< Timestamp in seconds since EPOC |
| 54 | uint32_t timestamp_us; ///< Timestamp microseconds |
| 55 | }; |
| 56 | |
| 57 | /// Collector action codes |
| 58 | enum collector_action_code { |
| 59 | COLLECTOR_ACTION_STARTED =0, |
| 60 | COLLECTOR_ACTION_CHANGE, |
| 61 | COLLECTOR_ACTION_HEARTBEAT, |
| 62 | COLLECTOR_ACTION_STOPPED, |
| 63 | }; |
| 64 | |
| 65 | /** |
| 66 | * OBJECT: routers |
| 67 | * |
| 68 | * Router table schema |
| 69 | */ |
| 70 | struct obj_router { |
| 71 | u_char hash_id[16]; ///< Router hash ID of name and src_addr |
| 72 | uint16_t hash_type; ///< Router hash type 0:IP, 1:router_name, 2:bgp_id |
| 73 | u_char name[255]; ///< BMP router sysName (initiation Type=2) |
| 74 | u_char descr[255]; ///< BMP router sysDescr (initiation Type=1) |
| 75 | u_char ip_addr[46]; ///< BMP router source IP address in printed form |
| 76 | char bgp_id[16]; ///< BMP Router bgp-id |
| 77 | uint32_t asn; ///< BMP router ASN |
| 78 | uint16_t term_reason_code; ///< BMP termination reason code |
| 79 | char term_reason_text[255]; ///< BMP termination reason text decode string |
| 80 | |
| 81 | char term_data[4096]; ///< Type=0 String termination info data |
| 82 | char initiate_data[4096]; ///< Type=0 String initiation info data |
| 83 | uint32_t timestamp_secs; ///< Timestamp in seconds since EPOC |
| 84 | uint32_t timestamp_us; ///< Timestamp microseconds |
| 85 | }; |
| 86 | |
| 87 | /// Router action codes |
| 88 | enum router_action_code { |
| 89 | ROUTER_ACTION_FIRST=0, |
nothing calls this directly
no outgoing calls
no test coverage detected