4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
36 #define PCPL_MAX_TRY_CNT 5
37 #define PCP_CLEANUP_TIMEOUT 3
39 #define PCPL_DEF_MTU_SZ 100
42 #define PCPL_IO_OP_READ (1)
43 #define PCPL_IO_OP_WRITE (2)
44 #define PCPL_IO_OP_PEEK (3)
47 * sleep (seconds) for glvc call failures before
50 #define PCPL_GLVC_SLEEP (5)
53 * Error codes for pcp library that are
54 * returned to users applications.
57 #define PCPL_ERROR (-1)
58 #define PCPL_INVALID_ARGS (-2)
59 #define PCPL_GLVC_ERROR (-3)
60 #define PCPL_XPORT_ERROR (-4)
61 #define PCPL_MALLOC_FAIL (-5)
62 #define PCPL_GLVC_TIMEOUT (-6)
63 #define PCPL_FRAME_ERROR (-7)
64 #define PCPL_CKSUM_ERROR (-8)
65 #define PCPL_PROT_ERROR (-9)
69 #define MIN(x, y) ((x) < (y) ? (x) : (y))
72 #define MAX(x, y) ((x) > (y) ? (x) : (y))
75 #define ABS(x) ((x) < (0) ? (-(x)) : (x))
79 * PCP user apps message format
81 typedef struct pcp_msg
{
89 int pcp_init(char *channel_name
);
90 int pcp_send_recv(int channel_fd
, pcp_msg_t
*req_msg
, pcp_msg_t
*resp_msg
,
92 int pcp_close(int channel_fd
);
98 #endif /* _LIBPCP_H */