Update jsonapi to current specs, refactor
[oweals/gnunet.git] / src / include / gnunet_network_lib.h
index f7050983062236121c1d63783f28132064162e43..8064140aa5e474f28dd96aa3c91436ee878d476c 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2009-2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2009-2013 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
 */
 
 /**
- * @file include/gnunet_network_lib.h
- * @brief basic low-level networking interface
  * @author Nils Durner
+ *
+ * @file
+ * Basic low-level networking interface
+ *
+ * @defgroup network  Network library
+ * Basic low-level networking interface
+ * @{
  */
 #ifndef GNUNET_NETWORK_LIB_H
 #define GNUNET_NETWORK_LIB_H
@@ -106,6 +111,21 @@ char *
 GNUNET_NETWORK_shorten_unixpath (char *unixpath);
 
 
+#ifndef WINDOWS
+/**
+ * If services crash, they can leave a unix domain socket file on the
+ * disk. This needs to be manually removed, because otherwise both
+ * bind() and connect() for the respective address will fail.  In this
+ * function, we test if such a left-over file exists, and if so,
+ * remove it (unless there is a listening service at the address).
+ *
+ * @param un unix domain socket address to check
+ */
+void
+GNUNET_NETWORK_unix_precheck (const struct sockaddr_un *un);
+#endif
+
+
 /**
  * Accept a new connection on a socket.  Configure it for non-blocking
  * IO and mark it as non-inheritable to child processes (set the
@@ -576,3 +596,5 @@ GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds);
 #endif
 
 #endif /* GNUNET_NETWORK_LIB_H */
+
+/** @} */  /* end of group */