mirror of
https://github.com/openvswitch/ovs
synced 2025-09-02 15:25:22 +00:00
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>
This commit is contained in:
@@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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
|
* - Square brackets [] quote ":" separators and are removed from the
|
||||||
* tokens. */
|
* tokens. */
|
||||||
static char *
|
char *
|
||||||
parse_bracketed_token(char **pp)
|
inet_parse_token(char **pp)
|
||||||
{
|
{
|
||||||
char *p = *pp;
|
char *p = *pp;
|
||||||
|
|
||||||
@@ -445,8 +445,8 @@ inet_parse_active(const char *target_, uint16_t default_port,
|
|||||||
bool ok;
|
bool ok;
|
||||||
|
|
||||||
p = target;
|
p = target;
|
||||||
host = parse_bracketed_token(&p);
|
host = inet_parse_token(&p);
|
||||||
port = parse_bracketed_token(&p);
|
port = inet_parse_token(&p);
|
||||||
if (!host) {
|
if (!host) {
|
||||||
VLOG_ERR("%s: host must be specified", target_);
|
VLOG_ERR("%s: host must be specified", target_);
|
||||||
ok = false;
|
ok = false;
|
||||||
@@ -572,8 +572,8 @@ inet_parse_passive(const char *target_, int default_port,
|
|||||||
bool ok;
|
bool ok;
|
||||||
|
|
||||||
p = target;
|
p = target;
|
||||||
port = parse_bracketed_token(&p);
|
port = inet_parse_token(&p);
|
||||||
host = parse_bracketed_token(&p);
|
host = inet_parse_token(&p);
|
||||||
if (!port && default_port < 0) {
|
if (!port && default_port < 0) {
|
||||||
VLOG_ERR("%s: port must be specified", target_);
|
VLOG_ERR("%s: port must be specified", target_);
|
||||||
ok = false;
|
ok = false;
|
||||||
|
@@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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);
|
void drain_fd(int fd, size_t n_packets);
|
||||||
ovs_be32 guess_netmask(ovs_be32 ip);
|
ovs_be32 guess_netmask(ovs_be32 ip);
|
||||||
|
|
||||||
|
char *inet_parse_token(char **);
|
||||||
bool inet_parse_active(const char *target, uint16_t default_port,
|
bool inet_parse_active(const char *target, uint16_t default_port,
|
||||||
struct sockaddr_storage *ssp);
|
struct sockaddr_storage *ssp);
|
||||||
int inet_open_active(int style, const char *target, uint16_t default_port,
|
int inet_open_active(int style, const char *target, uint16_t default_port,
|
||||||
|
Reference in New Issue
Block a user