blob: 51541336cf396ad9e830f19a36102ed3bdc6aad3 [file] [log] [blame]
Darren Tuckerce321d82005-10-03 18:11:24 +10001/* $OpenBSD: misc.h,v 1.26 2005/09/13 23:40:07 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);
Darren Tucker8e2eb302005-07-14 17:07:21 +100028char *percent_expand(const char *, ...) __attribute__((__sentinel__));
Damien Miller13390022005-07-06 09:44:19 +100029char *tohex(const u_char *, u_int);
Darren Tuckerce321d82005-10-03 18:11:24 +100030void sanitise_stdfd(void);
Kevin Stevesd009ae32001-07-04 17:25:54 +000031
32struct passwd *pwcopy(struct passwd *);
Ben Lindstrom226cfa02001-01-22 05:34:40 +000033
Ben Lindstrom387c4722001-05-08 20:27:25 +000034typedef struct arglist arglist;
35struct arglist {
Ben Lindstrom6328ab32002-03-22 02:54:23 +000036 char **list;
Darren Tuckerc7a6fc42004-08-13 21:18:00 +100037 u_int num;
38 u_int nalloc;
Ben Lindstrom387c4722001-05-08 20:27:25 +000039};
Kevin Stevesd009ae32001-07-04 17:25:54 +000040void addargs(arglist *, char *, ...) __attribute__((format(printf, 2, 3)));
Darren Tucker06f2bd82004-05-13 16:06:46 +100041
Darren Tuckere608ca22004-05-13 16:15:47 +100042/* 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 *);