mirror of
https://github.com/SELinuxProject/setools
synced 2025-03-25 04:26:28 +00:00
Implement DCCP protocol support for portcons.
This commit is contained in:
parent
bb1acd1c7f
commit
1147d00797
@ -694,6 +694,11 @@
|
||||
<string/>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>DCCP</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>TCP</string>
|
||||
|
@ -4919,6 +4919,8 @@ int define_port_context(unsigned int low, unsigned int high)
|
||||
protocol = IPPROTO_TCP;
|
||||
} else if ((strcmp(id, "udp") == 0) || (strcmp(id, "UDP") == 0)) {
|
||||
protocol = IPPROTO_UDP;
|
||||
} else if ((strcmp(id, "dccp") == 0) || (strcmp(id, "DCCP") == 0)) {
|
||||
protocol = IPPROTO_DCCP;
|
||||
} else {
|
||||
yyerror2("unrecognized protocol %s", id);
|
||||
free(newc);
|
||||
|
@ -25,6 +25,10 @@ from . import context
|
||||
|
||||
port_range = namedtuple("port_range", ["low", "high"])
|
||||
|
||||
# Python does not have a constant
|
||||
# for the DCCP protocol.
|
||||
IPPROTO_DCCP = getprotobyname("dccp")
|
||||
|
||||
|
||||
def netifcon_factory(policy, name):
|
||||
"""Factory function for creating netifcon objects."""
|
||||
@ -146,7 +150,8 @@ class PortconProtocol(int):
|
||||
corresponding protocol string (udp, tcp).
|
||||
"""
|
||||
|
||||
_proto_to_text = {IPPROTO_TCP: 'tcp',
|
||||
_proto_to_text = {IPPROTO_DCCP: 'dccp',
|
||||
IPPROTO_TCP: 'tcp',
|
||||
IPPROTO_UDP: 'udp'}
|
||||
|
||||
def __new__(cls, value):
|
||||
|
Loading…
Reference in New Issue
Block a user