Coverage Report

Created: 2026-01-10 06:46

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/strongswan/src/libstrongswan/pen/pen.h
Line
Count
Source
1
/*
2
 * Copyright (C) 2011-2015 Andreas Steffen
3
 *
4
 * Copyright (C) secunet Security Networks AG
5
 *
6
 * This program is free software; you can redistribute it and/or modify it
7
 * under the terms of the GNU General Public License as published by the
8
 * Free Software Foundation; either version 2 of the License, or (at your
9
 * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
10
 *
11
 * This program is distributed in the hope that it will be useful, but
12
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14
 * for more details.
15
 */
16
17
/**
18
 * @defgroup pen pen
19
 * @ingroup libstrongswan
20
 *
21
 * @defgroup pent pen
22
 * @{ @ingroup pen
23
 */
24
25
#ifndef PEN_H_
26
#define PEN_H_
27
28
#include <library.h>
29
30
typedef enum pen_t pen_t;
31
typedef struct pen_type_t pen_type_t;
32
33
/**
34
 * Private enterprise numbers allocated by IANA.
35
 *
36
 * http://www.iana.org/assignments/enterprise-numbers
37
 */
38
enum pen_t {
39
  PEN_IETF =      0x000000, /*        0 */
40
  PEN_IBM =     0x000002, /*        2 */
41
  PEN_MICROSOFT =   0x000137, /*      311 */
42
  PEN_REDHAT =    0x000908, /*     2312 */
43
  PEN_PWG =     0x000A8B, /*     2699 */
44
  PEN_ALTIGA =    0x000c04, /*     3076 */
45
  PEN_OSC =     0x002358, /*     9048 */
46
  PEN_DEBIAN =    0x002572, /*     9586 */
47
  PEN_GOOGLE =    0x002B79, /*    11129 */
48
  PEN_TCG =     0x005597, /*    21911 */
49
  PEN_CANONICAL =   0x007132, /*    28978 */
50
  PEN_FEDORA =    0x0076C1, /*    30401 */
51
  PEN_FHH =     0x0080ab, /*    32939 */
52
  PEN_ITA =     0x00902a, /*    36906 */
53
  PEN_OPENPTS =   0x00950e, /*    38158 */
54
  PEN_UNASSIGNED =  0xfffffe, /* 16777214 */
55
  PEN_RESERVED =    0xffffff, /* 16777215 */
56
};
57
58
/**
59
 * Vendor specific type in vendor specific namespace.
60
 */
61
struct pen_type_t {
62
  pen_t vendor_id;
63
  uint32_t type;
64
};
65
66
/**
67
 * Create a pen_type_t struct
68
 *
69
 * @param vendor_id   vendor ID to create a pen_type_t
70
 * @param type      type to create a pen_type_t
71
 * @return        created pen_type_t
72
 */
73
static inline pen_type_t pen_type_create(pen_t vendor_id, uint32_t type)
74
0
{
75
0
  pen_type_t pen_type = { vendor_id, type };
76
0
  return pen_type;
77
0
}
Unexecuted instantiation: library.c:pen_type_create
Unexecuted instantiation: auth_cfg.c:pen_type_create
Unexecuted instantiation: eap.c:pen_type_create
Unexecuted instantiation: plugin_loader.c:pen_type_create
Unexecuted instantiation: plugin_feature.c:pen_type_create
Unexecuted instantiation: random_plugin.c:pen_type_create
Unexecuted instantiation: random_rng.c:pen_type_create
Unexecuted instantiation: nonce_plugin.c:pen_type_create
Unexecuted instantiation: kdf_plugin.c:pen_type_create
Unexecuted instantiation: cmac_plugin.c:pen_type_create
Unexecuted instantiation: xcbc_plugin.c:pen_type_create
Unexecuted instantiation: x509_plugin.c:pen_type_create
Unexecuted instantiation: revocation_plugin.c:pen_type_create
Unexecuted instantiation: constraints_plugin.c:pen_type_create
Unexecuted instantiation: pubkey_plugin.c:pen_type_create
Unexecuted instantiation: pkcs1_plugin.c:pen_type_create
Unexecuted instantiation: pkcs7_plugin.c:pen_type_create
Unexecuted instantiation: pkcs8_plugin.c:pen_type_create
Unexecuted instantiation: pgp_plugin.c:pen_type_create
Unexecuted instantiation: dnskey_plugin.c:pen_type_create
Unexecuted instantiation: sshkey_plugin.c:pen_type_create
Unexecuted instantiation: pem_plugin.c:pen_type_create
Unexecuted instantiation: openssl_plugin.c:pen_type_create
Unexecuted instantiation: drbg_plugin.c:pen_type_create
Unexecuted instantiation: pen.c:pen_type_create
78
79
/**
80
 * Check two pen_type_t for equality.
81
 *
82
 * @param a       first pen_type_t to compare
83
 * @param b       second pen_type_t to compare
84
 * @return        TRUE if a == b
85
 */
86
static inline bool pen_type_equals(pen_type_t a, pen_type_t b)
87
0
{
88
0
  return a.vendor_id == b.vendor_id && a.type == b.type;
89
0
}
Unexecuted instantiation: library.c:pen_type_equals
Unexecuted instantiation: auth_cfg.c:pen_type_equals
Unexecuted instantiation: eap.c:pen_type_equals
Unexecuted instantiation: plugin_loader.c:pen_type_equals
Unexecuted instantiation: plugin_feature.c:pen_type_equals
Unexecuted instantiation: random_plugin.c:pen_type_equals
Unexecuted instantiation: random_rng.c:pen_type_equals
Unexecuted instantiation: nonce_plugin.c:pen_type_equals
Unexecuted instantiation: kdf_plugin.c:pen_type_equals
Unexecuted instantiation: cmac_plugin.c:pen_type_equals
Unexecuted instantiation: xcbc_plugin.c:pen_type_equals
Unexecuted instantiation: x509_plugin.c:pen_type_equals
Unexecuted instantiation: revocation_plugin.c:pen_type_equals
Unexecuted instantiation: constraints_plugin.c:pen_type_equals
Unexecuted instantiation: pubkey_plugin.c:pen_type_equals
Unexecuted instantiation: pkcs1_plugin.c:pen_type_equals
Unexecuted instantiation: pkcs7_plugin.c:pen_type_equals
Unexecuted instantiation: pkcs8_plugin.c:pen_type_equals
Unexecuted instantiation: pgp_plugin.c:pen_type_equals
Unexecuted instantiation: dnskey_plugin.c:pen_type_equals
Unexecuted instantiation: sshkey_plugin.c:pen_type_equals
Unexecuted instantiation: pem_plugin.c:pen_type_equals
Unexecuted instantiation: openssl_plugin.c:pen_type_equals
Unexecuted instantiation: drbg_plugin.c:pen_type_equals
Unexecuted instantiation: pen.c:pen_type_equals
90
91
/**
92
 * Check if a pen_type_t matches vendor and type.
93
 *
94
 * @param pen_type    pen_type_t to compare
95
 * @param vendor_id   vendor to check in pen_type
96
 * @param type      type to check in pen_type
97
 * @return        TRUE if vendor_id and type matches pen_type
98
 */
99
static inline bool pen_type_is(pen_type_t pen_type,
100
                 pen_t vendor_id, uint32_t type)
101
0
{
102
0
  return pen_type.vendor_id == vendor_id && pen_type.type == type;
103
0
}
Unexecuted instantiation: library.c:pen_type_is
Unexecuted instantiation: auth_cfg.c:pen_type_is
Unexecuted instantiation: eap.c:pen_type_is
Unexecuted instantiation: plugin_loader.c:pen_type_is
Unexecuted instantiation: plugin_feature.c:pen_type_is
Unexecuted instantiation: random_plugin.c:pen_type_is
Unexecuted instantiation: random_rng.c:pen_type_is
Unexecuted instantiation: nonce_plugin.c:pen_type_is
Unexecuted instantiation: kdf_plugin.c:pen_type_is
Unexecuted instantiation: cmac_plugin.c:pen_type_is
Unexecuted instantiation: xcbc_plugin.c:pen_type_is
Unexecuted instantiation: x509_plugin.c:pen_type_is
Unexecuted instantiation: revocation_plugin.c:pen_type_is
Unexecuted instantiation: constraints_plugin.c:pen_type_is
Unexecuted instantiation: pubkey_plugin.c:pen_type_is
Unexecuted instantiation: pkcs1_plugin.c:pen_type_is
Unexecuted instantiation: pkcs7_plugin.c:pen_type_is
Unexecuted instantiation: pkcs8_plugin.c:pen_type_is
Unexecuted instantiation: pgp_plugin.c:pen_type_is
Unexecuted instantiation: dnskey_plugin.c:pen_type_is
Unexecuted instantiation: sshkey_plugin.c:pen_type_is
Unexecuted instantiation: pem_plugin.c:pen_type_is
Unexecuted instantiation: openssl_plugin.c:pen_type_is
Unexecuted instantiation: drbg_plugin.c:pen_type_is
Unexecuted instantiation: pen.c:pen_type_is
104
105
/**
106
 * enum names for pen_t.
107
 */
108
extern enum_name_t *pen_names;
109
110
/**
111
 * short enum names for pen_t.
112
 */
113
extern enum_name_t *pen_short_names;
114
115
#endif /** PEN_H_ @}*/