Skip to content

Commit

Permalink
Remove InvalidAddress exception.
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Greear <greearb@candelatech.com>
  • Loading branch information
greearb committed Sep 8, 2017
1 parent 8e8b733 commit 5cadac1
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 41 deletions.
4 changes: 0 additions & 4 deletions xorp/libxipc/finder_main.cc
Expand Up @@ -195,10 +195,6 @@ finder_main(int argc, char* const argv[])
XLOG_ERROR("%s: a finder may already be running.\n",
i.why().c_str());
exit(-1);
} catch (const InvalidAddress& i) {
XLOG_ERROR("Invalid finder server adddress: %s.\n",
i.why().c_str());
exit(-1);
} catch (...) {
xorp_catch_standard_exceptions();
}
Expand Down
4 changes: 2 additions & 2 deletions xorp/libxipc/finder_server.cc
Expand Up @@ -27,7 +27,7 @@
FinderServer::FinderServer(EventLoop& e,
IPv4 default_interface,
uint16_t default_port)
throw (InvalidAddress, InvalidPort)
throw (InvalidPort)
: _e(e), _f(e), _fxt(_f)
{
char* value;
Expand Down Expand Up @@ -90,7 +90,7 @@ FinderServer::~FinderServer()

bool
FinderServer::add_binding(IPv4 addr, uint16_t port)
throw (InvalidAddress, InvalidPort)
throw (InvalidPort)
{
Listeners::const_iterator i = _listeners.begin();
while (i != _listeners.end()) {
Expand Down
5 changes: 2 additions & 3 deletions xorp/libxipc/finder_server.hh
Expand Up @@ -19,7 +19,6 @@
// XORP, Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
// http://xorp.net

// $XORP: xorp/libxipc/finder_server.hh,v 1.20 2008/10/02 21:57:20 bms Exp $

#ifndef __LIBXIPC_FINDER_SERVER_HH__
#define __LIBXIPC_FINDER_SERVER_HH__
Expand Down Expand Up @@ -51,7 +50,7 @@ public:
* Constructor
*/
FinderServer(EventLoop& e, IPv4 default_interface, uint16_t default_port)
throw (InvalidAddress, InvalidPort);
throw (InvalidPort);

/**
* Destructor
Expand All @@ -65,7 +64,7 @@ public:
* instantiated.
*/
bool add_binding(IPv4 addr, uint16_t port)
throw (InvalidAddress, InvalidPort);
throw (InvalidPort);

/**
* Remove an interface binding that was added by calling add_binding.
Expand Down
4 changes: 2 additions & 2 deletions xorp/libxipc/finder_tcp.cc
Expand Up @@ -288,7 +288,7 @@ FinderTcpListenerBase::FinderTcpListenerBase(EventLoop& e,
IPv4 interface,
uint16_t port,
bool en)
throw (InvalidAddress, InvalidPort)
throw (InvalidPort)
: _e(e), _en(false), _addr(interface), _port(port)
{
comm_init();
Expand All @@ -297,7 +297,7 @@ FinderTcpListenerBase::FinderTcpListenerBase(EventLoop& e,
if_ia.s_addr = interface.addr();

if (is_ip_configured(if_ia) == false && interface != IPv4::ANY()) {
xorp_throw(InvalidAddress, "Not a configured IPv4 address");
XLOG_FATAL("Not a configured IPv4 address");
}

_lsock = comm_bind_tcp4(&if_ia, htons(port), COMM_SOCK_NONBLOCKING);
Expand Down
3 changes: 1 addition & 2 deletions xorp/libxipc/finder_tcp.hh
Expand Up @@ -19,7 +19,6 @@
// XORP, Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
// http://xorp.net

// $XORP: xorp/libxipc/finder_tcp.hh,v 1.25 2008/10/02 21:57:20 bms Exp $

#ifndef __LIBXIPC_FINDER_TCP_HH__
#define __LIBXIPC_FINDER_TCP_HH__
Expand Down Expand Up @@ -139,7 +138,7 @@ public:
IPv4 iface,
uint16_t port,
bool en = true)
throw (InvalidAddress, InvalidPort);
throw (InvalidPort);

virtual ~FinderTcpListenerBase();

Expand Down
2 changes: 1 addition & 1 deletion xorp/libxipc/finder_tcp_messenger.cc
Expand Up @@ -241,7 +241,7 @@ FinderTcpListener::FinderTcpListener(EventLoop& e,
IPv4 interface,
uint16_t port,
bool en)
throw (InvalidAddress, InvalidPort)
throw (InvalidPort)
: FinderTcpListenerBase(e, interface, port, en), _mm(mm), _cmds(cmds)
{
}
Expand Down
3 changes: 1 addition & 2 deletions xorp/libxipc/finder_tcp_messenger.hh
Expand Up @@ -19,7 +19,6 @@
// XORP, Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
// http://xorp.net

// $XORP: xorp/libxipc/finder_tcp_messenger.hh,v 1.23 2008/10/02 21:57:21 bms Exp $

#ifndef __LIBXIPC_FINDER_TCP_MESSENGER_HH__
#define __LIBXIPC_FINDER_TCP_MESSENGER_HH__
Expand Down Expand Up @@ -94,7 +93,7 @@ public:
IPv4 iface,
uint16_t port,
bool enabled = true)
throw (InvalidAddress, InvalidPort);
throw (InvalidPort);

virtual ~FinderTcpListener();

Expand Down
7 changes: 1 addition & 6 deletions xorp/libxipc/xrl_router.cc
Expand Up @@ -87,18 +87,15 @@ class XrlRouterDispatchState {
XrlRouter::XrlCallback _xcb;
};


//
// This is scatty and temporary
//
static IPv4
finder_host(const char* host)
throw (InvalidAddress)
{
in_addr ia;
if (address_lookup(host, ia) == false) {
xorp_throw(InvalidAddress,
c_format("Could resolve finder host %s\n", host));
XLOG_FATAL("Could resolve finder host %s\n", host);
}
return IPv4(ia);
}
Expand Down Expand Up @@ -236,7 +233,6 @@ XrlRouter::XrlRouter(EventLoop& e,
const char* class_name,
const char* finder_addr,
uint16_t finder_port)
throw (InvalidAddress)
: XrlDispatcher(class_name), _e(e), _finalized(false)
{
IPv4 finder_ip;
Expand All @@ -256,7 +252,6 @@ XrlRouter::XrlRouter(EventLoop& e,
const char* class_name,
IPv4 finder_ip,
uint16_t finder_port)
throw (InvalidAddress)
: XrlDispatcher(class_name), _e(e), _finalized(false)
{
if (0 == finder_port)
Expand Down
6 changes: 2 additions & 4 deletions xorp/libxipc/xrl_router.hh
Expand Up @@ -53,14 +53,12 @@ public:
XrlRouter(EventLoop& e,
const char* class_name,
const char* finder_address,
uint16_t finder_port)
throw (InvalidAddress);
uint16_t finder_port);

XrlRouter(EventLoop& e,
const char* class_name,
IPv4 finder_address,
uint16_t finder_port)
throw (InvalidAddress);
uint16_t finder_port);

virtual ~XrlRouter();

Expand Down
7 changes: 0 additions & 7 deletions xorp/libxorp/exceptions.cc
Expand Up @@ -72,13 +72,6 @@ XorpReasonedException::why() const
return ( _why.size() != 0 ) ? _why : string("Not specified");
}

InvalidAddress::InvalidAddress(const char* file,
size_t line,
const string& init_why)
: XorpReasonedException("InvalidAddress", file, line, init_why)
{
}

InvalidPort::InvalidPort(const char* file,
size_t line,
const string& init_why)
Expand Down
8 changes: 0 additions & 8 deletions xorp/libxorp/exceptions.hh
Expand Up @@ -134,14 +134,6 @@ protected:
// ----------------------------------------------------------------------------
// Standard XORP exceptions

/**
* @short A standard XORP exception that is thrown if an address is invalid.
*/
class InvalidAddress : public XorpReasonedException {
public:
InvalidAddress(const char* file, size_t line, const string& init_why = "");
};

/**
* @short A standard XORP exception that is thrown if a port is invalid.
*/
Expand Down

0 comments on commit 5cadac1

Please sign in to comment.