-change vpn wire data format
[oweals/gnunet.git] / src / include / gnunet_configuration_lib.h
index 0fcb4e054c1f2fde4cb237f1e000abf95326ead5..77d6d5552f0025b2753734fa9a1ed3834453cfe0 100644 (file)
@@ -112,6 +112,37 @@ GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg,
                             const char *filename);
 
 
+/**
+ * Serializes the given configuration.
+ *
+ * @param cfg configuration to serialize
+ * @param size will be set to the size of the serialized memory block
+ * @return the memory block where the serialized configuration is
+ *           present. This memory should be freed by the caller
+ */
+char *
+GNUNET_CONFIGURATION_serialize (const struct GNUNET_CONFIGURATION_Handle *cfg,
+                               size_t *size);
+
+
+/**
+ * De-serializes configuration
+ *
+ * @param cfg configuration to update
+ * @param mem the memory block of serialized configuration
+ * @param size the size of the memory block
+ * @param allow_inline set to GNUNET_YES if we recursively load configuration
+ *          from inlined configurations; GNUNET_NO if not and raise warnings
+ *          when we come across them
+ * @return GNUNET_OK on success, GNUNET_ERROR on error
+ */
+int
+GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg,
+                                 const char *mem,
+                                 const size_t size,
+                                 int allow_inline);
+
+
 /**
  * Write configuration file.
  *