X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Fsockaddr-util.h;h=d5e68eef7393d99c7e434799fdc65daf973e3e75;hb=b116e9366c7b2ea2c2eb53b0a13df4090e176235;hp=868df2d2832dfa21c829b86c24f74bd44861d4b9;hpb=fd48f3e498442f0cbff5f3606c7c403d0566150e;p=debian%2Famanda diff --git a/common-src/sockaddr-util.h b/common-src/sockaddr-util.h index 868df2d..d5e68ee 100644 --- a/common-src/sockaddr-util.h +++ b/common-src/sockaddr-util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007,2008 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 @@ -55,6 +55,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