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