Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add onlyForTopics and forbiddenTopics config options to enable/disables PSMXes on a topic-by-topic basis #2030

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 74 additions & 3 deletions docs/manual/config/config_file_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ The default value is: ``default``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Attributes: :ref:`config<//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange[@config]>`, :ref:`library<//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange[@library]>`, :ref:`name<//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange[@name]>`, :ref:`priority<//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange[@priority]>`
Children: :ref:`forbiddenTopics<//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/forbiddenTopics>`, :ref:`onlyForTopics<//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/onlyForTopics>`

This element defines a PSMX.

Expand Down Expand Up @@ -707,6 +708,76 @@ This attribute specifies the interface priority (decimal integer or default). Th
The default value is: ``default``


.. _`//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/forbiddenTopics`:

//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/forbiddenTopics
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Children: :ref:`Pattern<//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/forbiddenTopics/Pattern>`

A list of topics that should never use this psmx. Mutually exclusive with onlyForTopics.


.. _`//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/forbiddenTopics/Pattern`:

//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/forbiddenTopics/Pattern
____________________________________________________________________________________

Attributes: :ref:`value<//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/forbiddenTopics/Pattern[@value]>`

Text

A pattern (with ? and \* wildcards) that is matched against topics.

The default value is: ``<empty>``


.. _`//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/forbiddenTopics/Pattern[@value]`:

//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/forbiddenTopics/Pattern[@value]
____________________________________________________________________________________________

Text


The default value is: ``<empty>``


.. _`//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/onlyForTopics`:

//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/onlyForTopics
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Children: :ref:`Pattern<//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/onlyForTopics/Pattern>`

A list of topics that should never use this psmx. Mutually exclusive with onlyForTopics.


.. _`//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/onlyForTopics/Pattern`:

//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/onlyForTopics/Pattern
__________________________________________________________________________________

Attributes: :ref:`value<//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/forbiddenTopics/Pattern[@value]>`

Text

A pattern (with ? and \* wildcards) that is matched against topics.

The default value is: ``<empty>``


.. _`//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/forbiddenTopics/Pattern[@value]`:

//CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/forbiddenTopics/Pattern[@value]
____________________________________________________________________________________________

Text


The default value is: ``<empty>``


.. _`//CycloneDDS/Domain/General/MaxMessageSize`:

//CycloneDDS/Domain/General/MaxMessageSize
Expand Down Expand Up @@ -2704,10 +2775,10 @@ The categorisation of tracing output is incomplete and hence most of the verbosi
The default value is: ``none``

..
generated from ddsi_config.h[83ad19f1a665710b0c82b3ac6b861e6c8e83913f]
generated from ddsi_config.h[9296f1e4eceda8b8514e7859c5584f1cda35412c]
generated from ddsi__cfgunits.h[bd22f0c0ed210501d0ecd3b07c992eca549ef5aa]
generated from ddsi__cfgelems.h[194217161977869610495a7889bbc1e6bc976ce1]
generated from ddsi_config.c[a439a20e32fe327db26f2f10028d0056e46c1a0b]
generated from ddsi__cfgelems.h[714f801d2988b476694a198097d36169f7e5e129]
generated from ddsi_config.c[6fa39d18f6f0d241b7592a0dc23741e2a934ff2e]
generated from _confgen.h[e32eabfc35e9f3a7dcb63b19ed148c0d17c6e5fc]
generated from _confgen.c[237308acd53897a34e8c643e16e05a61d73ffd65]
generated from generate_rnc.c[b50e4b7ab1d04b2bc1d361a0811247c337b74934]
Expand Down
53 changes: 50 additions & 3 deletions docs/manual/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ The default value is: `default`

##### //CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange
Attributes: [config](#cycloneddsdomaingeneralinterfacespubsubmessageexchangeconfig), [library](#cycloneddsdomaingeneralinterfacespubsubmessageexchangelibrary), [name](#cycloneddsdomaingeneralinterfacespubsubmessageexchangename), [priority](#cycloneddsdomaingeneralinterfacespubsubmessageexchangepriority)
Children: [forbiddenTopics](#cycloneddsdomaingeneralinterfacespubsubmessageexchangeforbiddentopics), [onlyForTopics](#cycloneddsdomaingeneralinterfacespubsubmessageexchangeonlyfortopics)

This element defines a PSMX.

Expand Down Expand Up @@ -474,6 +475,52 @@ This attribute specifies the interface priority (decimal integer or default). Th
The default value is: `default`


###### //CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/forbiddenTopics
Children: [Pattern](#cycloneddsdomaingeneralinterfacespubsubmessageexchangeforbiddentopicspattern)

A list of topics that should never use this psmx. Mutually exclusive with onlyForTopics.


####### //CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/forbiddenTopics/Pattern
Attributes: [value](#cycloneddsdomaingeneralinterfacespubsubmessageexchangeforbiddentopicspatternvalue)

Text

A pattern (with ? and \* wildcards) that is matched against topics.

The default value is: `<empty>`


####### //CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/forbiddenTopics/Pattern[@value]
Text


The default value is: `<empty>`


###### //CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/onlyForTopics
Children: [Pattern](#cycloneddsdomaingeneralinterfacespubsubmessageexchangeonlyfortopicspattern)

A list of topics that should never use this psmx. Mutually exclusive with onlyForTopics.


####### //CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/onlyForTopics/Pattern
Attributes: [value](#cycloneddsdomaingeneralinterfacespubsubmessageexchangeforbiddentopicspatternvalue)

Text

A pattern (with ? and \* wildcards) that is matched against topics.

The default value is: `<empty>`


####### //CycloneDDS/Domain/General/Interfaces/PubSubMessageExchange/forbiddenTopics/Pattern[@value]
Text


The default value is: `<empty>`


#### //CycloneDDS/Domain/General/MaxMessageSize
Number-with-unit

Expand Down Expand Up @@ -1898,10 +1945,10 @@ While none prevents any message from being written to a DDSI2 log file.
The categorisation of tracing output is incomplete and hence most of the verbosity levels and categories are not of much use in the current release. This is an ongoing process and here we describe the target situation rather than the current situation. Currently, the most useful verbosity levels are config, fine and finest.

The default value is: `none`
<!--- generated from ddsi_config.h[83ad19f1a665710b0c82b3ac6b861e6c8e83913f] -->
<!--- generated from ddsi_config.h[9296f1e4eceda8b8514e7859c5584f1cda35412c] -->
<!--- generated from ddsi__cfgunits.h[bd22f0c0ed210501d0ecd3b07c992eca549ef5aa] -->
<!--- generated from ddsi__cfgelems.h[194217161977869610495a7889bbc1e6bc976ce1] -->
<!--- generated from ddsi_config.c[a439a20e32fe327db26f2f10028d0056e46c1a0b] -->
<!--- generated from ddsi__cfgelems.h[714f801d2988b476694a198097d36169f7e5e129] -->
<!--- generated from ddsi_config.c[6fa39d18f6f0d241b7592a0dc23741e2a934ff2e] -->
<!--- generated from _confgen.h[e32eabfc35e9f3a7dcb63b19ed148c0d17c6e5fc] -->
<!--- generated from _confgen.c[237308acd53897a34e8c643e16e05a61d73ffd65] -->
<!--- generated from generate_rnc.c[b50e4b7ab1d04b2bc1d361a0811247c337b74934] -->
Expand Down
36 changes: 33 additions & 3 deletions etc/cyclonedds.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,36 @@ CycloneDDS configuration""" ] ]
attribute priority {
text
}?
& [ a:documentation [ xml:lang="en" """
<p>A list of topics that should never use this psmx. Mutually exclusive with onlyForTopics. </p>""" ] ]
element forbiddenTopics {
[ a:documentation [ xml:lang="en" """
<p>A pattern (with ? and * wildcards) that is matched against topics. </p>
<p>The default value is: <code>&lt;empty&gt;</code></p>""" ] ]
element Pattern {
[ a:documentation [ xml:lang="en" """

<p>The default value is: <code>&lt;empty&gt;</code></p>""" ] ]
attribute value {
text
}
}*
}?
& [ a:documentation [ xml:lang="en" """
<p>A list of topics that should never use this psmx. Mutually exclusive with onlyForTopics. </p>""" ] ]
element onlyForTopics {
[ a:documentation [ xml:lang="en" """
<p>A pattern (with ? and * wildcards) that is matched against topics. </p>
<p>The default value is: <code>&lt;empty&gt;</code></p>""" ] ]
element Pattern {
[ a:documentation [ xml:lang="en" """

<p>The default value is: <code>&lt;empty&gt;</code></p>""" ] ]
attribute value {
text
}
}*
}?
}*
}?
& [ a:documentation [ xml:lang="en" """
Expand Down Expand Up @@ -1313,10 +1343,10 @@ MIIEpAIBAAKCAQEA3HIh...AOBaaqSV37XBUJg==<br>
duration_inf = xsd:token { pattern = "inf|0|(\d+(\.\d*)?([Ee][\-+]?\d+)?|\.\d+([Ee][\-+]?\d+)?) *([num]?s|min|hr|day)" }
memsize = xsd:token { pattern = "0|(\d+(\.\d*)?([Ee][\-+]?\d+)?|\.\d+([Ee][\-+]?\d+)?) *([kMG]i?)?B" }
}
# generated from ddsi_config.h[83ad19f1a665710b0c82b3ac6b861e6c8e83913f]
# generated from ddsi_config.h[9296f1e4eceda8b8514e7859c5584f1cda35412c]
# generated from ddsi__cfgunits.h[bd22f0c0ed210501d0ecd3b07c992eca549ef5aa]
# generated from ddsi__cfgelems.h[194217161977869610495a7889bbc1e6bc976ce1]
# generated from ddsi_config.c[a439a20e32fe327db26f2f10028d0056e46c1a0b]
# generated from ddsi__cfgelems.h[714f801d2988b476694a198097d36169f7e5e129]
# generated from ddsi_config.c[6fa39d18f6f0d241b7592a0dc23741e2a934ff2e]
# generated from _confgen.h[e32eabfc35e9f3a7dcb63b19ed148c0d17c6e5fc]
# generated from _confgen.c[237308acd53897a34e8c643e16e05a61d73ffd65]
# generated from generate_rnc.c[b50e4b7ab1d04b2bc1d361a0811247c337b74934]
Expand Down
48 changes: 45 additions & 3 deletions etc/cyclonedds.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,10 @@ CycloneDDS configuration</xs:documentation>
&lt;p&gt;This element defines a PSMX.&lt;/p&gt;</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element minOccurs="0" ref="config:forbiddenTopics"/>
<xs:element minOccurs="0" ref="config:onlyForTopics"/>
</xs:all>
<xs:attribute name="config">
<xs:annotation>
<xs:documentation>
Expand Down Expand Up @@ -528,6 +532,44 @@ CycloneDDS configuration</xs:documentation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="forbiddenTopics">
<xs:annotation>
<xs:documentation>
&lt;p&gt;A list of topics that should never use this psmx. Mutually exclusive with onlyForTopics. &lt;/p&gt;</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="config:Pattern"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Pattern">
<xs:annotation>
<xs:documentation>
&lt;p&gt;A pattern (with ? and * wildcards) that is matched against topics. &lt;/p&gt;
&lt;p&gt;The default value is: &lt;code&gt;&amp;lt;empty&amp;gt;&lt;/code&gt;&lt;/p&gt;</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="value" use="required">
<xs:annotation>
<xs:documentation>

&lt;p&gt;The default value is: &lt;code&gt;&amp;lt;empty&amp;gt;&lt;/code&gt;&lt;/p&gt;</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="onlyForTopics">
<xs:annotation>
<xs:documentation>
&lt;p&gt;A list of topics that should never use this psmx. Mutually exclusive with onlyForTopics. &lt;/p&gt;</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="config:Pattern"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="MaxMessageSize" type="config:memsize">
<xs:annotation>
<xs:documentation>
Expand Down Expand Up @@ -1971,10 +2013,10 @@ MIIEpAIBAAKCAQEA3HIh...AOBaaqSV37XBUJg==&lt;br&gt;
</xs:restriction>
</xs:simpleType>
</xs:schema>
<!--- generated from ddsi_config.h[83ad19f1a665710b0c82b3ac6b861e6c8e83913f] -->
<!--- generated from ddsi_config.h[9296f1e4eceda8b8514e7859c5584f1cda35412c] -->
<!--- generated from ddsi__cfgunits.h[bd22f0c0ed210501d0ecd3b07c992eca549ef5aa] -->
<!--- generated from ddsi__cfgelems.h[194217161977869610495a7889bbc1e6bc976ce1] -->
<!--- generated from ddsi_config.c[a439a20e32fe327db26f2f10028d0056e46c1a0b] -->
<!--- generated from ddsi__cfgelems.h[714f801d2988b476694a198097d36169f7e5e129] -->
<!--- generated from ddsi_config.c[6fa39d18f6f0d241b7592a0dc23741e2a934ff2e] -->
<!--- generated from _confgen.h[e32eabfc35e9f3a7dcb63b19ed148c0d17c6e5fc] -->
<!--- generated from _confgen.c[237308acd53897a34e8c643e16e05a61d73ffd65] -->
<!--- generated from generate_rnc.c[b50e4b7ab1d04b2bc1d361a0811247c337b74934] -->
Expand Down
2 changes: 2 additions & 0 deletions src/core/ddsc/include/dds/ddsc/dds_psmx.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ typedef struct dds_psmx {
dds_psmx_ops_t ops; //!< associated functions
const char *instance_name; //!< name of this PSMX instance
int32_t priority; //!< priority of choosing this interface
char ** only_for_topics; //!< See ddsi_config_psmx. Format is nullptr-terminated array of separately allocated char*
char ** forbidden_topics; //!< See ddsi_config_psmx. Format is nullptr-terminated array of separately allocated char*
const struct ddsi_locator *locator; //!< the locator for this PSMX instance
dds_psmx_instance_id_t instance_id; //!< the identifier of this PSMX instance
struct dds_psmx_topic_list_elem *psmx_topics; //!< associated topics
Expand Down
Loading
Loading