types.h

Definition of public Netplan types.

Defines

NETPLAN_PUBLIC

Symbols that are considered part of Netplan public API.

NETPLAN_INTERNAL

Symbols that are used internally by Netplan.

Warning

Do not use those symbols in an external codebase, they might be dropped or changed without notice.

NETPLAN_DEPRECATED

Symbols that are outdated and should not be used anymore.

Note

Those symbols will be dropped in the future.

NETPLAN_BUFFER_TOO_SMALL

Error of value -2 to indicate an issue with the buffer.

Typedefs

typedef struct netplan_parser NetplanParser

Private data structure to contain parsed but unvalidated Netplan configuration. See netplan_parser_new and related accessor functions.

typedef struct netplan_state NetplanState

Private data structure to contain validated Netplan configuration, ready for writing to disk. See netplan_state_new and related accessor functions.

typedef struct netplan_net_definition NetplanNetDefinition

Private data structure to contain individual settings per Netplan ID. See netplan_state_get_netdef, netplan_netdef_get_id and related accessor functions.

typedef GError NetplanError

Private data structure for error reporting. See netplan_error_code, netplan_error_message and netplan_error_clear.

typedef struct _NetplanStateIterator NetplanStateIterator

Private data structure to iterate through a list of NetplanNetDefinition inside NetplanState. See netplan_state_iterator_init and related accessor functions.

Enums

enum NetplanDefType

Network interface types supported by Netplan.

Values:

enumerator NETPLAN_DEF_TYPE_NONE
enumerator NETPLAN_DEF_TYPE_ETHERNET
enumerator NETPLAN_DEF_TYPE_WIFI
enumerator NETPLAN_DEF_TYPE_MODEM
enumerator NETPLAN_DEF_TYPE_VIRTUAL
enumerator NETPLAN_DEF_TYPE_BRIDGE
enumerator NETPLAN_DEF_TYPE_BOND
enumerator NETPLAN_DEF_TYPE_VLAN
enumerator NETPLAN_DEF_TYPE_TUNNEL
enumerator NETPLAN_DEF_TYPE_PORT
enumerator NETPLAN_DEF_TYPE_VRF
enumerator NETPLAN_DEF_TYPE_NM
enumerator NETPLAN_DEF_TYPE_DUMMY
enumerator NETPLAN_DEF_TYPE_VETH
enumerator NETPLAN_DEF_TYPE_NM_PLACEHOLDER_
enumerator NETPLAN_DEF_TYPE_MAX_
enum NetplanBackend

Renderer backends supported by Netplan.

Values:

enumerator NETPLAN_BACKEND_NONE
enumerator NETPLAN_BACKEND_NETWORKD
enumerator NETPLAN_BACKEND_NM
enumerator NETPLAN_BACKEND_OVS
enumerator NETPLAN_BACKEND_MAX_
enum NETPLAN_ERROR_DOMAINS

Defining different classes of NetplanError.

Values:

enumerator NETPLAN_PARSER_ERROR

See NETPLAN_PARSER_ERRORS.

enumerator NETPLAN_VALIDATION_ERROR

See NETPLAN_VALIDATION_ERRORS.

enumerator NETPLAN_FILE_ERROR

Returns errno as the NetplanError code and a corresponding message.

enumerator NETPLAN_BACKEND_ERROR

See NETPLAN_BACKEND_ERRORS.

enumerator NETPLAN_EMITTER_ERROR

See NETPLAN_EMITTER_ERRORS.

enumerator NETPLAN_FORMAT_ERROR

See NETPLAN_FORMAT_ERRORS.

enum NETPLAN_PARSER_ERRORS

Errors for domain NETPLAN_PARSER_ERROR.

Such errors are expected to contain the file name, line and column numbers.

Values:

enumerator NETPLAN_ERROR_INVALID_YAML
enumerator NETPLAN_ERROR_INVALID_CONFIG
enumerator NETPLAN_ERROR_INVALID_FLAG
enum NETPLAN_VALIDATION_ERRORS

Errors for domain NETPLAN_VALIDATION_ERROR.

Such errors are expected to contain only the YAML file name where the error was found.

Values:

enumerator NETPLAN_ERROR_CONFIG_GENERIC
enumerator NETPLAN_ERROR_CONFIG_VALIDATION
enum NETPLAN_BACKEND_ERRORS

Errors for domain NETPLAN_BACKEND_ERROR.

Values:

enumerator NETPLAN_ERROR_UNSUPPORTED
enumerator NETPLAN_ERROR_VALIDATION
enum NETPLAN_EMITTER_ERRORS

Errors for domain NETPLAN_EMITTER_ERROR.

Values:

enumerator NETPLAN_ERROR_YAML_EMITTER
enum NETPLAN_FORMAT_ERRORS

Errors for domain NETPLAN_FORMAT_ERROR.

Such errors are generic errors emitted from contexts where information such as the file name is not known.

Values:

enumerator NETPLAN_ERROR_FORMAT_INVALID_YAML
enum NETPLAN_PARSER_FLAGS

Flags used to change the parser behavior.

Values:

enumerator NETPLAN_PARSER_IGNORE_ERRORS

Ignore parsing errors such as bad YAML files and definitions.

enumerator NETPLAN_PARSER_FLAGS_MAX_
struct _NetplanStateIterator
#include <types.h>

Defining a non-opaque placeholder type for the private struct netplan_state_iterator.

Do not use directly. Use NetplanStateIterator instead. Enables consumers to place the iterator at the stack.

Note

The idea is based on the GLib implementation of iterators.

Public Members

void *placeholder

Just a placeholder in memory.