interface: Make _virInterfaceObj struct private

Move the struct into virinterfaceobj.c, create necessary accessors, and
initializers.

Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
John Ferlan
2017-04-25 17:45:02 -04:00
parent 4939f0b25d
commit 3b6de6c0cb
4 changed files with 51 additions and 20 deletions

View File

@@ -24,12 +24,6 @@
typedef struct _virInterfaceObj virInterfaceObj;
typedef virInterfaceObj *virInterfaceObjPtr;
struct _virInterfaceObj {
virMutex lock;
bool active; /* true if interface is active (up) */
virInterfaceDefPtr def; /* The interface definition */
};
typedef struct _virInterfaceObjList virInterfaceObjList;
typedef virInterfaceObjList *virInterfaceObjListPtr;
@@ -38,11 +32,15 @@ struct _virInterfaceObjList {
virInterfaceObjPtr *objs;
};
static inline bool
virInterfaceObjIsActive(const virInterfaceObj *iface)
{
return iface->active;
}
virInterfaceDefPtr
virInterfaceObjGetDef(virInterfaceObjPtr obj);
bool
virInterfaceObjIsActive(virInterfaceObjPtr obj);
void
virInterfaceObjSetActive(virInterfaceObjPtr obj,
bool active);
int
virInterfaceObjFindByMACString(virInterfaceObjListPtr interfaces,