* [Qemu-devel] [PATCH] net: remove parse_host_src_port() function
@ 2011-02-24 11:22 Juan Quintela
2011-03-06 19:07 ` Aurelien Jarno
0 siblings, 1 reply; 2+ messages in thread
From: Juan Quintela @ 2011-02-24 11:22 UTC (permalink / raw)
To: qemu-devel
It was deprecated, and it has no users.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
net.c | 41 -----------------------------------------
qemu_socket.h | 3 ---
2 files changed, 0 insertions(+), 44 deletions(-)
diff --git a/net.c b/net.c
index ec4745d..4c3e083 100644
--- a/net.c
+++ b/net.c
@@ -93,47 +93,6 @@ static int get_str_sep(char *buf, int buf_size, const char **pp, int sep)
return 0;
}
-int parse_host_src_port(struct sockaddr_in *haddr,
- struct sockaddr_in *saddr,
- const char *input_str)
-{
- char *str = qemu_strdup(input_str);
- char *host_str = str;
- char *src_str;
- const char *src_str2;
- char *ptr;
-
- /*
- * Chop off any extra arguments at the end of the string which
- * would start with a comma, then fill in the src port information
- * if it was provided else use the "any address" and "any port".
- */
- if ((ptr = strchr(str,',')))
- *ptr = '\0';
-
- if ((src_str = strchr(input_str,'@'))) {
- *src_str = '\0';
- src_str++;
- }
-
- if (parse_host_port(haddr, host_str) < 0)
- goto fail;
-
- src_str2 = src_str;
- if (!src_str || *src_str == '\0')
- src_str2 = ":0";
-
- if (parse_host_port(saddr, src_str2) < 0)
- goto fail;
-
- free(str);
- return(0);
-
-fail:
- free(str);
- return -1;
-}
-
int parse_host_port(struct sockaddr_in *saddr, const char *str)
{
char buf[512];
diff --git a/qemu_socket.h b/qemu_socket.h
index 897a8ae..180e4db 100644
--- a/qemu_socket.h
+++ b/qemu_socket.h
@@ -54,9 +54,6 @@ int unix_connect(const char *path);
/* Old, ipv4 only bits. Don't use for new code. */
int parse_host_port(struct sockaddr_in *saddr, const char *str);
-int parse_host_src_port(struct sockaddr_in *haddr,
- struct sockaddr_in *saddr,
- const char *str);
int socket_init(void);
#endif /* QEMU_SOCKET_H */
--
1.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] net: remove parse_host_src_port() function
2011-02-24 11:22 [Qemu-devel] [PATCH] net: remove parse_host_src_port() function Juan Quintela
@ 2011-03-06 19:07 ` Aurelien Jarno
0 siblings, 0 replies; 2+ messages in thread
From: Aurelien Jarno @ 2011-03-06 19:07 UTC (permalink / raw)
To: Juan Quintela; +Cc: qemu-devel
On Thu, Feb 24, 2011 at 12:22:10PM +0100, Juan Quintela wrote:
> It was deprecated, and it has no users.
>
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
> net.c | 41 -----------------------------------------
> qemu_socket.h | 3 ---
> 2 files changed, 0 insertions(+), 44 deletions(-)
Thanks, applied.
> diff --git a/net.c b/net.c
> index ec4745d..4c3e083 100644
> --- a/net.c
> +++ b/net.c
> @@ -93,47 +93,6 @@ static int get_str_sep(char *buf, int buf_size, const char **pp, int sep)
> return 0;
> }
>
> -int parse_host_src_port(struct sockaddr_in *haddr,
> - struct sockaddr_in *saddr,
> - const char *input_str)
> -{
> - char *str = qemu_strdup(input_str);
> - char *host_str = str;
> - char *src_str;
> - const char *src_str2;
> - char *ptr;
> -
> - /*
> - * Chop off any extra arguments at the end of the string which
> - * would start with a comma, then fill in the src port information
> - * if it was provided else use the "any address" and "any port".
> - */
> - if ((ptr = strchr(str,',')))
> - *ptr = '\0';
> -
> - if ((src_str = strchr(input_str,'@'))) {
> - *src_str = '\0';
> - src_str++;
> - }
> -
> - if (parse_host_port(haddr, host_str) < 0)
> - goto fail;
> -
> - src_str2 = src_str;
> - if (!src_str || *src_str == '\0')
> - src_str2 = ":0";
> -
> - if (parse_host_port(saddr, src_str2) < 0)
> - goto fail;
> -
> - free(str);
> - return(0);
> -
> -fail:
> - free(str);
> - return -1;
> -}
> -
> int parse_host_port(struct sockaddr_in *saddr, const char *str)
> {
> char buf[512];
> diff --git a/qemu_socket.h b/qemu_socket.h
> index 897a8ae..180e4db 100644
> --- a/qemu_socket.h
> +++ b/qemu_socket.h
> @@ -54,9 +54,6 @@ int unix_connect(const char *path);
>
> /* Old, ipv4 only bits. Don't use for new code. */
> int parse_host_port(struct sockaddr_in *saddr, const char *str);
> -int parse_host_src_port(struct sockaddr_in *haddr,
> - struct sockaddr_in *saddr,
> - const char *str);
> int socket_init(void);
>
> #endif /* QEMU_SOCKET_H */
> --
> 1.7.4
>
>
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-03-06 19:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-24 11:22 [Qemu-devel] [PATCH] net: remove parse_host_src_port() function Juan Quintela
2011-03-06 19:07 ` Aurelien Jarno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).