4 * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
5 * Copyright (c) 1999 by Internet Software Consortium.
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
17 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 * Id: irp.h,v 1.4 2005/04/27 04:56:15 sra Exp
24 #ifndef _IRP_H_INCLUDED
25 #define _IRP_H_INCLUDED
29 #define IRPD_TIMEOUT 30 /*%< seconds */
30 #define IRPD_MAXSESS 50 /*%< number of simultaneous sessions. */
31 #define IRPD_PORT 6660 /*%< 10 times the number of the beast. */
32 #define IRPD_PATH "/var/run/irpd" /*%< af_unix socket path */
34 /* If sets the environment variable IRPDSERVER to an IP address
35 (e.g. "192.5.5.1"), then that's the host the client expects irpd to be
37 #define IRPD_HOST_ENV "IRPDSERVER"
39 /* Protocol response codes. */
40 #define IRPD_WELCOME_CODE 200
41 #define IRPD_NOT_WELCOME_CODE 500
43 #define IRPD_GETHOST_ERROR 510
44 #define IRPD_GETHOST_NONE 210
45 #define IRPD_GETHOST_OK 211
46 #define IRPD_GETHOST_SETOK 212
48 #define IRPD_GETNET_ERROR 520
49 #define IRPD_GETNET_NONE 220
50 #define IRPD_GETNET_OK 221
51 #define IRPD_GETNET_SETOK 222
53 #define IRPD_GETUSER_ERROR 530
54 #define IRPD_GETUSER_NONE 230
55 #define IRPD_GETUSER_OK 231
56 #define IRPD_GETUSER_SETOK 232
58 #define IRPD_GETGROUP_ERROR 540
59 #define IRPD_GETGROUP_NONE 240
60 #define IRPD_GETGROUP_OK 241
61 #define IRPD_GETGROUP_SETOK 242
63 #define IRPD_GETSERVICE_ERROR 550
64 #define IRPD_GETSERVICE_NONE 250
65 #define IRPD_GETSERVICE_OK 251
66 #define IRPD_GETSERVICE_SETOK 252
68 #define IRPD_GETPROTO_ERROR 560
69 #define IRPD_GETPROTO_NONE 260
70 #define IRPD_GETPROTO_OK 261
71 #define IRPD_GETPROTO_SETOK 262
73 #define IRPD_GETNETGR_ERROR 570
74 #define IRPD_GETNETGR_NONE 270
75 #define IRPD_GETNETGR_OK 271
76 #define IRPD_GETNETGR_NOMORE 272
77 #define IRPD_GETNETGR_MATCHES 273
78 #define IRPD_GETNETGR_NOMATCH 274
79 #define IRPD_GETNETGR_SETOK 275
80 #define IRPD_GETNETGR_SETERR 276
82 #define irs_irp_read_body __irs_irp_read_body
83 #define irs_irp_read_response __irs_irp_read_response
84 #define irs_irp_disconnect __irs_irp_disconnect
85 #define irs_irp_connect __irs_irp_connect
86 #define irs_irp_connection_setup __irs_irp_connection_setup
87 #define irs_irp_send_command __irs_irp_send_command
91 char *irs_irp_read_body(struct irp_p
*, size_t *);
92 int irs_irp_read_response(struct irp_p
*, char *, size_t);
93 void irs_irp_disconnect(struct irp_p
*);
94 int irs_irp_connect(struct irp_p
*);
95 int irs_irp_is_connected(struct irp_p
*);
96 int irs_irp_connection_setup(struct irp_p
*, int *);
98 int irs_irp_send_command(struct irp_p
*, const char *, ...)
99 __attribute__((__format__(__printf__
, 2, 3)));
101 int irs_irp_send_command(struct irp_p
*, const char *, ...);
103 int irs_irp_get_full_response(struct irp_p
*, int *, char *, size_t,
105 int irs_irp_read_line(struct irp_p
*, char *, int);