Cross Reference: libpcp.h
xref
: /
osnet-11
/
usr
/
src
/
lib
/
libpcp
/
common
/
libpcp.h
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
2
N/A
/*
2
N/A
* CDDL HEADER START
2
N/A
*
2
N/A
* The contents of this file are subject to the terms of the
2
N/A
* Common Development and Distribution License, Version 1.0 only
2
N/A
* (the "License"). You may not use this file except in compliance
2
N/A
* with the License.
2
N/A
*
2
N/A
* You can obtain a copy of the license at
usr
/
src
/
OPENSOLARIS.LICENSE
2
N/A
* or
http://www.opensolaris.org/os/licensing
.
2
N/A
* See the License for the specific language governing permissions
2
N/A
* and limitations under the License.
2
N/A
*
2
N/A
* When distributing Covered Code, include this CDDL HEADER in each
2
N/A
* file and include the License file at
usr
/
src
/
OPENSOLARIS.LICENSE
.
2
N/A
* If applicable, add the following below this CDDL HEADER, with the
2
N/A
* fields enclosed by brackets "[]" replaced with your own identifying
2
N/A
* information: Portions Copyright [yyyy] [name of copyright owner]
2
N/A
*
2
N/A
* CDDL HEADER END
2
N/A
*/
2
N/A
/*
2
N/A
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
2
N/A
* Use is subject to license terms.
2
N/A
*/
2
N/A
2
N/A
#
ifndef
_LIBPCP_H
2
N/A
#
define
_LIBPCP_H
2
N/A
2
N/A
#
pragma
ident
"%Z%%M% %I% %E% SMI"
2
N/A
2
N/A
#
ifdef
__cplusplus
2
N/A
extern
"C"
{
2
N/A
#
endif
2
N/A
2
N/A
#
define
PCPL_MAX_TRY_CNT
5
2
N/A
#
define
PCP_CLEANUP_TIMEOUT
3
2
N/A
2
N/A
#
define
PCPL_DEF_MTU_SZ
100
2
N/A
2
N/A
2
N/A
#
define
PCPL_IO_OP_READ
(
1
)
2
N/A
#
define
PCPL_IO_OP_WRITE
(
2
)
2
N/A
#
define
PCPL_IO_OP_PEEK
(
3
)
2
N/A
2
N/A
/*
2
N/A
* sleep (seconds) for glvc call failures before
2
N/A
* retrying.
2
N/A
*/
2
N/A
#
define
PCPL_GLVC_SLEEP
(
5
)
2
N/A
2
N/A
/*
2
N/A
* Error codes for pcp library that are
2
N/A
* returned to users applications.
2
N/A
*/
2
N/A
#
define
PCPL_OK
0
2
N/A
#
define
PCPL_ERROR
(-
1
)
2
N/A
#
define
PCPL_INVALID_ARGS
(-
2
)
2
N/A
#
define
PCPL_GLVC_ERROR
(-
3
)
2
N/A
#
define
PCPL_XPORT_ERROR
(-
4
)
2
N/A
#
define
PCPL_MALLOC_FAIL
(-
5
)
2
N/A
#
define
PCPL_GLVC_TIMEOUT
(-
6
)
2
N/A
#
define
PCPL_FRAME_ERROR
(-
7
)
2
N/A
#
define
PCPL_CKSUM_ERROR
(-
8
)
2
N/A
#
define
PCPL_PROT_ERROR
(-
9
)
2
N/A
2
N/A
/* common defines */
2
N/A
#
ifndef
MIN
2
N/A
#
define
MIN
(x, y) ((x) < (y) ? (x) : (y))
2
N/A
#
endif
2
N/A
#
ifndef
MAX
2
N/A
#
define
MAX
(x, y) ((x) > (y) ? (x) : (y))
2
N/A
#
endif
2
N/A
#
ifndef
ABS
2
N/A
#
define
ABS
(x) ((x) < (0) ? (-(x)) : (x))
2
N/A
#
endif
2
N/A
2
N/A
/*
2
N/A
* PCP user apps message format
2
N/A
*/
2
N/A
typedef
struct
pcp_msg
{
2
N/A
uint8_t
msg_type
;
2
N/A
uint8_t
sub_type
;
2
N/A
uint16_t
rsvd_pad
;
2
N/A
uint32_t
msg_len
;
2
N/A
void
*
msg_data
;
2
N/A
}
pcp_msg_t
;
2
N/A
2
N/A
int
pcp_init
(
char
*
channel_name
);
2
N/A
int
pcp_send_recv
(
int
channel_fd
,
pcp_msg_t
*
req_msg
,
pcp_msg_t
*
resp_msg
,
2
N/A
uint32_t
timeout
);
2
N/A
int
pcp_close
(
int
channel_fd
);
2
N/A
2
N/A
#
ifdef
__cplusplus
2
N/A
}
2
N/A
#
endif
2
N/A
2
N/A
#
endif
/* _LIBPCP_H */