summaryrefslogtreecommitdiffstats
path: root/sys/contrib/ngatm/netnatm/api/ccatm.h
blob: 1b4a179a33482bf35344703dc5ecf39aa9472f7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*
 * Copyright (c) 2003-2004
 *	Hartmut Brandt
 *	All rights reserved.
 *
 * Author: Harti Brandt <harti@freebsd.org>
 *
 * Redistribution of this software and documentation and use in source and
 * binary forms, with or without modification, are permitted provided that
 * the following conditions are met:
 *
 * 1. Redistributions of source code or documentation must retain the above
 *    copyright notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE AUTHOR
 * AND ITS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
 * THE AUTHOR OR ITS CONTRIBUTORS  BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * $Begemot: libunimsg/netnatm/api/ccatm.h,v 1.1 2004/07/08 08:21:58 brandt Exp $
 *
 * ATM API as defined per af-saa-0108
 *
 * Interface to the supporting code.
 */

#ifndef _API_CCATM_H_
#define _API_CCATM_H_

struct ccuser;
struct ccconn;
struct ccport;
struct ccdata;

struct cc_funcs {
	/* send signal to API user */
	void	(*send_user)(struct ccuser *, void *, u_int, void *, size_t);

	/* respond API user */
	void	(*respond_user)(struct ccuser *, void *, int, u_int,
		    void *, size_t);

	/* send signal to uni for connection */
	void	(*send_uni)(struct ccconn *, void *, u_int, u_int,
		    struct uni_msg *);

	/* send global signal to uni */
	void	(*send_uni_glob)(struct ccport *, void *, u_int, u_int,
		    struct uni_msg *);

	/* log a message */
	void	(*log)(const char *, ...);
};

enum {
	CCLOG_USER_STATE	= 0x00000001,
	CCLOG_USER_INST		= 0x00000002,
	CCLOG_USER_SIG		= 0x00000004,
	CCLOG_CONN_STATE	= 0x00000010,
	CCLOG_CONN_INST		= 0x00000020,
	CCLOG_CONN_SIG		= 0x00000040,
	CCLOG_PARTY_STATE	= 0x00000100,
	CCLOG_PARTY_INST	= 0x00000200,
	CCLOG_PARTY_SIG		= 0x00000400,
	CCLOG_SIGS		= 0x00001000,
};

/* instance handling */
struct ccdata *cc_create(const struct cc_funcs *);
void cc_destroy(struct ccdata *);
void cc_reset(struct ccdata *);

/* input a response from the UNI layer to CC */
int cc_uni_response(struct ccport *, u_int cookie, u_int reason, u_int state);

/* Signal from UNI on this port */
int cc_uni_signal(struct ccport *, u_int cookie, u_int sig, struct uni_msg *);

/* retrieve addresses */
int cc_get_addrs(struct ccdata *, u_int, struct uni_addr **, u_int **, u_int *);

/* dump state */
typedef int (*cc_dump_f)(struct ccdata *, void *, const char *);
int cc_dump(struct ccdata *, size_t, cc_dump_f, void *);

/* start/stop port */
int cc_port_stop(struct ccdata *, u_int);
int cc_port_start(struct ccdata *, u_int);

/* is port running? */
int cc_port_isrunning(struct ccdata *, u_int, int *);

/* return port number */
u_int cc_port_no(struct ccport *);

/* Clear address and prefix information from the named port. */
int cc_port_clear(struct ccdata *, u_int);

/* Address registered.  */
int cc_addr_register(struct ccdata *, u_int, const struct uni_addr *);

/* Address unregistered. */
int cc_addr_unregister(struct ccdata *, u_int, const struct uni_addr *);

/* get port info */
int cc_port_get_param(struct ccdata *, u_int, struct atm_port_info *);

/* set port info */
int cc_port_set_param(struct ccdata *, const struct atm_port_info *);

/* get port list */
int cc_port_getlist(struct ccdata *, u_int *, u_int **);

/* create a port */
struct ccport *cc_port_create(struct ccdata *, void *, u_int);

/* destroy a port */
void cc_port_destroy(struct ccport *, int);

/* New endpoint created */
struct ccuser *cc_user_create(struct ccdata *, void *, const char *);

/* destroy user endpoint */
void cc_user_destroy(struct ccuser *);

/* signal from user */
int cc_user_signal(struct ccuser *, u_int, struct uni_msg *);

/* Management is given up on this node. */
void cc_unmanage(struct ccdata *);

/* handle all queued signals */
void cc_work(struct ccdata *);

/* set/get logging flags */
void cc_set_log(struct ccdata *, u_int);
u_int cc_get_log(const struct ccdata *);

/* get extended status */
int cc_get_extended_status(const struct ccdata *, struct atm_exstatus *,
    struct atm_exstatus_ep **, struct atm_exstatus_port **,
    struct atm_exstatus_conn **, struct atm_exstatus_party **);

#endif
OpenPOWER on IntegriCloud