]> git.ipfire.org Git - thirdparty/strongswan.git/blame - src/libtnccs/plugins/tnccs_20/messages/tcg/pb_pdp_referral_msg.h
Update copyright headers after acquisition by secunet
[thirdparty/strongswan.git] / src / libtnccs / plugins / tnccs_20 / messages / tcg / pb_pdp_referral_msg.h
CommitLineData
ddfc5896
AS
1/*
2 * Copyright (C) 2013 Andreas Steffen
19ef2aec
TB
3 *
4 * Copyright (C) secunet Security Networks AG
ddfc5896
AS
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 pb_pdp_referral_msg pb_pdp_referral_msg
19 * @{ @ingroup tnccs_20
20 */
21
22#ifndef PB_PDP_REFERRAL_MSG_H_
23#define PB_PDP_REFERRAL_MSG_H_
24
25typedef enum pb_pdp_identifier_type_t pb_pdp_identifier_type_t;
26typedef struct pb_pdp_referral_msg_t pb_pdp_referral_msg_t;
27
28#include "messages/pb_tnc_msg.h"
29
30#include <pen/pen.h>
31
32/**
33 * PB-TNC PDP Identifier Types as defined in section 3.1.1.2 of the
34 * TCG TNC PDP Discovery and Validation Specification 1.0
35 */
36enum pb_pdp_identifier_type_t {
37 PB_PDP_ID_FQDN = 0,
38 PB_PDP_ID_IPV4 = 1,
39 PB_PDP_ID_IPV6 = 2
40};
41
42/**
43 * enum name for pb_pdp_identifier_type_t.
44 */
45extern enum_name_t *pb_pdp_identifier_type_names;
46
47/**
48 * Class representing the PB-Remediation-Parameters message type.
49 */
50struct pb_pdp_referral_msg_t {
51
52 /**
53 * PB-TNC Message interface
54 */
55 pb_tnc_msg_t pb_interface;
56
57 /**
58 * Get the PDP Identifier Type (Vendor ID and Type)
59 *
60 * @return PDP Identifier Type
61 */
62 pen_type_t (*get_identifier_type)(pb_pdp_referral_msg_t *this);
63
64 /**
65 * Get the PDP Identifier Value
66 *
67 * @return PDP Identifier Value
68 */
69 chunk_t (*get_identifier)(pb_pdp_referral_msg_t *this);
70
2c4d772a
AS
71 /**
72 * Get the PDP Identifier Value
73 *
74 * @param protocol PT transport protocol
75 * @param port PT port the PDP is listening on
76 * @return Fully Qualified Domain Name of PDP
77 */
b12c53ce
AS
78 chunk_t (*get_fqdn)(pb_pdp_referral_msg_t *this, uint8_t *protocol,
79 uint16_t *port);
2c4d772a 80
ddfc5896
AS
81};
82
83/**
84 * Create a general PB-PDP-Referral message
85 *
86 * @param identifier_type PDP Identifier Type
87 * @param identifier PDP Identifier
88 */
89pb_tnc_msg_t* pb_pdp_referral_msg_create(pen_type_t identifier_type,
90 chunk_t identifier);
91
2c4d772a
AS
92/**
93 * Create a PB-PDP-Referral message of TCG Type PDP FQDN Identifier
94 *
95 * @param fqdn Fully Qualified Domain Name of PDP
b9949e98 96 * @param port PT-TLS port the PDP is listening on
2c4d772a 97 */
b12c53ce 98pb_tnc_msg_t* pb_pdp_referral_msg_create_from_fqdn(chunk_t fqdn, uint16_t port);
2c4d772a 99
ddfc5896
AS
100/**
101 * Create an unprocessed PB-PDP-Referral message from raw data
102 *
103 * @param data PB-PDP-Referral message data
104 */
105pb_tnc_msg_t* pb_pdp_referral_msg_create_from_data(chunk_t data);
106
107#endif /** PB_PA_MSG_H_ @}*/