Deleted Added
full compact
cc_user.c (131826) cc_user.c (133492)
1/*
2 * Copyright (c) 2003-2004
3 * Hartmut Brandt
4 * All rights reserved.
5 *
6 * Copyright (c) 2001-2002
7 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
8 * All rights reserved.

--- 17 unchanged lines hidden (view full) ---

26 * THE AUTHOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
29 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
32 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
1/*
2 * Copyright (c) 2003-2004
3 * Hartmut Brandt
4 * All rights reserved.
5 *
6 * Copyright (c) 2001-2002
7 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
8 * All rights reserved.

--- 17 unchanged lines hidden (view full) ---

26 * THE AUTHOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
29 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
32 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 * $Begemot: libunimsg/netnatm/api/cc_user.c,v 1.2 2004/07/08 09:17:18 brandt Exp $
34 * $Begemot: libunimsg/netnatm/api/cc_user.c,v 1.3 2004/07/16 18:46:55 brandt Exp $
35 *
36 * ATM API as defined per af-saa-0108
37 *
38 * User side (upper half)
39 */
40
41#include <netnatm/unimsg.h>
42#include <netnatm/msg/unistruct.h>

--- 1249 unchanged lines hidden (view full) ---

1292 uni_msg_destroy(msg);
1293 cc_user_err(user, ATMERR_BAD_STATE);
1294 goto bad_state;
1295 }
1296 if (user->aborted) {
1297 /* connection has disappeared. Send an ok
1298 * to the user and lock whether there is another
1299 * connection at this endpoint */
35 *
36 * ATM API as defined per af-saa-0108
37 *
38 * User side (upper half)
39 */
40
41#include <netnatm/unimsg.h>
42#include <netnatm/msg/unistruct.h>

--- 1249 unchanged lines hidden (view full) ---

1292 uni_msg_destroy(msg);
1293 cc_user_err(user, ATMERR_BAD_STATE);
1294 goto bad_state;
1295 }
1296 if (user->aborted) {
1297 /* connection has disappeared. Send an ok
1298 * to the user and lock whether there is another
1299 * connection at this endpoint */
1300 uni_msg_destroy(msg);
1300 cc_user_ok(user, ATMRESP_NONE, NULL, 0);
1301
1302 set_state(user, USER_IN_WAITING);
1303 do_arrival(user);
1304 return;
1305 }
1306 conn->cause[0] = rej->cause;
1307 memset(&conn->cause[1], 0, sizeof(conn->cause[1]));

--- 46 unchanged lines hidden (view full) ---

1354 uni_msg_destroy(msg);
1355 cc_user_err(user, ATMERR_BAD_STATE);
1356 return;
1357 }
1358 if (user->aborted) {
1359 /* connection has disappeared. Send an error
1360 * to the user and lock whether there is another
1361 * connection at this endpoint */
1301 cc_user_ok(user, ATMRESP_NONE, NULL, 0);
1302
1303 set_state(user, USER_IN_WAITING);
1304 do_arrival(user);
1305 return;
1306 }
1307 conn->cause[0] = rej->cause;
1308 memset(&conn->cause[1], 0, sizeof(conn->cause[1]));

--- 46 unchanged lines hidden (view full) ---

1355 uni_msg_destroy(msg);
1356 cc_user_err(user, ATMERR_BAD_STATE);
1357 return;
1358 }
1359 if (user->aborted) {
1360 /* connection has disappeared. Send an error
1361 * to the user and lock whether there is another
1362 * connection at this endpoint */
1363 uni_msg_destroy(msg);
1362 cc_user_err(user, ATMERR_PREVIOUSLY_ABORTED);
1363
1364 set_state(user, USER_IN_WAITING);
1365 do_arrival(user);
1366 return;
1367 }
1368 acc->newep[sizeof(acc->newep) - 1] = '\0';
1369
1370 LIST_FOREACH(newep, &user->cc->user_list, node_link)
1371 if (strcmp(acc->newep, newep->name) == 0)
1372 break;
1364 cc_user_err(user, ATMERR_PREVIOUSLY_ABORTED);
1365
1366 set_state(user, USER_IN_WAITING);
1367 do_arrival(user);
1368 return;
1369 }
1370 acc->newep[sizeof(acc->newep) - 1] = '\0';
1371
1372 LIST_FOREACH(newep, &user->cc->user_list, node_link)
1373 if (strcmp(acc->newep, newep->name) == 0)
1374 break;
1375 uni_msg_destroy(msg);
1373
1374 if (newep == NULL) {
1376
1377 if (newep == NULL) {
1375 uni_msg_destroy(msg);
1376 cc_user_err(user, ATMERR_BAD_ENDPOINT);
1377 return;
1378 }
1379
1380 if (newep->state != USER_NULL || newep->accepted != NULL) {
1378 cc_user_err(user, ATMERR_BAD_ENDPOINT);
1379 return;
1380 }
1381
1382 if (newep->state != USER_NULL || newep->accepted != NULL) {
1381 uni_msg_destroy(msg);
1382 cc_user_err(user, ATMERR_BAD_STATE);
1383 return;
1384 }
1385
1386 set_state(user, USER_IN_WAIT_ACC);
1387 cc_conn_sig(TAILQ_FIRST(&user->connq), CONN_SIG_ACCEPT, newep);
1388
1389 return;

--- 532 unchanged lines hidden ---
1383 cc_user_err(user, ATMERR_BAD_STATE);
1384 return;
1385 }
1386
1387 set_state(user, USER_IN_WAIT_ACC);
1388 cc_conn_sig(TAILQ_FIRST(&user->connq), CONN_SIG_ACCEPT, newep);
1389
1390 return;

--- 532 unchanged lines hidden ---