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.4 2005/04/27 04:56:15 sra Exp $ 20 */ 21 22 #ifndef _IRP_H_INCLUDED 23 #define _IRP_H_INCLUDED 24 25 /*! \file */ 26 27 #define IRPD_TIMEOUT 30 /*%< seconds */ 28 #define IRPD_MAXSESS 50 /*%< number of simultaneous sessions. */ 29 #define IRPD_PORT 6660 /*%< 10 times the number of the beast. */ 30 #define IRPD_PATH "/var/run/irpd" /*%< af_unix socket path */ 31 32 /* If sets the environment variable IRPDSERVER to an IP address 33 (e.g. "192.5.5.1"), then that's the host the client expects irpd to be 34 running on. */ 35 #define IRPD_HOST_ENV "IRPDSERVER" 36 37 /* Protocol response codes. */ 38 #define IRPD_WELCOME_CODE 200 39 #define IRPD_NOT_WELCOME_CODE 500 40 41 #define IRPD_GETHOST_ERROR 510 42 #define IRPD_GETHOST_NONE 210 43 #define IRPD_GETHOST_OK 211 44 #define IRPD_GETHOST_SETOK 212 45 46 #define IRPD_GETNET_ERROR 520 47 #define IRPD_GETNET_NONE 220 48 #define IRPD_GETNET_OK 221 49 #define IRPD_GETNET_SETOK 222 50 51 #define IRPD_GETUSER_ERROR 530 52 #define IRPD_GETUSER_NONE 230 53 #define IRPD_GETUSER_OK 231 54 #define IRPD_GETUSER_SETOK 232 55 56 #define IRPD_GETGROUP_ERROR 540 57 #define IRPD_GETGROUP_NONE 240 58 #define IRPD_GETGROUP_OK 241 59 #define IRPD_GETGROUP_SETOK 242 60 61 #define IRPD_GETSERVICE_ERROR 550 62 #define IRPD_GETSERVICE_NONE 250 63 #define IRPD_GETSERVICE_OK 251 64 #define IRPD_GETSERVICE_SETOK 252 65 66 #define IRPD_GETPROTO_ERROR 560 67 #define IRPD_GETPROTO_NONE 260 68 #define IRPD_GETPROTO_OK 261 69 #define IRPD_GETPROTO_SETOK 262 70 71 #define IRPD_GETNETGR_ERROR 570 72 #define IRPD_GETNETGR_NONE 270 73 #define IRPD_GETNETGR_OK 271 74 #define IRPD_GETNETGR_NOMORE 272 75 #define IRPD_GETNETGR_MATCHES 273 76 #define IRPD_GETNETGR_NOMATCH 274 77 #define IRPD_GETNETGR_SETOK 275 78 #define IRPD_GETNETGR_SETERR 276 79 80 #define irs_irp_read_body __irs_irp_read_body 81 #define irs_irp_read_response __irs_irp_read_response 82 #define irs_irp_disconnect __irs_irp_disconnect 83 #define irs_irp_connect __irs_irp_connect 84 #define irs_irp_connection_setup __irs_irp_connection_setup 85 #define irs_irp_send_command __irs_irp_send_command 86 87 struct irp_p; 88 89 char *irs_irp_read_body(struct irp_p *, size_t *); 90 int irs_irp_read_response(struct irp_p *, char *, size_t); 91 void irs_irp_disconnect(struct irp_p *); 92 int irs_irp_connect(struct irp_p *); 93 int irs_irp_is_connected(struct irp_p *); 94 int irs_irp_connection_setup(struct irp_p *, int *); 95 #ifdef __GNUC__ 96 int irs_irp_send_command(struct irp_p *, const char *, ...) 97 __attribute__((__format__(__printf__, 2, 3))); 98 #else 99 int irs_irp_send_command(struct irp_p *, const char *, ...); 100 #endif 101 int irs_irp_get_full_response(struct irp_p *, int *, char *, size_t, 102 char **, size_t *); 103 int irs_irp_read_line(struct irp_p *, char *, int); 104 105 #endif 106 107 /*! \file */ 108