[ovs-dev,09/13] socket-util: Make parse_bracketed_token() public, as inet_parse_token().

Message ID 20171007004458.5788-10-blp@ovn.org
State New
Headers show
Series
  • clustering implementation, part 1
Related show

Commit Message

Ben Pfaff Oct. 7, 2017, 12:44 a.m.
An upcoming commit will introduce a new user outside socket-util.

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 lib/socket-util.c | 14 +++++++-------
 lib/socket-util.h |  3 ++-
 2 files changed, 9 insertions(+), 8 deletions(-)

Comments

Russell Bryant Oct. 9, 2017, 7:59 p.m. | #1
On Fri, Oct 6, 2017 at 8:44 PM, Ben Pfaff <blp@ovn.org> wrote:
> 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>

Patch

diff --git a/lib/socket-util.c b/lib/socket-util.c
index 85ed54c058d6..6fb26effe54a 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 1782745fa2c0..873a59a3fd21 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,