Skip to content

Commit 18084be

Browse files
committed
CP-17786: Add kind field to port config
Ports that were used so far are now considered to be of type `Basic`. These are ports associated with physical interfaces or bonds of them. We also add a new `PVS_proxy` port kind. Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
1 parent 3d28db6 commit 18084be

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

network/network_interface.ml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ let duplex_of_string = function
8787
| "half" -> Duplex_half
8888
| _ -> Duplex_unknown
8989

90+
type port_kind =
91+
| Basic
92+
| PVS_proxy
93+
94+
let string_of_port_kind = function
95+
| Basic -> "basic"
96+
| PVS_proxy -> "PVS proxy"
97+
9098
type interface_config_t = {
9199
ipv4_conf: ipv4;
92100
ipv4_gateway: Unix.inet_addr option;
@@ -103,6 +111,7 @@ type port_config_t = {
103111
interfaces: iface list;
104112
bond_properties: (string * string) list;
105113
bond_mac: string option;
114+
kind: port_kind;
106115
}
107116
type bridge_config_t = {
108117
ports: (port * port_config_t) list;
@@ -143,6 +152,7 @@ let default_port = {
143152
interfaces = [];
144153
bond_properties = [];
145154
bond_mac = None;
155+
kind = Basic;
146156
}
147157
let default_config = {
148158
interface_config = [];
@@ -287,7 +297,7 @@ module Bridge = struct
287297
external set_persistent : debug_info -> name:bridge -> value:bool -> unit = ""
288298
external get_vlan : debug_info -> name:bridge -> (bridge * int) option = ""
289299
external add_port : debug_info -> ?bond_mac:string -> bridge:bridge -> name:port -> interfaces:iface list ->
290-
?bond_properties:(string * string) list -> unit -> unit = ""
300+
?bond_properties:(string * string) list -> ?kind:port_kind -> unit -> unit = ""
291301
external remove_port : debug_info -> bridge:bridge -> name:port -> unit = ""
292302
external get_interfaces : debug_info -> name:bridge -> iface list = ""
293303
external get_fail_mode : debug_info -> name:bridge -> fail_mode option = ""

0 commit comments

Comments
 (0)