netplan.h#

NetplanState and NetplanNetDefinition manipulation.

Functions

NETPLAN_PUBLIC NetplanState * netplan_state_new ()
NETPLAN_PUBLIC void netplan_state_reset (NetplanState *np_state)
NETPLAN_PUBLIC void netplan_state_clear (NetplanState **np_state)
NETPLAN_PUBLIC NetplanBackend netplan_state_get_backend (const NetplanState *np_state)
NETPLAN_PUBLIC guint netplan_state_get_netdefs_size (const NetplanState *np_state)
NETPLAN_PUBLIC NetplanNetDefinition * netplan_state_get_netdef (const NetplanState *np_state, const char *id)
NETPLAN_PUBLIC gboolean netplan_state_finish_nm_write (const NetplanState *np_state, const char *rootdir, NetplanError **error)
NETPLAN_PUBLIC gboolean netplan_state_finish_ovs_write (const NetplanState *np_state, const char *rootdir, NetplanError **error)
NETPLAN_PUBLIC gboolean netplan_state_finish_sriov_write (const NetplanState *np_state, const char *rootdir, NetplanError **error)
NETPLAN_PUBLIC gboolean netplan_state_write_yaml_file (const NetplanState *np_state, const char *filename, const char *rootdir, NetplanError **error)

Generate the YAML configuration, filtered to the data relevant to a particular file. Any data that’s assigned to another file is ignored. Data that is not assigned is considered relevant.

@np_state: the state for which to generate the config @filename: Relevant file basename (e.g. origin-hint.yaml) @rootdir: If not NULL, generate configuration in this root directory (useful for testing).

NETPLAN_PUBLIC gboolean netplan_state_update_yaml_hierarchy (const NetplanState *np_state, const char *default_filename, const char *rootdir, NetplanError **error)

Regenerate the YAML configuration files from a given state. Any state that hasn’t an associated filepath will use the default_filename output in the standard config directory.

@np_state: the state for which to generate the config @default_filename: Default config file, cannot be NULL or empty @rootdir: If not NULL, generate configuration in this root directory (useful for testing).

NETPLAN_PUBLIC gboolean netplan_state_dump_yaml (const NetplanState *np_state, int output_fd, NetplanError **error)

Dump the whole state into a single YAML file.

@np_state: the state for which to generate the config @out_fd: File descriptor to an opened file into which to dump the content

NETPLAN_PUBLIC gboolean netplan_netdef_write_yaml (const NetplanState *np_state, const NetplanNetDefinition *netdef, const char *rootdir, NetplanError **error)
NETPLAN_PUBLIC ssize_t netplan_netdef_get_filepath (const NetplanNetDefinition *netdef, char *out_buffer, size_t out_buffer_size)
NETPLAN_PUBLIC NetplanBackend netplan_netdef_get_backend (const NetplanNetDefinition *netdef)
NETPLAN_PUBLIC NetplanDefType netplan_netdef_get_type (const NetplanNetDefinition *netdef)
NETPLAN_PUBLIC ssize_t netplan_netdef_get_id (const NetplanNetDefinition *netdef, char *out_buffer, size_t out_buffer_size)
NETPLAN_PUBLIC NetplanNetDefinition * netplan_netdef_get_bridge_link (const NetplanNetDefinition *netdef)
NETPLAN_PUBLIC NetplanNetDefinition * netplan_netdef_get_bond_link (const NetplanNetDefinition *netdef)
NETPLAN_PUBLIC NetplanNetDefinition * netplan_netdef_get_peer_link (const NetplanNetDefinition *netdef)
NETPLAN_PUBLIC NetplanNetDefinition * netplan_netdef_get_vlan_link (const NetplanNetDefinition *netdef)
NETPLAN_PUBLIC NetplanNetDefinition * netplan_netdef_get_sriov_link (const NetplanNetDefinition *netdef)
NETPLAN_PUBLIC ssize_t netplan_netdef_get_set_name (const NetplanNetDefinition *netdef, char *out_buffer, size_t out_buffer_size)
NETPLAN_PUBLIC gboolean netplan_netdef_has_match (const NetplanNetDefinition *netdef)
NETPLAN_PUBLIC gboolean netplan_netdef_match_interface (const NetplanNetDefinition *netdef, const char *name, const char *mac, const char *driver_name)
NETPLAN_PUBLIC gboolean netplan_netdef_get_dhcp4 (const NetplanNetDefinition *netdef)
NETPLAN_PUBLIC gboolean netplan_netdef_get_dhcp6 (const NetplanNetDefinition *netdef)
NETPLAN_PUBLIC ssize_t netplan_netdef_get_macaddress (const NetplanNetDefinition *netdef, char *out_buffer, size_t out_buffer_size)
NETPLAN_DEPRECATED NETPLAN_PUBLIC const char * netplan_netdef_get_filename (const NetplanNetDefinition *netdef)
NETPLAN_PUBLIC void write_netplan_conf (const NetplanNetDefinition *def, const char *rootdir)