*/
typedef VsmString* VsmArrayString;
+typedef void *VsmAddrList;
/**
* Completion status of libvasum-client's functions
*/
typedef enum {
- VSMCLIENT_CUSTOM_ERROR, ///< User specified error
- VSMCLIENT_IO_ERROR, ///< Input/Output error
- VSMCLIENT_OPERATION_FAILED, ///< Operation failed
- VSMCLIENT_INVALID_ARGUMENT, ///< Invalid argument
- VSMCLIENT_OTHER_ERROR, ///< Other error
- VSMCLIENT_SUCCESS ///< Success
+ VSMCLIENT_CUSTOM_ERROR, /**< User specified error */
+ VSMCLIENT_IO_ERROR, /**< Input/Output error */
+ VSMCLIENT_OPERATION_FAILED, /**< Operation failed */
+ VSMCLIENT_INVALID_ARGUMENT, /**< Invalid argument */
+ VSMCLIENT_OTHER_ERROR, /**< Other error */
+ VSMCLIENT_SUCCESS /**< Success */
} VsmStatus;
/**
} VsmZoneState;
/**
- * Zone information structure
- */
-typedef struct {
- char* id;
- int terminal;
- VsmZoneState state;
- char *rootfs_path;
-} VsmZoneStructure;
-
-/**
* Zone information
*/
-typedef VsmZoneStructure* VsmZone;
+typedef void* VsmZone;
/**
* Netowrk device type
} VsmNetdevType;
/**
- * Network device information structure
- */
-typedef struct {
- char* name;
- VsmNetdevType type;
-} VsmNetdevStructure;
-
-/**
* Network device information
*/
-typedef VsmNetdevStructure* VsmNetdev;
+typedef void* VsmNetdev;
/**
* File type
VSMDISPATCHER_INTERNAL /**< Library will take care of dispatching messages */
} VsmDispacherType;
-#ifndef __VASUM_WRAPPER_SOURCE__
-
/**
* Get file descriptor associated with event dispatcher of zone client
*
void vsm_string_free(VsmString string);
/**
+ * Get zone id (offline)
+ *
+ * @param zone VsmZone
+ * @return zone id
+ */
+VsmString vsm_zone_get_id(VsmZone zone);
+
+/**
+ * Get zone terminal (offline)
+ *
+ * @param zone VsmZone
+ * @return zone terminal
+ */
+int vsm_zone_get_terminal(VsmZone zone);
+
+/**
+ * Get zone state (offline)
+ *
+ * @param zone VsmZone
+ * @return zone state
+ */
+VsmZoneState vsm_zone_get_state(VsmZone zone);
+
+/**
+ * Get zone rootfs path (offline)
+ *
+ * @param zone VsmZone
+ * @return zone rootfs path
+ */
+VsmString vsm_zone_get_rootfs(VsmZone zone);
+
+/**
* Release VsmZone
*
* @param zone VsmZone
void vsm_zone_free(VsmZone zone);
/**
+ * Get netdev name (offline)
+ *
+ * @param netdev VsmNetdev
+ * @return netdev name
+ */
+VsmString vsm_netdev_get_name(VsmNetdev netdev);
+
+/**
+ * Get netdev type (offline)
+ *
+ * @param netdev VsmNetdev
+ * @return netdev type
+ */
+VsmNetdevType vsm_netdev_get_type(VsmNetdev netdev);
+
+/**
* Release VsmNetdev
*
* @param netdev VsmNetdev
VsmStatus vsm_get_active_zone_id(VsmClient client, VsmString* id);
/**
- * Get zone rootfs path.
- *
- * @param[in] client vasum-server's client
- * @param[in] id zone name
- * @param[out] rootpath zone rootfs path
- * @return status of this function call
- * @remark Use @p vsm_string_free() to free memory occupied by @p rootpath.
- */
-VsmStatus vsm_get_zone_rootpath(VsmClient client, const char* id, VsmString* rootpath);
-
-/**
* Get zone name of process with given pid.
*
* @param[in] client vasum-server's client
*/
VsmStatus vsm_zone_get_netdevs(VsmClient client, const char* zone, VsmArrayString* netdevIds);
+
+/**
+ * Get ipv4 address for given netdevId
+ *
+ * @param[in] client vasum-server's client
+ * @param[in] zone zone name
+ * @param[in] netdevId netdev id
+ * @param[out] addrs ip address array
+ * @return status of this function call
+ * @remark Use vsm_netdev_addr_free() to free memory occupied by address array.
+ */
+VsmStatus vsm_netdev_get_ip_addr(VsmClient client,
+ const char* zone,
+ const char* netdevId,
+ VsmAddrList *addrs);
+
+/**
+ * Release VsmAddrList
+ *
+ * @param addrs VsmAddrList
+ */
+void vsm_addrlist_free(VsmAddrList addrs);
+
/**
* Get ipv4 address for given netdevId
*
struct in6_addr *addr);
/**
- * Set ipv4 address for given netdevId
+ * Add ipv4 address for given netdevId
*
* @param[in] client vasum-server's client
* @param[in] zone zone name
* @param[in] prefix bit-length of the network prefix
* @return status of this function call
*/
-VsmStatus vsm_netdev_set_ipv4_addr(VsmClient client,
+VsmStatus vsm_netdev_add_ipv4_addr(VsmClient client,
const char* zone,
const char* netdevId,
struct in_addr *addr,
int prefix);
/**
- * Set ipv6 address for given netdevId
+ * Add ipv6 address for given netdevId
*
* @param[in] client vasum-server's client
* @param[in] zone zone name
* @param[in] prefix bit-length of the network prefix
* @return status of this function call
*/
-VsmStatus vsm_netdev_set_ipv6_addr(VsmClient client,
+VsmStatus vsm_netdev_add_ipv6_addr(VsmClient client,
const char* zone,
const char* netdevId,
struct in6_addr *addr,
const char* zone,
VsmString declaration);
-#endif /* __VASUM_WRAPPER_SOURCE__ */
+/**
+ * Clean up zones root directory
+ *
+ * Removes all unknown zones root directory entry
+ * @return status of this function call
+ */
+VsmStatus vsm_clean_up_zones_root(VsmClient client);
+
+/**
+ * Retrieve array size
+ *
+ * @return array size
+ */
+unsigned int vsm_addrlist_size(VsmAddrList addrs);
+
+/**
+ * Get address type for i'th entry
+ *
+ * @return network type (AF_INET or AF_INET6)
+ */
+int vsm_addrlist_get_type(VsmAddrList addrs, unsigned int i);
+
+/**
+ * Get pointer to in_addr property for i'th entry
+ * see inet_ntop man pages
+ *
+ * @return poiner of in_addr
+ */
+const void *vsm_addrlist_get_addr(VsmAddrList addrs, unsigned int i);
+
+/**
+ * Get address prefix for i'th entry
+ *
+ * @return adress prefix (mask bits count)
+ */
+unsigned int vsm_addrlist_get_prefix(VsmAddrList addrs, unsigned int i);
#ifdef __cplusplus
}
#endif
#endif /* VASUM_CLIENT_H */
-/*@}*/
\ No newline at end of file
+/*@}*/