diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h index 6922942e790f9e652ea7472b66d727847a8409d8..e9a5baf5bf218701d4d48f211dc359f550856cb3 100644 --- a/src/conf/network_conf.h +++ b/src/conf/network_conf.h @@ -290,43 +290,71 @@ enum { VIR_NETWORK_OBJ_LIST_ADD_CHECK_LIVE = (1 << 1), }; -virNetworkDefPtr virNetworkDefCopy(virNetworkDefPtr def, unsigned int flags); -virNetworkDefPtr virNetworkDefParseXML(xmlXPathContextPtr ctxt); -virNetworkDefPtr virNetworkDefParseString(const char *xmlStr); -virNetworkDefPtr virNetworkDefParseFile(const char *filename); -virNetworkDefPtr virNetworkDefParseNode(xmlDocPtr xml, - xmlNodePtr root); -char *virNetworkDefFormat(const virNetworkDef *def, unsigned int flags); -int virNetworkDefFormatBuf(virBufferPtr buf, - const virNetworkDef *def, - unsigned int flags); - -const char * virNetworkDefForwardIf(const virNetworkDef *def, size_t n); - -virPortGroupDefPtr virPortGroupFindByName(virNetworkDefPtr net, - const char *portgroup); +virNetworkDefPtr +virNetworkDefCopy(virNetworkDefPtr def, unsigned int flags); + +virNetworkDefPtr +virNetworkDefParseXML(xmlXPathContextPtr ctxt); + +virNetworkDefPtr +virNetworkDefParseString(const char *xmlStr); + +virNetworkDefPtr +virNetworkDefParseFile(const char *filename); + +virNetworkDefPtr +virNetworkDefParseNode(xmlDocPtr xml, + xmlNodePtr root); + +char * +virNetworkDefFormat(const virNetworkDef *def, + unsigned int flags); + +int +virNetworkDefFormatBuf(virBufferPtr buf, + const virNetworkDef *def, + unsigned int flags); + +const char * +virNetworkDefForwardIf(const virNetworkDef *def, + size_t n); + +virPortGroupDefPtr +virPortGroupFindByName(virNetworkDefPtr net, + const char *portgroup); virNetworkIPDefPtr virNetworkDefGetIPByIndex(const virNetworkDef *def, - int family, size_t n); + int family, + size_t n); + virNetDevIPRoutePtr virNetworkDefGetRouteByIndex(const virNetworkDef *def, - int family, size_t n); -int virNetworkIPDefPrefix(const virNetworkIPDef *def); -int virNetworkIPDefNetmask(const virNetworkIPDef *def, - virSocketAddrPtr netmask); + int family, + size_t n); + +int +virNetworkIPDefPrefix(const virNetworkIPDef *def); -int virNetworkSaveXML(const char *configDir, - virNetworkDefPtr def, - const char *xml); +int +virNetworkIPDefNetmask(const virNetworkIPDef *def, + virSocketAddrPtr netmask); + +int +virNetworkSaveXML(const char *configDir, + virNetworkDefPtr def, + const char *xml); -int virNetworkSaveConfig(const char *configDir, - virNetworkDefPtr def); +int +virNetworkSaveConfig(const char *configDir, + virNetworkDefPtr def); -char *virNetworkConfigFile(const char *dir, - const char *name); +char * +virNetworkConfigFile(const char *dir, + const char *name); -void virNetworkSetBridgeMacAddr(virNetworkDefPtr def); +void +virNetworkSetBridgeMacAddr(virNetworkDefPtr def); VIR_ENUM_DECL(virNetworkForward) diff --git a/src/conf/virnetworkobj.h b/src/conf/virnetworkobj.h index 1eb315144e80e0c4c7561b27e519737507843cb2..431721b37c21df22e70d5098275a7e728d3d4e42 100644 --- a/src/conf/virnetworkobj.h +++ b/src/conf/virnetworkobj.h @@ -47,8 +47,11 @@ struct _virNetworkObj { virMacMapPtr macmap; }; -virNetworkObjPtr virNetworkObjNew(void); -void virNetworkObjEndAPI(virNetworkObjPtr *net); +virNetworkObjPtr +virNetworkObjNew(void); + +void +virNetworkObjEndAPI(virNetworkObjPtr *net); typedef struct _virNetworkObjList virNetworkObjList; typedef virNetworkObjList *virNetworkObjListPtr; @@ -59,67 +62,98 @@ virNetworkObjIsActive(const virNetworkObj *net) return net->active; } -virNetworkObjListPtr virNetworkObjListNew(void); - -virNetworkObjPtr virNetworkObjFindByUUIDLocked(virNetworkObjListPtr nets, - const unsigned char *uuid); -virNetworkObjPtr virNetworkObjFindByUUID(virNetworkObjListPtr nets, - const unsigned char *uuid); -virNetworkObjPtr virNetworkObjFindByNameLocked(virNetworkObjListPtr nets, - const char *name); -virNetworkObjPtr virNetworkObjFindByName(virNetworkObjListPtr nets, - const char *name); -bool virNetworkObjTaint(virNetworkObjPtr obj, - virNetworkTaintFlags taint); - -typedef bool (*virNetworkObjListFilter)(virConnectPtr conn, - virNetworkDefPtr def); - -virNetworkObjPtr virNetworkAssignDef(virNetworkObjListPtr nets, - virNetworkDefPtr def, - unsigned int flags); -void virNetworkObjAssignDef(virNetworkObjPtr network, - virNetworkDefPtr def, - bool live); -int virNetworkObjSetDefTransient(virNetworkObjPtr network, bool live); -void virNetworkObjUnsetDefTransient(virNetworkObjPtr network); -virNetworkDefPtr virNetworkObjGetPersistentDef(virNetworkObjPtr network); -int virNetworkObjReplacePersistentDef(virNetworkObjPtr network, - virNetworkDefPtr def); -int virNetworkConfigChangeSetup(virNetworkObjPtr dom, unsigned int flags); - -void virNetworkRemoveInactive(virNetworkObjListPtr nets, - virNetworkObjPtr net); - -int virNetworkSaveStatus(const char *statusDir, - virNetworkObjPtr net) ATTRIBUTE_RETURN_CHECK; - -virNetworkObjPtr virNetworkLoadConfig(virNetworkObjListPtr nets, - const char *configDir, - const char *autostartDir, - const char *file); - -virNetworkObjPtr virNetworkLoadState(virNetworkObjListPtr nets, - const char *stateDir, - const char *name); - -int virNetworkLoadAllConfigs(virNetworkObjListPtr nets, - const char *configDir, - const char *autostartDir); - -int virNetworkLoadAllState(virNetworkObjListPtr nets, - const char *stateDir); - -int virNetworkDeleteConfig(const char *configDir, - const char *autostartDir, - virNetworkObjPtr net); - -char *virNetworkConfigFile(const char *dir, - const char *name); - -int virNetworkBridgeInUse(virNetworkObjListPtr nets, - const char *bridge, - const char *skipname); +virNetworkObjListPtr +virNetworkObjListNew(void); + +virNetworkObjPtr +virNetworkObjFindByUUIDLocked(virNetworkObjListPtr nets, + const unsigned char *uuid); + +virNetworkObjPtr +virNetworkObjFindByUUID(virNetworkObjListPtr nets, + const unsigned char *uuid); + +virNetworkObjPtr +virNetworkObjFindByNameLocked(virNetworkObjListPtr nets, + const char *name); + +virNetworkObjPtr +virNetworkObjFindByName(virNetworkObjListPtr nets, + const char *name); + +bool +virNetworkObjTaint(virNetworkObjPtr obj, + virNetworkTaintFlags taint); + +typedef bool +(*virNetworkObjListFilter)(virConnectPtr conn, + virNetworkDefPtr def); + +virNetworkObjPtr +virNetworkAssignDef(virNetworkObjListPtr nets, + virNetworkDefPtr def, + unsigned int flags); + +void +virNetworkObjAssignDef(virNetworkObjPtr network, + virNetworkDefPtr def, + bool live); + +int +virNetworkObjSetDefTransient(virNetworkObjPtr network, + bool live); + +void +virNetworkObjUnsetDefTransient(virNetworkObjPtr network); + +virNetworkDefPtr +virNetworkObjGetPersistentDef(virNetworkObjPtr network); + +int +virNetworkObjReplacePersistentDef(virNetworkObjPtr network, + virNetworkDefPtr def); + +int +virNetworkConfigChangeSetup(virNetworkObjPtr dom, + unsigned int flags); + +void +virNetworkRemoveInactive(virNetworkObjListPtr nets, + virNetworkObjPtr net); + +int +virNetworkSaveStatus(const char *statusDir, + virNetworkObjPtr net) ATTRIBUTE_RETURN_CHECK; + +virNetworkObjPtr +virNetworkLoadConfig(virNetworkObjListPtr nets, + const char *configDir, + const char *autostartDir, + const char *file); + +virNetworkObjPtr +virNetworkLoadState(virNetworkObjListPtr nets, + const char *stateDir, + const char *name); + +int +virNetworkLoadAllConfigs(virNetworkObjListPtr nets, + const char *configDir, + const char *autostartDir); + +int +virNetworkLoadAllState(virNetworkObjListPtr nets, + const char *stateDir); + +int +virNetworkDeleteConfig(const char *configDir, + const char *autostartDir, + virNetworkObjPtr net); + +int +virNetworkBridgeInUse(virNetworkObjListPtr nets, + const char *bridge, + const char *skipname); int virNetworkObjUpdate(virNetworkObjPtr obj, @@ -129,32 +163,38 @@ virNetworkObjUpdate(virNetworkObjPtr obj, const char *xml, unsigned int flags); /* virNetworkUpdateFlags */ -int virNetworkObjListExport(virConnectPtr conn, - virNetworkObjListPtr netobjs, - virNetworkPtr **nets, - virNetworkObjListFilter filter, - unsigned int flags); - -typedef int (*virNetworkObjListIterator)(virNetworkObjPtr net, - void *opaque); - -int virNetworkObjListForEach(virNetworkObjListPtr nets, - virNetworkObjListIterator callback, +int +virNetworkObjListExport(virConnectPtr conn, + virNetworkObjListPtr netobjs, + virNetworkPtr **nets, + virNetworkObjListFilter filter, + unsigned int flags); + +typedef int +(*virNetworkObjListIterator)(virNetworkObjPtr net, void *opaque); -int virNetworkObjListGetNames(virNetworkObjListPtr nets, - bool active, - char **names, - int nnames, - virNetworkObjListFilter filter, - virConnectPtr conn); +int +virNetworkObjListForEach(virNetworkObjListPtr nets, + virNetworkObjListIterator callback, + void *opaque); -int virNetworkObjListNumOfNetworks(virNetworkObjListPtr nets, - bool active, - virNetworkObjListFilter filter, - virConnectPtr conn); +int +virNetworkObjListGetNames(virNetworkObjListPtr nets, + bool active, + char **names, + int nnames, + virNetworkObjListFilter filter, + virConnectPtr conn); -void virNetworkObjListPrune(virNetworkObjListPtr nets, - unsigned int flags); +int +virNetworkObjListNumOfNetworks(virNetworkObjListPtr nets, + bool active, + virNetworkObjListFilter filter, + virConnectPtr conn); + +void +virNetworkObjListPrune(virNetworkObjListPtr nets, + unsigned int flags); #endif /* __VIRNETWORKOBJ_H__ */