Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

Olympus Messaging

Generated by Doxygen 1.8.9.1

Tue Apr 30 2019 09:32:13


Contents

1 Main Page 1

2 Data Structure Index 3

2.1 Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

3 File Index 5

3.1 File List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

4 Data Structure Documentation 7

4.1 async_id_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4.2 Debostream Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4.3 MqMsg Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4.4 MqMsgHeader Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

4.5 msgq::MsgQ Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

4.6 se_close_connection_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

4.7 se_close_connection_reply_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 9

4.8 se_debug_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

4.9 se_del_unique_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

4.10 se_die_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

4.11 se_get_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

4.12 se_get_reply_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

4.13 se_iterate_get_iterator_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

4.14 se_iterate_get_iterator_reply_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . 11

4.15 se_iterate_get_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

4.16 se_iterate_get_reply_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

4.17 se_msg_footer Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

4.18 se_msg_hdr Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

4.19 se_msg_string Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

4.20 se_new_client_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

4.21 se_notification_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

4.22 se_open_connection_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

4.23 se_open_connection_reply_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 13


iv CONTENTS

4.24 se_ping_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13


4.25 se_ping_reply_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.26 se_remove_async_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.27 se_remove_async_reply_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.28 se_run_executable_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.29 se_run_serially_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.30 se_send_notification_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.31 se_set_async_action_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.32 se_set_async_message_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.33 se_set_async_reply_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.34 se_set_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.35 se_set_options_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.36 se_set_options_reply_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.37 se_set_reply_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.38 se_set_unique_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.39 se_set_unique_reply_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.40 se_show_data_elements_msg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

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

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


CONTENTS v

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

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


Chapter 1

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

Start by establishing contact with the messaging system via omsg_open():

omsg_handle handle = omsg_open();


/* ... More info to come ... */

To generate HTML documentation, install Doxygen & org-mode then run:

$ make doc

Links:

• Doxygen - http://doxygen.org/

• org-mode - http://orgmode.org/
2 Main Page

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


Chapter 2

Data Structure Index

2.1 Data Structures

Here are the data structures with brief descriptions:


async_id_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Debostream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
MqMsg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
MqMsgHeader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
msgq::MsgQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
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
se_iterate_get_iterator_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
se_iterate_get_iterator_reply_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
se_iterate_get_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
se_iterate_get_reply_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
se_msg_footer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
se_msg_hdr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
se_msg_string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
se_new_client_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
se_notification_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
se_open_connection_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
se_open_connection_reply_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
se_ping_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
se_ping_reply_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
se_remove_async_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
se_remove_async_reply_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
se_run_executable_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
se_run_serially_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
se_send_notification_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
se_set_async_action_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
se_set_async_message_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
se_set_async_reply_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
se_set_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
se_set_options_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
se_set_options_reply_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
se_set_reply_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
se_set_unique_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4 Data Structure Index

se_set_unique_reply_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
se_show_data_elements_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


Chapter 3

File Index

3.1 File List

Here is a list of all documented files with brief descriptions:


/home/dash/Documents/linksys/olympus-messaging/include/debostream.h . . . . . . . . . . . . . . . ??
/home/dash/Documents/linksys/olympus-messaging/include/logging.h . . . . . . . . . . . . . . . . . . ??
/home/dash/Documents/linksys/olympus-messaging/include/mq_msg.h . . . . . . . . . . . . . . . . . ??
/home/dash/Documents/linksys/olympus-messaging/include/msgq.h . . . . . . . . . . . . . . . . . . . ??
/home/dash/Documents/linksys/olympus-messaging/include/omsg.h
Olympus Messaging Data definitions and prototypes . . . . . . . . . . . . . . . . . . . . . . 19
/home/dash/Documents/linksys/olympus-messaging/include/syscfg.h . . . . . . . . . . . . . . . . . . ??
/home/dash/Documents/linksys/olympus-messaging/include/sysevent.h . . . . . . . . . . . . . . . . . ??
/home/dash/Documents/linksys/olympus-messaging/include/ulog.h . . . . . . . . . . . . . . . . . . . ??
6 File Index

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


Chapter 4

Data Structure Documentation

4.1 async_id_t Struct Reference

Data Fields

• unsigned int trigger_id


• unsigned int action_id

The documentation for this struct was generated from the following file:

• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h

4.2 Debostream Class Reference

Public Member Functions

• Debostream (bool verbose=true)


• bool get_verbosity ()
• void set_verbosity (bool new_verbosity)
• std::ostream & operator() (bool v)
• std::ostream & operator() ()

The documentation for this class was generated from the following file:

• /home/dash/Documents/linksys/olympus-messaging/include/debostream.h

4.3 MqMsg Class Reference

Public Member Functions

• 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 Public Member Functions

• static MqMsg ∗ make (const char ∗topic, void ∗payload, size_t payload_size)

Protected Member Functions

• MqMsg (const char ∗topic, void ∗payload, size_t payload_size)

Friends

• ostream & operator<< (ostream &, MqMsg &)

The documentation for this class was generated from the following file:

• /home/dash/Documents/linksys/olympus-messaging/include/mq_msg.h

4.4 MqMsgHeader Class Reference

Public Member Functions

• MqMsgHeader (size_t topic_len, size_t pay_len)


• bool valid ()

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

4.5 msgq::MsgQ Class Reference

Public Member Functions

• MsgQ (std::string name=MsgQ::DEFAULT_Q_NAME, int flags=DEFAULT_FLAGS, bool remove_on_←-


close=false)
• int send (MqMsg &)
• MqMsg ∗ timed_recv (int timeout=5)
• MqMsg ∗ recv ()

Static Public Attributes

• static const string DEFAULT_Q_NAME


• static const int DEFAULT_FLAGS

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


4.6 se_close_connection_msg Struct Reference 9

Protected Member Functions

• void ∗ raw_timed_recv (int timeout)

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

4.6 se_close_connection_msg Struct Reference

Data Fields

• void ∗ reserved

The documentation for this struct was generated from the following file:

• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h

4.7 se_close_connection_reply_msg Struct Reference

Data Fields

• void ∗ reserved

The documentation for this struct was generated from the following file:

• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h

4.8 se_debug_msg Struct Reference

Data Fields

• int level

The documentation for this struct was generated from the following file:

• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


10 Data Structure Documentation

4.9 se_del_unique_msg Struct Reference

Data Fields

• 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

4.10 se_die_msg Struct Reference

Data Fields

• void ∗ reserved

The documentation for this struct was generated from the following file:

• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h

4.11 se_get_msg Struct Reference

Data Fields

• void ∗ data

The documentation for this struct was generated from the following file:

• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h

4.12 se_get_reply_msg Struct Reference

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

4.13 se_iterate_get_iterator_msg Struct Reference

Data Fields

• 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

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


4.14 se_iterate_get_iterator_reply_msg Struct Reference 11

4.14 se_iterate_get_iterator_reply_msg Struct Reference

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

4.15 se_iterate_get_msg Struct Reference

Data Fields

• 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

4.16 se_iterate_get_reply_msg Struct Reference

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

4.17 se_msg_footer Struct Reference

Data Fields

• int poison

The documentation for this struct was generated from the following file:

• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


12 Data Structure Documentation

4.18 se_msg_hdr Struct Reference

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

4.19 se_msg_string Struct Reference

Data Fields

• unsigned int size

The documentation for this struct was generated from the following file:

• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h

4.20 se_new_client_msg Struct Reference

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

4.21 se_notification_msg Struct Reference

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

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


4.22 se_open_connection_msg Struct Reference 13

4.22 se_open_connection_msg Struct Reference

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

4.23 se_open_connection_reply_msg Struct Reference

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

4.24 se_ping_msg Struct Reference

Data Fields

• void ∗ reserved

The documentation for this struct was generated from the following file:

• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h

4.25 se_ping_reply_msg Struct Reference

Data Fields

• void ∗ reserved

The documentation for this struct was generated from the following file:

• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h

4.26 se_remove_async_msg Struct Reference

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

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


14 Data Structure Documentation

4.27 se_remove_async_reply_msg Struct Reference

Data Fields

• int status

The documentation for this struct was generated from the following file:

• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h

4.28 se_run_executable_msg Struct Reference

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

4.29 se_run_serially_msg Struct Reference

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

4.30 se_send_notification_msg Struct Reference

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

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


4.31 se_set_async_action_msg Struct Reference 15

4.31 se_set_async_action_msg Struct Reference

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

4.32 se_set_async_message_msg Struct Reference

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

4.33 se_set_async_reply_msg Struct Reference

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

4.34 se_set_msg Struct Reference

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

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


16 Data Structure Documentation

4.35 se_set_options_msg Struct Reference

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

4.36 se_set_options_reply_msg Struct Reference

Data Fields

• int status

The documentation for this struct was generated from the following file:

• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h

4.37 se_set_reply_msg Struct Reference

Data Fields

• int status

The documentation for this struct was generated from the following file:

• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h

4.38 se_set_unique_msg Struct Reference

Data Fields

• void ∗ data

The documentation for this struct was generated from the following file:

• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h

4.39 se_set_unique_reply_msg Struct Reference

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

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


4.40 se_show_data_elements_msg Struct Reference 17

4.40 se_show_data_elements_msg Struct Reference

Data Fields

• void ∗ data

The documentation for this struct was generated from the following file:

• /home/dash/Documents/linksys/olympus-messaging/include/sysevent.h

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


18 Data Structure Documentation

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


Chapter 5

File Documentation

5.1 /home/dash/Documents/linksys/olympus-messaging/include/omsg.h File Reference

Olympus Messaging Data definitions and prototypes.


#include <stdbool.h>
#include <stdint.h>
#include <oswak.h>

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

• typedef void omsg_handle


Olympus Messaging handle.
• typedef void(∗ omsg_receiver) (omsg_handle ∗handle, omsg_type type, oswak_avpairs ∗payload)
Message receiver.

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)

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


5.1 /home/dash/Documents/linksys/olympus-messaging/include/omsg.h File Reference 21

Post a message Create a free-form message.


• const char ∗ omsg_version ()
Get Olympus Messaging library version.

5.1.1 Detailed Description

Olympus Messaging Data definitions and prototypes.


This represents the API interfacing router-resident client code with the /Olympus Messaging/ subsystem.

Getting Started

Start by establishing contact with the messaging system via omsg_open :

omsg_handle handle = omsg_open();

... More info to come ...

5.1.2 Macro Definition Documentation

5.1.2.1 #define OMSG_DEFAULT_CC_URL "http://cisco.com/jnap/networkconnections/GetNetworkConnections"

Default JNAP C&C URL.


Olympus already defines a JNAP interface to get basic connection data.

5.1.2.2 #define OMSG_MAX_PAYLOAD (8192)

Only payloads up to 8KB allowed.


AllJoyn imposes a maximum signal payload size of 128KB (although they recommend no more than 110KB).

5.1.2.3 #define OMSG_VER

Value:

val_to_str(OMSG_VER_MAJOR) "." \
val_to_str(OMSG_VER_MINOR) "." \
val_to_str(OMSG_VER_PATCH)

omsg library version.


This aggregates the major, minor and patch values defined above into a single version string.

5.1.3 Typedef Documentation

5.1.3.1 typedef void omsg_handle

Olympus Messaging handle.


Created with omsg_open, required for every call. Remember to omsg_close it when done.

5.1.3.2 typedef void(∗ omsg_receiver) (omsg_handle ∗handle, omsg_type type, oswak_avpairs ∗payload)

Message receiver.
Receive message matching previous subscription

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


22 File Documentation

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.

5.1.4 Enumeration Type Documentation

5.1.4.1 enum omsg_connection_type

Connection type.

Enumerator

OMSG_CONN_TYPE_UNKNOWN Unknown connection type.


OMSG_CONN_TYPE_WIFI Wi-Fi connection.
OMSG_CONN_TYPE_FAST_ETH Fast ethernet (100Mb)
OMSG_CONN_TYPE_GIG_ETH Gigabit ethernet.
OMSG_CONN_TYPE_PWR_LINE Power line.

5.1.4.2 enum omsg_status

Status codes returned by various Olympus Messaging functions.

Enumerator

OMSG_OK 0: Zero is always OK.


OMSG_UNKNOWN_ERROR 1: An undocumented error.
OMSG_INTERNAL 2: Internal Error
OMSG_BAD_DEST 3: Bad message destination
OMSG_PAYLOAD_TOO_BIG 4: Payload length exceeds maximum
OMSG_BAD_CALLBACK 5: Bad (perhaps NULL) callback
OMSG_BAD_TYPE 6: Bad message type
OMSG_TOO_MANY_REC 7: Too many receivers
OMSG_BAD_PAYLOAD 8: Problem with payload
OMSG_MISSING_PARAMS 9: One or more mandatory A/V pairs missing from message
OMSG_BAD_FORMAT 10: Invalid data while en/decoding
OMSG_NO_CONNECTION Client has no connection to master.
OMSG_CONNECT_FAIL Failure establishing connection.

5.1.4.3 enum omsg_type

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.

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


5.1 /home/dash/Documents/linksys/olympus-messaging/include/omsg.h File Reference 23

See also

omsg_subscribe

Enumerator

OMSG_TYPE_NONE 0: None (unsubscribe)


OMSG_TYPE_CONNECT 1: Connection state change
OMSG_TYPE_QUERY 2: Request connection info
OMSG_TYPE_INFO 4: Connection information
OMSG_TYPE_CUSTOM 8: Application defined
OMSG_TYPE_ALL 16: Receive all messages
OMSG_TYPE_SMART_CONNECT 32: Smart Connect
OMSG_TYPE_CONF_CHANGE 64: Configuration change
OMSG_TYPE_SET_ME_UP 128: Slave wants to be setup

5.1.5 Function Documentation

5.1.5.1 omsg_status omsg_close ( omsg_handle ∗ handle )

Close Olympus Messaging handle Open handles must be closed.


Closing a handle twice is an error. NULL handles are ignored.
Parameters
handle Pointer to handle returned from previous call to OMSG_open().

Returns

OMSG_OK on success, otherwise an omsg_status code

5.1.5.2 omsg_status omsg_connect ( omsg_handle ∗ handle, bool connected, const char ∗ mac,
omsg_connection_type connection_type, unsigned connection_speed )

Post a connection message.


Do this whenever a device connects or disconnects.
Parameters
handle Pointer to handle returned from previous call to OMSG_open().
connected Is device is connected?
mac MAC address of device. Has room for EUI-64 format (e.g. "01-23-45-67-89-ab-cd-ef") +
NULL.
connection_type; Enumeration indicating Wi-Fi, Ethernet, etc
connection_←- Nominal link speed in Mb/s
speed

Returns

OMSG_OK on success.

5.1.5.3 omsg_status omsg_info ( omsg_handle ∗ handle, oswak_avpairs ∗ avp )

Post an informational message about this Node.


Use omsg_info at startup and in response to omsg_query messages.

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


24 File Documentation

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 )

Open Olympus Messaging.


Parameters
host Host running the broker service.
port Port number to connect with
const char ∗bind_addr Address to bind to. If NULL will bind to localhost. Note that this address will
be present in every message this client sends as the value to the payload attribute "sender-
address".

Returns

On success an omsg_handle pointer. On fail sets errno and returns NULL.

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 )

Open Olympus Messaging.


Parameters
host Host running the broker service.
port Port number to connect with
const char ∗bind_addr Address to bind to. If NULL will bind to localhost. Note that this address will
be present in every message this client sends as the value to the payload attribute "sender-
address".
const char ∗username Name to use for authentication
const char ∗password Name to use for authentication
psk_id When using PSK TLS, this provides the /identity/ part. Leave NULL if not using PSK.
psk_key When using PSK TLS, this provides the /key/ part. Leave NULL if not using PSK.

Returns

On success an omsg_handle pointer. On fail sets errno and returns NULL.

5.1.5.6 omsg_status omsg_post ( omsg_handle ∗ handle, omsg_type mtype, oswak_avpairs ∗ pairs )

Post a message Create a free-form message.

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


5.1 /home/dash/Documents/linksys/olympus-messaging/include/omsg.h File Reference 25

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 )

Post a message Create a free-form message.


Parameters
handle Handle returned from previous call to omsg_open.
topic A string containing a topic valid to the selected transport.
data Pointer to buffer containing data for message. If no message, NULL.
size Size of data to send or 0 if data is NULL.

Returns

OMSG_OK on success.

5.1.5.8 omsg_status omsg_query ( omsg_handle ∗ handle )

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.

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


26 File Documentation

See also

OMSG_MAX_PIN

5.1.5.10 omsg_status omsg_subscribe ( omsg_handle ∗ handle, omsg_type types, omsg_receiver receiver )

Subscribe to message type(s).


One can subscribe a single callback to multiple message types by adding them together like so:

status = omsg_subscribe( h,
OMSG_TYPE_FOO | OMSG_TYPE_BAR,
my_callback );

Alternately, one can use multiple callbacks:

status = omsg_subscribe( h, OMSG_TYPE_FOO, my_foo_callback );


status = omsg_subscribe( h, OMSG_TYPE_BAR, my_bar_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.

5.1.5.11 const char∗ omsg_version ( )

Get Olympus Messaging library version.

Returns

library version as a string (e.g. "1.2.3").

See also

http://semver.org
https://wiki.belkin.com/x/-IFUB

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen


Index

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

Generated on Tue Apr 30 2019 09:32:13 for Olympus Messaging by Doxygen

You might also like