diff options
author | Ben Pfaff <blp@ovn.org> | 2017-09-18 11:27:13 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2017-10-24 16:09:16 -0700 |
commit | ce04c33d8b20c20aff73b45348b6769f80ce6e6f (patch) | |
tree | 5a8b6987d9994f0ad9f7867bbfd4bba20a3e4096 | |
parent | 238f0052d861f41d41c57e33dbfc052689af7e8f (diff) | |
download | openvswitch-ce04c33d8b20c20aff73b45348b6769f80ce6e6f.tar.gz |
socket-util: Make parse_bracketed_token() public, as inet_parse_token().
An upcoming commit will introduce a new user outside socket-util.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
-rw-r--r-- | lib/socket-util.c | 14 | ||||
-rw-r--r-- | lib/socket-util.h | 3 |
2 files changed, 9 insertions, 8 deletions
diff --git a/lib/socket-util.c b/lib/socket-util.c index 85ed54c05..6fb26effe 100644 --- a/lib/socket-util.c +++ b/lib/socket-util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -337,8 +337,8 @@ guess_netmask(ovs_be32 ip_) * * - Square brackets [] quote ":" separators and are removed from the * tokens. */ -static char * -parse_bracketed_token(char **pp) +char * +inet_parse_token(char **pp) { char *p = *pp; @@ -445,8 +445,8 @@ inet_parse_active(const char *target_, uint16_t default_port, bool ok; p = target; - host = parse_bracketed_token(&p); - port = parse_bracketed_token(&p); + host = inet_parse_token(&p); + port = inet_parse_token(&p); if (!host) { VLOG_ERR("%s: host must be specified", target_); ok = false; @@ -572,8 +572,8 @@ inet_parse_passive(const char *target_, int default_port, bool ok; p = target; - port = parse_bracketed_token(&p); - host = parse_bracketed_token(&p); + port = inet_parse_token(&p); + host = inet_parse_token(&p); if (!port && default_port < 0) { VLOG_ERR("%s: port must be specified", target_); ok = false; diff --git a/lib/socket-util.h b/lib/socket-util.h index 1782745fa..873a59a3f 100644 --- a/lib/socket-util.h +++ b/lib/socket-util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,6 +46,7 @@ int check_connection_completion(int fd); void drain_fd(int fd, size_t n_packets); ovs_be32 guess_netmask(ovs_be32 ip); +char *inet_parse_token(char **); bool inet_parse_active(const char *target, uint16_t default_port, struct sockaddr_storage *ssp); int inet_open_active(int style, const char *target, uint16_t default_port, |