blob: 798d80fbf3fd98794d034ca288d54260c33f58b7 [file] [log] [blame]
Damien Miller5fd38c02005-05-26 12:02:14 +10001/* $OpenBSD: misc.h,v 1.22 2005/04/09 04:32:54 djm Exp $ */
Ben Lindstrom36579d32001-01-29 07:39:26 +00002
Ben Lindstrom226cfa02001-01-22 05:34:40 +00003/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
5 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
6 * All rights reserved
7 *
8 * As far as I am concerned, the code I have written for this software
9 * can be used freely for any purpose. Any derived versions of this
10 * software must be clearly marked as such, and if the derived work is
11 * incompatible with the protocol description in the RFC file, it must be
12 * called by a name other than "ssh" or "Secure Shell".
13 */
Ben Lindstrom226cfa02001-01-22 05:34:40 +000014
Darren Tuckere608ca22004-05-13 16:15:47 +100015/* misc.c */
16
Kevin Stevesd009ae32001-07-04 17:25:54 +000017char *chop(char *);
18char *strdelim(char **);
Damien Miller232711f2004-06-15 10:35:30 +100019int set_nonblock(int);
20int unset_nonblock(int);
Damien Miller398e1cf2002-02-05 11:52:13 +110021void set_nodelay(int);
Kevin Stevesd009ae32001-07-04 17:25:54 +000022int a2port(const char *);
Damien Millerf91ee4c2005-03-01 21:24:33 +110023char *hpdelim(char **);
Kevin Stevesd009ae32001-07-04 17:25:54 +000024char *cleanhostname(char *);
25char *colon(char *);
26long convtime(const char *);
Damien Miller5fd38c02005-05-26 12:02:14 +100027char *tilde_expand_filename(const char *, uid_t);
Kevin Stevesd009ae32001-07-04 17:25:54 +000028
29struct passwd *pwcopy(struct passwd *);
Ben Lindstrom226cfa02001-01-22 05:34:40 +000030
Ben Lindstrom387c4722001-05-08 20:27:25 +000031typedef struct arglist arglist;
32struct arglist {
Ben Lindstrom6328ab32002-03-22 02:54:23 +000033 char **list;
Darren Tuckerc7a6fc42004-08-13 21:18:00 +100034 u_int num;
35 u_int nalloc;
Ben Lindstrom387c4722001-05-08 20:27:25 +000036};
Kevin Stevesd009ae32001-07-04 17:25:54 +000037void addargs(arglist *, char *, ...) __attribute__((format(printf, 2, 3)));
Darren Tucker06f2bd82004-05-13 16:06:46 +100038
Darren Tuckere608ca22004-05-13 16:15:47 +100039/* readpass.c */
40
41#define RP_ECHO 0x0001
42#define RP_ALLOW_STDIN 0x0002
43#define RP_ALLOW_EOF 0x0004
Damien Miller23f07702004-06-18 01:19:03 +100044#define RP_USE_ASKPASS 0x0008
Darren Tuckere608ca22004-05-13 16:15:47 +100045
46char *read_passphrase(const char *, int);
Darren Tuckerce327b62004-11-05 20:38:03 +110047int ask_permission(const char *, ...) __attribute__((format(printf, 1, 2)));
Darren Tuckerf0f90982004-12-11 13:39:50 +110048int read_keyfile_line(FILE *, const char *, char *, size_t, u_long *);