2 # -*- coding: utf-8 -*-
4 from nepi.core.description import AF_INET
5 from nepi.core.attributes import Attribute
6 from nepi.util import validation
11 "factory_type": "routing",
12 "display_name": "Node",
14 "category": "topology",
17 "Connector from node to applications",
19 ["netns_application_node"]),
21 "Connector from node to network interfaces",
24 "netns_nodeiface_node",
25 "netns_tapiface_node",
31 "Forward x11 from main namespace to the node",
33 False, None, None, False,
37 "P2PInterface": dict({
38 "factory_type": "addressable",
41 "display_name": "P2PInterface",
42 "help": "Point to point network interface",
43 "category": "devices",
45 ("netns_p2piface_node",
46 "Connector from P2PInterface to Node",
49 ("netns_p2pinterface_p2p",
50 "Connector to another P2PInterface",
52 ["netns_p2piface_p2p"])
55 ("lladdr", "Mac address", Attribute.STRING,
56 None, None, None, False,
57 validation.is_mac_address),
58 ("up", "Link up", Attribute.BOOL,
59 False, None, None, False,
61 ("name", "Device name", Attribute.STRING,
62 None, None, None, False,
63 validation.is_string),
64 ("mtu", "Maximmum transmition unit for device",
66 None, None, None, False,
67 validation.is_integer),
68 ("broadcast", "Broadcast address",
70 None, None, None, False,
71 validation.is_string),
72 ("multicast", "Is multicast enabled",
74 False, None, None, False,
76 ("arp", "Is ARP enabled", Attribute.BOOL,
77 True, None, None, False,
81 "TapNodeInterface": dict({
82 "factory_type": "addressable",
85 "display_name": "TapNodeInterface",
86 "help": "Tap device network interface",
87 "category": "devices",
89 ("netns_tapiface_node",
90 "Connector to a Node",
94 "Connector to a network interface that can receive a file descriptor",
96 # TODO: Doesn't exist yet!
100 ("lladdr", "Mac address", Attribute.STRING,
101 None, None, None, False,
102 validation.is_mac_address),
103 ("up", "Link up", Attribute.BOOL,
104 False, None, None, False,
106 ("name", "Device name", Attribute.STRING,
107 None, None, None, False,
108 validation.is_string),
109 ("mtu", "Maximmum transmition unit for device",
111 None, None, None, False,
112 validation.is_integer),
113 ("broadcast", "Broadcast address",
115 None, None, None, False,
116 validation.is_string),
117 ("multicast", "Is multicast enabled",
119 False, None, None, False,
121 ("arp", "Is ARP enabled", Attribute.BOOL,
122 True, None, None, False,
126 "NodeInterface": dict({
127 "factory_type": "addressable",
130 "display_name": "NodeInterface",
131 "help": "Node network interface",
132 "category": "devices",
134 ("netns_nodeiface_node", "Connector to a node",
136 ["netns_node_devs"]),
137 ("netns_nodeiface_switch", "Connector to a switch",
139 ["netns_switch_devs"])
142 ("lladdr", "Mac address", Attribute.STRING,
143 None, None, None, False,
144 validation.is_mac_address),
145 ("up", "Link up", Attribute.BOOL,
146 False, None, None, False,
148 ("name", "Device name", Attribute.STRING,
149 None, None, None, False,
150 validation.is_string),
151 ("mtu", "Maximmum transmition unit for device",
153 None, None, None, False,
154 validation.is_integer),
155 ("broadcast", "Broadcast address",
157 None, None, None, False,
158 validation.is_string),
159 ("multicast", "Is multicast enabled",
161 False, None, None, False,
163 ("arp", "Is ARP enabled", Attribute.BOOL,
164 True, None, None, False,
169 "display_name": "Switch",
170 "help": "Switch interface",
171 "category": "devices",
173 ("netns_switch_devs", "Connector to network interfaces",
175 ["netns_nodeiface_switch"])
178 ("up", "Link up", Attribute.BOOL,
179 False, None, None, False,
181 ("name", "Device name", Attribute.STRING,
182 None, None, None, False,
183 validation.is_string),
184 ("mtu", "Maximmum transmition unit for device",
186 None, None, None, False,
187 validation.is_integer),
188 ("multicast", "Is multicast enabled",
190 None, None, None, False,
192 #TODO:("Stp", help, type, value, range, allowed, readonly, validation_function),
193 #TODO:("ForwarddDelay", help, type, value, range, allowed, readonly, validation_function),
194 #TODO:("HelloTime", help, type, value, range, allowed, readonly, validation_function),
195 #TODO:("AgeingTime", help, type, value, range, allowed, readonly, validation_function),
196 #TODO:("MaxAge", help, type, value, range, allowed, readonly, validation_function)
199 "Application": dict({
200 "display_name": "Application",
201 "help": "Generic executable command line application",
202 "category": "applications",
204 ("netns_application_node", "Connector to a node",
209 ("StdoutTrace", "Standard output"),
210 ("StderrTrace", "Standard error")
213 ("command", "Command line",
215 None, None, None, False,
216 validation.is_string),
217 ("user", "System user",
219 None, None, None, False,
220 validation.is_string),
221 ("stdin", "Standard input",
223 None, None, None, False,
224 validation.is_string)