lintian doesn't like orphan packages with uploaders...
[debian/amanda] / common-src / sockaddr-util.h
index 868df2d2832dfa21c829b86c24f74bd44861d4b9..d9cf647809e196b80b2d4fb84bb8c694b2ecef2a 100644 (file)
@@ -1,9 +1,10 @@
 /*
- * Copyright (c) 2007,2008 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2007-2012 Zmanda, Inc.  All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
@@ -42,6 +43,7 @@ void  dump_sockaddr(sockaddr_union *  sa);
  * @returns: pointer to statically allocated string
  */
 char *  str_sockaddr(sockaddr_union *sa);
+char *  str_sockaddr_no_port(sockaddr_union *sa);
 
 /* Compare two sockaddr_union objects, optionally comparing
  * only the address (and thus ignoring port, flow info, etc.).
@@ -55,6 +57,17 @@ int     cmp_sockaddr(sockaddr_union *su1,
                     sockaddr_union *su2,
                     int addr_only);
 
+/* Parse a string into a sockaddr.  This will try all available address
+ * families.
+ *
+ * @param src: the string representation of the address
+ * @param dst: the sockaddr_union in which to store the result
+ * @returns: 1 on success, -1 on error, or 0 if unparseable
+ */
+int    str_to_sockaddr(
+       const char *src,
+       sockaddr_union *dst);
+
 /* Copy a sockaddr object.
  *
  * @param dest: destination