]> git.meshlink.io Git - catta/blobdiff - avahi-common/address.h
update python programs to new DBUS API
[catta] / avahi-common / address.h
index c5e529713bfc430ecf5cabbd405be2f07fb2f505..5523a7233ac77039655df2e8f4c7f2436f4f8631 100644 (file)
@@ -31,8 +31,8 @@
 
 AVAHI_C_DECL_BEGIN
 
-/** Protocol family specification, takes the values AVAHI_INET, AVAHI_INET6, AVAHI_UNSPEC */
-typedef char AvahiProtocol;
+/** Protocol family specification, takes the values AVAHI_PROTO_INET, AVAHI_PROTO_INET6, AVAHI_PROTO_UNSPEC */
+typedef int AvahiProtocol;
 
 /** Numeric network interface index. Takes OS dependent values and the special constant AVAHI_IF_UNSPEC  */
 typedef int AvahiIfIndex;
@@ -46,14 +46,21 @@ enum {
 
 /** Special values for AvahiIfIndex */
 enum {
-    AVAHI_IF_UNSPEC = -1 /**< Unspecifed/all interfaces */
+    AVAHI_IF_UNSPEC = -1,       /**< Unspecified/all interface(s) */
 };
 
+/** Return TRUE if the specified interface index is valid */
+#define AVAHI_IF_VALID(ifindex) (((ifindex) >= 0) || ((ifindex) == AVAHI_PROTO_UNSPEC))
+
+/** Return TRUE if the specified protocol is valid */
+#define AVAHI_PROTO_VALID(protocol) (((protocol) == AVAHI_PROTO_INET) || ((protocol) == AVAHI_PROTO_INET6) || ((protocol) == AVAHI_PROTO_UNSPEC))
+
 /** An IPv4 address */
 typedef struct {
     uint32_t address; /**< Address data in network byte order. */
 } AvahiIPv4Address;
 
+
 /** An IPv6 address */
 typedef struct {
     uint8_t address[16]; /**< Address data */