Commit graph

196 commits

Author SHA1 Message Date
Ariadne Conill
1f7fe26dd9 version: use printf() with a static string, compiler changes this into puts() automatically, saves additional 20 bytes 2020-12-04 00:31:53 -07:00
Ariadne Conill
3734aaecbd version: use a single printf() call for the entire about text, saves 104 bytes on aarch64 2020-12-04 00:26:01 -07:00
Ariadne Conill
8a8f56dda8 version: remove newline between copyright statements 2020-12-04 00:14:20 -07:00
Ariadne Conill
cef4fafdb9
Merge pull request #129 from BarbarossaTM/feature/dhcp-config
Rename dhcp related interface options to dhcp-* and allow interface specific config file
2020-12-02 11:57:19 -07:00
Ariadne Conill
c4d9d6fd06 interface: add lif_interface_finalize() which rewrites addresses as CIDR when an interface stanza ends 2020-12-02 11:38:39 -07:00
Ariadne Conill
259851a829 interface: fix default netmask size for AF_INET6 addresses (closes #130) 2020-12-02 11:05:40 -07:00
Maximilian Wilhelm
aada42795c DHCP: Rename options to dhcp-*
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-11-30 22:36:28 +01:00
Ariadne Conill
d2a75c7bb4 yaml-writer: constify 2020-11-13 21:35:12 -07:00
Ariadne Conill
dd8064142c yaml-writer: add ability to enable/disable type annotations 2020-11-13 21:31:48 -07:00
Ariadne Conill
dbfebbff87 YAML: add support for booleans 2020-11-11 03:11:48 -07:00
Ariadne Conill
95f0ea4895 yaml writer: implement type hinting 2020-11-11 02:51:24 -07:00
Ariadne Conill
cfb43e9573 add really basic yaml document graph building and writing functionality 2020-11-11 02:46:28 -07:00
Ariadne Conill
fe1664d311 list: fix LIF_LIST_FOREACH_SAFE() iteration on empty lists 2020-11-11 02:18:04 -07:00
Ariadne Conill
d250ab213c
Merge pull request #122 from ifupdown-ng/feature/configure-auto-executor-selection
Feature/configure auto executor selection
2020-11-04 21:53:42 -07:00
Ariadne Conill
632af7b716 interface: learn hostname from uname(2) only if an interface requests the dhcp executor
Closes #74.
2020-11-04 11:46:18 -07:00
Ariadne Conill
068f464e4c interface-file: if auto_executor_selection is disabled, don't guess what executors should be used 2020-11-04 11:18:40 -07:00
Ariadne Conill
0050995b64 config-file: add support for auto_executor_selection setting 2020-11-04 11:16:47 -07:00
Ariadne Conill
19a5a671eb
Merge pull request #111 from ifupdown-ng/feature/deprecate-brctl
vlan aware bridging
2020-10-22 13:42:00 -08:00
Ariadne Conill
b4f87cbd1e state: explicitly check for explicit keyword when loading from the ifstate file 2020-10-21 09:13:34 -06:00
Ariadne Conill
b09d622cfc state: synchronize is_explicit from state records to parsed interface collections 2020-10-21 08:30:35 -06:00
Ariadne Conill
dae7d59864 state: write and restore explicit flag from ifstate 2020-10-21 08:29:54 -06:00
Ariadne Conill
4f7063ba0f state: add lif_state_record::is_explicit 2020-10-21 08:15:52 -06:00
Ariadne Conill
817262fa33 lifecycle: skip parent interfaces marked as explicitly configured when going down
these interfaces will be taken down by ifdown itself when appropriate
2020-10-21 08:11:45 -06:00
Ariadne Conill
b201f351ec interface: auto interfaces are always explicit 2020-10-21 08:09:21 -06:00
Ariadne Conill
9bcf914250 interface: add lif_interface::is_explicit 2020-10-21 08:06:59 -06:00
Maximilian Wilhelm
ab7b1f5d24 compat: Fix build failure.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-10-18 05:36:45 +02:00
Maximilian Wilhelm
480fc5eecb compat: Only create interface when configured to do so.
Add config option <compat_create_interfaces>:

  Denotes where or not to create interfaces when compat_* settings are
  active and it would be necessary to create an interface to be fully
  compliant.  This could happen when inheriting bridge VLAN settings to
  an interface within a bridges bridge-ports setting but no interface
  stanza is found.  Valid values are 0 and 1, the default is 1.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-10-18 05:14:03 +02:00
Maximilian Wilhelm
d86297f29c compat: Add glue for ifupdown2 bridge port VLAN inheritance.
Add config options <compat_ifupdown2_bridge_ports_inherit_vlans>.

  In ifupdown2 <bridge-vids> as well as the <bridge-pvid> set on a bridge
  interface will be inherited by all member ports if not set explicitly.
  When set to 1 ifupdown-ng behaves the same way and will internally copy
  both options from the bridge member ports if they are not set on the
  member port. Valid values are 0 and 1, the default is 1.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-10-18 04:58:23 +02:00
Maximilian Wilhelm
d96f579d7f Introduce an compatibility layer which is empty for now.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-10-18 03:26:40 +02:00
Ariadne Conill
4aa2749737 add a config option to disable automatically setting the dhcp hostname 2020-10-14 05:21:15 -06:00
Ariadne Conill
a210cf6a66 interface: set a default hostname property 2020-10-14 05:11:12 -06:00
Ariadne Conill
aec7dad1c1 interface-file: add special handler for hostname keyword 2020-10-14 05:04:06 -06:00
Ariadne Conill
ee5e8b5702 interface-file: implement source-directory 2020-10-14 04:26:26 -06:00
Ariadne Conill
5035d2e160 interface-file: handle_generic(): drop unnecessary unused declaration for state 2020-10-14 04:12:59 -06:00
Ariadne Conill
8d4c7461af interface-file: break loops using lif_interface_file_parse_state.loaded dictionary 2020-10-14 04:07:14 -06:00
Ariadne Conill
0df3e03b68 interface-file: fully encapsulate cur_iface into lif_interface_file_parse_state 2020-10-14 04:00:39 -06:00
Ariadne Conill
3bcfe91e84 interface-file: simplify state management a bit 2020-10-14 03:48:20 -06:00
Maximilian Wilhelm
de207a5950 lifecyle: Use lif_address_format_cidr() for IF_ADDRESSES
Previously IF_ADDRESSES would not contain a prefix length if the address
  entry in the configuration did not was in CIDR format but had a netmask
  set seperately. This commit fixes that behaviour and computes a CIDR
  netmask if necessary.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-10-14 01:47:49 +02:00
Maximilian Wilhelm
365461a6f6 interface: Consider the lif_interface as const in lif_address_format_cidr()
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-10-14 01:45:14 +02:00
Maximilian Wilhelm
a72d87df0b dict: lif_dict_find() + lif_dict_find_all() do not touch the dict, so mark it const.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-10-14 01:39:31 +02:00
Maximilian Wilhelm
02324bebd5 Move handling of address/netmask pairs from ifquery into library.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-10-14 01:24:33 +02:00
Ariadne Conill
122a54377d lifecycle: break dependency cycles when calculating the full dependency graph 2020-10-08 02:01:46 -06:00
Ariadne Conill
175f002b3e lifecycle: add lif_interface.is_pending to break dependency cycles 2020-10-08 01:49:44 -06:00
Maximilian Wilhelm
5302bee850 lifecycle: Don't leak allocated memory.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-10-06 04:50:02 +02:00
Maximilian Wilhelm
1a2298a759 lifecycle: Use snprintf() in favor of sprintf()
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-10-06 04:50:02 +02:00
Maximilian Wilhelm
99b0d67b8e lifecycle: Remove debugging statement.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-10-06 04:50:02 +02:00
Maximilian Wilhelm
44be0c0721 Add myself to copyright notice in version information.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-10-06 04:43:12 +02:00
Maximilian Wilhelm
8a58c0ae6d lifecycle: Expose all adresses and gateways via the environment.
Gather all IP addresses and gateways and expose them as IF_ADDRESSES and
  IF_GATEWAYS environment variables to executors. This eliminates the need
  to run ifquery from execuctors which would have to parse the config file
  again on every run.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-10-06 04:43:12 +02:00
Ariadne Conill
df6835bd62
Merge pull request #98 from BarbarossaTM/feature/pointopoint
static executor: Add support for IPv4 'pointopoint' addresses.
2020-10-05 22:04:58 -04:00
Maximilian Wilhelm
6dc43a2bb4 Let's use "point-to-point" and map "pointopoint" to it.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-10-06 04:03:27 +02:00