From 19066a112baff6107781dc337b27e557f43098c2 Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Thu, 12 Apr 2001 23:39:26 +0000 Subject: - stevesk@cvs.openbsd.org 2001/04/12 20:09:38 [misc.c misc.h readconf.c servconf.c ssh.c sshd.c] robust port validation; ok markus@ jakob@ --- misc.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'misc.h') diff --git a/misc.h b/misc.h index 3204b626a..2346a5ea5 100644 --- a/misc.h +++ b/misc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.h,v 1.3 2001/02/22 21:59:44 markus Exp $ */ +/* $OpenBSD: misc.h,v 1.4 2001/04/12 20:09:36 stevesk Exp $ */ /* * Author: Tatu Ylonen @@ -22,6 +22,13 @@ void set_nonblock(int fd); struct passwd * pwcopy(struct passwd *pw); +/* + * Convert ASCII string to TCP/IP port number. + * Port must be >0 and <=65535. + * Return 0 if invalid. + */ +int a2port(const char *s); + /* wrapper for signal interface */ typedef void (*mysig_t)(int); mysig_t mysignal(int sig, mysig_t act); -- cgit v1.2.3