File tree 3 files changed +40
-0
lines changed
3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,7 @@ let read_management_conf () =
187
187
; bridge_config
188
188
; gateway_interface= Some bridge_name
189
189
; dns_interface= Some bridge_name
190
+ ; interface_order= None
190
191
}
191
192
with e ->
192
193
error " Error while trying to read firstboot data: %s\n %s"
Original file line number Diff line number Diff line change 11
11
xapi-idl
12
12
xapi-log
13
13
ipaddr
14
+ macaddr
14
15
)
15
16
(wrapped false)
16
17
(preprocess (pps ppx_deriving_rpc)))
Original file line number Diff line number Diff line change @@ -81,6 +81,31 @@ module Unix = struct
81
81
}
82
82
end
83
83
84
+ module Macaddr = struct
85
+ include Macaddr
86
+
87
+ let typ_of =
88
+ Rpc.Types. Abstract
89
+ {
90
+ aname= " macaddr"
91
+ ; test_data= [Macaddr. of_string_exn " ca:fe:ba:be:ee:ee" ]
92
+ ; rpc_of= (fun t -> Rpc. String (Macaddr. to_string t))
93
+ ; of_rpc=
94
+ (function
95
+ | Rpc. String s ->
96
+ Ok (Macaddr. of_string_exn s)
97
+ | r ->
98
+ Error
99
+ (`Msg
100
+ (Printf. sprintf
101
+ " typ_of_macaddr: expectd rpc string but got %s"
102
+ (Rpc. to_string r)
103
+ )
104
+ )
105
+ )
106
+ }
107
+ end
108
+
84
109
(* * {2 Types} *)
85
110
86
111
type debug_info = string [@@ deriving rpcty ]
@@ -91,6 +116,8 @@ type port = string [@@deriving rpcty]
91
116
92
117
type bridge = string [@@ deriving rpcty ]
93
118
119
+ type mac_address = Macaddr .t [@@ deriving rpcty ]
120
+
94
121
(* rpcty cannot handle polymorphic variant, so change the definition to variant *)
95
122
type dhcp_options = Set_gateway | Set_dns [@@ deriving rpcty ]
96
123
@@ -184,11 +211,21 @@ type bridge_config_t = {
184
211
}
185
212
[@@ deriving rpcty ]
186
213
214
+ type ordered_iface = {
215
+ name : iface
216
+ ; position : int
217
+ ; mac : mac_address
218
+ ; pci : Xcp_pci .address
219
+ ; present : bool
220
+ }
221
+ [@@ deriving rpcty ]
222
+
187
223
type config_t = {
188
224
interface_config : (iface * interface_config_t ) list [@ default []]
189
225
; bridge_config : (bridge * bridge_config_t ) list [@ default []]
190
226
; gateway_interface : iface option [@ default None ]
191
227
; dns_interface : iface option [@ default None ]
228
+ ; interface_order : ordered_iface list option [@ default None ]
192
229
}
193
230
[@@ deriving rpcty ]
194
231
@@ -226,6 +263,7 @@ let default_config =
226
263
; bridge_config= []
227
264
; gateway_interface= None
228
265
; dns_interface= None
266
+ ; interface_order= None
229
267
}
230
268
231
269
(* * {2 Configuration manipulation} *)
You can’t perform that action at this time.
0 commit comments