blob: 8bbc87f0dbda4086d21c403b3f4002c64c6ed48f [file] [log] [blame]
Damien Millerf91ee4c2005-03-01 21:24:33 +11001/* $OpenBSD: misc.h,v 1.21 2005/03/01 10:09:52 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 *);
27
28struct passwd *pwcopy(struct passwd *);
Ben Lindstrom226cfa02001-01-22 05:34:40 +000029
Ben Lindstrom387c4722001-05-08 20:27:25 +000030typedef struct arglist arglist;
31struct arglist {
Ben Lindstrom6328ab32002-03-22 02:54:23 +000032 char **list;
Darren Tuckerc7a6fc42004-08-13 21:18:00 +100033 u_int num;
34 u_int nalloc;
Ben Lindstrom387c4722001-05-08 20:27:25 +000035};
Kevin Stevesd009ae32001-07-04 17:25:54 +000036void addargs(arglist *, char *, ...) __attribute__((format(printf, 2, 3)));
Darren Tucker06f2bd82004-05-13 16:06:46 +100037
Darren Tuckere608ca22004-05-13 16:15:47 +100038/* tildexpand.c */
39
Darren Tucker06f2bd82004-05-13 16:06:46 +100040char *tilde_expand_filename(const char *, uid_t);
Darren Tuckere608ca22004-05-13 16:15:47 +100041
42/* readpass.c */
43
44#define RP_ECHO 0x0001
45#define RP_ALLOW_STDIN 0x0002
46#define RP_ALLOW_EOF 0x0004
Damien Miller23f07702004-06-18 01:19:03 +100047#define RP_USE_ASKPASS 0x0008
Darren Tuckere608ca22004-05-13 16:15:47 +100048
49char *read_passphrase(const char *, int);
Darren Tuckerce327b62004-11-05 20:38:03 +110050int ask_permission(const char *, ...) __attribute__((format(printf, 1, 2)));
Darren Tuckerf0f90982004-12-11 13:39:50 +110051int read_keyfile_line(FILE *, const char *, char *, size_t, u_long *);