Professional Documents
Culture Documents
Olympus Messaging: Generated by Doxygen 1.8.9.1
Olympus Messaging: Generated by Doxygen 1.8.9.1
1 Main Page 1
3 File Index 5
5 File Documentation 19
5.1 /home/dash/Documents/linksys/olympus-messaging/include/omsg.h File Reference . . . . . . . . 19
5.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.1.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.1.2.1 OMSG_DEFAULT_CC_URL . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.1.2.2 OMSG_MAX_PAYLOAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.1.2.3 OMSG_VER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.1.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.1.3.1 omsg_handle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.1.3.2 omsg_receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.1.4 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.1.4.1 omsg_connection_type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.1.4.2 omsg_status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.1.4.3 omsg_type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.1.5 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.1.5.1 omsg_close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.1.5.2 omsg_connect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.1.5.3 omsg_info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.1.5.4 omsg_open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.1.5.5 omsg_open_sec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.1.5.6 omsg_post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.1.5.7 omsg_publish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.1.5.8 omsg_query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.1.5.9 omsg_smart_connect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.1.5.10 omsg_subscribe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.1.5.11 omsg_version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Index 27
Main Page
This represents the API interfacing router-resident client code with the /Olympus Messaging/ subsystem. Click the
Files tab above to browse through the modules.
Getting Started
$ make doc
Links:
• Doxygen - http://doxygen.org/
• org-mode - http://orgmode.org/
2 Main Page
se_set_unique_reply_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
se_show_data_elements_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
File Index
Data Fields
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
The documentation for this class was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/debostream.h
• MqMsg (void ∗)
• const char ∗ topic ()
• void ∗ payload ()
• size_t size ()
• MqMsg (void ∗data, size_t size)
• bool valid ()
• size_t payload_len () const
8 Data Structure Documentation
• static MqMsg ∗ make (const char ∗topic, void ∗payload, size_t payload_size)
Friends
The documentation for this class was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/mq_msg.h
Data Fields
• magic_t magic
• uint16_t ver
• uint16_t header_len
• uint16_t topic_len
• uint16_t payload_len
The documentation for this class was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/mq_msg.h
Protected Attributes
• mqd_t mq
• std::string qname
• size_t buffer_size
• char ∗ buffer
The documentation for this class was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/msgq.h
Data Fields
• void ∗ reserved
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• void ∗ reserved
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• int level
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• void ∗ reserved
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• void ∗ data
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• int status
• void ∗ data
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• int status
• unsigned int iterator
• void ∗ data
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• int status
• unsigned int iterator
• void ∗ data
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• int poison
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• int poison
• int mbytes
• se_msg_type mtype
• token_t sender_token
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• token_t token_id
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• int source
• int tid
• async_id_t async_id
• void ∗ data
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• int version
• void ∗ data
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• int status
• token_t token_id
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• void ∗ reserved
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• void ∗ reserved
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• async_id_t async_id
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• int status
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• token_t token_id
• async_id_t async_id
• action_flag_t flags
• void ∗ data
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• async_id_t async_id
• int num_msgs
• void ∗ data
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• int source
• int tid
• token_t token_id
• async_id_t async_id
• action_flag_t flags
• void ∗ data
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• action_flag_t flags
• int num_params
• void ∗ data
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• action_flag_t flags
• void ∗ data
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• int status
• async_id_t async_id
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• int source
• int tid
• void ∗ data
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• tuple_flag_t flags
• void ∗ data
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• int status
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• int status
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• void ∗ data
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• int status
• void ∗ data
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
Data Fields
• void ∗ data
The documentation for this struct was generated from the following file:
• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h
File Documentation
Macros
• #define OMSG_VER_MAJOR 1
omsg library version major number
• #define OMSG_VER_MINOR 3
omsg library version minor number
• #define OMSG_VER_PATCH 0
omsg library version patch number
• #define OMSG_VER
omsg library version.
• #define OMSG_CONNECTED_NAME "connected"
• #define OMSG_TRUE_NAME "true"
• #define OMSG_FALSE_NAME "false"
• #define OMSG_MAC_NAME "mac"
• #define OMSG_CONN_TYPE_NAME "connection_type"
• #define OMSG_CONN_SPEED_NAME "connection_speed"
• #define OMSG_CC_URL_NAME "service::cnc::location"
• #define OMSG_UUID_NAME "uuid"
• #define OMSG_ACTIVE_NAME "active"
• #define OMSG_PIN_NAME "pin"
• #define OMSG_DURATION_NAME "duration"
• #define OMSG_SENDER_NAME "sender-address"
• #define OMSG_MAX_PAYLOAD (8192)
Only payloads up to 8KB allowed.
• #define OMSG_MAX_PIN (32)
Smart Config PINs can only be this large (including terminating NULL.
• #define OMSG_DEFAULT_CC_URL "http://cisco.com/jnap/networkconnections/GetNetworkConnections"
Default JNAP C&C URL.
20 File Documentation
Typedefs
Enumerations
• enum omsg_status {
OMSG_OK = 0, OMSG_UNKNOWN_ERROR = 1, OMSG_INTERNAL = 2, OMSG_BAD_DEST = 3,
OMSG_PAYLOAD_TOO_BIG = 4, OMSG_BAD_CALLBACK = 5, OMSG_BAD_TYPE = 6, OMSG_TOO_←-
MANY_REC = 7,
OMSG_BAD_PAYLOAD = 8, OMSG_MISSING_PARAMS = 9, OMSG_BAD_FORMAT = 10, OMSG_NO←-
_CONNECTION = 11,
OMSG_CONNECT_FAIL = 12 }
Status codes returned by various Olympus Messaging functions.
• enum omsg_type {
OMSG_TYPE_NONE = 0b00000000000, OMSG_TYPE_CONNECT = 0b00000000001, OMSG_TYPE_Q←-
UERY = 0b00000000010, OMSG_TYPE_INFO = 0b00000000100,
OMSG_TYPE_CUSTOM = 0b00000001000, OMSG_TYPE_ALL = 0b00000010000, OMSG_TYPE_SMA←-
RT_CONNECT = 0b00000100000, OMSG_TYPE_CONF_CHANGE = 0b00001000000,
OMSG_TYPE_SET_ME_UP = 0b00010000000 }
Message type.
• enum omsg_connection_type {
OMSG_CONN_TYPE_UNKNOWN, OMSG_CONN_TYPE_WIFI, OMSG_CONN_TYPE_FAST_ETH, OM←-
SG_CONN_TYPE_GIG_ETH,
OMSG_CONN_TYPE_PWR_LINE }
Connection type.
Functions
• omsg_handle ∗ omsg_open (const char ∗host, int port, const char ∗bind_addr)
Open Olympus Messaging.
• omsg_handle ∗ omsg_open_sec (const char ∗host, int port, const char ∗bind_addr, const char ∗username,
const char ∗password, const char ∗psk_id, const char ∗psk_key)
Open Olympus Messaging.
• omsg_status omsg_close (omsg_handle ∗handle)
Close Olympus Messaging handle Open handles must be closed.
• omsg_status omsg_connect (omsg_handle ∗handle, bool connected, const char ∗mac, omsg_connection←-
_type connection_type, unsigned connection_speed)
Post a connection message.
• omsg_status omsg_query (omsg_handle ∗handle)
Query Request all subscribed Nodes post their device connection status.
• omsg_status omsg_info (omsg_handle ∗handle, oswak_avpairs ∗avp)
Post an informational message about this Node.
• omsg_status omsg_smart_connect (omsg_handle ∗handle, bool active, char ∗pin, unsigned duration)
omsg_smart_connect state.
• omsg_status omsg_subscribe (omsg_handle ∗handle, omsg_type types, omsg_receiver receiver)
Subscribe to message type(s).
• omsg_status omsg_post (omsg_handle ∗handle, omsg_type mtype, oswak_avpairs ∗pairs)
Post a message Create a free-form message.
• omsg_status omsg_publish (omsg_handle ∗handle, const char ∗topic, void ∗data, size_t size)
Getting Started
Value:
val_to_str(OMSG_VER_MAJOR) "." \
val_to_str(OMSG_VER_MINOR) "." \
val_to_str(OMSG_VER_PATCH)
5.1.3.2 typedef void(∗ omsg_receiver) (omsg_handle ∗handle, omsg_type type, oswak_avpairs ∗payload)
Message receiver.
Receive message matching previous subscription
Parameters
handle Handle returned from previous call to omsg_open.
omsg_type type Message type
oswak_avpairs ∗payload payload data as A/V pairs. Data should not be considered valid after callback
completes.
Connection type.
Enumerator
Enumerator
Message type.
Use these values when subscribing to message or creating custom messages. Note that each message type is a
single 1 bit. This is part of the design. Do not add multi-1 bit message types.
See also
omsg_subscribe
Enumerator
Returns
5.1.5.2 omsg_status omsg_connect ( omsg_handle ∗ handle, bool connected, const char ∗ mac,
omsg_connection_type connection_type, unsigned connection_speed )
Returns
OMSG_OK on success.
Parameters
handle Handle returned from previous call to omsg_open.
avp An oswak_avpairs A/V pairs structure. All info messages should contain at the minimum
UUID and services::cnc::location
Returns
OMSG_OK on success.
5.1.5.4 omsg_handle∗ omsg_open ( const char ∗ host, int port, const char ∗ bind_addr )
Returns
5.1.5.5 omsg_handle∗ omsg_open_sec ( const char ∗ host, int port, const char ∗ bind_addr, const char ∗ username,
const char ∗ password, const char ∗ psk_id, const char ∗ psk_key )
Returns
Parameters
handle Handle returned from previous call to omsg_open.
One of the predefined message types
pairs An oswak_avpairs A/V pairs structure. All info messages should contain at the minimum
UUID and services::cnc::location
Returns
OMSG_OK on success.
5.1.5.7 omsg_status omsg_publish ( omsg_handle ∗ handle, const char ∗ topic, void ∗ data, size_t size )
Returns
OMSG_OK on success.
Query Request all subscribed Nodes post their device connection status.
Parameters
handle Handle returned from previous call to omsg_open.
Returns
OMSG_OK on success.
5.1.5.9 omsg_status omsg_smart_connect ( omsg_handle ∗ handle, bool active, char ∗ pin, unsigned duration )
omsg_smart_connect state.
Announce when Node starts or ends /Smart Connect/.
Parameters
handle Handle returned from previous call to omsg_open.
active Boolean indicating whether /Smart Connect/ is active on this node.
pin Character array containing no more than OMSG_MAX_PIN characters
duration Smart Connect duration in seconds
Returns
OMSG_OK on success.
See also
OMSG_MAX_PIN
status = omsg_subscribe( h,
OMSG_TYPE_FOO | OMSG_TYPE_BAR,
my_callback );
Parameters
handle Handle returned from previous call to omsg_open.
types 1 or more types OR'd together
receiver The message receiver function
Returns
OMSG_OK on success.
Returns
See also
http://semver.org
https://wiki.belkin.com/x/-IFUB
omsg.h,
/home/dash/Documents/linksys/olympus-messaging/include/omsg.←- 23
h, 19 OMSG_TYPE_CONF_CHANGE
omsg.h, 23
async_id_t, 7 OMSG_TYPE_CONNECT
omsg.h, 23
Debostream, 7 OMSG_TYPE_CUSTOM
omsg.h, 23
MqMsg, 7 OMSG_TYPE_INFO
MqMsgHeader, 8
omsg.h, 23
msgq::MsgQ, 8
OMSG_TYPE_NONE
omsg.h, 23
OMSG_BAD_CALLBACK
OMSG_TYPE_QUERY
omsg.h, 22
omsg.h, 23
OMSG_BAD_DEST
OMSG_TYPE_SET_ME_UP
omsg.h, 22
omsg.h, 23
OMSG_BAD_FORMAT
OMSG_TYPE_SMART_CONNECT
omsg.h, 22
omsg.h, 23
OMSG_BAD_PAYLOAD
OMSG_UNKNOWN_ERROR
omsg.h, 22
omsg.h, 22
OMSG_BAD_TYPE
OMSG_VER
omsg.h, 22
omsg.h, 21
OMSG_CONN_TYPE_FAST_ETH
omsg.h, 22 omsg.h
OMSG_CONN_TYPE_GIG_ETH OMSG_BAD_CALLBACK, 22
omsg.h, 22 OMSG_BAD_DEST, 22
OMSG_CONN_TYPE_PWR_LINE OMSG_BAD_FORMAT, 22
omsg.h, 22 OMSG_BAD_PAYLOAD, 22
OMSG_CONN_TYPE_UNKNOWN OMSG_BAD_TYPE, 22
omsg.h, 22 OMSG_CONN_TYPE_FAST_ETH, 22
OMSG_CONN_TYPE_WIFI OMSG_CONN_TYPE_GIG_ETH, 22
omsg.h, 22 OMSG_CONN_TYPE_PWR_LINE, 22
OMSG_CONNECT_FAIL OMSG_CONN_TYPE_UNKNOWN, 22
omsg.h, 22 OMSG_CONN_TYPE_WIFI, 22
OMSG_DEFAULT_CC_URL OMSG_CONNECT_FAIL, 22
omsg.h, 21 OMSG_DEFAULT_CC_URL, 21
OMSG_INTERNAL OMSG_INTERNAL, 22
omsg.h, 22 OMSG_MAX_PAYLOAD, 21
OMSG_MAX_PAYLOAD OMSG_MISSING_PARAMS, 22
omsg.h, 21 OMSG_NO_CONNECTION, 22
OMSG_MISSING_PARAMS OMSG_OK, 22
omsg.h, 22 OMSG_PAYLOAD_TOO_BIG, 22
OMSG_NO_CONNECTION OMSG_TOO_MANY_REC, 22
omsg.h, 22 OMSG_TYPE_ALL, 23
OMSG_OK OMSG_TYPE_CONF_CHANGE, 23
omsg.h, 22 OMSG_TYPE_CONNECT, 23
OMSG_PAYLOAD_TOO_BIG OMSG_TYPE_CUSTOM, 23
omsg.h, 22 OMSG_TYPE_INFO, 23
OMSG_TOO_MANY_REC OMSG_TYPE_NONE, 23
omsg.h, 22 OMSG_TYPE_QUERY, 23
OMSG_TYPE_ALL OMSG_TYPE_SET_ME_UP, 23
28 INDEX
OMSG_TYPE_SMART_CONNECT, 23 se_iterate_get_iterator_msg, 10
OMSG_UNKNOWN_ERROR, 22 se_iterate_get_iterator_reply_msg, 11
OMSG_VER, 21 se_iterate_get_msg, 11
omsg_close, 23 se_iterate_get_reply_msg, 11
omsg_connect, 23 se_msg_footer, 11
omsg_connection_type, 22 se_msg_hdr, 12
omsg_handle, 21 se_msg_string, 12
omsg_info, 23 se_new_client_msg, 12
omsg_open, 24 se_notification_msg, 12
omsg_open_sec, 24 se_open_connection_msg, 13
omsg_post, 24 se_open_connection_reply_msg, 13
omsg_publish, 25 se_ping_msg, 13
omsg_query, 25 se_ping_reply_msg, 13
omsg_receiver, 21 se_remove_async_msg, 13
omsg_smart_connect, 25 se_remove_async_reply_msg, 14
omsg_status, 22 se_run_executable_msg, 14
omsg_subscribe, 26 se_run_serially_msg, 14
omsg_type, 22 se_send_notification_msg, 14
omsg_version, 26 se_set_async_action_msg, 15
omsg_close se_set_async_message_msg, 15
omsg.h, 23 se_set_async_reply_msg, 15
omsg_connect se_set_msg, 15
omsg.h, 23 se_set_options_msg, 16
omsg_connection_type se_set_options_reply_msg, 16
omsg.h, 22 se_set_reply_msg, 16
omsg_handle se_set_unique_msg, 16
omsg.h, 21 se_set_unique_reply_msg, 16
omsg_info se_show_data_elements_msg, 17
omsg.h, 23
omsg_open
omsg.h, 24
omsg_open_sec
omsg.h, 24
omsg_post
omsg.h, 24
omsg_publish
omsg.h, 25
omsg_query
omsg.h, 25
omsg_receiver
omsg.h, 21
omsg_smart_connect
omsg.h, 25
omsg_status
omsg.h, 22
omsg_subscribe
omsg.h, 26
omsg_type
omsg.h, 22
omsg_version
omsg.h, 26
se_close_connection_msg, 9
se_close_connection_reply_msg, 9
se_debug_msg, 9
se_del_unique_msg, 10
se_die_msg, 10
se_get_msg, 10
se_get_reply_msg, 10