|
libteam
1.30
|
Teamd daemon control library. More...
Functions | |
| void | teamdctl_log (struct teamdctl *tdc, int priority, const char *file, int line, const char *fn, const char *format,...) |
| TEAMDCTL_EXPORT struct teamdctl * | teamdctl_alloc (void) |
| TEAMDCTL_EXPORT void | teamdctl_free (struct teamdctl *tdc) |
| TEAMDCTL_EXPORT void | teamdctl_set_log_fn (struct teamdctl *tdc, void(*log_fn)(struct teamdctl *tdc, int priority, const char *file, int line, const char *fn, const char *format, va_list args)) |
| TEAMDCTL_EXPORT int | teamdctl_get_log_priority (struct teamdctl *tdc) |
| TEAMDCTL_EXPORT void | teamdctl_set_log_priority (struct teamdctl *tdc, int priority) |
| TEAMDCTL_EXPORT int | teamdctl_connect (struct teamdctl *tdc, const char *team_name, const char *addr, const char *cli_type) |
| TEAMDCTL_EXPORT void | teamdctl_disconnect (struct teamdctl *tdc) |
| TEAMDCTL_EXPORT int | teamdctl_refresh (struct teamdctl *tdc) |
| TEAMDCTL_EXPORT int | teamdctl_port_add (struct teamdctl *tdc, const char *port_devname) |
| TEAMDCTL_EXPORT int | teamdctl_port_remove (struct teamdctl *tdc, const char *port_devname) |
| TEAMDCTL_EXPORT int | teamdctl_port_config_update_raw (struct teamdctl *tdc, const char *port_devname, const char *port_config_raw) |
| TEAMDCTL_EXPORT int | teamdctl_port_config_get_raw_direct (struct teamdctl *tdc, const char *port_devname, char **p_cfg) |
| TEAMDCTL_EXPORT char * | teamdctl_config_get_raw (struct teamdctl *tdc) |
| TEAMDCTL_EXPORT int | teamdctl_config_get_raw_direct (struct teamdctl *tdc, char **p_cfg) |
| TEAMDCTL_EXPORT char * | teamdctl_config_actual_get_raw (struct teamdctl *tdc) |
| TEAMDCTL_EXPORT int | teamdctl_config_actual_get_raw_direct (struct teamdctl *tdc, char **p_cfg) |
| TEAMDCTL_EXPORT char * | teamdctl_state_get_raw (struct teamdctl *tdc) |
| TEAMDCTL_EXPORT int | teamdctl_state_get_raw_direct (struct teamdctl *tdc, char **p_cfg) |
| TEAMDCTL_EXPORT int | teamdctl_state_item_value_get (struct teamdctl *tdc, const char *item_path, char **p_value) |
| TEAMDCTL_EXPORT int | teamdctl_state_item_value_set (struct teamdctl *tdc, const char *item_path, const char *value) |
Teamd daemon control library.
| TEAMDCTL_EXPORT struct teamdctl* teamdctl_alloc | ( | void | ) |
Allocates library context and does initial setup.
| TEAMDCTL_EXPORT char* teamdctl_config_actual_get_raw | ( | struct teamdctl * | tdc | ) |
| tdc | libteamdctl library context |
Gets raw actual config string. Using reply cache. Return value is never NULL. To refresh the cache, use teamdctl_refresh function. Note: the obtained string should not be modified or freed by caller.
| TEAMDCTL_EXPORT int teamdctl_config_actual_get_raw_direct | ( | struct teamdctl * | tdc, |
| char ** | p_cfg | ||
| ) |
| tdc | libteamdctl library context |
| p_cfg | pointer to string which will be set |
Gets raw actual config string. Does direct method call avoiding possible stale data in the cache. Note: the obtained string should not be modified or freed by caller.
| TEAMDCTL_EXPORT char* teamdctl_config_get_raw | ( | struct teamdctl * | tdc | ) |
| tdc | libteamdctl library context |
Gets raw config string. Using reply cache. Return value is never NULL. To refresh the cache, use teamdctl_refresh function. Note: the obtained string should not be modified or freed by caller.
Return Pointer to cached config string.
| TEAMDCTL_EXPORT int teamdctl_config_get_raw_direct | ( | struct teamdctl * | tdc, |
| char ** | p_cfg | ||
| ) |
| tdc | libteamdctl library context |
| p_cfg | pointer to string which will be set |
Gets raw config string. Does direct method call avoiding possible stale data in the cache. Note: the obtained string should not be modified or freed by caller.
| TEAMDCTL_EXPORT int teamdctl_connect | ( | struct teamdctl * | tdc, |
| const char * | team_name, | ||
| const char * | addr, | ||
| const char * | cli_type | ||
| ) |
| tdc | libteamdctl library context |
| team_name | team device name |
| addr | address (for zeromq only) |
| cli_type | client type |
Connect to teamd instance controlling team driver instance with interface name team_name. Use client type cli_type to connect. That can be either "dbus" for connection over D-Bus, "usock" which will use unix domain socket or NULL to select the type automatically.
| TEAMDCTL_EXPORT void teamdctl_disconnect | ( | struct teamdctl * | tdc | ) |
| tdc | libteamdctl library context |
Disconnect from teamd instance.
| TEAMDCTL_EXPORT void teamdctl_free | ( | struct teamdctl * | tdc | ) |
| tdc | libteam library context |
Do library context cleanup.
| TEAMDCTL_EXPORT int teamdctl_get_log_priority | ( | struct teamdctl * | tdc | ) |
| tdc | libteamdctl library context |
| void teamdctl_log | ( | struct teamdctl * | tdc, |
| int | priority, | ||
| const char * | file, | ||
| int | line, | ||
| const char * | fn, | ||
| const char * | format, | ||
| ... | |||
| ) |
SECTION: logging
| TEAMDCTL_EXPORT int teamdctl_port_add | ( | struct teamdctl * | tdc, |
| const char * | port_devname | ||
| ) |
| tdc | libteamdctl library context |
| port_devname | port device name |
Adds specified port to team.
| TEAMDCTL_EXPORT int teamdctl_port_config_get_raw_direct | ( | struct teamdctl * | tdc, |
| const char * | port_devname, | ||
| char ** | p_cfg | ||
| ) |
| tdc | libteamdctl library context |
| port_devname | port device name |
| p_cfg | pointer to string which will be set |
Gets raw port config string. Does direct method call avoiding possible stale data in the cache. Note: the obtained string should not be modified or freed by caller.
| TEAMDCTL_EXPORT int teamdctl_port_config_update_raw | ( | struct teamdctl * | tdc, |
| const char * | port_devname, | ||
| const char * | port_config_raw | ||
| ) |
| tdc | libteamdctl library context |
| port_devname | port device name |
| port_config_raw | port config |
Update config for specified port.
| TEAMDCTL_EXPORT int teamdctl_port_remove | ( | struct teamdctl * | tdc, |
| const char * | port_devname | ||
| ) |
| tdc | libteamdctl library context |
| port_devname | port device name |
Removes specified port from team.
| TEAMDCTL_EXPORT int teamdctl_refresh | ( | struct teamdctl * | tdc | ) |
| tdc | libteamdctl library context |
Refresh cache.
| TEAMDCTL_EXPORT void teamdctl_set_log_fn | ( | struct teamdctl * | tdc, |
| void(*)(struct teamdctl *tdc, int priority, const char *file, int line, const char *fn, const char *format, va_list args) | log_fn | ||
| ) |
| tdc | libteamdctl library context |
| log_fn | function to be called for logging messages |
The built-in logging writes to stderr. It can be overridden by a custom function, to plug log messages into the user's logging functionality.
| TEAMDCTL_EXPORT void teamdctl_set_log_priority | ( | struct teamdctl * | tdc, |
| int | priority | ||
| ) |
| tdc | libteamdctl library context |
| priority | the new logging priority |
Set the current logging priority. The value controls which messages are logged.
| TEAMDCTL_EXPORT char* teamdctl_state_get_raw | ( | struct teamdctl * | tdc | ) |
| tdc | libteamdctl library context |
Gets raw state string. Using reply cache. Return value is never NULL. To refresh the cache, use teamdctl_refresh function. Note: the obtained string should not be modified or freed by caller.
| TEAMDCTL_EXPORT int teamdctl_state_get_raw_direct | ( | struct teamdctl * | tdc, |
| char ** | p_cfg | ||
| ) |
| tdc | libteamdctl library context |
| p_cfg | pointer to string which will be set |
Gets raw state string. Does direct method call avoiding possible stale data in the cache. Note: the obtained string should not be modified or freed by caller.
| TEAMDCTL_EXPORT int teamdctl_state_item_value_get | ( | struct teamdctl * | tdc, |
| const char * | item_path, | ||
| char ** | p_value | ||
| ) |
| tdc | libteamdctl library context |
| item_path | path to item |
| p_value | pointer where reply string will be stored |
Get state item value. Note that caller is responsible to free *p_value.
| TEAMDCTL_EXPORT int teamdctl_state_item_value_set | ( | struct teamdctl * | tdc, |
| const char * | item_path, | ||
| const char * | value | ||
| ) |
| tdc | libteamdctl library context |
| item_path | path to item |
| value | new value to be set |
Set state item value.
1.8.17