25cf1a301a396c38e8adf52c15f537b80d2483f7jl/*
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * CDDL HEADER START
25cf1a301a396c38e8adf52c15f537b80d2483f7jl *
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * The contents of this file are subject to the terms of the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * Common Development and Distribution License (the "License").
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * You may not use this file except in compliance with the License.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl *
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * or http://www.opensolaris.org/os/licensing.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * See the License for the specific language governing permissions
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * and limitations under the License.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl *
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * When distributing Covered Code, include this CDDL HEADER in each
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * If applicable, add the following below this CDDL HEADER, with the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * fields enclosed by brackets "[]" replaced with your own identifying
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * information: Portions Copyright [yyyy] [name of copyright owner]
25cf1a301a396c38e8adf52c15f537b80d2483f7jl *
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * CDDL HEADER END
25cf1a301a396c38e8adf52c15f537b80d2483f7jl */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/*
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * Use is subject to license terms.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#ifndef _LIBDSCP_H
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define _LIBDSCP_H
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#pragma ident "%Z%%M% %I% %E% SMI"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#include <sys/socket.h>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#include <netinet/in.h>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#ifdef __cplusplus
25cf1a301a396c38e8adf52c15f537b80d2483f7jlextern "C" {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#endif
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/*
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * DSCP Error Codes
25cf1a301a396c38e8adf52c15f537b80d2483f7jl */
25cf1a301a396c38e8adf52c15f537b80d2483f7jltypedef enum {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl DSCP_OK = 0, /* Success */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl DSCP_ERROR, /* General Error */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl DSCP_ERROR_ALREADY, /* Socket Already Bound */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl DSCP_ERROR_INVALID, /* Invalid Arguments */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl DSCP_ERROR_NOENT, /* Lookup Failure From dscpIdent() */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl DSCP_ERROR_DB, /* Error Reading Database */
ac92251dc182f030faf6a5f76981d551b0b16072jrutt DSCP_ERROR_REJECT, /* Rejection From dscpAuth() */
ac92251dc182f030faf6a5f76981d551b0b16072jrutt DSCP_ERROR_DOWN /* DSCP Interface down */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl} dscp_err_t;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/*
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * Possible values for the 'which' parameter to dscpAddr().
25cf1a301a396c38e8adf52c15f537b80d2483f7jl */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define DSCP_ADDR_LOCAL (1) /* Get the domain's local IP address */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define DSCP_ADDR_REMOTE (2) /* Get the SP's remote IP address */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/*
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * Define a special value used to represent the SP as a domain ID.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define DSCP_IDENT_SP (-1)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jlint dscpBind(int domain, int sockfd, int port);
25cf1a301a396c38e8adf52c15f537b80d2483f7jlint dscpSecure(int domain, int sockfd);
25cf1a301a396c38e8adf52c15f537b80d2483f7jlint dscpAuth(int domain, struct sockaddr *saddr, int len);
25cf1a301a396c38e8adf52c15f537b80d2483f7jlint dscpAddr(int domain, int which, struct sockaddr *saddr, int *lenp);
25cf1a301a396c38e8adf52c15f537b80d2483f7jlint dscpIdent(struct sockaddr *saddr, int len, int *domainp);
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#ifdef __cplusplus
25cf1a301a396c38e8adf52c15f537b80d2483f7jl}
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#endif
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#endif /* _LIBDSCP_H */