diff options
author | Hans-Joerg Hoexer <hshoexer@cvs.openbsd.org> | 2005-03-04 16:51:53 +0000 |
---|---|---|
committer | Hans-Joerg Hoexer <hshoexer@cvs.openbsd.org> | 2005-03-04 16:51:53 +0000 |
commit | e33c7b046085dbe714d5e1a231eb0b16e5c00f18 (patch) | |
tree | 234f8657857ae507215b6f6542c0187bc9d71da2 /sbin/isakmpd/udp.c | |
parent | ccc2ee524f8a3d40f352a30d1e15d76830f470ba (diff) |
remove unused function udp_decode_port(), add modified version as text2port() to
utilities.
ok cloder ho
Diffstat (limited to 'sbin/isakmpd/udp.c')
-rw-r--r-- | sbin/isakmpd/udp.c | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/sbin/isakmpd/udp.c b/sbin/isakmpd/udp.c index f2428f95bff..a2c8c644462 100644 --- a/sbin/isakmpd/udp.c +++ b/sbin/isakmpd/udp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udp.c,v 1.82 2005/03/04 16:09:59 hshoexer Exp $ */ +/* $OpenBSD: udp.c,v 1.83 2005/03/04 16:51:52 hshoexer Exp $ */ /* $EOM: udp.c,v 1.57 2001/01/26 10:09:57 niklas Exp $ */ /* @@ -83,9 +83,6 @@ static void udp_report(struct transport *); static void udp_handle_message(struct transport *); static struct transport *udp_make(struct sockaddr *); static int udp_send_message(struct message *, struct transport *); -#if 0 -static in_port_t udp_decode_port(char *); -#endif static struct transport_vtbl udp_transport_vtbl = { {0}, "udp_physical", @@ -540,33 +537,3 @@ udp_decode_ids(struct transport *t) snprintf(result, sizeof result, "src: %s dst: %s", idsrc, iddst); return result; } - -#if 0 -/* - * Take a string containing an ext representation of port and return a - * binary port number in host byte order. Return zero if anything goes wrong. - * XXX Currently unused. - */ -static in_port_t -udp_decode_port(char *port_str) -{ - char *port_str_end; - long port_long; - struct servent *service; - - port_long = ntohl(strtol(port_str, &port_str_end, 0)); - if (port_str == port_str_end) { - service = getservbyname(port_str, "udp"); - if (!service) { - log_print("udp_decode_port: service \"%s\" unknown", - port_str); - return 0; - } - return ntohs(service->s_port); - } else if (port_long < 1 || port_long > 65535) { - log_print("udp_decode_port: port %ld out of range", port_long); - return 0; - } - return port_long; -} -#endif |