ifstate 1.11.8__tar.gz → 1.11.9__tar.gz

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.
Files changed (41) hide show
  1. {ifstate-1.11.8 → ifstate-1.11.9}/PKG-INFO +1 -1
  2. {ifstate-1.11.8 → ifstate-1.11.9}/ifstate.egg-info/PKG-INFO +1 -1
  3. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/__init__.py +1 -1
  4. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/address/__init__.py +8 -3
  5. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/link/base.py +6 -0
  6. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/log.py +2 -0
  7. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/routing/__init__.py +11 -2
  8. {ifstate-1.11.8 → ifstate-1.11.9}/schema/ifstate.conf.schema.json +151 -8
  9. {ifstate-1.11.8 → ifstate-1.11.9}/LICENSE +0 -0
  10. {ifstate-1.11.8 → ifstate-1.11.9}/README.md +0 -0
  11. {ifstate-1.11.8 → ifstate-1.11.9}/ifstate/__init__.py +0 -0
  12. {ifstate-1.11.8 → ifstate-1.11.9}/ifstate/ifstate.py +0 -0
  13. {ifstate-1.11.8 → ifstate-1.11.9}/ifstate/shell.py +0 -0
  14. {ifstate-1.11.8 → ifstate-1.11.9}/ifstate/vrrp.py +0 -0
  15. {ifstate-1.11.8 → ifstate-1.11.9}/ifstate.egg-info/SOURCES.txt +0 -0
  16. {ifstate-1.11.8 → ifstate-1.11.9}/ifstate.egg-info/dependency_links.txt +0 -0
  17. {ifstate-1.11.8 → ifstate-1.11.9}/ifstate.egg-info/entry_points.txt +0 -0
  18. {ifstate-1.11.8 → ifstate-1.11.9}/ifstate.egg-info/requires.txt +0 -0
  19. {ifstate-1.11.8 → ifstate-1.11.9}/ifstate.egg-info/top_level.txt +0 -0
  20. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/bpf/__init__.py +0 -0
  21. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/bpf/ctypes.py +0 -0
  22. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/bpf/map.py +0 -0
  23. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/brport/__init__.py +0 -0
  24. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/exception.py +0 -0
  25. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/fdb/__init__.py +0 -0
  26. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/link/__init__.py +0 -0
  27. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/link/physical.py +0 -0
  28. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/link/tun.py +0 -0
  29. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/link/veth.py +0 -0
  30. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/neighbour/__init__.py +0 -0
  31. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/netns/__init__.py +0 -0
  32. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/parser/__init__.py +0 -0
  33. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/parser/base.py +0 -0
  34. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/parser/yaml.py +0 -0
  35. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/sysctl/__init__.py +0 -0
  36. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/tc/__init__.py +0 -0
  37. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/util.py +0 -0
  38. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/wireguard/__init__.py +0 -0
  39. {ifstate-1.11.8 → ifstate-1.11.9}/libifstate/xdp/__init__.py +0 -0
  40. {ifstate-1.11.8 → ifstate-1.11.9}/setup.cfg +0 -0
  41. {ifstate-1.11.8 → ifstate-1.11.9}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ifstate
3
- Version: 1.11.8
3
+ Version: 1.11.9
4
4
  Summary: Manage host interface settings in a declarative manner
5
5
  Home-page: https://ifstate.net/
6
6
  Author: Thomas Liske
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ifstate
3
- Version: 1.11.8
3
+ Version: 1.11.9
4
4
  Summary: Manage host interface settings in a declarative manner
5
5
  Home-page: https://ifstate.net/
6
6
  Author: Thomas Liske
@@ -48,7 +48,7 @@ import json
48
48
  import errno
49
49
  import logging
50
50
 
51
- __version__ = "1.11.8"
51
+ __version__ = "1.11.9"
52
52
 
53
53
 
54
54
  class IfState():
@@ -1,7 +1,7 @@
1
1
  from libifstate.util import logger, IfStateLogging
2
2
  from libifstate.exception import netlinkerror_classes
3
3
  from ipaddress import ip_interface
4
- from pyroute2.netlink.rtnl.ifaddrmsg import IFA_F_PERMANENT
4
+ from pyroute2.netlink.rtnl.ifaddrmsg import IFA_F_DADFAILED, IFA_F_PERMANENT
5
5
 
6
6
 
7
7
  class Addresses():
@@ -25,20 +25,25 @@ class Addresses():
25
25
  # get active ip addresses
26
26
  ipr_addr = {}
27
27
  addr_add = []
28
+ addr_dad = []
28
29
  for addr in self.netns.ipr.get_addr(index=idx):
30
+ flags = addr.get_attr('IFA_FLAGS', 0)
29
31
  ip = ip_interface(addr.get_attr('IFA_ADDRESS') +
30
32
  '/' + str(addr['prefixlen']))
33
+ if flags & IFA_F_DADFAILED == IFA_F_DADFAILED:
34
+ logger.debug('{} has failed dad'.format(ip), extra={'iface': self.iface, 'netns': self.netns})
35
+ addr_dad.append(ip)
31
36
  ipr_addr[ip] = addr
32
37
 
33
38
  for addr in self.addresses:
34
- if addr in ipr_addr:
39
+ if addr in ipr_addr and addr not in addr_dad:
35
40
  logger.log_ok('addresses', '= {}'.format(addr.with_prefixlen))
36
41
  del ipr_addr[addr]
37
42
  else:
38
43
  addr_add.append(addr)
39
44
 
40
45
  for ip, addr in ipr_addr.items():
41
- if not any(ip in net for net in ignore):
46
+ if addr in addr_dad or not any(ip in net for net in ignore):
42
47
  if not ign_dynamic or ipr_addr[ip]['flags'] & IFA_F_PERMANENT == IFA_F_PERMANENT:
43
48
  logger.log_del('addresses', '- {}'.format(ip.with_prefixlen))
44
49
  try:
@@ -76,6 +76,12 @@ class Link(ABC):
76
76
  0x88a8: '802.1ad',
77
77
  0x8100: '802.1q',
78
78
  },
79
+ # === vxlan ===
80
+ 'vxlan_df': {
81
+ 0: 'unset',
82
+ 1: 'set',
83
+ 2: 'inherit',
84
+ },
79
85
  }
80
86
  attr_value_lookup = {
81
87
  'group': RTLookups.group,
@@ -10,6 +10,8 @@ logger.log_add = lambda option, oper='add': logger.info(oper, extra={'option': o
10
10
  logger.log_change = lambda option, oper='change': logger.info(oper, extra={'option': option, 'style': IfStateLogging.STYLE_CHG})
11
11
  logger.log_ok = lambda option, oper='ok': logger.info(oper, extra={'option': option, 'style': IfStateLogging.STYLE_OK})
12
12
  logger.log_del = lambda option, oper='del': logger.info(oper, extra={'option': option, 'style': IfStateLogging.STYLE_DEL})
13
+ logger.log_err = lambda option, oper='warn': logger.error(oper, extra={'option': option})
14
+ logger.log_warn = lambda option, oper='warn': logger.warning(oper, extra={'option': option})
13
15
 
14
16
  formatter = logging.Formatter('%(bol)s%(prefix)s%(style)s%(message)s%(eol)s')
15
17
 
@@ -309,8 +309,17 @@ class Tables(collections.abc.Mapping):
309
309
 
310
310
  for route in croutes:
311
311
  if 'oif' in route and type(route['oif']) == str:
312
- route['oif'] = next(
312
+ oif = next(
313
313
  iter(self.netns.ipr.link_lookup(ifname=route['oif'])), None)
314
+ if oif is None:
315
+ if 'gateway' in route:
316
+ logger.log_warn(log_str, '! {}: dev {} is unknown'.format(route['dst'], route['oif']))
317
+ del route['oif']
318
+ else:
319
+ logger.log_err(log_str, '! {}: dev {} is unknown'.format(route['dst'], route['oif']))
320
+ continue
321
+ else:
322
+ route['oif'] = oif
314
323
  found = False
315
324
  identical = False
316
325
  matched = vrrp_match(route, by_vrrp, vrrp_type, vrrp_name, vrrp_state)
@@ -554,7 +563,7 @@ class Rules():
554
563
  if ignore:
555
564
  continue
556
565
 
557
- logger.log_del(log_str)
566
+ logger.log_del('#{}'.format(rule['priority']))
558
567
  try:
559
568
  if do_apply:
560
569
  self.netns.ipr.rule('del', **rule)
@@ -2,7 +2,7 @@
2
2
  "$id": "https://ifstate.net/schema/ifstate.conf.schema.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "ifstate.conf",
5
- "description": "IfState 1.11.8 Configuration Schema",
5
+ "description": "IfState 1.11.9 Configuration Schema",
6
6
  "type": "object",
7
7
  "required": [
8
8
  "interfaces"
@@ -1783,7 +1783,8 @@
1783
1783
  "items": {
1784
1784
  "type": "object",
1785
1785
  "required": [
1786
- "name"
1786
+ "name",
1787
+ "link"
1787
1788
  ],
1788
1789
  "additionalProperties": false,
1789
1790
  "properties": {
@@ -1887,7 +1888,9 @@
1887
1888
  "items": {
1888
1889
  "type": "object",
1889
1890
  "additionalProperties": false,
1890
- "required": ["lladdr"],
1891
+ "required": [
1892
+ "lladdr"
1893
+ ],
1891
1894
  "properties": {
1892
1895
  "lladdr": {
1893
1896
  "description": "destination link layer address",
@@ -1959,6 +1962,9 @@
1959
1962
  "link": {
1960
1963
  "description": "link settings of the interface",
1961
1964
  "type": "object",
1965
+ "required": [
1966
+ "kind"
1967
+ ],
1962
1968
  "oneOf": [
1963
1969
  {
1964
1970
  "description": "Intermediate Functional Block device",
@@ -2805,7 +2811,7 @@
2805
2811
  "null"
2806
2812
  ],
2807
2813
  "description": "specifies the peer's netns name or null if the peer isn't in a netns namespace"
2808
- },
2814
+ },
2809
2815
  "state": {
2810
2816
  "$ref": "#/$defs/iface-link_state"
2811
2817
  },
@@ -2920,17 +2926,154 @@
2920
2926
  "$ref": "#/$defs/iface-link_ifalias"
2921
2927
  },
2922
2928
  "vxlan_id": {
2923
- "type": [
2924
- "integer"
2925
- ],
2929
+ "type": "integer",
2926
2930
  "minimum": 0,
2927
2931
  "maximum": 16777215,
2928
2932
  "description": "specifies the VNI"
2929
2933
  },
2934
+ "vxlan_ageing": {
2935
+ "type": "integer",
2936
+ "minimum": 0,
2937
+ "maximum": 4294967296,
2938
+ "description": "specifies the lifetime in seconds of FDB entries learnt by the kernel (0: none)",
2939
+ "default": 300
2940
+ },
2941
+ "vxlan_df": {
2942
+ "enum": [
2943
+ 0,
2944
+ "unset",
2945
+ 1,
2946
+ "set",
2947
+ 2,
2948
+ "inherit"
2949
+ ],
2950
+ "default": "unset",
2951
+ "description": "specifies the usage of the DF bit in outgoing packets with IPv4 headers"
2952
+ },
2953
+ "vxlan_label": {
2954
+ "type": "integer",
2955
+ "minimum": 0,
2956
+ "maximum": 1048575,
2957
+ "description": "specifies a fixed flowlabel"
2958
+ },
2959
+ "vxlan_learning": {
2960
+ "type": "integer",
2961
+ "minimum": 0,
2962
+ "maximum": 1,
2963
+ "description": "specifies if unknown source link layer addresses and IP addresses are entered into the VXLAN device fdb",
2964
+ "default": 1
2965
+ },
2966
+ "vxlan_limit": {
2967
+ "type": "integer",
2968
+ "minimum": 0,
2969
+ "maximum": 4294967296,
2970
+ "description": "specifies the maximum number of FDB entries (0: none)",
2971
+ "default": 0
2972
+ },
2973
+ "vxlan_proxy": {
2974
+ "type": "integer",
2975
+ "minimum": 0,
2976
+ "maximum": 1,
2977
+ "description": "specifies if ARP proxy is turned on",
2978
+ "default": 0
2979
+ },
2980
+ "vxlan_rsc": {
2981
+ "type": "integer",
2982
+ "minimum": 0,
2983
+ "maximum": 1,
2984
+ "description": "specifies if route short circuit is turned on",
2985
+ "default": 0
2986
+ },
2987
+ "vxlan_l2miss": {
2988
+ "type": "integer",
2989
+ "minimum": 0,
2990
+ "maximum": 1,
2991
+ "description": "specifies if netlink LLADDR miss notifications are generated",
2992
+ "default": 0
2993
+ },
2994
+ "vxlan_l3miss": {
2995
+ "type": "integer",
2996
+ "minimum": 0,
2997
+ "maximum": 1,
2998
+ "description": "specifies if netlink IP ADDR miss notifications are generated",
2999
+ "default": 0
3000
+ },
3001
+ "vxlan_udp_csum": {
3002
+ "type": "integer",
3003
+ "minimum": 0,
3004
+ "maximum": 1,
3005
+ "description": "specifies if UDP checksum is calculated for tx packets over IPv4",
3006
+ "default": 1
3007
+ },
2930
3008
  "vxlan_link": {
2931
3009
  "$ref": "#/$defs/iface-link_tun-dev"
3010
+ },
3011
+ "vxlan_local": {
3012
+ "type": "string",
3013
+ "description": "tunnel source ip address",
3014
+ "oneOf": [
3015
+ {
3016
+ "format": "ipv4"
3017
+ },
3018
+ {
3019
+ "format": "ipv6"
3020
+ }
3021
+ ]
3022
+ },
3023
+ "vxlan_group": {
3024
+ "type": "string",
3025
+ "description": "remote unicast destination or multicast group IPv4 address",
3026
+ "format": "ipv4"
3027
+ },
3028
+ "vxlan_group6": {
3029
+ "type": "string",
3030
+ "description": "remote unicast destination or multicast group IPv6 address",
3031
+ "format": "ipv6"
3032
+ },
3033
+ "vxlan_tos": {
3034
+ "type": "integer",
3035
+ "description": "specifies the TOS value to use in outgoing packets (0: inherit)",
3036
+ "minimum": 0,
3037
+ "maximum": 255,
3038
+ "default": 0
3039
+ },
3040
+ "vxlan_ttl": {
3041
+ "type": "integer",
3042
+ "description": "specifies the TTL value to use in outgoing packets (0: auto)",
3043
+ "minimum": 0,
3044
+ "maximum": 255,
3045
+ "default": 0
3046
+ },
3047
+ "vxlan_ttl_inherit": {
3048
+ "type": "boolean",
3049
+ "description": "control whether TTL is propagated",
3050
+ "default": false
2932
3051
  }
2933
- }
3052
+ },
3053
+ "anyOf": [
3054
+ {
3055
+ "oneOf": [
3056
+ {
3057
+ "required": [
3058
+ "vxlan_group"
3059
+ ]
3060
+ },
3061
+ {
3062
+ "required": [
3063
+ "vxlan_group6"
3064
+ ]
3065
+ }
3066
+ ]
3067
+ },
3068
+ {
3069
+ "not": {
3070
+ "required": [
3071
+ "vxlan_group",
3072
+ "vxlan_group6"
3073
+ ]
3074
+ }
3075
+ }
3076
+ ]
2934
3077
  },
2935
3078
  {
2936
3079
  "description": "IPIP interface",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes