GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: usr.sbin/ripd/logmsg.c Lines: 0 20 0.0 %
Date: 2017-11-07 Branches: 0 16 0.0 %

Line Branch Exec Source
1
/*	$OpenBSD: logmsg.c,v 1.1 2016/09/02 14:07:52 benno Exp $ */
2
3
/*
4
 * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
5
 *
6
 * Permission to use, copy, modify, and distribute this software for any
7
 * purpose with or without fee is hereby granted, provided that the above
8
 * copyright notice and this permission notice appear in all copies.
9
 *
10
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
 */
18
19
#include "ripd.h"
20
21
/* names */
22
const char *
23
nbr_state_name(int state)
24
{
25
	switch (state) {
26
	case NBR_STA_DOWN:
27
		return ("DOWN");
28
	case NBR_STA_REQ_RCVD:
29
		return ("REQUEST RCVD");
30
	case NBR_STA_ACTIVE:
31
		return ("ACTIVE");
32
	default:
33
		return ("UNKNOWN");
34
	}
35
}
36
37
const char *
38
if_type_name(enum iface_type type)
39
{
40
	switch (type) {
41
	case IF_TYPE_POINTOPOINT:
42
		return ("POINTOPOINT");
43
	case IF_TYPE_BROADCAST:
44
		return ("BROADCAST");
45
	case IF_TYPE_NBMA:
46
		return ("NBMA");
47
	case IF_TYPE_POINTOMULTIPOINT:
48
		return ("POINTOMULTIPOINT");
49
	}
50
	/* NOTREACHED */
51
	return ("UNKNOWN");
52
}
53
54
const char *
55
if_auth_name(enum auth_type type)
56
{
57
	switch (type) {
58
	case AUTH_NONE:
59
		return ("none");
60
	case AUTH_SIMPLE:
61
		return ("simple");
62
	case AUTH_CRYPT:
63
		return ("crypt");
64
	}
65
	/* NOTREACHED */
66
	return ("unknown");
67
}
68
69
const char *
70
if_state_name(int state)
71
{
72
	switch (state) {
73
	case IF_STA_DOWN:
74
		return ("DOWN");
75
	case IF_STA_ACTIVE:
76
		return ("ACTIVE");
77
	default:
78
		return ("UNKNOWN");
79
	}
80
}