Fork Vasum on GitHub Official Vasum Wiki on Tizen.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vasum-client.h File Reference

This file contains the public API for Vasum Client. More...

#include <stdint.h>
#include <sys/stat.h>
#include <netinet/ip.h>
#include <linux/if_link.h>

Go to the source code of this file.

Typedefs

typedef void * VsmClient
 vasum-server's opaque client pointer. More...
 
typedef char * VsmString
 NULL-terminated string type. More...
 
typedef VsmStringVsmArrayString
 NULL-terminated array of strings type. More...
 
typedef void * VsmAddrList
 
typedef unsigned int VsmSubscriptionId
 Subscription id. More...
 
typedef void * VsmZone
 Zone information. More...
 
typedef void * VsmNetdev
 Network device information. More...
 
typedef void(* VsmZoneDbusStateCallback )(const char *zoneId, const char *address, void *data)
 Zone's D-Bus state change callback function signature. More...
 

Enumerations

enum  VsmStatus {
  VSMCLIENT_CUSTOM_ERROR, VSMCLIENT_IO_ERROR, VSMCLIENT_OPERATION_FAILED, VSMCLIENT_INVALID_ARGUMENT,
  VSMCLIENT_OTHER_ERROR, VSMCLIENT_SUCCESS
}
 Completion status of libvasum-client's functions. More...
 
enum  VsmZoneState {
  STOPPED, STARTING, RUNNING, STOPPING,
  ABORTING, FREEZING, FROZEN, THAWED,
  LOCKED, MAX_STATE, ACTIVATING = 128
}
 States of zone. More...
 
enum  VsmNetdevType { VSMNETDEV_VETH, VSMNETDEV_PHYS, VSMNETDEV_MACVLAN }
 Netowrk device type. More...
 
enum  VsmFileType { VSMFILE_DIRECTORY, VSMFILE_FIFO, VSMFILE_REGULAR }
 File type. More...
 
enum  VsmDispacherType { VSMDISPATCHER_EXTERNAL, VSMDISPATCHER_INTERNAL }
 Event dispacher types. More...
 

Functions

VsmStatus vsm_get_poll_fd (VsmClient client, int *fd)
 Get file descriptor associated with event dispatcher of zone client. More...
 
VsmStatus vsm_enter_eventloop (VsmClient client, int flags, int timeout)
 Wait for an I/O event on a vsm client. More...
 
VsmStatus vsm_set_dispatcher_type (VsmClient client, VsmDispacherType dispacher)
 Set dispatching method. More...
 
VsmStatus vsm_get_dispatcher_type (VsmClient client, VsmDispacherType *dispacher)
 Get dispatching method. More...
 
VsmClient vsm_client_create ()
 Create a new vasum-server's client. More...
 
void vsm_client_free (VsmClient client)
 Release client resources. More...
 
VsmStatus vsm_get_status (VsmClient client)
 Get status code of last vasum-server communication. More...
 
const char * vsm_get_status_message (VsmClient client)
 Get status message of the last vasum-server communication. More...
 
VsmStatus vsm_connect (VsmClient client)
 Connect client to the vasum-server. More...
 
VsmStatus vsm_connect_custom (VsmClient client, const char *address)
 Connect client to the vasum-server via custom address. More...
 
VsmStatus vsm_disconnect (VsmClient client)
 Disconnect client from vasum-server. More...
 
void vsm_array_string_free (VsmArrayString astring)
 Release VsmArrayString. More...
 
void vsm_string_free (VsmString string)
 Release VsmString. More...
 
VsmString vsm_zone_get_id (VsmZone zone)
 Get zone id (offline) More...
 
int vsm_zone_get_terminal (VsmZone zone)
 Get zone terminal (offline) More...
 
VsmZoneState vsm_zone_get_state (VsmZone zone)
 Get zone state (offline) More...
 
VsmString vsm_zone_get_rootfs (VsmZone zone)
 Get zone rootfs path (offline) More...
 
void vsm_zone_free (VsmZone zone)
 Release VsmZone. More...
 
VsmString vsm_netdev_get_name (VsmNetdev netdev)
 Get netdev name (offline) More...
 
VsmNetdevType vsm_netdev_get_type (VsmNetdev netdev)
 Get netdev type (offline) More...
 
void vsm_netdev_free (VsmNetdev netdev)
 Release VsmNetdev. More...
 
VsmStatus vsm_lock_queue (VsmClient client)
 Lock the command queue exclusively. More...
 
VsmStatus vsm_unlock_queue (VsmClient client)
 Unlock the command queue. More...
 
VsmStatus vsm_get_zone_dbuses (VsmClient client, VsmArrayString *keys, VsmArrayString *values)
 Get dbus address of each zone. More...
 
VsmStatus vsm_get_zone_ids (VsmClient client, VsmArrayString *array)
 Get zones name. More...
 
VsmStatus vsm_get_active_zone_id (VsmClient client, VsmString *id)
 Get active (foreground) zone name. More...
 
VsmStatus vsm_lookup_zone_by_pid (VsmClient client, int pid, VsmString *id)
 Get zone name of process with given pid. More...
 
VsmStatus vsm_lookup_zone_by_id (VsmClient client, const char *id, VsmZone *zone)
 Get zone informations of zone with given id. More...
 
VsmStatus vsm_lookup_zone_by_terminal_id (VsmClient client, int terminal, VsmString *id)
 Get zone name with given terminal. More...
 
VsmStatus vsm_set_active_zone (VsmClient client, const char *id)
 Set active (foreground) zone. More...
 
VsmStatus vsm_create_zone (VsmClient client, const char *id, const char *tname)
 Create and add zone. More...
 
VsmStatus vsm_destroy_zone (VsmClient client, const char *id, int force)
 Remove zone. More...
 
VsmStatus vsm_shutdown_zone (VsmClient client, const char *id)
 Shutdown zone. More...
 
VsmStatus vsm_start_zone (VsmClient client, const char *id)
 Start zone. More...
 
VsmStatus vsm_lock_zone (VsmClient client, const char *id)
 Lock zone. More...
 
VsmStatus vsm_unlock_zone (VsmClient client, const char *id)
 Unlock zone. More...
 
VsmStatus vsm_add_state_callback (VsmClient client, VsmZoneDbusStateCallback zoneDbusStateCallback, void *data, VsmSubscriptionId *subscriptionId)
 Register dbus state change callback function. More...
 
VsmStatus vsm_del_state_callback (VsmClient client, VsmSubscriptionId subscriptionId)
 Unregister dbus state change callback function. More...
 
VsmStatus vsm_grant_device (VsmClient client, const char *zone, const char *device, uint32_t flags)
 Grant access to device. More...
 
VsmStatus vsm_revoke_device (VsmClient client, const char *zone, const char *device)
 Revoke access to device. More...
 
VsmStatus vsm_zone_get_netdevs (VsmClient client, const char *zone, VsmArrayString *netdevIds)
 Get array of netdev from given zone. More...
 
VsmStatus vsm_netdev_get_ip_addr (VsmClient client, const char *zone, const char *netdevId, VsmAddrList *addrs)
 Get ipv4 address for given netdevId. More...
 
void vsm_addrlist_free (VsmAddrList addrs)
 Release VsmAddrList. More...
 
VsmStatus vsm_netdev_get_ipv4_addr (VsmClient client, const char *zone, const char *netdevId, struct in_addr *addr)
 Get ipv4 address for given netdevId. More...
 
VsmStatus vsm_netdev_get_ipv6_addr (VsmClient client, const char *zone, const char *netdevId, struct in6_addr *addr)
 Get ipv6 address for given netdevId. More...
 
VsmStatus vsm_netdev_add_ipv4_addr (VsmClient client, const char *zone, const char *netdevId, struct in_addr *addr, int prefix)
 Add ipv4 address for given netdevId. More...
 
VsmStatus vsm_netdev_add_ipv6_addr (VsmClient client, const char *zone, const char *netdevId, struct in6_addr *addr, int prefix)
 Add ipv6 address for given netdevId. More...
 
VsmStatus vsm_netdev_del_ipv4_addr (VsmClient client, const char *zone, const char *netdevId, struct in_addr *addr, int prefix)
 Remove ipv4 address from netdev. More...
 
VsmStatus vsm_netdev_del_ipv6_addr (VsmClient client, const char *zone, const char *netdevId, struct in6_addr *addr, int prefix)
 Remove ipv6 address from netdev. More...
 
VsmStatus vsm_netdev_up (VsmClient client, const char *zone, const char *netdevId)
 Turn up a network device in the zone. More...
 
VsmStatus vsm_netdev_down (VsmClient client, const char *zone, const char *netdevId)
 Turn down a network device in the zone. More...
 
VsmStatus vsm_create_netdev_veth (VsmClient client, const char *zone, const char *zoneDev, const char *hostDev)
 Create veth netdev in zone. More...
 
VsmStatus vsm_create_netdev_macvlan (VsmClient client, const char *zone, const char *zoneDev, const char *hostDev, enum macvlan_mode mode)
 Create macvlan in zone. More...
 
VsmStatus vsm_create_netdev_phys (VsmClient client, const char *zone, const char *devId)
 Create/move phys netdev in/to zone. More...
 
VsmStatus vsm_lookup_netdev_by_name (VsmClient client, const char *zone, const char *netdevId, VsmNetdev *netdev)
 Get netdev informations. More...
 
VsmStatus vsm_destroy_netdev (VsmClient client, const char *zone, const char *devId)
 Remove netdev from zone. More...
 
VsmStatus vsm_declare_file (VsmClient client, const char *zone, VsmFileType type, const char *path, int32_t flags, mode_t mode)
 Create file, directory or pipe in zone. More...
 
VsmStatus vsm_declare_mount (VsmClient client, const char *source, const char *zone, const char *target, const char *type, uint64_t flags, const char *data)
 Create mount point in zone. More...
 
VsmStatus vsm_declare_link (VsmClient client, const char *source, const char *zone, const char *target)
 Create link in zone. More...
 
VsmStatus vsm_list_declarations (VsmClient client, const char *zone, VsmArrayString *declarations)
 Get all declarations. More...
 
VsmStatus vsm_remove_declaration (VsmClient client, const char *zone, VsmString declaration)
 Remove declaration. More...
 
VsmStatus vsm_clean_up_zones_root (VsmClient client)
 Clean up zones root directory. More...
 
unsigned int vsm_addrlist_size (VsmAddrList addrs)
 Retrieve array size. More...
 
int vsm_addrlist_get_type (VsmAddrList addrs, unsigned int i)
 Get address type for i'th entry. More...
 
const void * vsm_addrlist_get_addr (VsmAddrList addrs, unsigned int i)
 Get pointer to in_addr property for i'th entry see inet_ntop man pages. More...
 
unsigned int vsm_addrlist_get_prefix (VsmAddrList addrs, unsigned int i)
 Get address prefix for i'th entry. More...
 

Detailed Description

This file contains the public API for Vasum Client.

Author
Mateusz Malicki (m.mal.nosp@m.icki.nosp@m.2@sam.nosp@m.sung.nosp@m..com)