X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Fsockaddr-util.h;h=2b162018d025081bc663e2bb8327399d7d427f50;hb=911bfb4415195b5c0a98b8c957caa8968313fd81;hp=977c4f9a2efefc5af73660909caf7fa01f57e85a;hpb=6ba576375c19b829b2a13dbe6562eedd2716b9ea;p=debian%2Famanda diff --git a/common-src/sockaddr-util.h b/common-src/sockaddr-util.h index 977c4f9..2b16201 100644 --- a/common-src/sockaddr-util.h +++ b/common-src/sockaddr-util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda Inc. All Rights Reserved. + * Copyright (c) 2007, 2008, 2010 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 @@ -14,8 +14,8 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com * * Author: Dustin J. Mitchell */ @@ -42,6 +42,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 +56,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