diff options
author | cvs2svn <cvs2svn@FreeBSD.org> | 2004-09-29 06:22:39 +0000 |
---|---|---|
committer | cvs2svn <cvs2svn@FreeBSD.org> | 2004-09-29 06:22:39 +0000 |
commit | c3e24b206d97a5a5f14307b0c5506e641cb360fd (patch) | |
tree | 929f173255bba2f6c77b41421394ea2be5148457 | |
parent | 24dc798a69ab1b0f198d5af4893a2ccb8f442fc8 (diff) | |
download | src-vendor/ngatm/1.1.1.tar.gz src-vendor/ngatm/1.1.1.zip |
This commit was manufactured by cvs2svn to create tagvendor/ngatm/1.1.1
'ngatm-vendor-NGATM_1_1_1'.
-rw-r--r-- | contrib/ngatm/libngatm/cccust.h | 49 | ||||
-rw-r--r-- | contrib/ngatm/libngatm/net_in.fig | 74 | ||||
-rw-r--r-- | contrib/ngatm/libngatm/net_out.fig | 76 | ||||
-rw-r--r-- | contrib/ngatm/libngatm/sscfucust.h | 108 | ||||
-rw-r--r-- | contrib/ngatm/libngatm/sscopcust.h | 255 | ||||
-rw-r--r-- | contrib/ngatm/libngatm/unicust.h | 123 | ||||
-rw-r--r-- | contrib/ngatm/libngatm/unimsg.c | 245 | ||||
-rw-r--r-- | contrib/ngatm/man/libngatm.3 | 75 | ||||
-rw-r--r-- | contrib/ngatm/man/uniaddr.3 | 125 | ||||
-rw-r--r-- | contrib/ngatm/man/unifunc.3 | 252 | ||||
-rw-r--r-- | contrib/ngatm/man/unimsg.3 | 234 | ||||
-rw-r--r-- | contrib/ngatm/man/unisap.3 | 255 | ||||
-rw-r--r-- | contrib/ngatm/man/unistruct.3 | 320 | ||||
-rw-r--r-- | contrib/ngatm/snmp_atm/BEGEMOT-ATM.txt | 301 | ||||
-rw-r--r-- | contrib/ngatm/snmp_atm/atm.h | 96 | ||||
-rw-r--r-- | contrib/ngatm/snmp_atm/atm_tree.def | 75 | ||||
-rw-r--r-- | contrib/ngatm/snmp_atm/snmp_atm.3 | 217 | ||||
-rw-r--r-- | contrib/ngatm/snmp_atm/snmp_atm.c | 622 | ||||
-rw-r--r-- | contrib/ngatm/snmp_atm/snmp_atm.h | 102 | ||||
-rw-r--r-- | contrib/ngatm/sscop/sscop.1 | 169 |
20 files changed, 0 insertions, 3773 deletions
diff --git a/contrib/ngatm/libngatm/cccust.h b/contrib/ngatm/libngatm/cccust.h deleted file mode 100644 index d67b12049cca..000000000000 --- a/contrib/ngatm/libngatm/cccust.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2004 - * Hartmut Brandt - * All rights reserved. - * - * Author: Hartmut Brandt <harti@freebsd.org> - * - * Redistribution 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 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 IS PROVIDED BY THE AUTHOR AND 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 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/libngatm/cccust.h,v 1.2 2004/07/16 18:48:24 brandt Exp $ - * - * Customisation of call control source to user space. - */ - -#include <sys/types.h> -#include <sys/queue.h> -#include <stdio.h> -#include <stdlib.h> -#include <stddef.h> -#include <string.h> -#include <assert.h> -#include <errno.h> - -#define CCASSERT(E, M) assert(E) - -#define CCMALLOC(S) (malloc((S))) -#define CCZALLOC(S) (calloc(1, (S))) -#define CCFREE(P) do { free(P); } while (0) - -#define CCGETERRNO() (errno) diff --git a/contrib/ngatm/libngatm/net_in.fig b/contrib/ngatm/libngatm/net_in.fig deleted file mode 100644 index 3914c1002dc9..000000000000 --- a/contrib/ngatm/libngatm/net_in.fig +++ /dev/null @@ -1,74 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5400 675 225 225 5400 675 5400 900 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5400 1800 225 225 5400 1800 5400 2025 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5400 2925 225 225 5400 2925 5400 3150 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5400 4050 225 225 5400 4050 5400 4275 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5408 5169 225 225 5408 5169 5408 5394 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 4281 6292 225 225 4281 6292 4281 6517 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5408 7419 225 225 5408 7419 5408 7644 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 6525 6292 225 225 6525 6292 6525 6517 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 5400 900 5400 1575 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 5400 2025 5400 2700 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 5400 3150 5400 3825 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 5400 4275 5400 4950 -2 1 0 1 -1 7 50 0 -1 0.000 0 0 -1 1 0 5 - 1 1 1.00 60.00 120.00 - 5625 2925 5850 2925 5850 4500 5625 4500 5400 4725 -2 1 0 1 -1 7 50 0 -1 0.000 0 0 -1 1 0 5 - 1 1 1.00 60.00 120.00 - 5175 1800 4725 1800 4725 3375 5175 3375 5400 3600 -2 1 0 1 -1 7 50 0 -1 0.000 0 0 -1 1 0 5 - 1 1 1.00 60.00 120.00 - 5175 1800 4275 1800 4275 4500 5175 4500 5400 4725 -2 1 0 1 -1 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 5400 5400 5400 7200 -2 1 0 1 -1 7 50 0 -1 0.000 0 0 -1 1 0 3 - 1 1 1.00 60.00 120.00 - 5175 5175 4275 5175 4275 6075 -2 1 0 1 -1 7 50 0 -1 0.000 0 0 -1 1 0 3 - 1 1 1.00 60.00 120.00 - 5625 5175 6525 5175 6525 6075 -2 1 0 1 -1 7 50 0 -1 0.000 0 0 -1 1 0 3 - 1 1 1.00 60.00 120.00 - 4275 6525 4275 7425 5175 7425 -2 1 0 1 -1 7 50 0 -1 0.000 0 0 -1 1 0 3 - 1 1 1.00 60.00 120.00 - 6525 6525 6525 7425 5625 7425 -2 1 0 1 -1 7 50 0 -1 0.000 0 0 -1 1 0 5 - 1 1 1.00 60.00 120.00 - 5625 1800 8100 1800 8100 7875 5400 7875 5400 7650 -4 1 0 50 0 14 12 0.0000 4 120 210 5400 720 N0\001 -4 0 9 50 0 14 12 0.0000 4 135 1680 5445 1080 SETUP.indication\001 -4 1 0 50 0 14 12 0.0000 4 120 210 5400 1845 N1\001 -4 0 20 50 0 14 12 0.0000 4 150 2520 5445 2205 PROCEEDING.request (opt)\001 -4 1 0 50 0 14 12 0.0000 4 120 210 5400 2970 N3\001 -4 1 0 50 0 14 12 0.0000 4 120 210 5400 4095 N4\001 -4 0 20 50 0 14 12 0.0000 4 135 1680 5760 1755 RELEASE.response\001 -4 0 20 50 0 14 12 0.0000 4 135 1470 5445 4860 SETUP.response\001 -4 0 20 50 0 14 12 0.0000 4 135 1680 5445 3690 ALERTING.request\001 -4 1 0 50 0 14 12 0.0000 4 120 315 5400 5220 N10\001 -4 1 0 50 0 14 12 0.0000 4 120 315 4275 6345 N11\001 -4 1 0 50 0 14 12 0.0000 4 120 315 6525 6345 N12\001 -4 2 9 50 0 14 12 0.0000 4 135 1890 5085 5130 RELEASE.indication\001 -4 0 20 50 0 14 12 0.0000 4 135 1575 5715 5130 RELEASE.request\001 -4 2 9 50 0 14 12 0.0000 4 135 1575 5355 5715 RELEASE.confirm\001 -4 0 9 50 0 14 12 0.0000 4 135 1575 5715 7605 RELEASE.confirm\001 -4 2 20 50 0 14 12 0.0000 4 135 1680 5085 7605 RELEASE.response\001 -4 1 0 50 0 14 12 0.0000 4 120 210 5400 7470 N0\001 diff --git a/contrib/ngatm/libngatm/net_out.fig b/contrib/ngatm/libngatm/net_out.fig deleted file mode 100644 index c46356d0600f..000000000000 --- a/contrib/ngatm/libngatm/net_out.fig +++ /dev/null @@ -1,76 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5400 675 225 225 5400 675 5400 900 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5400 1800 225 225 5400 1800 5400 2025 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5400 2925 225 225 5400 2925 5400 3150 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5400 4050 225 225 5400 4050 5400 4275 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5416 5181 225 225 5416 5181 5416 5406 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5408 6294 225 225 5408 6294 5408 6519 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 4281 7417 225 225 4281 7417 4281 7642 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5408 8544 225 225 5408 8544 5408 8769 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 6525 7417 225 225 6525 7417 6525 7642 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 5400 900 5400 1575 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 5400 2025 5400 2700 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 5400 3150 5400 3825 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 5400 4275 5400 4950 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 5400 5400 5400 6075 -2 1 0 1 -1 7 50 0 -1 0.000 0 0 -1 1 0 5 - 1 1 1.00 60.00 120.00 - 5175 1800 4950 1800 4950 3375 5175 3375 5400 3600 -2 1 0 1 -1 7 50 0 -1 0.000 0 0 -1 1 0 5 - 1 1 1.00 60.00 120.00 - 5175 1800 4500 1800 4500 4500 5175 4500 5400 4725 -2 1 0 1 -1 7 50 0 -1 0.000 0 0 -1 1 0 5 - 1 1 1.00 60.00 120.00 - 5625 2925 5850 2925 5850 4500 5625 4500 5400 4725 -2 1 0 1 -1 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 5400 6525 5400 8325 -2 1 0 1 -1 7 50 0 -1 0.000 0 0 -1 1 0 3 - 1 1 1.00 60.00 120.00 - 5175 6300 4275 6300 4275 7200 -2 1 0 1 -1 7 50 0 -1 0.000 0 0 -1 1 0 3 - 1 1 1.00 60.00 120.00 - 5625 6300 6525 6300 6525 7200 -2 1 0 1 -1 7 50 0 -1 0.000 0 0 -1 1 0 3 - 1 1 1.00 60.00 120.00 - 4275 7650 4275 8550 5175 8550 -2 1 0 1 -1 7 50 0 -1 0.000 0 0 -1 1 0 3 - 1 1 1.00 60.00 120.00 - 6525 7650 6525 8550 5625 8550 -4 1 0 50 0 14 12 0.0000 4 120 210 5400 720 N0\001 -4 0 20 50 0 14 12 0.0000 4 135 1365 5535 1125 SETUP.request\001 -4 1 0 50 0 14 12 0.0000 4 120 210 5400 1845 N6\001 -4 1 0 50 0 14 12 0.0000 4 120 210 5400 2970 N9\001 -4 1 0 50 0 14 12 0.0000 4 120 210 5400 4095 N7\001 -4 1 0 50 0 14 12 0.0000 4 120 210 5400 5220 N8\001 -4 1 0 50 0 14 12 0.0000 4 120 315 5400 6345 N10\001 -4 0 20 50 0 14 12 0.0000 4 135 2310 5535 5625 SETUP_COMPLETE.request\001 -4 0 9 50 0 14 12 0.0000 4 135 1995 5535 3735 ALERTING.indication\001 -4 0 9 50 0 14 12 0.0000 4 135 1365 5535 4860 SETUP.confirm\001 -4 0 9 50 0 14 12 0.0000 4 135 2205 5535 2610 PROCEEDING.indication\001 -4 1 0 50 0 14 12 0.0000 4 120 315 4275 7470 N11\001 -4 1 0 50 0 14 12 0.0000 4 120 315 6525 7470 N12\001 -4 2 9 50 0 14 12 0.0000 4 135 1890 5085 6255 RELEASE.indication\001 -4 0 20 50 0 14 12 0.0000 4 135 1575 5715 6255 RELEASE.request\001 -4 2 9 50 0 14 12 0.0000 4 135 1575 5355 6840 RELEASE.confirm\001 -4 0 9 50 0 14 12 0.0000 4 135 1575 5715 8730 RELEASE.confirm\001 -4 2 20 50 0 14 12 0.0000 4 135 1680 5085 8730 RELEASE.response\001 -4 1 0 50 0 14 12 0.0000 4 120 210 5400 8595 N0\001 diff --git a/contrib/ngatm/libngatm/sscfucust.h b/contrib/ngatm/libngatm/sscfucust.h deleted file mode 100644 index 760fd71660f9..000000000000 --- a/contrib/ngatm/libngatm/sscfucust.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2001-2003 - * Fraunhofer Institute for Open Communication Systems (FhG Fokus). - * All rights reserved. - * - * Redistribution 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 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 IS PROVIDED BY THE AUTHOR AND 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 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. - * - * Author: Hartmut Brandt <harti@freebsd.org> - * - * $Begemot: libunimsg/libngatm/sscfucust.h,v 1.4 2004/07/08 08:21:40 brandt Exp $ - * - * Customisation of the SSCFU code for the user space library. - */ -#include <sys/types.h> -#include <sys/queue.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> -#ifdef SSCFU_DEBUG -#include <assert.h> -#endif -#include <netnatm/unimsg.h> - -/* - * Allocate zeroed or non-zeroed memory of some size and cast it. - * Return NULL on failure. - */ -#define MEMINIT() - -#define MEMZALLOC(PTR,CAST,SIZE) do { \ - void *_m = malloc(SIZE); \ - if (_m != NULL) \ - bzero(_m, SIZE); \ - (PTR) = (CAST)_m; \ -} while(0) - -#define MEMFREE(PTR) \ - free(PTR) - -#define SIG_ALLOC(PTR) \ - MEMZALLOC(PTR, struct sscfu_sig *, sizeof(struct sscfu_sig)) -#define SIG_FREE(PTR) \ - MEMFREE(PTR) - -/* - * Signal queues - */ -typedef TAILQ_ENTRY(sscfu_sig) sscfu_sigq_link_t; -typedef TAILQ_HEAD(sscfu_sigq, sscfu_sig) sscfu_sigq_head_t; -#define SIGQ_INIT(Q) TAILQ_INIT(Q) -#define SIGQ_APPEND(Q,S) TAILQ_INSERT_TAIL(Q, S, link) -#define SIGQ_GET(Q) \ - ({ \ - struct sscfu_sig *_s = NULL; \ - \ - if(!TAILQ_EMPTY(Q)) { \ - _s = TAILQ_FIRST(Q); \ - TAILQ_REMOVE(Q, _s, link); \ - } \ - _s; \ - }) - -#define SIGQ_CLEAR(Q) \ - do { \ - struct sscfu_sig *_s1, *_s2; \ - \ - _s1 = TAILQ_FIRST(Q); \ - while(_s1 != NULL) { \ - _s2 = TAILQ_NEXT(_s1, link); \ - if(_s1->m) \ - MBUF_FREE(_s1->m); \ - SIG_FREE(_s1); \ - _s1 = _s2; \ - } \ - TAILQ_INIT(Q); \ - } while(0) - - -/* - * Message buffers - */ -#define MBUF_FREE(M) uni_msg_destroy(M) - -#ifdef SSCFU_DEBUG -#define ASSERT(S) assert(S) -#else -#define ASSERT(S) -#endif diff --git a/contrib/ngatm/libngatm/sscopcust.h b/contrib/ngatm/libngatm/sscopcust.h deleted file mode 100644 index 12736c26c030..000000000000 --- a/contrib/ngatm/libngatm/sscopcust.h +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright (c) 2001-2003 - * Fraunhofer Institute for Open Communication Systems (FhG Fokus). - * All rights reserved. - * - * Redistribution 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 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 IS PROVIDED BY THE AUTHOR AND 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 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. - * - * Author: Hartmut Brandt <harti@freebsd.org> - * - * $Begemot: libunimsg/libngatm/sscopcust.h,v 1.4 2004/07/08 08:21:40 brandt Exp $ - * - * Customisation of the SSCOP code for the user space library. - */ -#include <sys/types.h> -#include <sys/queue.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <stdarg.h> -#include <errno.h> -#ifdef SSCOP_DEBUG -#include <assert.h> -#endif -#include <netinet/in.h> -#include <arpa/inet.h> -#include <netnatm/unimsg.h> - -/* - * Allocate zeroed or non-zeroed memory of some size and cast it. - * Return NULL on failure. - */ -#define MEMINIT() - -#define MEMZALLOC(PTR,CAST,SIZE) do { \ - void *_m = malloc(SIZE); \ - if (_m != NULL) \ - bzero(_m, SIZE); \ - (PTR) = (CAST)_m; \ -} while(0) - -#define MEMFREE(PTR) free(PTR); - -#define MSG_ALLOC(PTR) \ - MEMZALLOC(PTR, struct sscop_msg *, sizeof(struct sscop_msg)) -#define MSG_FREE(PTR) \ - MEMFREE(PTR) - -#define SIG_ALLOC(PTR) \ - MEMZALLOC(PTR, struct sscop_sig *, sizeof(struct sscop_sig)) -#define SIG_FREE(PTR) \ - MEMFREE(PTR) - -/* - * Timer support. - */ -typedef void *sscop_timer_t; -#define TIMER_INIT(S,T) (S)->t_##T = NULL -#define TIMER_STOP(S,T) do { \ - if ((S)->t_##T != NULL) { \ - (S)->funcs->stop_timer((S), (S)->aarg, (S)->t_##T); \ - (S)->t_##T = NULL; \ - } \ - } while(0) -#define TIMER_RESTART(S,T) do { \ - if ((S)->t_##T != NULL) \ - (S)->funcs->stop_timer((S), (S)->aarg, (S)->t_##T); \ - (S)->t_##T = (S)->funcs->start_timer((S), (S)->aarg, \ - (S)->timer##T, T##_func); \ - } while(0) -#define TIMER_ISACT(S,T) ((S)->t_##T != NULL) - -#define TIMER_FUNC(T,N) \ -static void \ -T##_func(void *varg) \ -{ \ - struct sscop *sscop = varg; \ - VERBOSE(sscop, SSCOP_DBG_TIMER, (sscop, sscop->aarg, \ - "timer_" #T " expired")); \ - sscop->t_##T = NULL; \ - sscop_signal(sscop, SIG_T_##N, NULL); \ -} - - -/* - * Message queues - */ -typedef TAILQ_ENTRY(sscop_msg) sscop_msgq_link_t; -typedef TAILQ_HEAD(sscop_msgq, sscop_msg) sscop_msgq_head_t; -#define MSGQ_EMPTY(Q) TAILQ_EMPTY(Q) -#define MSGQ_INIT(Q) TAILQ_INIT(Q) -#define MSGQ_FOREACH(P,Q) TAILQ_FOREACH(P,Q,link) -#define MSGQ_REMOVE(Q,M) TAILQ_REMOVE(Q,M,link) -#define MSGQ_INSERT_BEFORE(B,M) TAILQ_INSERT_BEFORE(B,M,link) -#define MSGQ_APPEND(Q,M) TAILQ_INSERT_TAIL(Q,M,link) -#define MSGQ_PEEK(Q) (TAILQ_EMPTY((Q)) ? NULL : TAILQ_FIRST((Q))) -#define MSGQ_GET(Q) \ - ({ \ - struct sscop_msg *_m = NULL; \ - \ - if(!TAILQ_EMPTY(Q)) { \ - _m = TAILQ_FIRST(Q); \ - TAILQ_REMOVE(Q, _m, link); \ - } \ - _m; \ - }) - -#define MSGQ_CLEAR(Q) \ - do { \ - struct sscop_msg *_m1, *_m2; \ - \ - _m1 = TAILQ_FIRST(Q); \ - while(_m1 != NULL) { \ - _m2 = TAILQ_NEXT(_m1, link); \ - SSCOP_MSG_FREE(_m1); \ - _m1 = _m2; \ - } \ - TAILQ_INIT((Q)); \ - } while(0) - -/* - * Signal queues - */ -typedef TAILQ_ENTRY(sscop_sig) sscop_sigq_link_t; -typedef TAILQ_HEAD(sscop_sigq, sscop_sig) sscop_sigq_head_t; -#define SIGQ_INIT(Q) TAILQ_INIT(Q) -#define SIGQ_APPEND(Q,S) TAILQ_INSERT_TAIL(Q, S, link) -#define SIGQ_EMPTY(Q) TAILQ_EMPTY(Q) -#define SIGQ_GET(Q) \ - ({ \ - struct sscop_sig *_s = NULL; \ - \ - if(!TAILQ_EMPTY(Q)) { \ - _s = TAILQ_FIRST(Q); \ - TAILQ_REMOVE(Q, _s, link); \ - } \ - _s; \ - }) - -#define SIGQ_MOVE(F,T) \ - do { \ - struct sscop_sig *_s; \ - \ - while(!TAILQ_EMPTY(F)) { \ - _s = TAILQ_FIRST(F); \ - TAILQ_REMOVE(F, _s, link); \ - TAILQ_INSERT_TAIL(T, _s, link); \ - } \ - } while(0) - -#define SIGQ_PREPEND(F,T) \ - do { \ - struct sscop_sig *_s; \ - \ - while(!TAILQ_EMPTY(F)) { \ - _s = TAILQ_LAST(F, sscop_sigq); \ - TAILQ_REMOVE(F, _s, link); \ - TAILQ_INSERT_HEAD(T, _s, link); \ - } \ - } while(0) - -#define SIGQ_CLEAR(Q) \ - do { \ - struct sscop_sig *_s1, *_s2; \ - \ - _s1 = TAILQ_FIRST(Q); \ - while(_s1 != NULL) { \ - _s2 = TAILQ_NEXT(_s1, link); \ - SSCOP_MSG_FREE(_s1->msg); \ - SIG_FREE(_s1); \ - _s1 = _s2; \ - } \ - TAILQ_INIT(Q); \ - } while(0) - - - -/* - * Message buffers - */ -/* Free a buffer (if there is one) */ -#define MBUF_FREE(M) do { if(M) uni_msg_destroy(M); } while(0) - -/* duplicate a buffer */ -#define MBUF_DUP(M) uni_msg_dup(M) - -/* compute current length */ -#define MBUF_LEN(M) uni_msg_len((M)) - -/* - * Return the i-th word counted from the end of the buffer. - * i=-1 will return the last 32bit word, i=-2 the 2nd last. - * Assumes that there is enough space. - */ -#define MBUF_TRAIL32(M,I) uni_msg_trail32((M), (I)) - -/* - * Strip 32bit value from the end - */ -#define MBUF_STRIP32(M) uni_msg_strip32((M)) - -/* - * Strip 32bit value from head - */ -#define MBUF_GET32(M) uni_msg_get32((M)) - -/* - * Append a 32bit value to an mbuf. Failures are ignored. - */ -#define MBUF_APPEND32(M,W) uni_msg_append32((M), (W)) - -/* - * Pad a message to a multiple of four byte and return the amount of padding - * Failures are ignored. - */ -#define MBUF_PAD4(M) \ - ({ \ - int _npad = 0; \ - while (uni_msg_len(M) % 4 != 0) { \ - uni_msg_append8((M), 0); \ - _npad++; \ - } \ - _npad; \ - }) - -#define MBUF_UNPAD(M,P) do { (M)->b_wptr -= (P); } while(0) - -/* - * Allocate a message that will probably hold N bytes. - */ -#define MBUF_ALLOC(N) uni_msg_alloc(N) - -#ifdef SSCOP_DEBUG -#define ASSERT(X) assert(X) -#else -#define ASSERT(X) -#endif diff --git a/contrib/ngatm/libngatm/unicust.h b/contrib/ngatm/libngatm/unicust.h deleted file mode 100644 index ff028a65a8e6..000000000000 --- a/contrib/ngatm/libngatm/unicust.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2001-2003 - * Fraunhofer Institute for Open Communication Systems (FhG Fokus). - * All rights reserved. - * - * Redistribution 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 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 IS PROVIDED BY THE AUTHOR AND 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 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. - * - * Author: Hartmut Brandt <harti@freebsd.org> - * - * $Begemot: libunimsg/libngatm/unicust.h,v 1.4 2003/09/19 13:10:35 hbb Exp $ - * - * Customisation of signalling source to user space. - */ -#include <sys/types.h> -#include <sys/queue.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <assert.h> - -#define ASSERT(E, M) assert(E) - -static __inline__ void * -mzalloc(size_t s) -{ - void *ptr = malloc(s); - - if (ptr) - bzero(ptr, s); - return (ptr); -} - -#define INS_ALLOC() mzalloc(sizeof(struct uni)) -#define INS_FREE(P) free(P) - -#define UNI_ALLOC() mzalloc(sizeof(struct uni_all)) -#define UNI_FREE(P) free(P) - -#define SIG_ALLOC() mzalloc(sizeof(struct sig)) -#define SIG_FREE(P) free(P) - -#define CALL_ALLOC() mzalloc(sizeof(struct call)) -#define CALL_FREE(P) free(P) - -#define PARTY_ALLOC() mzalloc(sizeof(struct party)) -#define PARTY_FREE(P) free(P) - -/* - * Timers - */ -struct uni_timer { - void *c; -}; - -#define _TIMER_INIT(X,T) (X)->T.c = NULL -#define _TIMER_DESTROY(U,F) _TIMER_STOP(U,F) -#define _TIMER_STOP(U,F) \ - do { \ - if (F.c != NULL) { \ - (U)->funcs->stop_timer(U, U->arg, F.c); \ - F.c = NULL; \ - } \ - } while(0) -#define _TIMER_START(UNI,ARG,FIELD,DUE,FUNC) \ - (void)(FIELD.c = (UNI)->funcs->start_timer(UNI, \ - UNI->arg, DUE, FUNC, ARG)) - -#define TIMER_ISACT(X,T) (X->T.c != NULL) - -#define TIMER_FUNC_UNI(T,F) \ -static void F(struct uni *); \ -static void \ -_##T##_func(void *varg) \ -{ \ - struct uni *uni = (struct uni *)varg; \ - uni->T.c = NULL; \ - (F)(uni); \ -} - -/* - * Be careful: call may be invalid after the call to F - */ -#define TIMER_FUNC_CALL(T,F) \ -static void F(struct call *); \ -static void \ -_##T##_func(void *varg) \ -{ \ - struct call *call = (struct call *)varg; \ - call->T.c = NULL; \ - (F)(call); \ -} - -/* - * Be careful: call/party may be invalid after the call to F - */ -#define TIMER_FUNC_PARTY(T,F) \ -static void F(struct party *); \ -static void \ -_##T##_func(void *varg) \ -{ \ - struct party *party = (struct party *)varg; \ - party->T.c = NULL; \ - (F)(party); \ -} diff --git a/contrib/ngatm/libngatm/unimsg.c b/contrib/ngatm/libngatm/unimsg.c deleted file mode 100644 index 9df02a10598c..000000000000 --- a/contrib/ngatm/libngatm/unimsg.c +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright (c) 1996-2003 - * Fraunhofer Institute for Open Communication Systems (FhG Fokus). - * All rights reserved. - * - * Redistribution 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 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 IS PROVIDED BY THE AUTHOR AND 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 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. - * - * Author: Hartmut Brandt <harti@freebsd.org> - * - * $Begemot: libunimsg/libngatm/unimsg.c,v 1.4 2004/07/08 08:21:41 brandt Exp $ - * - * User space message structure. - */ - -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <errno.h> -#include <arpa/inet.h> -#include <netnatm/unimsg.h> - -/* the amount of extra bytes to allocate */ -#define EXTRA 128 - -/* - * Allocate a message that can hold at least 's' bytes. Return NULL if - * allocation fails. - */ -struct uni_msg * -uni_msg_alloc(size_t s) -{ - struct uni_msg *m; - - s += EXTRA; - - if ((m = malloc(sizeof(struct uni_msg))) == NULL) - return NULL; - if ((m->b_buf = malloc(s)) == NULL) { - free(m); - return (NULL); - } - m->b_rptr = m->b_wptr = m->b_buf; - m->b_lim = m->b_buf + s; - return (m); -} - -/* - * Destroy the message and free memory - */ -void -uni_msg_destroy(struct uni_msg *m) -{ - free(m->b_buf); - free(m); -} - -/* - * Extend message by at least 's' additional bytes. - * May reallocate the message buffer. Return -1 on errors, 0 if ok. - * If an error occurs the message is destroyed. - */ -int -uni_msg_extend(struct uni_msg *m, size_t s) -{ - u_char *b; - size_t len, leading, newsize; - - len = uni_msg_len(m); - newsize = m->b_wptr - m->b_buf + s + EXTRA; - leading = m->b_rptr - m->b_buf; - if ((b = realloc(m->b_buf, newsize)) == NULL) { - free(m->b_buf); - free(m); - return (-1); - } - m->b_buf = b; - m->b_rptr = m->b_buf + leading; - m->b_wptr = m->b_rptr + len; - m->b_lim = m->b_buf + newsize; - - return (0); -} - -/* - * Append the given buffer to the message. May reallocate the message - * buffer. Return 0 if ok, -1 on errors. - */ -int -uni_msg_append(struct uni_msg *m, void *buf, size_t size) -{ - int error; - - if ((error = uni_msg_ensure(m, size))) - return (error); - memcpy(m->b_wptr, buf, size); - m->b_wptr += size; - - return (0); -} - -/* - * Construct a message from a number of pieces. The list of pieces must end - * with a NULL pointer. - */ -struct uni_msg * -uni_msg_build(void *ptr, ...) -{ - va_list ap; - struct uni_msg *m; - size_t len, n; - void *p1; - - len = 0; - va_start(ap, ptr); - p1 = ptr; - while (p1 != NULL) { - n = va_arg(ap, size_t); - len += n; - p1 = va_arg(ap, void *); - } - va_end(ap); - - if ((m = uni_msg_alloc(len)) == NULL) - return (NULL); - - va_start(ap, ptr); - p1 = ptr; - while (p1 != NULL) { - n = va_arg(ap, size_t); - memcpy(m->b_wptr, p1, n); - m->b_wptr += n; - p1 = va_arg(ap, void *); - } - va_end(ap); - - return (m); -} - -/* - * Strip the last 32 bit word from the buffer. - * Barf if there is no word left. - */ -u_int -uni_msg_strip32(struct uni_msg *msg) -{ - uint32_t w; - - msg->b_wptr -= 4; - bcopy(msg->b_wptr, &w, 4); - return (ntohl(w)); -} - -/* - * Strip the first four bytes of the buffer. - */ -u_int -uni_msg_get32(struct uni_msg *msg) -{ - uint32_t w; - - bcopy(msg->b_rptr, &w, 4); - msg->b_rptr += 4; - return (ntohl(w)); -} - -/* - * Append a 32 bit word to the buffer. - */ -int -uni_msg_append32(struct uni_msg *msg, u_int u) -{ - if (uni_msg_ensure(msg, 4) == -1) - return (-1); - u = htonl(u); - bcopy(&u, msg->b_wptr, 4); - msg->b_wptr += 4; - return (0); -} - -/* - * Append a byte to the buffer. - */ -int -uni_msg_append8(struct uni_msg *msg, u_int u) -{ - if (uni_msg_ensure(msg, 1) == -1) - return (-1); - *msg->b_wptr++ = u; - return (0); -} - -/* - * Return the i-th word counted from the end of the buffer. - * i=-1 will return the last 32bit word, i=-2 the 2nd last. - * Assumes that the word is in the buffer. - */ -u_int -uni_msg_trail32(const struct uni_msg *msg, int i) -{ - u_int w; - - bcopy(msg->b_wptr + 4 * i, &w, 4); - return (ntohl(w)); -} - - -/* - * Make a duplicate. - */ -struct uni_msg * -uni_msg_dup(const struct uni_msg *inp) -{ - struct uni_msg *msg; - u_int len, off; - - len = inp->b_wptr - inp->b_rptr; - off = inp->b_rptr - inp->b_buf; - if ((msg = uni_msg_alloc(inp->b_lim - inp->b_buf)) == NULL) - return (NULL); - msg->b_rptr = msg->b_buf + off; - msg->b_wptr = msg->b_rptr + len; - (void)memcpy(msg->b_rptr, inp->b_rptr, len); - - return (msg); -} diff --git a/contrib/ngatm/man/libngatm.3 b/contrib/ngatm/man/libngatm.3 deleted file mode 100644 index 9de36efc7c38..000000000000 --- a/contrib/ngatm/man/libngatm.3 +++ /dev/null @@ -1,75 +0,0 @@ -.\" -.\" Copyright (c) 2001-2003 -.\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). -.\" All rights reserved. -.\" Copyright (c) 2004 -.\" Hartmut Brandt -.\" All rights reserved. -.\" -.\" Author: Hartmut Brandt <harti@freebsd.org> -.\" -.\" Redistribution 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 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 IS PROVIDED BY THE AUTHOR AND 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 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/man/libngatm.3,v 1.4 2004/07/08 08:21:42 brandt Exp $ -.\" -.Dd July 7, 2004 -.Dt libngatm 3 -.Os -.Sh NAME -.Nm libngatm -.Nd "ATM signalling library" -.Sh LIBRARY -Begemot ATM signalling library -.Pq libngatm, -lngatm -.Sh DESCRIPTION -The Begemot UNI signalling library handles message decoding and encoding as -well as the Q.2110 and Q.2120 transport protocols and adaptation layers, and -ATM-Forum UNI 4.0 compliant signalling. -Because of this complexity the description is broken down in several man pages: -.Bl -tag -width XXXX -.It Xr unimsg 3 -Describes a data structure and functions for handling of variable sized -messages. -.It Xr unistruct 3 -describes data structures for the decoding, encoding and printing functions -in the library. -.It Xr unifunc 3 -describes the decoding, encoding and printing functions. -.\" .It Xr sscop 3 -.\" describes the SSCOP transport protocol functions. -.\" .It Xr sscfu 3 -.\" describes the SSCF at the UNI functions. -.\" .It Xr uni 3 -.\" describes the UNI 4.0 signalling functions. -.It Xr uniaddr 3 -describes address structures and handling functions. -.It Xr unisap 3 -.\" describes ATM-Forum ATM-API service access point structures and -.\" handling functions. -.El -.Sh SEE ALSO -.Xr sscop 1 -.Sh STANDARDS -This implementation conforms to the applicable ITU-T -recommendations and ATM Forum standards. -.Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org diff --git a/contrib/ngatm/man/uniaddr.3 b/contrib/ngatm/man/uniaddr.3 deleted file mode 100644 index 7a54fbbefe11..000000000000 --- a/contrib/ngatm/man/uniaddr.3 +++ /dev/null @@ -1,125 +0,0 @@ -.\" -.\" Copyright (c) 2001-2003 -.\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). -.\" All rights reserved. -.\" -.\" Author: Hartmut Brandt <harti@freebsd.org> -.\" -.\" Redistribution 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 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 IS PROVIDED BY THE AUTHOR AND 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 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/man/uniaddr.3,v 1.3 2004/07/08 08:21:42 brandt Exp $ -.\" -.Dd October 30, 2003 -.Dt uniaddr 3 -.Os -.Sh NAME -.Nm unimsg , -.Nm uni_str2nsap , -.Nm uni_nsap2str , -.Nm uni_prefix2str , -.Nm uni_e1642nsap , -.Nm uni_nsap2e164 -.Nd "ATM signalling library - address handling" -.Sh LIBRARY -Begemot ATM signalling library -.Pq libunimsg, -lunimsg -.Sh SYNOPSIS -.In netnatm/addr.h -.Ft int -.Fn uni_str2nsap "u_char *nsap" "const char *str" -.Ft void -.Fn uni_nsap2str "char *str" "const u_char *nsap" "int dots" -.Ft void -.Fn uni_prefix2str "char *str" "const u_char *prefix" "u_int len" "int dots" -.Ft int -.Fn uni_e1642nsap "u_char *nsap" "const char *e164" -.Ft int -.Fn uni_nsap2e164 "char *e164" "const u_char *nsap" "int check" -.Sh DESCRIPTION -The UNI message library contains a number of utility functions to handle -NSAP and E.164 addresses. -.Pp -The function -.Fn uni_str2nsap -parses a string and interprets it as an NSAP address. -The string should consist of exact 40 hexadecimal digits -(upper and lower case are allowed) and any -number of dots at any position. -Any other character is illegal. -The resulting NSAP address is written to the buffer pointed to by -.Fa nsap . -This buffer should be at least 20 bytes. -On success the funtion returns 0. -If an parsing error happens -1 is returned. -.Pp -The function -.Fn uni_nsap2str -converts the NSAP address pointed to by -.Fa nsap -into a string. -For some commonly used NSAP formats (those with leading -octets 0x39, 0x45 or 0x47) dots may be inserted to make the address more -readable by passing a non-0 value in -.Fa dots . -The buffer pointed to by -.Fa str -should be large enough to hold the resulting string plus the terminating NUL. -A size of 80 byte is large enough for all cases. -.Pp -The function -.Fn uni_prefix2str -converts an NSAP prefix to a string. -The length of the NSAP prefix in bytes is passed in -.Fa len . -.Li "uni_nsap2str(str, nsap, dots)" -is equivalent to -.Li "uni_prefix2str(str, nsap, 20, dots)" . -.Pp -The function -.Fn uni_e1642nsap -converts an E.164 address given as an ASCII string to an embedded E.164 NSAP -address. -The string pointed to by -.Fa e164 -must consist of at least 1 and not more than 15 ASCII digits. -The function returns 0 on success and -1 if the E.164 address was malformed. -.Pp -The function -.Fn uni_nsap2e164 -extracts the E.164 address from an embedded E.164 NSAP address. -The argument -.Fa check -specifies whether the NSAP address should be checked for correct syntax. -If -.Fa check -is 0 the last 11 bytes of the address are ignored. If -.Fa check -is 1 the last 11 bytes except the selector byte must be zero. -If -.Fa check -is 2 the last 11 bytes must be zero. -The function returns 0 on success and -1 when the NSAP address was not an -embedded E.164 NSAP or one of the additional checks failed. -.Sh SEE ALSO -.Xr libngatm 3 , -.Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org diff --git a/contrib/ngatm/man/unifunc.3 b/contrib/ngatm/man/unifunc.3 deleted file mode 100644 index 093d0c8979bc..000000000000 --- a/contrib/ngatm/man/unifunc.3 +++ /dev/null @@ -1,252 +0,0 @@ -.\" -.\" Copyright (c) 2001-2003 -.\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). -.\" All rights reserved. -.\" -.\" Author: Hartmut Brandt <harti@freebsd.org> -.\" -.\" Redistribution 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 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 IS PROVIDED BY THE AUTHOR AND 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 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/man/unifunc.3,v 1.3 2004/07/08 08:21:43 brandt Exp $ -.\" -.Dd October 30, 2003 -.Dt unifunc 3 -.Os -.Sh NAME -.Nm libngatm -.Nm uni_decode -.Nm uni_decode_head -.Nm uni_decode_body -.Nm uni_decode_ie_hdr -.Nm uni_decode_ie_body -.Nm uni_encode -.Nm uni_encode_msg_hdr -.Nm uni_encode_ie -.Nm uni_encode_ie_hdr -.Nm uni_check_ie -.Nm uni_print_cref -.Nm uni_print_msghdr -.Nm uni_print -.Nm uni_print_ie -.Nm uni_initcx -.Nm uni_print_cx -.Nd "ATM signalling library - message handling functions" -.Sh LIBRARY -Begemot ATM signalling library -.Pq libngatm, -lngatm -.Sh SYNOPSIS -.In netnatm/msg/unistruct.h -.In netnatm/msg/unimsglib.h -.Ft int -.Fn uni_decode "struct uni_msg *buf" "struct uni_all *msg" "struct unicx *cx" -.Ft int -.Fn uni_decode_head "struct uni_msg *buf" "struct uni_all *msg" "struct unicx *cx" -.Ft int -.Fn uni_decode_body "struct uni_msg *buf" "struct uni_all *msg" "struct unicx *cx" -.Ft int -.Fn uni_decode_ie_hdr "enum uni_ietype *type" "struct uni_iehdr *hdr" "struct uni_msg *buf" "struct unicx *cx" "u_int *ielen" -.Ft int -.Fn uni_decode_ie_body "enum uni_ietype type" "union uni_ieall *ie" "struct uni_msg *buf" "u_int ielen" "struct unicx *cx" -.Ft int -.Fn uni_encode "struct uni_msg *buf" "struct uni_all *msg" "struct unicx *cx" -.Ft int -.Fn uni_encode_msg_hdr "struct uni_msg *buf" "struct uni_msghdr *hdr" "enum uni_msgtype type" "struct unicx *cx" "int *mlen" -.Ft int -.Fn uni_encode_ie "enum uni_ietype type" "struct uni_msg *buf" "union uni_ieall *ie" "struct unicx *cx" -.Ft int -.Fn uni_encode_ie_hdr "struct uni_msg *buf" "enum uni_ietype type" "struct uni_iehdr *hdr" "u_int len" "struct unicx *cx" -.Ft int -.Fn uni_check_ie "enum uni_ietype type" "union uni_ieall *ie" "struct unicx *cx" -.Ft void -.Fn uni_print_cref "char *buf" "size_t buflen" "struct uni_cref *cref" "struct unicx *cx" -.Ft void -.Fn uni_print_msghdr "char *buf" "size_t buflen" "struct uni_msghdr *hdr" "struct unicx *cx" -.Ft void -.Fn uni_print "char *buf" "size_t buflen" "struct uni_all *msg" "struct unicx *cx" -.Ft void -.Fn uni_print_ie "char *buf" "size_t buflen" "enum uni_ietype type" "union uni_ieall *ie" "struct unicx *cx" -.Ft void -.Fn uni_initcx "struct unicx *cx" -.Ft void -.Fn uni_print_cx "char *buf" "size_t buflen" "struct unicx *cx" -.Sh DESCRIPTION -The -.Nm -library handles UNI 4.0 messages. -For each information element and message -type the header files contain a structure definition. -Additionally there -are a number of help structures and a global context structure for some -of the library functions. -This document describes the functions that are -used to handle messages. -.Ss DECODING -Decoding is the process of taking an octet stream containing a UNI message -or IE, parsing it and filling in a message or IE structure. -.Pp -The function -.Fn uni_decode -takes a message buffer, interprets it as a UNI message and fills in the -structure pointed to by -.Fa msg . -It also takes a context argument and may fill the error array in the context. -It returns -1 if there is an error decoding the message header and --2 if there is an error decoding the message body. -The function returns 0 on success. -.Pp -The process of decoding a message can be split up by calling -.Fn uni_decode_head -and -.Fn uni_decode_body . -The first of these functions decodes only the message header and the second -one decodes only the information elements. -.Fn uni_decode_head -returns 0 if it could decode the message header -and -1 if the message could not be decoded (bad protocol -identifier, bad length or broken call reference). -.Fn uni_decode_body -return 0 on success and -1 for unknown message types or if any -IE had an error. -.Pp -The function -.Fn uni_decode_ie_hdr -decodes the next information element header. -It returns the IE type and its length -in the variables pointed to by -.Va type -and -.Va ielen -and stores the decoded header in the structure pointed to by -.Va hdr . -The function returns 0 on success and -1 if there were not enough bytes -in the buffer left for a complete IE header. -.Pp -The function -.Fn uni_decode_ie_body -decodes the body of an information element. It is passed the buffer with the -message -.Fa buf , -the information element type -.Fa type -and length -.Fa ielen . -The IE is stored in the union pointed to by -.Fa ie . -The function returns -1 on errors and 0 on success. -In any case the most correct -number of bytes is consumed from the input buffer. -.Ss ENCODING -Encoding is the process of taking a message or IE structure and producing -an octet stream from it. -.Pp -The function -.Fn uni_encode -encodes a UNI message. -It returns -1 if the message type is out of bounds, -3 -if the message type is unknown. -The encoding functions for the message types -can return their own error codes. -The function returns 0 on success. -.Pp -The function -.Fn uni_encode_msg_hdr -encodes a message header. -The variable pointed to by -.Fa mlen -is set to the offset of the message length field from the begin of the -byte stream. -This is needed because the length of the message body will -be known only after all the IEs have been encoded. -Then the length -has to be inserted into this place. -The function returns -1 if the call reference -was bad and 0 on success. -.Pp -The function -.Fn uni_encode_ie -encodes one information element. -The function returns 0 on success or -1 -on errors. -The function -.Fn uni_encode_ie_hdr -encodes the four byte IE header. -The argument -.Fa len -is the maximum expected length of the information element, not the real length. -The function inserts a 0 in the real length field. -This must be -fixed up by the caller after encoding the IE contents. -The function -return -1 if an empty IE is to be encoded (in this case the length field will -have been set to 4) or 0 otherwise. -.Ss CHECKING -There exists a number of function that do consistency checks on information -elements. -Note, that these functions do not check inter-IE consistency, but -each IE by itself. -.Pp -The function -.Fn uni_check_ie -check an information element for consistency. -It returns 0 if the IE seems -ok, -1 otherwise. -.Ss PRINTING -A number of functions can be used to print decoded messages and IEs in -a human readable form. -This is intended mainly for debugging. -Some fields of the library context are used to control how the printing is done -(see -.Xr unistruct 3 ). -Each of the function takes a -.Fa buf -and a -.Fa buflen -argument. -The string that is generated in the buffer pointed to by -.Fa buf -is guaranteed to be NUL terminated. -.Pp -The function -.Fn uni_print_cref -formats a call reference taking into account special call references. -The function -.Fn uni_print_msg_hdr -formats a message header. -The functions -.Fn uni_print -and -.Fn uni_print_ie -print messages and information elements. -.Ss CONTEXTS -There are two functions for context handling. -.Fn uni_initcx -initializes a context with default values and -.Fn uni_print_cx -prints a context to the given buffer. -.Sh SEE ALSO -.Xr libngatm 3 -.Sh STANDARDS -This implementation conforms to the applicable ITU-T -recommendations and ATM Forum standards with the exception of some limitations -(see the Configuration section). -.Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org diff --git a/contrib/ngatm/man/unimsg.3 b/contrib/ngatm/man/unimsg.3 deleted file mode 100644 index eafa7b12f17b..000000000000 --- a/contrib/ngatm/man/unimsg.3 +++ /dev/null @@ -1,234 +0,0 @@ -.\" -.\" Copyright (c) 2001-2003 -.\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). -.\" All rights reserved. -.\" -.\" Redistribution 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 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 IS PROVIDED BY THE AUTHOR AND 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 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. -.\" -.\" Author: Hartmut Brandt <harti@freebsd.org> -.\" -.\" $Begemot: libunimsg/man/unimsg.3,v 1.2 2003/08/21 16:01:08 hbb Exp $ -.\" -.Dd August 23, 2002 -.Dt unimsg 3 -.Os -.Sh NAME -.Nm uni_msg_len , -.Nm uni_msg_space , -.Nm uni_msg_leading , -.Nm uni_msg_size , -.Nm uni_msg_ensure , -.Nm uni_msg_append , -.Nm uni_msg_extend , -.Nm uni_msg_alloc , -.Nm uni_msg_build , -.Nm uni_msg_destroy , -.Nm uni_msg_strip32 , -.Nm uni_msg_get32 , -.Nm uni_msg_append32 , -.Nm uni_msg_append8 , -.Nm uni_msg_trail32 , -.Nm uni_msg_dup -.Nd "ATM signalling library - message buffers" -.Sh LIBRARY -Begemot ATM signalling library -.Pq libunimsg, -lunimsg -.Sh SYNOPSIS -.In uni4/unimsg.h -.Ft size_t -.Fn uni_msg_len "const struct uni_msg *msg" -.Ft size_t -.Fn uni_msg_space "const struct uni_msg *msg" -.Ft size_t -.Fn uni_msg_leading "const struct uni_msg *msg" -.Ft size_t -.Fn uni_msg_size "const struct uni_msg *msg" -.Ft int -.Fn uni_msg_ensure "struct uni_msg *msg" "size_t bytes" -.Ft int -.Fn uni_msg_append "struct uni_msg *msg" "void *buf" "size_t buflen" -.Ft int -.Fn uni_msg_extend "struct uni_msg *msg" "size_t bytes" -.Ft struct uni_msg * -.Fn uni_msg_alloc "size_t space" -.Ft struct uni_msg * -.Fn uni_msg_build "void *buf" "..." -.Ft void -.Fn uni_msg_destroy "struct uni_msg *msg" -.Ft u_int -.Fn uni_msg_strip32 "struct uni_msg *msg" -.Ft u_int -.Fn uni_msg_get32 "struct uni_msg *msg" -.Ft int -.Fn uni_msg_append32 "struct uni_msg *msg" "u_int value" -.Ft int -.Fn uni_msg_append8 "struct uni_msg *msg" "u_int byte" -.Ft u_int -.Fn uni_msg_trail32 "const struct uni_msg *msg" "int n" -.Ft struct uni_msg * -.Fn uni_msg_dup "const struct uni_msg *msg" -.Sh DESCRIPTION -These functions are used to manipulate variable sized message. They are -inspired by BSD mbufs and SysV stream buffers, but somewhat simplified because -signalling generally is a low bandwidth task. All the functions operation on -a -.Li uni_msg -data structure: -.Bd -literal -offset indent -struct uni_msg { - u_char *b_wptr; /* tail pointer */ - u_char *b_rptr; /* head pointer */ - u_char *b_buf; /* data buffer */ - u_char *b_lim; /* end of data buffer */ -}; -.Ed -.Pp -The field -.Fa b_buf -points to the begin of a memory block that is used to store the actual message -and the field -.Fa b_lim -points just to the first byte behind that buffer. This buffer is allocated -separate from the structure itself and the user calling any of the above -functions with a non const -.Vt struct uni_msg -argument should expect the buffer to be reallocated and hence not hold pointers -into the buffer accross call to these functions. -The pointer -.Fa b_rptr -points to the first used byte in the message and -.Fa b_wptr -to the first unused byte behind all used bytes. -If the message is empty, both pointers point to the same place somewhere in -the allocated buffer. -.Pp -There are several functions and macros that return various sizes and lengths. -The macro -.Fn uni_msg_len -returns the actual size of the message (the number of used bytes). The -macro -.Fn uni_msg_space -returns the number of bytes that are left unused behind the used space. -The macro -.Fn uni_msg_leading -returns the number of bytes that are unused before the used space and the -macro -.Fn uni_msg_size -returns the maximum size of the message (that is the size of the allocated -buffer). -.Pp -Two functions may be used to create new messages: The function -.Fn uni_msg_alloc -allocates the message structure and a buffer to hold at least -.Ar space -bytes (In fact it allocates a couple of bytes more). If the allocation fails -NULL is returned. The pointers are setup so that there is no leading space -in the buffer. -The function -.Fn uni_msg_build -constructs a new message from a variable number of buffers. The arguments -are pairs of -.Vt void * -pointers to buffers and -.Vt size_t -buffer sizes, terminated by a NULL pointer. The function computes the total -resulting message size, allocates a message and copies all the buffers -into the message. The message is built to have no leading space. If the -allocation fails, NULL is returned. -.Pp -The function -.Fn uni_msg_destroy -deallocates the buffer pointed to by the message and the message itself. -It is save to pass a message with a NULL buffer, but not a NULL message. -.Pp -The function -.Fn uni_msg_dup -returns a copy of a message with exact the same leading space. -.Pp -A number of functions are used to add bytes to an existing message. -The function -.Fn uni_msg_extend -extends the message buffer to have space for at least -.Ar bytes -additional byte at the end. The leading space does not change. This function -may reallocate the message buffer. The function returns 0 on success and ENOMEM -if the reallocation fails. In this case the message buffer is not changed. -The macro -.Fn uni_msg_ensure -checks whether the message has space for additional -.Ar bytes -bytes. If not it calls -.Fn uni_msg_extend -to make the message buffer larger. The macro returns 0 on success or ENOMEM -if there is not enough space and the reallocation fails. -In this case the message buffer is not changed. -The function -.Fn uni_msg_append -appends -.Ar buflen -bytes from the buffer pointed to by -.Ar buf -to the message. -The function -.Fn uni_msg_append8 -appends one byte to the message and the function -.Fn uni_msg_append32 -appends a 32-bit value in network byte order to the message ( -.Fa b_wptr -needs not to be aligned). All three functions call -.Fn uni_msg_ensure -to make sure, that the buffer contents fit into the message. They -return 0 on success and ENOMEM if the buffer is too small and the reallocation -fails. In this case the message buffer is not changed. -.Pp -A number of functions can be used to retrieve parts of the message. -The function -.Fn uni_msg_strip32 -returns the last four bytes of the message as a 32-bit integer assumed to -be in network byte order. It adjusts -.Fa b_wptr -to remove these four bytes from the message. -.Fa b_wptr -does not need to be aligned. -The function -.Fn uni_msg_get32 -returns the first four bytes of the message as a 32-bit integer assumed to -be in network byte order. It adjusts -.Fa b_rptr -to remove these four bytes from the message. -.Fa b_rptr -does not need to be aligned. -The function -.Fn uni_msg_trail32 -returns the -.Fa n 'th -32-bit integer from the buffer counted from the end of the buffer. The -integer is assumed to be in network byte order. A value of -1 for -.Fa n -returns the last four bytes of the buffer, a value of -2 the four bytes -just before the last four bytes and so on. All three functions do not check -that the message is large enough. -.Sh SEE ALSO -.Xr libunimsg 3 , -.Xr mbuf 9 -.Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org diff --git a/contrib/ngatm/man/unisap.3 b/contrib/ngatm/man/unisap.3 deleted file mode 100644 index ebec7edd7c19..000000000000 --- a/contrib/ngatm/man/unisap.3 +++ /dev/null @@ -1,255 +0,0 @@ -.\" -.\" Copyright (c) 2001-2003 -.\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). -.\" All rights reserved. -.\" -.\" Redistribution 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 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 IS PROVIDED BY THE AUTHOR AND 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 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. -.\" -.\" Author: Hartmut Brandt <harti@freebsd.org> -.\" -.\" $Begemot: libunimsg/man/unisap.3,v 1.2 2003/08/21 16:01:08 hbb Exp $ -.\" -.Dd August 23, 2002 -.Dt unisap 3 -.Os -.Sh NAME -.Nm unimsg , -.Nm unisve_check_addr , -.Nm unisve_check_selector , -.Nm unisve_check_blli_id2 , -.Nm unisve_check_blli_id3 , -.Nm unisve_check_bhli , -.Nm unisve_check_sap , -.Nm unisve_overlap_addr , -.Nm unisve_overlap_selector , -.Nm unisve_overlap_blli_id2 , -.Nm unisve_overlap_blli_id3 , -.Nm unisve_overlap_bhli , -.Nm unisve_overlap_sap , -.Nm unisve_is_catchall , -.Nm unisve_match -.Nd "ATM signalling library - ATM SAP handling" -.Sh LIBRARY -Begemot ATM signalling library -.Pq libunimsg, -lunimsg -.Sh SYNOPSIS -.In uni4/unisap.h -.Ft int -.Fn unisve_check_addr "const struct unisve_addr *sve" -.Ft int -.Fn unisve_check_selector "const struct unisve_selector *sve" -.Ft int -.Fn unisve_check_blli_id2 "const struct unisve_blli_id2 *sve" -.Ft int -.Fn unisve_check_blli_id3 "const struct unisve_blli_id3 *sve" -.Ft int -.Fn unisve_check_bhli "const struct unisve_bhli *sve" -.Ft int -.Fn unisve_check_sap "const struct uni_sap *sve" -.Ft int -.Fn unisve_overlap_addr "const struct unisve_addr *sve1" "const struct unisve_addr *sve2" -.Ft int -.Fn unisve_overlap_selector "const struct unisve_selector *sve1" "const struct unisve_selector *sve2" -.Ft int -.Fn unisve_overlap_blli_id2 "const struct unisve_blli_id2 *sve1" "const struct unisve_blli_id2 *sve2" -.Ft int -.Fn unisve_overlap_blli_id3 "const struct unisve_blli_id3 *sve1" "const struct unisve_blli_id3 *sve2" -.Ft int -.Fn unisve_overlap_bhli "const struct unisve_bhli *sve1" "const struct unisve_bhli *sve2" -.Ft int -.Fn unisve_overlap_sap "const struct uni_sap *sap1" "const struct uni_sap *sap2" -.Ft int -.Fn unisve_is_catchall "const struct uni_sap *sap" -.Ft int -.Fn unisve_match "const struct uni_sap *sap" \ -"const struct uni_ie_called *called" "const struct uni_ie_blli *blli" \ -"const struct uni_ie_bhli *bhli" -.Sh DESCRIPTION -The -.Nm -library contains functions to handle Service Access Points (SAP) and SAP Vector -Elements (SVE) as specified in the ATM Forum ATM API Semantic Description. -SAPs are the analog of TCP and UDP ports in the ATM world. As usually in ATM -they are a couple of orders of magnitude more complex as their Internet -equivalent. See the ATM Forum document for a description. -.Pp -A SAP is a data structure: -.Bd -literal -offset indent -struct uni_sap { - struct unisve_addr addr; - struct unisve_selector selector; - struct unisve_blli_id2 blli_id2; - struct unisve_blli_id3 blli_id3; - struct unisve_bhli bhli; -}; -.Ed -.Pp -that consists of 5 elements matching different information elements in -the SETUP message. Each of these elements has a tag that defines how -the SVE is to be matched with the information element. The tag is one of -.Bl -tag -widht ".It Dv UNISVE_PRESENT" -.It Dv UNISVE_ABSENT -The information element has to absent from the SETUP message. -.It Dv UNISVE_PRESENT -The information element has to be present in the SETUP message and must -match the SVE. -.It Dv UNISVE_ANY -The information element may be absent from the SETUP message or may -have any value. -.El -.Pp -The called address is matched by a -.Bd -literal -offset indent -struct unisve_addr { - enum unisve_tag tag; - enum uni_addr_type type;/* type of address */ - enum uni_addr_plan plan;/* addressing plan */ - u_int32_t len; /* length of address */ - u_char addr[UNI_ADDR_MAXLEN]; -}; -.Ed -.Pp -Here -.Fa type -is the type of address and -.Fa plan -is the address plan. -.Fa len -is the length of the address (for ATME addresses not counting the selector byte) -and -.Fa addr is the address itself. -.Pp -In case of ATME addresses the selector byte is matched by a -.Bd -literal -offset indent -struct unisve_selector { - enum unisve_tag tag; - u_int8_t selector; -}; -.Ed -.Pp -Here -.Fa selector -is the selector byte that must match the 20th byte of the ATME calling address -from the SETUP message. -.Pp -The BLLI information element is matched by two SVEs: one for layer 2 options -and one for layer 3 options. The layer 2 SVE is: -.Bd -literal -offset indent -struct unisve_blli_id2 { - enum unisve_tag tag; - u_int8_t proto:5;/* the protocol */ - u_int8_t user:7; /* user specific protocol */ -}; -.Ed -.Pp -Where the -.Fa user -fields is matched only if the -.Fa proto -field specifies -.Dv UNI_BLLI_L2_USER . -The layer 3 SVE is: -.Bd -literal -offset indent -struct unisve_blli_id3 { - enum unisve_tag tag; - u_int8_t proto:5;/* L3 protocol */ - u_int8_t user:7; /* user specific protocol */ - u_int8_t ipi:8; /* ISO/IEC TR 9557 IPI */ - u_int32_t oui:24; /* IEEE 802.1 OUI */ - u_int32_t pid:16; /* IEEE 802.1 PID */ - u_int32_t noipi; /* ISO/IEC TR 9557 per frame */ -}; -.Ed -For the exact rules how matching occures refer to the source code or the -ATM Forum document. -.Pp -Finally the BHLI information element is matched with a -.Bd -literal -offset indent -struct unisve_bhli { - enum unisve_tag tag; - enum uni_bhli type; /* type of info */ - u_int32_t len; /* length of info */ - u_int8_t info[8];/* info itself */ -}; -.Ed -.Pp -For each SVE type there is a function that checks whether the SVE is correct -specified. The functions -.Fn unisve_check_addr , -.Fn unisve_check_selector , -.Fn unisve_check_blli_id2 , -.Fn unisve_check_blli_id3 , -and -.Fn unisve_check_bhli -return one of the following error codes: -.Bd -literal -offset indent -enum { - UNISVE_OK = 0, - UNISVE_ERROR_BAD_TAG, - UNISVE_ERROR_TYPE_PLAN_CONFLICT, - UNISVE_ERROR_ADDR_SEL_CONFLICT, - UNISVE_ERROR_ADDR_LEN, - UNISVE_ERROR_BAD_ADDR_TYPE, - UNISVE_ERROR_BAD_BHLI_TYPE, - UNISVE_ERROR_BAD_BHLI_LEN, -}; -.Ed -.Pp -A code of -.Li UNISVE_OK -means that the SVE has no error. -The function -.Fn unisve_check_sap -checks a complete SAP and returns one of the above codes. -.Pp -There is a definition -.Dv UNISVE_ERRSTR -that evaluates to a comma separated list of strings that can be used -to initializes an array of char pointers to map the error codes into -human readable strings. -.Pp -The ATM Forum document defines the concept of overlaping SAPs. This basically -means, that an incoming SETUP could match more than one SAP (and more than -one application) to receive the SETUP. For each SVE type there is a function -that checks whether two SVEs overlap and there is a function that checks whether -two SAPs overlap. The functions -.Fn unisve_overlap_addr , -.Fn unisve_overlap_selector , -.Fn unisve_overlap_blli_id2 , -.Fn unisve_overlap_blli_id3 , -.Fn unisve_overlap_bhli , and -.Fn unisve_overlap_sap -return 1 if the SVEs or SAPs overlap and 0 if they do not. They assume, that -the SAPs are correct. -.Pp -The ATM Forum document specifies a catch-all SAP. The function -.Fn unisve_is_catchall -returns 1 if the SAP is the catch-all SAP and 0 otherwise. -.Pp -Finally the function -.Fn unisve_match -is used to match a SAP against the information elements from a SETUP message. -It returns 1 if they match and 0 otherwise. -.Sh SEE ALSO -.Xr libunimsg 3 , -.Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org diff --git a/contrib/ngatm/man/unistruct.3 b/contrib/ngatm/man/unistruct.3 deleted file mode 100644 index 6f7a651c9fd1..000000000000 --- a/contrib/ngatm/man/unistruct.3 +++ /dev/null @@ -1,320 +0,0 @@ -.\" -.\" Copyright (c) 2001-2003 -.\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). -.\" All rights reserved. -.\" -.\" Author: Hartmut Brandt <harti@freebsd.org> -.\" -.\" Redistribution 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 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 IS PROVIDED BY THE AUTHOR AND 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 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/man/unistruct.3,v 1.3 2004/07/08 08:21:43 brandt Exp $ -.\" -.Dd October 30, 2003 -.Dt unistruct 3 -.Os -.Sh NAME -.Nm libngatm -.Nd "ATM signalling library" -.Sh LIBRARY -Begemot ATM signalling library -.Pq libngatm, -lngatm -.Sh SYNOPSIS -.In netnatm/msg/unistruct.h -.In netnatm/msg/unimsglib.h -.Sh DESCRIPTION -The -.Nm -library handles UNI 4.0 messages. -For each information element and message -type the header files contain a structure definition. -Additionally there -are a number of help structures and a global context structure for some -of the library functions. -This document only describes the common structures. -For information element and message structures see the header files. -.Ss LIBRARY CONFIGURATION -When the library is compiled a number of constants are define in the file -.Pa uni_config.h . -They define certain limits. -Because of the use of these definitions a change -in any of them requires a complete recompilation of all library code and -all code that uses the library. -The following constants are defined (they -value behind the name is the default value): -.Bl -tag -width XXXX -.It Dv UNI_MAX_ERRIE ( Li 50 ) -When decoding information elements and analyzing them the library fills -an array in the context with the identifiers of IEs that had errors. -This is the size of this array. -.It Dv UNI_NUM_IE_GIT ( Li 3 ) -A message is allowed to contain more than one General Identifier Transport -information element. -This is the maximum supported number of these IEs. -.It Dv UNI_NUM_IE_BLLI ( Li 3 ) -The maximum number of BLLI information elements in a SETUP message. -.It Dv UNI_NUM_IE_CALLEDSUB ( Li 2 ) -The maximum number of Called Subaddress information elements in a SETUP message. -.It Dv UNI_NUM_IE_CALLINGSUB ( Li 2 ) -The maximum number of Calling Subaddress information elements in a SETUP -message. -.It Dv UNI_NUM_IE_TNS ( Li 4 ) -The maximum number of Transit Network Selection information elements in a SETUP -message. -.It Dv UNI_TNS_MAXLEN ( Li 4 ) -The maximum size of a name in the TNS IE. -.It Dv UNI_UU_MAXLEN ( Li 128 ) -Maximum size of user data in the UU IE. -.It Dv UNI_ADDR_MAXLEN ( Li 20 ) -Maximum address size. -.It Dv UNI_SUBADDR_MAXLEN ( Li 20 ) -Maximum subaddress size. -.It Dv UNI_NUM_IE_DTL ( Li 10 ) -Maximum number of DTL information elements in a SETUP message. -.It Dv UNI_DTL_MAXNUM ( Li 20 ) -Maximum number of identifiers in one DTL information element. -.El -.Ss INFORMATION ELEMENTS -Each information element structure starts with a field of type: -.Bd -literal -offset indent -struct uni_iehdr { - enum uni_coding coding; /* coding standard */ - enum uni_ieact act; /* action indicator */ - u_int pass:1; /* PNNI pass along request */ - u_int present;/* which optional elements are present */ -}; -.Ed -.Pp -The -.Fa coding -field is the coding standard of the information element and may be one of -.Dv UNI_CODING_ITU -or -.Dv UNI_CODING_NET . -The action indicator -.Fa act -is used for error processing and is one of: -.Bl -tag -width XXXX -.It Dv UNI_IEACT_CLEAR -clear call -.It Dv UNI_IEACT_IGNORE -ignore IE and proceed -.It Dv UNI_IEACT_REPORT -ignore IE, report and proceed -.It Dv UNI_IEACT_MSG_IGNORE -ignore message -.It Dv UNI_IEACT_MSG_REPORT -ignore message and report -.It Dv UNI_IEACT_DEFAULT -the use action indicator flag was not set. -.El -.Pp -For information elements in PNNI message the -.Fa pass -fields contains the pass along flag from the IE header. -.Pp -The -.Fa present -field is a bit field, which contains four common bits describing the current -state of the information element. -The rest of the bits are used by the -information elements to indicate which of the optional fields of the IE are -present. -Most of the IE header files contain definitions for those bits. -The common bits are: -.Bd -literal -offset indent -#define UNI_IE_EMPTY 0x80000000 -#define UNI_IE_PRESENT 0x40000000 -#define UNI_IE_ERROR 0x20000000 -#define UNI_IE_XXX 0x10000000 -.Ed -.Pp -The flag -.Dv UNI_IE_EMPTY -indicates that the information element is present, but empty (its length is -zero). -This is legal for all information elements. -The flag -.Dv UNI_IE_PRESENT -indicates that the IE is present in the message and the flag -.Dv UNI_IE_ERROR -indicates that the IE had an error. -The flag -.Dv UNI_IE_XXX -is currently not used. -.Pp -The following macros may be used to test or change these flags: -.Bl -tag -width XXXX -.It Dv IE_ISPRESENT -Check whether the IE is present and not empty. -Returns true in this case. -.It Dv IE_SETPRESENT -Set the IE to be present and not empty. -.It Dv IE_ISEMPTY -Check whether the IE is present and empty. -Returns true in this case. -.It Dv IE_SETEMPTY -Set the IE to be present and empty. -.It Dv IE_ISERROR -Check whether the IE is present and has an error. -Returns true in this case. -.It Dv IE_SETERROR -Sets the IE to be present and to have an error. -.It Dv IE_ISGOOD -Checks whether the IE is present, not empty and without error. -Returns true in this case. -.El -.Pp -For each IE type there is an -.Vt enum uni_ietype -definition of the form -.Dv UNI_IE_* -in -.Pa uni_hdr.h . -.Pp -.Pa unistruct.h -contains a -.Vt union uni_ieall -that is the union of all IE structures and a -.Bd -literal -offset indent -struct uni_ie { - enum uni_ietype ietype; - union uni_ieall u; -}; -.Ed -.Ss MESSAGES -Each message structure starts with a -.Bd -literal -offset indent -struct uni_msghdr { - struct uni_cref cref; - enum uni_msgact act; /* action indicator */ - u_int pass:1; /* PNNI pass along request */ -}; -.Ed -.Pp -The -.Fa cref -is the call reference: -.Bd -literal -offset indent -struct uni_cref { - u_int flag; - u_int cref; -}; -.Ed -.Pp -There are two special call references: -.Dv CREF_GLOBAL -and -.Dv CREF_DUMMY . -The -.Fa act -field is the message action indicator and has one of the following values: -.Bl -tag -width XXXX -.It Dv UNI_MSGACT_CLEAR -clear call -.It Dv UNI_MSGACT_IGNORE -ignore message -.It Dv UNI_MSGACT_REPORT -send STATUS message -.It Dv UNI_MSGACT_DEFAULT -default handling for this message type -.El -.Pp -The -.Fa pass -field is the pass along indicator in the case of PNNI messages. -.Pp -For each message type there is a -.Vt enum uni_msgtype -definition of the form -.Dv UNI_* -in -.Pa uni_hdr.h . -.Pa uni_struct.h -contains a -.Vt union_msgall -that is the union of all message structures and a -.Bd -literal -offset indent -struct uni_all { - enum uni_msgtype mtype; - union uni_msgall u; -}; -.Ed -.Ss CONTEXTS -The header file -.Pa unimsglib.h -contains a definition of a -.Vt struct uni_context -that is used to minimize the number of arguments passed to certain functions -and to avoid the use of global variables. -This structure has the following -public fields (all other fields are used internally by the library): -.Bl -tag -width XXXX -.It Fa err -This is an array consisting of the following structures: -.Bd -literal -offset indent -struct uni_ierr { - enum uni_ierr_type err; /* what error */ - enum uni_ieact act; /* the action indicator */ - u_int ie:8; /* the ie type */ - u_int man:1; /* mandatory flag */ - u_int epref:1;/* Q.2971 9.5.3.2.1 low-pri epref */ -}; -.Ed -When decoding information elements the information about IEs with errors is -stuffed into this array. -.It Fa errcnt -The current number of IEs in -.Fa err . -.It Fa q2932 -Enable the Q.2932.1 Generic Functional Protocol. -Currently only message -and IE decoding/encoding is supported. -The signalling part is still missing. -.It Fa pnni -Enable PNNI extensions. -Currently only message and IE decoding/encoding -is supported. -The signalling part is still missing. -.It Fa git_hard -Do hard checking on GIT information elements. -.It Fa bearer_hard -Do hard checking on Broadband Bearer IEs. -This involves rejecting old bearer -type values. -.It Fa cause_hard -Do hard checking on Cause information elements. -.It Fa multiline -This is used by the printing routines. -Legal values are 0 to 4 and give -different kinds of printout. -.It Fa tabsiz -The size of tabulation to use in printing. -4 is a good value. -.El -.Sh SEE ALSO -.Xr libunimsg 3 , -.Sh STANDARDS -This implementation conforms to the applicable ITU-T -recommendations and ATM Forum standards with the exception of some limitations -(see the Configuration section). -.Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org diff --git a/contrib/ngatm/snmp_atm/BEGEMOT-ATM.txt b/contrib/ngatm/snmp_atm/BEGEMOT-ATM.txt deleted file mode 100644 index f6cca9615e2c..000000000000 --- a/contrib/ngatm/snmp_atm/BEGEMOT-ATM.txt +++ /dev/null @@ -1,301 +0,0 @@ --- --- Copyright (c) 2001-2002 --- Fraunhofer Institute for Open Communication Systems (FhG Fokus). --- All rights reserved. --- Copyright (c) 2004 --- Hartmut Brandt. --- All rights reserved. --- --- Author: Hartmut Brandt <harti@freebsd.org> --- --- Redistribution 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 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 IS PROVIDED BY AUTHOR AND 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 AUTHOR OR 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/snmp_atm/BEGEMOT-ATM.txt,v 1.2 2004/08/06 14:50:26 brandt Exp $ --- --- Private Begemot MIB for ATM interfaces. --- -BEGEMOT-ATM-MIB DEFINITIONS ::= BEGIN - -IMPORTS - MODULE-IDENTITY, OBJECT-TYPE, Unsigned32, TimeTicks - FROM SNMPv2-SMI - TEXTUAL-CONVENTION, DisplayString - FROM SNMPv2-TC - ifIndex - FROM IF-MIB - begemot - FROM BEGEMOT-MIB; - -begemotAtm MODULE-IDENTITY - LAST-UPDATED "200407190000Z" - ORGANIZATION "German Aerospace Centre" - CONTACT-INFO - " Hartmut Brandt - - Postal: German Aerospace Centre (DLR) - Institute of Communications and Navigation - 82234 Wessling - Germany - - Fax: +49 8153 28 2844 - - E-mail: harti@freebsd.org" - DESCRIPTION - "The Begemot MIB for ATM interfaces." - - ::= { begemot 101 } - -begemotAtmObjects OBJECT IDENTIFIER ::= { begemotAtm 1 } - --- -------------------------------------------------------------------------- - -AtmESI ::= TEXTUAL-CONVENTION - DISPLAY-HINT "1x:" - STATUS current - DESCRIPTION - "An ATM End System Identifier. This is basically the same as - an Ethernet Address and is assigned using the same rules." - SYNTAX OCTET STRING (SIZE(6)) - --- -------------------------------------------------------------------------- - --- --- Interfaces table --- -begemotAtmIfTable OBJECT-TYPE - SYNTAX SEQUENCE OF BegemotAtmIfEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "This table contains an entry for each hardware ATM - interface. The table is indexed by the interface index." - ::= { begemotAtmObjects 1 } - -begemotAtmIfEntry OBJECT-TYPE - SYNTAX BegemotAtmIfEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "This is a table entry describing one ATM hardware interface." - INDEX { ifIndex } - ::= { begemotAtmIfTable 1 } - -BegemotAtmIfEntry ::= SEQUENCE { - begemotAtmIfName DisplayString, - begemotAtmIfPcr Unsigned32, - begemotAtmIfMedia INTEGER, - begemotAtmIfVpiBits Unsigned32, - begemotAtmIfVciBits Unsigned32, - begemotAtmIfMaxVpcs Unsigned32, - begemotAtmIfMaxVccs Unsigned32, - begemotAtmIfEsi AtmESI, - begemotAtmIfCarrierStatus INTEGER, - begemotAtmIfMode INTEGER -} - -begemotAtmIfName OBJECT-TYPE - SYNTAX DisplayString (SIZE(1..15)) - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "Name of the ATM interface." - ::= { begemotAtmIfEntry 1 } - -begemotAtmIfPcr OBJECT-TYPE - SYNTAX Unsigned32 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The line cell rate of the interface." - ::= { begemotAtmIfEntry 2 } - -begemotAtmIfMedia OBJECT-TYPE - SYNTAX INTEGER { - other(1), - unknown(3), - utp25(4), - taxi100(5), - taxi140(6), - mm155(7), - sm155(8), - utp155(9), - mm622(10), - sm622(11), - virtual(12) - } - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The physical medium." - ::= { begemotAtmIfEntry 3 } - -begemotAtmIfVpiBits OBJECT-TYPE - SYNTAX Unsigned32 (0..12) - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "Number of VPI bits that are used by the device." - ::= { begemotAtmIfEntry 4 } - -begemotAtmIfVciBits OBJECT-TYPE - SYNTAX Unsigned32 (0..16) - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "Number of VCI bits that are used by the device." - ::= { begemotAtmIfEntry 5 } - -begemotAtmIfMaxVpcs OBJECT-TYPE - SYNTAX Unsigned32 (0..256) - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The maximum number of VPC supported on this device. This may not - be larger than 2^begemotAtmIfVpiBits." - ::= { begemotAtmIfEntry 6 } - -begemotAtmIfMaxVccs OBJECT-TYPE - SYNTAX Unsigned32 (0..16777216) - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The maximum number of VCC supported on this device. This may not - be larger than 2^(begemotAtmIfVpiBits + begemotAtmVciBits)." - ::= { begemotAtmIfEntry 7 } - -begemotAtmIfEsi OBJECT-TYPE - SYNTAX AtmESI - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The default End System Identifier as reported by the hardware. - If the hardware has no ESI all six bytes are reported as 0." - ::= { begemotAtmIfEntry 8 } - -begemotAtmIfCarrierStatus OBJECT-TYPE - SYNTAX INTEGER { carrierOn(1), carrierOff(2), unknown(3), none(4) } - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The state of the carrier. For interfaces which don't have the - notion of a carriere none is reported." - ::= { begemotAtmIfEntry 9 } - -begemotAtmIfMode OBJECT-TYPE - SYNTAX INTEGER { sonet(1), sdh(2), unknown(3) } - MAX-ACCESS read-write - STATUS current - DESCRIPTION - "The mode of the SUNI interface. For interfaces without SUNI - unknown is reported in which case the variable is read-only. - Some types of interfaces may not be able to change this value." - ::= { begemotAtmIfEntry 10 } - -begemotAtmIfTableLastChange OBJECT-TYPE - SYNTAX TimeTicks - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The value of sysUpTime the last time that an entry in - begemotIfTable was created or destroyed. If the table is - unchanged since the last coldStart this value is zero." - ::= { begemotAtmObjects 2 } - --- --- Interface hardware table --- -begemotAtmHWTable OBJECT-TYPE - SYNTAX SEQUENCE OF BegemotAtmHWEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "This table augments the begemotAtmIfTable and contains an entry - for each hardware ATM interface. The entries describe the - ATM hardware interface." - ::= { begemotAtmObjects 3 } - -begemotAtmHWEntry OBJECT-TYPE - SYNTAX BegemotAtmHWEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "This is a table entry describing one ATM hardware interface." - AUGMENTS { begemotAtmIfEntry } - ::= { begemotAtmHWTable 1 } - -BegemotAtmHWEntry ::= SEQUENCE { - begemotAtmHWVendor DisplayString, - begemotAtmHWDevice DisplayString, - begemotAtmHWSerial Unsigned32, - begemotAtmHWVersion Unsigned32, - begemotAtmHWSoftVersion Unsigned32 -} - -begemotAtmHWVendor OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "A short string naming the vendor of the interface card." - ::= { begemotAtmHWEntry 1 } - -begemotAtmHWDevice OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "A short string naming the brand of the interface card." - ::= { begemotAtmHWEntry 2 } - -begemotAtmHWSerial OBJECT-TYPE - SYNTAX Unsigned32 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The serial number of the interface card or 0 if it doesn't - report a serial number." - ::= { begemotAtmHWEntry 3 } - -begemotAtmHWVersion OBJECT-TYPE - SYNTAX Unsigned32 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The hardware version of the interface card or 0 if it doesn't - report a hardware version number." - ::= { begemotAtmHWEntry 4 } - -begemotAtmHWSoftVersion OBJECT-TYPE - SYNTAX Unsigned32 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The firmware version of the interface card or 0 if it doesn't - report a firmware version number." - ::= { begemotAtmHWEntry 5 } - --- -------------------------------------------------------------------- - --- System specific parts -begemotAtmSysGroup OBJECT IDENTIFIER ::= { begemotAtmObjects 4 } - -END diff --git a/contrib/ngatm/snmp_atm/atm.h b/contrib/ngatm/snmp_atm/atm.h deleted file mode 100644 index 0df6f7e3eaec..000000000000 --- a/contrib/ngatm/snmp_atm/atm.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2004 - * Deutsches Zentrum fuer Luft- und Raumfahrt. - * All rights reserved. - * - * Author: Hartmut Brandt <harti@freebsd.org> - * - * Redistribution 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 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 IS PROVIDED BY AUTHOR AND 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 AUTHOR OR 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/snmp_atm/atm.h,v 1.2 2004/08/11 07:55:22 brandt Exp $ - */ - -#include <sys/types.h> -#include <sys/queue.h> -#include <sys/socket.h> - -#include <net/if.h> -#include <net/if_mib.h> - -#include <bsnmp/snmpmod.h> -#include <bsnmp/snmp_mibII.h> -#include "snmp_atm.h" - -/* - * Event registrations - */ -struct atmif_reg { - TAILQ_ENTRY(atmif_reg) link; - void *data; - atmif_event_f func; - const struct lmodule *mod; - struct atmif_priv *aif; /* back pointer */ -}; -TAILQ_HEAD(atmif_reg_list, atmif_reg); - -/* - * Interface data - */ -struct atmif_priv { - struct atmif pub; /* public part, must be first */ - TAILQ_ENTRY(atmif_priv) link; - u_int index; /* if_index */ - void *ifpreg; - struct atmif_sys *sys; - struct atmif_reg_list notify; -}; -TAILQ_HEAD(atmif_list, atmif_priv); - -/* list of all (known) ATM interfaces */ -extern struct atmif_list atmif_list; - -extern struct lmodule *module; - -/* Check the carrier state of the interface */ -void atmif_check_carrier(struct atmif_priv *); - -/* Send notification to all listeners. */ -void atmif_send_notification(struct atmif_priv *, enum atmif_notify, uintptr_t); - -/* Get the interface point for a table access */ -int atmif_get_aif(struct snmp_value *, u_int, enum snmp_op, - struct atmif_priv **); - -/* Destroy system dependend stuff. */ -void atmif_sys_destroy(struct atmif_priv *); - -/* Attach to an ATM interface */ -int atmif_sys_attach_if(struct atmif_priv *); - -/* Get vendor string */ -int atm_sys_get_hw_vendor(struct atmif_priv *, struct snmp_value *); - -/* Get device string */ -int atm_sys_get_hw_device(struct atmif_priv *, struct snmp_value *); - -/* Extract the ATM MIB from the interface's private MIB */ -void atmif_sys_fill_mib(struct atmif_priv *); diff --git a/contrib/ngatm/snmp_atm/atm_tree.def b/contrib/ngatm/snmp_atm/atm_tree.def deleted file mode 100644 index ac70b0e7ee22..000000000000 --- a/contrib/ngatm/snmp_atm/atm_tree.def +++ /dev/null @@ -1,75 +0,0 @@ -# -# Copyright (c) 2000-2003 -# Fraunhofer Institut for Open Communication Systems (FOKUS). -# All rights reserved. -# Copyright (c) 2004 -# Hartmut Brandt. -# All rights reserved. -# -# Author: Hartmut Brandt <harti@freebsd.org> -# -# Redistribution 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 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 IS PROVIDED BY AUTHOR AND 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 AUTHOR OR 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/snmp_atm/atm_tree.def,v 1.3 2004/08/06 14:50:27 brandt Exp $ -# -# SNMP module for ATM hardware interfaces. -# -# $Begemot: libunimsg/snmp_atm/atm_tree.def,v 1.3 2004/08/06 14:50:27 brandt Exp $ -# -(1 internet - (4 private - (1 enterprises - (12325 fokus - (1 begemot - (101 begemotAtm - (1 begemotAtmObjects - (1 begemotAtmIfTable - (1 begemotAtmIfEntry : INTEGER op_atmif - (1 begemotAtmIfName OCTETSTRING GET) - (2 begemotAtmIfPcr UNSIGNED32 GET) - (3 begemotAtmIfMedia INTEGER GET) - (4 begemotAtmIfVpiBits UNSIGNED32 GET) - (5 begemotAtmIfVciBits UNSIGNED32 GET) - (6 begemotAtmIfMaxVpcs UNSIGNED32 GET) - (7 begemotAtmIfMaxVccs UNSIGNED32 GET) - (8 begemotAtmIfEsi OCTETSTRING GET) - (9 begemotAtmIfCarrierStatus INTEGER GET) - (10 begemotAtmIfMode INTEGER GET SET) - )) - (2 begemotAtmIfTableLastChange TIMETICKS op_atm GET) - (3 begemotAtmHWTable - (1 begemotAtmHWEntry : INTEGER op_atmhw - (1 begemotAtmHWVendor OCTETSTRING GET) - (2 begemotAtmHWDevice OCTETSTRING GET) - (3 begemotAtmHWSerial UNSIGNED32 GET) - (4 begemotAtmHWVersion UNSIGNED32 GET) - (5 begemotAtmHWSoftVersion UNSIGNED32 GET) - )) - (4 begemotAtmSysGroup - (1 begemotAtmFreeBSDGroup - ) - ) - ) - )) - ) - ) -)) diff --git a/contrib/ngatm/snmp_atm/snmp_atm.3 b/contrib/ngatm/snmp_atm/snmp_atm.3 deleted file mode 100644 index 7fe2f4663975..000000000000 --- a/contrib/ngatm/snmp_atm/snmp_atm.3 +++ /dev/null @@ -1,217 +0,0 @@ -.\" -.\" Copyright (c) 2001-2002 -.\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). -.\" All rights reserved. -.\" Copyright (c) 2003-2004 -.\" Hartmut Brandt. -.\" All rights reserved. -.\" -.\" Author: Hartmut Brandt <harti@freebsd.org> -.\" -.\" Redistribution 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 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 IS PROVIDED BY AUTHOR AND 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 AUTHOR OR 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/snmp_atm/snmp_atm.3,v 1.1 2004/07/20 16:30:03 brandt Exp $ -.\" -.Dd July 20, 2004 -.Dt snmp_atm 3 -.Os -.Sh NAME -.Nm atmif_event_f , -.Nm atm_find_if_name , -.Nm atm_find_if , -.Nm atm_notify_aif , -.Nm atm_unnotify_aif -.Nd "ATM driver module for snmpd. -.Sh LIBRARY -.Pq begemotSnmpdModulePath."netgraph" = "@MODPATH@snmp_netgraph.so" (FreeBSD) -.Pq begemotSnmpdModulePath."mibII" = "@MODPATH@snmp_mibII.so" -.Pq begemotSnmpdModulePath."atm" = "@MODPATH@snmp_atm.so" -.Sh SYNOPSIS -.In bsnmp/snmpmod.h -.In bsnmp/snmp_mibII.h -.In bsnmp/snmp_atm.h -.Ft typedef void -.Fn (*atmif_event_f) "struct atmif *aif" "enum atmif_notify event" "uintptr_t data" "void *uarg" -.Ft struct atmif * -.Fn atm_find_if_name "const char *name" -.Ft struct atmif * -.Fn atm_find_if "u_int ifindex" -.Ft void * -.Fn atm_notify_aif "struct atmif *aif" "const struct lmodule *mod" "atmif_event_f func" "void *uarg" -.Ft void -.Fn atm_unnotify_aif "void *not" -.Sh DESCRIPTION -The -.Nm snmp_atm -module implements a number of tables and scalars that enable remote access to -the ATM devices in the system. It also exports a number of -functions, that allow other modules to easily access ATM devices. -.Pp -The module maintains an extension to the interface structure exported by -.Xr snmp_mibII 3 -for all ATM devices. This structure has the following fields: -.Bd -literal -offset indent -struct atmif { - struct mibif *ifp; /* common interface data */ - struct atmif_mib *mib; /* ATM MIB */ - enum atmif_carrier_state carrier; - enum atmif_suni_mode mode; /* SUNI mode SDH or SONET */ -}; -.Ed -.Pp -The fields have the following meaning: -.Bl -tag -width XXX -.It Fa ifp -The field points to the -.Xr snmp_mibII 3 -interface structure. -.It Fa mib -The special ATM interface MIB (see below). -.It Fa carrier -The current state of the carrier. One of the following: -.Bl -tag -width XXX -.It Dv ATMIF_CARRIER_ON -carrier detected, -.It Dv ATMIF_CARRIER_OFF -no carrier, -.It Dv ATMIF_CARRIER_UNKNOWN -the state of the carrier is unknown, -.It Dv ATMIF_CARRIER_NONE -the device has no notion of carrier or is not able to sense it. -.El -.It Fa mode -For ATM devices with a SUNI chip this is the current mode of the interface: -.Bl -tag -width XXX -.It Dv ATMIF_SUNI_MODE_SONET -The interface is in SONET mode. -.It Dv ATMIF_SUNI_MODE_SDH -The interface is in SDH mode. -.It Dv ATMIF_SUNI_MODE_UNKNOWN -The interface either has no SUNI interface or the mode is unknown (for example, -interface is down). -.El -.El -.Pp -An ATM interface can be found by name or by SNMP interface index (see -.Xr snmp_mibII 3 -for a discussion of interface indexes). -The function -.Fn atm_find_if_name -searches an interface given a name. -The function -.Fn atm_find_if -searches an interface by its interface index. -Both functions return NULL if an interface cannot be found. -.Pp -The ATM MIB contains the following fields: -.Bd -literal -offset indent -struct atmif_mib { - u_int version; /* currently 0 */ - - u_int device; /* type of hardware (system specific) */ - u_int serial; /* card serial number (device specific) */ - u_int hw_version; /* card version (device specific) */ - u_int sw_version; /* firmware version (device specific) */ - u_int media; /* physical media (see MIB) */ - - u_char esi[6]; /* end system identifier (MAC) */ - u_int pcr; /* supported peak cell rate */ - u_int vpi_bits; /* number of used bits in VPI field */ - u_int vci_bits; /* number of used bits in VCI field */ - u_int max_vpcs; /* maximum number of VPCs */ - u_int max_vccs; /* maximum number of VCCs */ -}; -.Ed -.Ss NOTIFICATIONS -An other module can register with -.Nm -to receive notifications when certain events happen on the ATM interface. -The registration is done with -.Fn atm_notify_aif -which takes a pointer to the interface, the calling module pointer, a callback -function and a user argument that is passed to the callback function. -The callback function is called with the interface pointer, a notification -code, a notification argument and the user argument. The following -notifications are defined: -.Bl -tag -width XXX -.It Dv ATMIF_NOTIFY_DESTROY -The interface is destroyed. The notification argument is not used. -.It Dv ATMIF_NOTIFY_CARRIER -The carrier state on the interface has changed. The argument is the -.Em old -state of the carrier. The new state can be obtained from the interface -structure. -.It Dv ATMIF_NOTIFY_VCC -A permanent VCC has been created or destroyed. The argument is an u_int that -can be decoded as follows: -.Bd -literal -offset indent -vpi = (arg >> 24) & 0xff; -vci = (arg >> 8) & 0xffff; -state = arg & 1; -.Ed -.Pp -.Va state -is 0 if the VCC was destroyed and 1 if it was created. -.El -The registration for notification can be undone by passing the return -value from -.Fn atm_notify_aif -to -.Fn atm_unnotify_aif . -The registrations is automatically removed if the interface is destroyed. -.Ss MIB -The MIB implemented by the module is defined in -.Pa BEGEMOT-ATM.txt . -In the generic part there are two tables and one scalar, there is also -a system specific group: -.Bl -tag -width XXX -.It Va begemotAtmIfTable -This table is an extension of -.Va ifTable . -It contains a row for each ATM interface and is index with -.Va ifIndex . -All fields are read-only except the -.Va begemotAtmIfMode -column. -.It Va begemotAtmIfTableLastChange -Contains the tick when a row was created or destroyed in the above table or -0, if the table did not change since start of the SNMP agent. -.It Va begemotAtmHWTable -Is also indexed by -.Va ifIndex -and contains hardware specific information. This table is read-only. -.El -.Sh FILES -.Bl -tag -width "XXXXXXXXX" -.It Pa @DEFPATH@atm_tree.def -The description of the MIB tree implemented by -.Nm . -.It Pa @MIBSPATH@BEGEMOT-ATM.txt -This is the MIB that is implemented by this module. -.Sh SEE ALSO -.Xr bsnmpd 1 , -.Xr snmpmod 3 , -.Xr snmp_mibII 3 , -.Xr snmp_netgraph 3 , -.Xr gensnmptree 1 -.Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org diff --git a/contrib/ngatm/snmp_atm/snmp_atm.c b/contrib/ngatm/snmp_atm/snmp_atm.c deleted file mode 100644 index 1106e8a237be..000000000000 --- a/contrib/ngatm/snmp_atm/snmp_atm.c +++ /dev/null @@ -1,622 +0,0 @@ -/* - * Copyright (c) 2001-2002 - * Fraunhofer Institute for Open Communication Systems (FhG Fokus). - * All rights reserved. - * Copyright (c) 2003-2004 - * Hartmut Brandt. - * All rights reserved. - * - * Author: Hartmut Brandt <harti@freebsd.org> - * - * Redistribution 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 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 IS PROVIDED BY AUTHOR AND 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 AUTHOR OR 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/snmp_atm/snmp_atm.c,v 1.2 2004/08/06 17:30:40 brandt Exp $ - * - * SNMP module for ATM hardware interfaces. - */ - -#include "atm.h" -#include "atm_tree.h" -#include "atm_oid.h" - -#include <sys/ioctl.h> - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> -#include <syslog.h> -#include <net/if_types.h> -#include <net/if_media.h> -#include <net/if_atm.h> - -struct lmodule *module; - -/* list of all (known) ATM interfaces */ -struct atmif_list atmif_list = TAILQ_HEAD_INITIALIZER(atmif_list); - -/* whether we are started or not */ -static int started; - -/* last time table was changed */ -static uint32_t last_change; - -/* for the registration */ -static const struct asn_oid oid_begemotAtm = OIDX_begemotAtm; - -/* the registration */ -static u_int reg_atm; - -/* - * Find an ATM interface by name - */ -struct atmif * -atm_find_if_name(const char *name) -{ - struct atmif_priv *aif; - - TAILQ_FOREACH(aif, &atmif_list, link) - if (strcmp(aif->pub.ifp->name, name) == 0) - return (&aif->pub); - return (NULL); -} - -/* - * get the interface from the interface index - */ -struct atmif * -atm_find_if(u_int ifindex) -{ - struct atmif_priv *aif; - - TAILQ_FOREACH(aif, &atmif_list, link) - if (aif->index == ifindex) - return (&aif->pub); - return (NULL); -} - -/* - * Send notification to all listeners. - */ -void -atmif_send_notification(struct atmif_priv *aif, enum atmif_notify code, - uintptr_t arg) -{ - struct atmif_reg *r0, *r1; - - r0 = TAILQ_FIRST(&aif->notify); - while (r0 != NULL) { - r1 = TAILQ_NEXT(r0, link); - r0->func(&aif->pub, code, arg, r0->data); - r0 = r1; - } -} - -/* - * Destroy an interface - */ -static void -atmif_destroy(struct atmif_priv *aif) -{ - struct atmif_reg *r0; - - atmif_send_notification(aif, ATMIF_NOTIFY_DESTROY, - (uintptr_t)0); - - atmif_sys_destroy(aif); - - if (aif->ifpreg != NULL) - mibif_unnotify(aif->ifpreg); - - while ((r0 = TAILQ_FIRST(&aif->notify)) != NULL) { - TAILQ_REMOVE(&aif->notify, r0, link); - free(r0); - } - - TAILQ_REMOVE(&atmif_list, aif, link); - free(aif); - - last_change = this_tick; -} - -/* - * Function gets called from the MIB-II module for events on that interface - */ -static void -atmif_notify(struct mibif *ifp __unused, enum mibif_notify event, void *data) -{ - struct atmif_priv *aif = data; - - switch (event) { - - case MIBIF_NOTIFY_DESTROY: - atmif_destroy(aif); - break; - } -} - -/* - * Check the carrier state of the interface - */ -void -atmif_check_carrier(struct atmif_priv *aif) -{ - struct ifmediareq ifmr; - enum atmif_carrier_state ost = aif->pub.carrier; - - memset(&ifmr, 0, sizeof(ifmr)); - strcpy(ifmr.ifm_name, aif->pub.ifp->name); - - if (ioctl(mib_netsock, SIOCGIFMEDIA, &ifmr) == -1) { - aif->pub.carrier = ATMIF_CARRIER_UNKNOWN; - return; - } - if (!ifmr.ifm_status & IFM_AVALID) { - aif->pub.carrier = ATMIF_CARRIER_UNKNOWN; - return; - } - if (ifmr.ifm_status & IFM_ACTIVE) - aif->pub.carrier = ATMIF_CARRIER_ON; - else - aif->pub.carrier = ATMIF_CARRIER_OFF; - - if (ost != aif->pub.carrier) - atmif_send_notification(aif, ATMIF_NOTIFY_CARRIER, - (uintptr_t)ost); -} - -/* - * Retrieve the SUNI mode - */ -static int -atmif_get_mode(struct atmif_priv *aif) -{ - struct ifmediareq ifmr; - - memset(&ifmr, 0, sizeof(ifmr)); - strcpy(ifmr.ifm_name, aif->pub.ifp->name); - - if (ioctl(mib_netsock, SIOCGIFMEDIA, &ifmr) < 0) { - syslog(LOG_ERR, "SIOCGIFMEDIA: %m"); - aif->pub.mode = ATMIF_SUNI_MODE_UNKNOWN; - return (SNMP_ERR_GENERR); - } - if (ifmr.ifm_current & IFM_ATM_SDH) - aif->pub.mode = ATMIF_SUNI_MODE_SDH; - else - aif->pub.mode = ATMIF_SUNI_MODE_SONET; - - return (SNMP_ERR_NOERROR); -} - -/* - * Change the SUNI mod - */ -static int -atmif_set_mode(struct atmif_priv *aif, int newmode) -{ - struct ifmediareq ifmr; - struct ifreq ifr; - - memset(&ifmr, 0, sizeof(ifmr)); - strcpy(ifmr.ifm_name, aif->pub.ifp->name); - - /* get current mode */ - if (ioctl(mib_netsock, SIOCGIFMEDIA, &ifmr) < 0) { - syslog(LOG_ERR, "SIOCGIFMEDIA: %m"); - return (SNMP_ERR_GENERR); - } - - memset(&ifr, 0, sizeof(ifr)); - strcpy(ifr.ifr_name, aif->pub.ifp->name); - - ifr.ifr_media = ifmr.ifm_current; - if (newmode == ATMIF_SUNI_MODE_SDH) - ifr.ifr_media |= IFM_ATM_SDH; - else - ifr.ifr_media &= ~IFM_ATM_SDH; - - if (ioctl(mib_netsock, SIOCSIFMEDIA, &ifr) < 0) { - syslog(LOG_ERR, "SIOCSIFMEDIA: %m"); - return (SNMP_ERR_GENERR); - } - - aif->pub.mode = newmode; - return (SNMP_ERR_NOERROR); -} - -/* - * Attach to an ATM interface - */ -static void -attach_if(struct mibif *ifp) -{ - struct atmif_priv *aif; - - /* we should not know it */ - TAILQ_FOREACH(aif, &atmif_list, link) - if (aif->pub.ifp == ifp) { - syslog(LOG_CRIT, "new ATM if already known '%s'", - ifp->name); - return; - } - - /* - * tap it - */ - if ((aif = malloc(sizeof(*aif))) == NULL) { - syslog(LOG_ERR, "new atmif: %m"); - return; - } - memset(aif, 0, sizeof(*aif)); - - aif->pub.ifp = ifp; - aif->index = ifp->index; - - if (atmif_sys_attach_if(aif)) { - free(aif); - return; - } - - aif->ifpreg = mibif_notify(ifp, module, atmif_notify, aif); - - aif->pub.carrier = ATMIF_CARRIER_UNKNOWN; - atmif_check_carrier(aif); - (void)atmif_get_mode(aif); - - INSERT_OBJECT_INT(aif, &atmif_list); - - last_change = this_tick; - - return; -} - -/* - * Function gets called when a new interface is created. If this is an - * ATM interface, hook in. Claim the interface in any case even when - * the creation of our data structures fails. - */ -static int -new_if(struct mibif *ifp) -{ - if (!started || ifp->mib.ifmd_data.ifi_type != IFT_ATM || - ifp->xnotify != NULL) - return (0); - - attach_if(ifp); - return (1); -} - -/* - * Start the module - */ -static void -atm_start(void) -{ - struct mibif *ifp; - - reg_atm = or_register(&oid_begemotAtm, - "The Begemot MIB for ATM interfaces.", module); - - started = 1; - for (ifp = mib_first_if(); ifp != NULL; ifp = mib_next_if(ifp)) - if (ifp->mib.ifmd_data.ifi_type == IFT_ATM && - ifp->xnotify == NULL) - attach_if(ifp); -} - -/* - * Called when modules is loaded - */ -static int -atm_init(struct lmodule *mod, int argc __unused, char *argv[] __unused) -{ - module = mod; - - /* register to get creation messages for ATM interfaces */ - if (mib_register_newif(new_if, module)) { - syslog(LOG_ERR, "cannot register newif function: %m"); - return (-1); - } - - return (0); -} - -/* - * Called when module gets unloaded - free all resources - */ -static int -atm_fini(void) -{ - struct atmif_priv *aif; - - while ((aif = TAILQ_FIRST(&atmif_list)) != NULL) - atmif_destroy(aif); - - mib_unregister_newif(module); - or_unregister(reg_atm); - - return (0); -} - -/* - * Other module unloaded/loaded - */ -static void -atm_loading(const struct lmodule *mod, int loading) -{ - struct atmif_priv *aif; - struct atmif_reg *r0, *r1; - - if (!loading) { - /* remove notifications for this module */ - TAILQ_FOREACH(aif, &atmif_list, link) - TAILQ_FOREACH_SAFE(r0, &aif->notify, link, r1) { - if (r0->mod == mod) { - TAILQ_REMOVE(&aif->notify, r0, link); - free(r0); - } - } - } -} - -const struct snmp_module config = { - .comment = "This module implements a private MIB for ATM interfaces.", - .init = atm_init, - .fini = atm_fini, - .start = atm_start, - .tree = atm_ctree, - .tree_size = atm_CTREE_SIZE, - .loading = atm_loading -}; - -/* - * Get the interface point for a table access - */ -int -atmif_get_aif(struct snmp_value *value, u_int sub, enum snmp_op op, - struct atmif_priv **aifp) -{ - switch (op) { - - case SNMP_OP_GETNEXT: - if ((*aifp = NEXT_OBJECT_INT(&atmif_list, - &value->var, sub)) == NULL) - return (SNMP_ERR_NOSUCHNAME); - value->var.len = sub + 1; - value->var.subs[sub] = (*aifp)->index; - break; - - case SNMP_OP_GET: - if ((*aifp = FIND_OBJECT_INT(&atmif_list, - &value->var, sub)) == NULL) - return (SNMP_ERR_NOSUCHNAME); - break; - - case SNMP_OP_SET: - if ((*aifp = FIND_OBJECT_INT(&atmif_list, - &value->var, sub)) == NULL) - return (SNMP_ERR_NO_CREATION); - break; - - case SNMP_OP_ROLLBACK: - case SNMP_OP_COMMIT: - if ((*aifp = FIND_OBJECT_INT(&atmif_list, - &value->var, sub)) == NULL) - abort(); - return (SNMP_ERR_NOERROR); - } - - if ((*aifp)->pub.mib->pcr == 0) { - mib_fetch_ifmib((*aifp)->pub.ifp); - atmif_sys_fill_mib(*aifp); - atmif_check_carrier(*aifp); - } - - return (SNMP_ERR_NOERROR); -} - -/* - * Table of all ATM interfaces - */ -int -op_atmif(struct snmp_context *ctx __unused, struct snmp_value *value, - u_int sub, u_int vindex __unused, enum snmp_op op) -{ - struct atmif_priv *aif; - int err; - - if ((err = atmif_get_aif(value, sub, op, &aif)) != SNMP_ERR_NOERROR) - return (err); - - if (op == SNMP_OP_SET) { - switch (value->var.subs[sub - 1]) { - - default: - return (SNMP_ERR_NOT_WRITEABLE); - - case LEAF_begemotAtmIfMode: - if ((err = atmif_get_mode(aif)) != SNMP_ERR_NOERROR) - return (err); - if (aif->pub.mode == ATMIF_SUNI_MODE_UNKNOWN) - return (SNMP_ERR_INCONS_VALUE); - if (value->v.integer != ATMIF_SUNI_MODE_SONET && - value->v.integer != ATMIF_SUNI_MODE_SDH) - return (SNMP_ERR_WRONG_VALUE); - if ((u_int)value->v.integer == aif->pub.mode) - return (SNMP_ERR_NOERROR); - return (atmif_set_mode(aif, value->v.integer)); - } - abort(); - } - - switch (value->var.subs[sub - 1]) { - - case LEAF_begemotAtmIfName: - return (string_get(value, aif->pub.ifp->name, -1)); - - case LEAF_begemotAtmIfPcr: - value->v.uint32 = aif->pub.mib->pcr; - return (SNMP_ERR_NOERROR); - - case LEAF_begemotAtmIfMedia: - value->v.integer = aif->pub.mib->media; - return (SNMP_ERR_NOERROR); - - case LEAF_begemotAtmIfVpiBits: - value->v.uint32 = aif->pub.mib->vpi_bits; - return (SNMP_ERR_NOERROR); - - case LEAF_begemotAtmIfVciBits: - value->v.uint32 = aif->pub.mib->vci_bits; - return (SNMP_ERR_NOERROR); - - case LEAF_begemotAtmIfMaxVpcs: - value->v.uint32 = aif->pub.mib->max_vpcs; - return (SNMP_ERR_NOERROR); - - case LEAF_begemotAtmIfMaxVccs: - value->v.uint32 = aif->pub.mib->max_vccs; - return (SNMP_ERR_NOERROR); - - case LEAF_begemotAtmIfEsi: - return (string_get(value, aif->pub.mib->esi, 6)); - - case LEAF_begemotAtmIfCarrierStatus: - value->v.integer = aif->pub.carrier; - return (SNMP_ERR_NOERROR); - - case LEAF_begemotAtmIfMode: - if ((err = atmif_get_mode(aif)) != SNMP_ERR_NOERROR) - return (err); - value->v.integer = aif->pub.mode; - return (SNMP_ERR_NOERROR); - } - abort(); -} - -/* - * Hardware table - */ -int -op_atmhw(struct snmp_context *ctx __unused, struct snmp_value *value, - u_int sub, u_int vindex __unused, enum snmp_op op) -{ - struct atmif_priv *aif; - int err; - - if ((err = atmif_get_aif(value, sub, op, &aif)) != SNMP_ERR_NOERROR) - return (err); - if (op == SNMP_OP_SET) - return (SNMP_ERR_NOT_WRITEABLE); - - switch (value->var.subs[sub - 1]) { - - case LEAF_begemotAtmHWVendor: - return (atm_sys_get_hw_vendor(aif, value)); - - case LEAF_begemotAtmHWDevice: - return (atm_sys_get_hw_device(aif, value)); - - case LEAF_begemotAtmHWSerial: - value->v.uint32 = aif->pub.mib->serial; - return (SNMP_ERR_NOERROR); - - case LEAF_begemotAtmHWVersion: - value->v.uint32 = aif->pub.mib->hw_version; - return (SNMP_ERR_NOERROR); - - case LEAF_begemotAtmHWSoftVersion: - value->v.uint32 = aif->pub.mib->sw_version; - return (SNMP_ERR_NOERROR); - - } - abort(); -} - -/* - * Scalars - */ -int -op_atm(struct snmp_context *ctx __unused, struct snmp_value *value, - u_int sub, u_int vindex __unused, enum snmp_op op) -{ - switch (op) { - - case SNMP_OP_GETNEXT: - abort(); - - case SNMP_OP_GET: - switch (value->var.subs[sub - 1]) { - - case LEAF_begemotAtmIfTableLastChange: - value->v.uint32 = - (last_change == 0 ? 0 : last_change - start_tick); - return (SNMP_ERR_NOERROR); - } - abort(); - - case SNMP_OP_SET: - return (SNMP_ERR_NOT_WRITEABLE); - - case SNMP_OP_ROLLBACK: - case SNMP_OP_COMMIT: - abort(); - } - abort(); -} - -/* - * Register for interface notifications - */ -void * -atm_notify_aif(struct atmif *pub, const struct lmodule *mod, - atmif_event_f func, void *arg) -{ - struct atmif_priv *aif = (struct atmif_priv *)pub; - struct atmif_reg *r0; - - if ((r0 = malloc(sizeof(*r0))) == NULL) { - syslog(LOG_CRIT, "out of memory"); - return (NULL); - } - r0->func = func; - r0->mod = mod; - r0->data = arg; - r0->aif = aif; - - TAILQ_INSERT_TAIL(&aif->notify, r0, link); - - return (r0); -} - -/* - * Unregister it - */ -void -atm_unnotify_aif(void *arg) -{ - struct atmif_reg *r0 = arg; - - TAILQ_REMOVE(&r0->aif->notify, r0, link); - free(r0); -} diff --git a/contrib/ngatm/snmp_atm/snmp_atm.h b/contrib/ngatm/snmp_atm/snmp_atm.h deleted file mode 100644 index 50784ccc45bb..000000000000 --- a/contrib/ngatm/snmp_atm/snmp_atm.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2001-2002 - * Fraunhofer Institute for Open Communication Systems (FhG Fokus). - * All rights reserved. - * Copyright (c) 2003-2004 - * Hartmut Brandt - * All rights reserved. - * - * Author: Hartmut Brandt <harti@freebsd.org> - * - * Redistribution 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 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 IS PROVIDED BY AUTHOR AND 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 AUTHOR OR 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/snmp_atm/snmp_atm.h,v 1.2 2004/08/06 17:30:40 brandt Exp $ - */ -#ifndef _BSNMP_SNMP_ATM_H -#define _BSNMP_SNMP_ATM_H - -enum atmif_notify { - ATMIF_NOTIFY_DESTROY, /* interface has been destroyed */ - ATMIF_NOTIFY_CARRIER, /* carriere change */ - ATMIF_NOTIFY_VCC /* VCC change */ -}; - -enum atmif_carrier_state { - ATMIF_CARRIER_ON = 1, - ATMIF_CARRIER_OFF = 2, - ATMIF_CARRIER_UNKNOWN = 3, - ATMIF_CARRIER_NONE = 4 -}; - -enum atmif_suni_mode { - ATMIF_SUNI_MODE_SONET = 1, - ATMIF_SUNI_MODE_SDH = 2, - ATMIF_SUNI_MODE_UNKNOWN = 3 -}; - -/* forward declaration */ -struct atmif; -typedef void (*atmif_event_f)(struct atmif *, enum atmif_notify, uintptr_t, - void *); - -struct atmif_mib { - u_int version; /* currently 0 */ - - u_int device; /* type of hardware (system specific) */ - u_int serial; /* card serial number (device specific) */ - u_int hw_version; /* card version (device specific) */ - u_int sw_version; /* firmware version (device specific) */ - u_int media; /* physical media (see MIB) */ - - u_char esi[6]; /* end system identifier (MAC) */ - u_int pcr; /* supported peak cell rate */ - u_int vpi_bits; /* number of used bits in VPI field */ - u_int vci_bits; /* number of used bits in VCI field */ - u_int max_vpcs; /* maximum number of VPCs */ - u_int max_vccs; /* maximum number of VCCs */ -}; - -struct atmif { - struct mibif *ifp; /* common interface data */ - struct atmif_mib *mib; /* ATM MIB */ - enum atmif_carrier_state carrier; - enum atmif_suni_mode mode; /* SUNI mode SDH or SONET */ -}; - -/* find an ATM interface by name */ -struct atmif *atm_find_if_name(const char *); - -/* get the interface from the interface index */ -struct atmif *atm_find_if(u_int); - -/* register for notifications */ -void *atm_notify_aif(struct atmif *, const struct lmodule *mod, - atmif_event_f, void *); -void atm_unnotify_aif(void *); - -/* return the If for a system-specific node number */ -struct atmif *atm_node2if(u_int); - -/* return the node id for the if */ -u_int atm_if2node(struct atmif *); - -#endif diff --git a/contrib/ngatm/sscop/sscop.1 b/contrib/ngatm/sscop/sscop.1 deleted file mode 100644 index 233859d295ca..000000000000 --- a/contrib/ngatm/sscop/sscop.1 +++ /dev/null @@ -1,169 +0,0 @@ -.\" -.\" Copyright (c) 2001-2003 -.\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). -.\" All rights reserved. -.\" -.\" Author: Harti Brandt <harti@freebsd.org> -.\" -.\" Redistribution 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 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 IS PROVIDED BY THE AUTHOR AND 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 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/sscop/sscop.1,v 1.3 2004/07/08 08:22:28 brandt Exp $ -.\" -.Dd October 28, 2003 -.Dt SSCOP 1 -.Os -.Sh NAME -.Nm sscop -.Nd "SSCOP transport protocol" -.Sh SYNOPSIS -.Nm -.Op Fl Fbefhirwx3 -.Op Fl V Ar X -.Op Fl W Ar N -.Op Fl a Ar p Ns Li = Ns Ar v -.Op Fl l Ar N -.Op Fl t Ar t Ns Li = Ns Ar m -.Op Fl v Ar X -.Sh DESCRIPTION -The -.Nm -tool implements the Q.2110 transport protocol. -Normally the program reads from standard input and sends this input over -the SSCOP protocol on the standard output file descriptor. This means, that -the standard output file descriptor should be connected in read-write mode. -The program takes the -following arguments: -.Bl -tag -width ".It Fl a Ar p Ns Li = Ns Ar v" -.It Fl F -Use frameing on the SSCOP connection (see the -.Fl f -option). -.It Fl V Ar X -Set the verbose flag to the hex value -.Ar X . -.It Fl W Ar N -Set the initial SSCOP window to -.Ar N . -.It Fl a Ar p Ns Li = Ns Ar v -Set SSCOP parameter -.Ar p -to the value -.Ar v . -The following parameters may be set: -.Bl -tag -width ".It Li stat Ns = Ns Ar N" -.It Li j Ns = Ns Ar N -Set the maximum SSCOP-UU data size to -.Ar N -octets. -.It Li k Ns = Ns Ar N -Set the maximum SSCOP SDU data size to -.Ar N -octets. -.It Li cc Ns = Ns Ar N -Set the parameter -.Li MaxCC -(maximum number of connection control message re-transmissions) to -the value -.Ar N . -.It Li pd Ns = Ns Ar N -Set the parameter -.Li MaxPD -(maximum acceptable number of outstanding unacknowledged SD PDUs before -sending a POLL) to the value -.Ar N . -.It Li stat Ns = Ns Ar N -Set the parameter -.Li MaxSTAT -(maximum number of elements placed in a STAT PDU) to the value -.Ar N . -.El -.It Fl b -Enable the ATM-Forum SSCOP robustness enhancement. -.It Fl e -Exit when there is an end of file condition on the input file or the -SSCOP indicates a release confirmation. -.It Fl f -Use the framing protocol for communication over the SSCOP link. See -.Xr frame l -(libbegemot) for framing. -.It Fl h -Print a short help information and exit. -.It Fl i -Try not to read from the user input file descriptor. Assume that we a receiving -only. -.It Fl l Ar N -Loose every Nth message. This is used for testing. -.It Fl r -Revert user and SSCOP file descriptors. That means, that user input and output -is done on standard output and SSCOP input and output on standard input. -.It Fl t Ar t Ns Li = Ns Ar m -Set SSCOP timer -.Ar t -to -.Ar m -milliseconds. The following timers may be set: -.Bl -tag -width ".It Li stat Ns = Ns Ar N" -.It Li cc Ns = Ns Ar m -Set the connection control timer to -.Ar m . -This timer controls the retransmission of connection control messages. -.It Li poll Ns = Ns Ar m -Set the poll timer to -.Ar m . -This timer controls the transmission of POLL messages. -.It Li ka Ns = Ns Ar m -Set the keep-alive timer to -.Ar m . -This timer controls the maximum length of the transient phase. -.It Li nr Ns = Ns Ar m -Set the no-response timer to -.Ar m . -This timer controls the maximum time between two received STAT PDUs before -the connection is aborted. -.It Li idle Ns = Ns Ar m -Set the idle timer to -.Ar m . -This timer controls the length of the idle phase. -.El -.It Fl v Ar X -Set the SSCOP library verbose flag to the hex value. -.It Fl w -Don't start the SSCOP protocol. Wait for a establish indication from the remote -side. -.It Fl x -Enable to POLL after retransmission flag. -.It Fl 3 -Send user output to file descriptor 3. -.El -.Sh EXAMPLES -The following command line sends the file -.Pa Makefile -over a pipe (this depends on the feature that pipes are bi-directional): -.Bd -literal -cat Makefile | sscop -reF | sscop -weF -.Ed -.Sh SEE ALSO -.Xr libunimsg 3 -.Sh STANDARDS -The implemented protocol conforms to ITU-T recommendation Q.2110. -.Sh AUTHORS -.An Hartmut Brandt Aq harti@freebsd.org |