10Sstevel@tonic-gate /* 2*11038SRao.Shoaib@Sun.COM * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") 30Sstevel@tonic-gate * Copyright (c) 1999 by Internet Software Consortium. 40Sstevel@tonic-gate * 50Sstevel@tonic-gate * Permission to use, copy, modify, and distribute this software for any 60Sstevel@tonic-gate * purpose with or without fee is hereby granted, provided that the above 70Sstevel@tonic-gate * copyright notice and this permission notice appear in all copies. 80Sstevel@tonic-gate * 9*11038SRao.Shoaib@Sun.COM * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES 10*11038SRao.Shoaib@Sun.COM * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11*11038SRao.Shoaib@Sun.COM * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR 12*11038SRao.Shoaib@Sun.COM * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13*11038SRao.Shoaib@Sun.COM * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14*11038SRao.Shoaib@Sun.COM * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 15*11038SRao.Shoaib@Sun.COM * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 160Sstevel@tonic-gate */ 170Sstevel@tonic-gate 180Sstevel@tonic-gate /* 19*11038SRao.Shoaib@Sun.COM * $Id: irp.h,v 1.4 2005/04/27 04:56:15 sra Exp $ 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate 220Sstevel@tonic-gate #ifndef _IRP_H_INCLUDED 230Sstevel@tonic-gate #define _IRP_H_INCLUDED 240Sstevel@tonic-gate 25*11038SRao.Shoaib@Sun.COM /*! \file */ 260Sstevel@tonic-gate 27*11038SRao.Shoaib@Sun.COM #define IRPD_TIMEOUT 30 /*%< seconds */ 28*11038SRao.Shoaib@Sun.COM #define IRPD_MAXSESS 50 /*%< number of simultaneous sessions. */ 29*11038SRao.Shoaib@Sun.COM #define IRPD_PORT 6660 /*%< 10 times the number of the beast. */ 30*11038SRao.Shoaib@Sun.COM #define IRPD_PATH "/var/run/irpd" /*%< af_unix socket path */ 310Sstevel@tonic-gate 320Sstevel@tonic-gate /* If sets the environment variable IRPDSERVER to an IP address 330Sstevel@tonic-gate (e.g. "192.5.5.1"), then that's the host the client expects irpd to be 340Sstevel@tonic-gate running on. */ 350Sstevel@tonic-gate #define IRPD_HOST_ENV "IRPDSERVER" 360Sstevel@tonic-gate 370Sstevel@tonic-gate /* Protocol response codes. */ 380Sstevel@tonic-gate #define IRPD_WELCOME_CODE 200 390Sstevel@tonic-gate #define IRPD_NOT_WELCOME_CODE 500 400Sstevel@tonic-gate 410Sstevel@tonic-gate #define IRPD_GETHOST_ERROR 510 420Sstevel@tonic-gate #define IRPD_GETHOST_NONE 210 430Sstevel@tonic-gate #define IRPD_GETHOST_OK 211 440Sstevel@tonic-gate #define IRPD_GETHOST_SETOK 212 450Sstevel@tonic-gate 460Sstevel@tonic-gate #define IRPD_GETNET_ERROR 520 470Sstevel@tonic-gate #define IRPD_GETNET_NONE 220 480Sstevel@tonic-gate #define IRPD_GETNET_OK 221 490Sstevel@tonic-gate #define IRPD_GETNET_SETOK 222 500Sstevel@tonic-gate 510Sstevel@tonic-gate #define IRPD_GETUSER_ERROR 530 520Sstevel@tonic-gate #define IRPD_GETUSER_NONE 230 530Sstevel@tonic-gate #define IRPD_GETUSER_OK 231 540Sstevel@tonic-gate #define IRPD_GETUSER_SETOK 232 550Sstevel@tonic-gate 560Sstevel@tonic-gate #define IRPD_GETGROUP_ERROR 540 570Sstevel@tonic-gate #define IRPD_GETGROUP_NONE 240 580Sstevel@tonic-gate #define IRPD_GETGROUP_OK 241 590Sstevel@tonic-gate #define IRPD_GETGROUP_SETOK 242 600Sstevel@tonic-gate 610Sstevel@tonic-gate #define IRPD_GETSERVICE_ERROR 550 620Sstevel@tonic-gate #define IRPD_GETSERVICE_NONE 250 630Sstevel@tonic-gate #define IRPD_GETSERVICE_OK 251 640Sstevel@tonic-gate #define IRPD_GETSERVICE_SETOK 252 650Sstevel@tonic-gate 660Sstevel@tonic-gate #define IRPD_GETPROTO_ERROR 560 670Sstevel@tonic-gate #define IRPD_GETPROTO_NONE 260 680Sstevel@tonic-gate #define IRPD_GETPROTO_OK 261 690Sstevel@tonic-gate #define IRPD_GETPROTO_SETOK 262 700Sstevel@tonic-gate 710Sstevel@tonic-gate #define IRPD_GETNETGR_ERROR 570 720Sstevel@tonic-gate #define IRPD_GETNETGR_NONE 270 730Sstevel@tonic-gate #define IRPD_GETNETGR_OK 271 740Sstevel@tonic-gate #define IRPD_GETNETGR_NOMORE 272 750Sstevel@tonic-gate #define IRPD_GETNETGR_MATCHES 273 760Sstevel@tonic-gate #define IRPD_GETNETGR_NOMATCH 274 770Sstevel@tonic-gate #define IRPD_GETNETGR_SETOK 275 780Sstevel@tonic-gate #define IRPD_GETNETGR_SETERR 276 790Sstevel@tonic-gate 800Sstevel@tonic-gate #define irs_irp_read_body __irs_irp_read_body 810Sstevel@tonic-gate #define irs_irp_read_response __irs_irp_read_response 820Sstevel@tonic-gate #define irs_irp_disconnect __irs_irp_disconnect 830Sstevel@tonic-gate #define irs_irp_connect __irs_irp_connect 840Sstevel@tonic-gate #define irs_irp_connection_setup __irs_irp_connection_setup 850Sstevel@tonic-gate #define irs_irp_send_command __irs_irp_send_command 860Sstevel@tonic-gate 870Sstevel@tonic-gate struct irp_p; 880Sstevel@tonic-gate 89*11038SRao.Shoaib@Sun.COM char *irs_irp_read_body(struct irp_p *, size_t *); 90*11038SRao.Shoaib@Sun.COM int irs_irp_read_response(struct irp_p *, char *, size_t); 91*11038SRao.Shoaib@Sun.COM void irs_irp_disconnect(struct irp_p *); 92*11038SRao.Shoaib@Sun.COM int irs_irp_connect(struct irp_p *); 93*11038SRao.Shoaib@Sun.COM int irs_irp_is_connected(struct irp_p *); 94*11038SRao.Shoaib@Sun.COM int irs_irp_connection_setup(struct irp_p *, int *); 95*11038SRao.Shoaib@Sun.COM #ifdef __GNUC__ 960Sstevel@tonic-gate int irs_irp_send_command(struct irp_p *, const char *, ...) 97*11038SRao.Shoaib@Sun.COM __attribute__((__format__(__printf__, 2, 3))); 980Sstevel@tonic-gate #else 99*11038SRao.Shoaib@Sun.COM int irs_irp_send_command(struct irp_p *, const char *, ...); 1000Sstevel@tonic-gate #endif 101*11038SRao.Shoaib@Sun.COM int irs_irp_get_full_response(struct irp_p *, int *, char *, size_t, 102*11038SRao.Shoaib@Sun.COM char **, size_t *); 103*11038SRao.Shoaib@Sun.COM int irs_irp_read_line(struct irp_p *, char *, int); 1040Sstevel@tonic-gate 1050Sstevel@tonic-gate #endif 106*11038SRao.Shoaib@Sun.COM 107*11038SRao.Shoaib@Sun.COM /*! \file */ 108