gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r31898 - in gnunet/src: hello include


From: gnunet
Subject: [GNUnet-SVN] r31898 - in gnunet/src: hello include
Date: Tue, 14 Jan 2014 14:07:25 +0100

Author: wachs
Date: 2014-01-14 14:07:25 +0100 (Tue, 14 Jan 2014)
New Revision: 31898

Modified:
   gnunet/src/hello/address.c
   gnunet/src/include/gnunet_hello_lib.h
Log:
additional function to check option


Modified: gnunet/src/hello/address.c
===================================================================
--- gnunet/src/hello/address.c  2014-01-14 12:55:09 UTC (rev 31897)
+++ gnunet/src/hello/address.c  2014-01-14 13:07:25 UTC (rev 31898)
@@ -29,6 +29,22 @@
 
 
 /**
+ * Check if an address has a local option set
+ *
+ * @param address the address to check
+ * @param option the respective option to check for
+ * @return GNUNET_YES or GNUNET_NO
+ */
+int
+GNUNET_HELLO_address_check_option (const struct GNUNET_HELLO_Address * address,
+    enum GNUNET_HELLO_AddressInfo option)
+{
+  if (option == (address->local_info & option))
+    return GNUNET_YES;
+  return GNUNET_NO;
+}
+
+/**
  * Get the size of an address struct.
  *
  * @param address address

Modified: gnunet/src/include/gnunet_hello_lib.h
===================================================================
--- gnunet/src/include/gnunet_hello_lib.h       2014-01-14 12:55:09 UTC (rev 
31897)
+++ gnunet/src/include/gnunet_hello_lib.h       2014-01-14 13:07:25 UTC (rev 
31898)
@@ -160,7 +160,18 @@
 size_t
 GNUNET_HELLO_address_get_size (const struct GNUNET_HELLO_Address *address);
 
+/**
+ * Check if an address has a local option set
+ *
+ * @param address the address to check
+ * @param option the respective option to check for
+ * @return GNUNET_YES or GNUNET_NO
+ */
+int
+GNUNET_HELLO_address_check_option (const struct GNUNET_HELLO_Address * address,
+    enum GNUNET_HELLO_AddressInfo option);
 
+
 /**
  * Free an address.
  *




reply via email to

[Prev in Thread] Current Thread [Next in Thread]