ifstate 1.13.0__py3-none-any.whl → 1.13.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ifstate
3
- Version: 1.13.0
3
+ Version: 1.13.1
4
4
  Summary: Manage host interface settings in a declarative manner
5
5
  Home-page: https://ifstate.net/
6
6
  Author: Thomas Liske
@@ -2,7 +2,7 @@ ifstate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  ifstate/ifstate.py,sha256=jNWVc-XPZOKwD--xSJvAXZP-DEomljmGXtMf8SAdmmU,8770
3
3
  ifstate/shell.py,sha256=7_JFpi4icr9MijynDzbb0v5mxhFsng6PCC4m3uQ255A,2177
4
4
  ifstate/vrrp.py,sha256=m-vkm_Yx82qx5RmTnouYceWpa1agziBUHr87yK9tBro,5542
5
- libifstate/__init__.py,sha256=zAn9f1jay5LI9JWSwgzqLK8RmTIks4cYELHolpX60i0,30792
5
+ libifstate/__init__.py,sha256=0v7ECPwNFfreOiy5YidN9pHMmEol3gCIcEDFZ85I94w,30792
6
6
  libifstate/exception.py,sha256=5i59BZdl56J_sNJbyU9n6uHuUNJEyDOO4FJ-neDn9Ds,2608
7
7
  libifstate/log.py,sha256=XVoZdwdQoWsjuupFIuG6OP0OrBpXpx7oqyAaUhQ-nJk,4553
8
8
  libifstate/util.py,sha256=vqNaa67QZ2G07bQNAisTyUKbVmp0JGkvEGgbKVTtmYA,10579
@@ -13,7 +13,7 @@ libifstate/bpf/map.py,sha256=cLHNMvRBDNW2yVCEf3z242_oRdU0HqVbFEYVkKXng0w,10818
13
13
  libifstate/brport/__init__.py,sha256=NzdA8F4hr2se1bXKNnyKZbvOFlCWBq_cdjwsL1H0Y-o,2964
14
14
  libifstate/fdb/__init__.py,sha256=jMplRZZQKkgwFQT2L7Ua4YCdLKwOzkd43_6OFtet2No,6262
15
15
  libifstate/link/__init__.py,sha256=epVw6jY8exNeJZUmmUas91yJoeupfgIY7rthq7SGIIw,142
16
- libifstate/link/base.py,sha256=QbHi3R3Ptyi5L4gdBbOPzJ2Ftpvhnk4Hdl4CCIz5pxs,33162
16
+ libifstate/link/base.py,sha256=UX_g8R5Hm9SbtezM2Hc6ED8rGk-LlchfNCOHmoE_OG0,33201
17
17
  libifstate/link/dsa.py,sha256=Y3axTtcym6YL1voKblxctx4PoKDZHzpteKQNnEBUrS8,264
18
18
  libifstate/link/physical.py,sha256=cJiq-MCfy-3XQoU-OxzgfPZZtu_pJ8u2ioJgn9VYdGk,560
19
19
  libifstate/link/tun.py,sha256=m55o5cwO3h3DCLofUR-68fM4ggLoTKElp6ZJ2LrJSCc,959
@@ -23,15 +23,15 @@ libifstate/netns/__init__.py,sha256=lKv43oEcpVUmL494MNOOG_Uh4ght50uu8n8nb9TIwsA,
23
23
  libifstate/parser/__init__.py,sha256=byz1W0G7UewVc5FFie-ti3UZjGK3-75wHIaOeq0oySQ,88
24
24
  libifstate/parser/base.py,sha256=VFAo05O3tiKtI381LVUMYfsDTseMKoQGTfkgnEkm3H4,4770
25
25
  libifstate/parser/yaml.py,sha256=MC0kmwqt3P45z61fb_wfUqoj0iZyhFYkdPyr0UqMSZA,1415
26
- libifstate/routing/__init__.py,sha256=sYe05nuYPYhzahWWwCofDk3F7eRx0vh-iJ6rZr2Utkw,19745
26
+ libifstate/routing/__init__.py,sha256=Hmj-LHBEtVXs5tlRzY8JS_C5qdnN3alD3cIznmzQ-rY,20469
27
27
  libifstate/sysctl/__init__.py,sha256=L2gkoLnac_HM6RbCaKmsEuDTNj2m7U4Rjw42TEti0kg,3074
28
28
  libifstate/tc/__init__.py,sha256=inPdampCOIr_4oKNB3awqMkW0Eh4fpPh9jvSba6sPVg,12092
29
29
  libifstate/wireguard/__init__.py,sha256=vM7vxioV9vQ3gq9SE_URf97ZfGhLsxNiam16y_gXZ5E,6225
30
30
  libifstate/xdp/__init__.py,sha256=X1xhEIGng7R5d5F4KsChykT2g6H-XBRWbWABijoYDQA,7208
31
- schema/ifstate.conf.schema.json,sha256=NZSBedK5m037Iu8O1G5KQ3cc5anNjDs_sPK64U9a6z8,199377
32
- ifstate-1.13.0.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
33
- ifstate-1.13.0.dist-info/METADATA,sha256=gcKwFbvj7qRlszUfdQyFHNOqO1ifd1tu09XwlC4L5u4,1385
34
- ifstate-1.13.0.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
35
- ifstate-1.13.0.dist-info/entry_points.txt,sha256=HF6jX7Uu_nF1Ly-J9uEPeiRapOxnM6LuHsb2y6Mt-k4,52
36
- ifstate-1.13.0.dist-info/top_level.txt,sha256=A7peI7aKBaM69fsiSPvMbL3rzTKZZr5qDxKC-pHMGdE,19
37
- ifstate-1.13.0.dist-info/RECORD,,
31
+ schema/ifstate.conf.schema.json,sha256=oDCBqgOI5uFbSjWUz9RcVmK-3i_90m3AMKA2uzGclRg,201291
32
+ ifstate-1.13.1.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
33
+ ifstate-1.13.1.dist-info/METADATA,sha256=1O1GTUtL-q0T6_QZctL8KntC-zC5RhHz7pnQHDaBlGw,1385
34
+ ifstate-1.13.1.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
35
+ ifstate-1.13.1.dist-info/entry_points.txt,sha256=HF6jX7Uu_nF1Ly-J9uEPeiRapOxnM6LuHsb2y6Mt-k4,52
36
+ ifstate-1.13.1.dist-info/top_level.txt,sha256=A7peI7aKBaM69fsiSPvMbL3rzTKZZr5qDxKC-pHMGdE,19
37
+ ifstate-1.13.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.2.0)
2
+ Generator: setuptools (75.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
libifstate/__init__.py CHANGED
@@ -48,7 +48,7 @@ import json
48
48
  import errno
49
49
  import logging
50
50
 
51
- __version__ = "1.13.0"
51
+ __version__ = "1.13.1"
52
52
 
53
53
 
54
54
  class IfState():
libifstate/link/base.py CHANGED
@@ -85,6 +85,7 @@ class Link(ABC):
85
85
  }
86
86
  attr_value_lookup = {
87
87
  'group': RTLookups.group,
88
+ 'vrf_table': RTLookups.tables,
88
89
  }
89
90
  attr_bind_kinds = [
90
91
  'ip6tnl',
@@ -157,7 +157,21 @@ class Tables(collections.abc.Mapping):
157
157
  rt['oif'] = route['dev']
158
158
 
159
159
  if 'via' in route:
160
- rt['gateway'] = str(ip_address(route['via']))
160
+ via = ip_address(route['via'])
161
+
162
+ if via.version == dst.version:
163
+ rt['gateway'] = str(via)
164
+ else:
165
+ if via.version == 4:
166
+ rt['via'] = {
167
+ 'family': int(AF_INET),
168
+ 'addr': str(via),
169
+ }
170
+ else:
171
+ rt['via'] = {
172
+ 'family': int(AF_INET6),
173
+ 'addr': str(via),
174
+ }
161
175
 
162
176
  if 'src' in route:
163
177
  rt['prefsrc'] = route['src']
@@ -219,6 +233,10 @@ class Tables(collections.abc.Mapping):
219
233
  via = route.get_attr('RTA_GATEWAY')
220
234
  if via:
221
235
  rt['via'] = via
236
+ else:
237
+ via = route.get_attr('RTA_VIA')
238
+ if via and 'addr' in via:
239
+ rt['via'] = via['addr']
222
240
 
223
241
  realm = route.get_attr('RTA_FLOW')
224
242
  if realm:
@@ -280,6 +298,10 @@ class Tables(collections.abc.Mapping):
280
298
  if not gateway is None:
281
299
  rt['gateway'] = str(ip_address(gateway))
282
300
 
301
+ via = route.get_attr('RTA_VIA')
302
+ if not via is None:
303
+ rt['via'] = via
304
+
283
305
  metric = route.get_attr('RTA_PRIORITY')
284
306
  if not metric is None:
285
307
  rt['metric'] = metric
@@ -307,7 +329,7 @@ class Tables(collections.abc.Mapping):
307
329
 
308
330
  kroutes = self.kernel_routes(table)
309
331
 
310
- for route in sorted(croutes, key=lambda x: [x.get('via', ''), x['dst']]):
332
+ for route in sorted(croutes, key=lambda x: [str(x.get('gateway', x.get('via', ''))), x['dst']]):
311
333
  if 'oif' in route and type(route['oif']) == str:
312
334
  oif = next(
313
335
  iter(self.netns.ipr.link_lookup(ifname=route['oif'])), None)
@@ -2318,8 +2318,10 @@
2318
2318
  {
2319
2319
  "description": "Virtual Routing and Forwarding device",
2320
2320
  "required": [
2321
- "kind"
2321
+ "kind",
2322
+ "vrf_table"
2322
2323
  ],
2324
+ "additionalProperties": false,
2323
2325
  "properties": {
2324
2326
  "kind": {
2325
2327
  "const": "vrf",
@@ -2343,6 +2345,15 @@
2343
2345
  "txqlen": {
2344
2346
  "$ref": "#/$defs/iface-link_txqlen"
2345
2347
  },
2348
+ "vrf_table": {
2349
+ "description": "routing table associated with the VRF device",
2350
+ "type": [
2351
+ "integer",
2352
+ "string"
2353
+ ],
2354
+ "minimum": 1,
2355
+ "maximum": 4294967295
2356
+ },
2346
2357
  "ifalias": {
2347
2358
  "$ref": "#/$defs/iface-link_ifalias"
2348
2359
  }
@@ -3081,15 +3092,13 @@
3081
3092
  },
3082
3093
  "vxlan_local": {
3083
3094
  "type": "string",
3084
- "description": "tunnel source ip address",
3085
- "oneOf": [
3086
- {
3087
- "format": "ipv4"
3088
- },
3089
- {
3090
- "format": "ipv6"
3091
- }
3092
- ]
3095
+ "description": "tunnel source IPv4 address",
3096
+ "format": "ipv4"
3097
+ },
3098
+ "vxlan_local6": {
3099
+ "type": "string",
3100
+ "description": "tunnel source IPv6 address",
3101
+ "format": "ipv6"
3093
3102
  },
3094
3103
  "vxlan_group": {
3095
3104
  "type": "string",
@@ -3129,10 +3138,32 @@
3129
3138
  "vxlan_group"
3130
3139
  ]
3131
3140
  },
3141
+ {
3142
+ "required": [
3143
+ "vxlan_local"
3144
+ ]
3145
+ },
3146
+ {
3147
+ "required": [
3148
+ "vxlan_local",
3149
+ "vxlan_group"
3150
+ ]
3151
+ },
3132
3152
  {
3133
3153
  "required": [
3134
3154
  "vxlan_group6"
3135
3155
  ]
3156
+ },
3157
+ {
3158
+ "required": [
3159
+ "vxlan_local6"
3160
+ ]
3161
+ },
3162
+ {
3163
+ "required": [
3164
+ "vxlan_group6",
3165
+ "vxlan_local6"
3166
+ ]
3136
3167
  }
3137
3168
  ]
3138
3169
  },
@@ -3140,7 +3171,9 @@
3140
3171
  "not": {
3141
3172
  "required": [
3142
3173
  "vxlan_group",
3143
- "vxlan_group6"
3174
+ "vxlan_group6",
3175
+ "vxlan_local",
3176
+ "vxlan_local6"
3144
3177
  ]
3145
3178
  }
3146
3179
  }