Deleted Added
full compact
sig_print.c (131826) sig_print.c (133492)
1/*
2 * Copyright (c) 2002-2003
3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * Author: Hartmut Brandt <harti@freebsd.org>
28 * Kendy Kutzner <kutzner@fokus.fraunhofer.de>
29 *
1/*
2 * Copyright (c) 2002-2003
3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * Author: Hartmut Brandt <harti@freebsd.org>
28 * Kendy Kutzner <kutzner@fokus.fraunhofer.de>
29 *
30 * $Begemot: libunimsg/netnatm/sig/sig_print.c,v 1.5 2004/07/08 08:22:22 brandt Exp $
30 * $Begemot: libunimsg/netnatm/sig/sig_print.c,v 1.6 2004/08/05 07:11:02 brandt Exp $
31 */
32
33#include <sys/types.h>
34#ifdef _KERNEL
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/libkern.h>
38#include <machine/stdarg.h>

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

51#include <netnatm/sig/uni.h>
52#include <netnatm/sig/unisig.h>
53#include <netnatm/sig/unidef.h>
54
55const char *
56uni_strerr(u_int err)
57{
58 static const char *const errstr[] = {
31 */
32
33#include <sys/types.h>
34#ifdef _KERNEL
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/libkern.h>
38#include <machine/stdarg.h>

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

51#include <netnatm/sig/uni.h>
52#include <netnatm/sig/unisig.h>
53#include <netnatm/sig/unidef.h>
54
55const char *
56uni_strerr(u_int err)
57{
58 static const char *const errstr[] = {
59#define DEF(NAME, VAL, STR) [UNIAPI_##NAME] STR,
59#define DEF(NAME, VAL, STR) [UNIAPI_##NAME] = STR,
60UNIAPI_DEF_ERRORS(DEF)
61#undef DEF
62 };
63 static char buf[100];
64
65 if (err >= sizeof(errstr)/sizeof(errstr[0]) || errstr[err] == NULL) {
66 sprintf(buf, "Unknown error %u", err);
67 return (buf);
68 }
69 return (errstr[err]);
70}
71
60UNIAPI_DEF_ERRORS(DEF)
61#undef DEF
62 };
63 static char buf[100];
64
65 if (err >= sizeof(errstr)/sizeof(errstr[0]) || errstr[err] == NULL) {
66 sprintf(buf, "Unknown error %u", err);
67 return (buf);
68 }
69 return (errstr[err]);
70}
71
72#define D(M) [M] #M
72#define D(M) [M] = #M
73static const char *const msgs[] = {
74 D(UNIAPI_ERROR),
75 D(UNIAPI_CALL_CREATED),
76 D(UNIAPI_CALL_DESTROYED),
77 D(UNIAPI_PARTY_CREATED),
78 D(UNIAPI_PARTY_DESTROYED),
79 D(UNIAPI_LINK_ESTABLISH_request),
80 D(UNIAPI_LINK_ESTABLISH_confirm),

--- 542 unchanged lines hidden ---
73static const char *const msgs[] = {
74 D(UNIAPI_ERROR),
75 D(UNIAPI_CALL_CREATED),
76 D(UNIAPI_CALL_DESTROYED),
77 D(UNIAPI_PARTY_CREATED),
78 D(UNIAPI_PARTY_DESTROYED),
79 D(UNIAPI_LINK_ESTABLISH_request),
80 D(UNIAPI_LINK_ESTABLISH_confirm),

--- 542 unchanged lines hidden ---