[RFC] net-dhcp-leases: virNetworkDHCPLeases struct design

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Continued from https://www.redhat.com/archives/libvir-list/2013-October/msg00325.html

Earlier, the virNetworkDHCPLeases struct design was:

struct _virNetworkDHCPLeases {
    long long expirytime;       /* Seconds since epoch */
    union {
        char *mac;              /* MAC address */
        unsigned long iaid;     /* Identity association identifier (IAID) */
    } id;
    char *ipaddr;               /* IP address */
    char *hostname;             /* Hostname */
    char *clientid;             /* Client ID or DUID */
    int type;                   /* virIPAddrType */
    unsigned int prefix;        /* IP address prefix */
};

Since no one likes the idea of having a union, but we do want to
support dhcpv6, following is the new design:

struct _virNetworkDHCPLeases {
    char *interface;            /* Network interface name (non-null) */
    long long expirytime;       /* Seconds since epoch (non-null) */
    int type;                   /* virIPAddrType (non-null) */
    unsigned int prefix;        /* IP address prefix (non-null) */
    char *mac;                  /* MAC address (mostly non-null,
except rare cases) */
    char *iaid;                 /* IAID (ipv6) (null, in case of ipv4) */
    char *ipaddr;               /* IP address (non-null) */
    char *hostname;             /* Hostname (can be null) */
    char *clientid;             /* Client ID(ipv4) or DUID(ipv6) (can
be null, in case of ipv4) */
};
-- 
Nehal J Wani

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]