Statistics
| Branch: | Tag: | Revision:

root / src / charon / encoding / payloads / vendor_id_payload.h @ 82713deafd623c3ac9ead6521647301607c24d24

History | View | Annotate | Download (1.8 KB)

1
/*
2
 * Copyright (C) 2005-2009 Martin Willi
3
 * Copyright (C) 2005 Jan Hutter
4
 * Hochschule fuer Technik Rapperswil
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 vendor_id_payload vendor_id_payload
19
 * @{ @ingroup payloads
20
 */
21
22
#ifndef VENDOR_ID_PAYLOAD_H_
23
#define VENDOR_ID_PAYLOAD_H_
24
25
typedef struct vendor_id_payload_t vendor_id_payload_t;
26
27
#include <library.h>
28
#include <encoding/payloads/payload.h>
29
30
/**
31
 * Length of a VENDOR ID payload without the VID data in bytes.
32
 */
33
#define VENDOR_ID_PAYLOAD_HEADER_LENGTH 4
34
35
/**
36
 * Class representing an IKEv2 VENDOR ID payload.
37
 *
38
 * The VENDOR ID payload format is described in RFC section 3.12.
39
 */
40
struct vendor_id_payload_t {
41
42
    /**
43
     * The payload_t interface.
44
     */
45
    payload_t payload_interface;
46
47
    /**
48
     * Get the VID data.
49
     *
50
     * @return        VID data, pointing to an internal chunk_t
51
     */
52
    chunk_t (*get_data)(vendor_id_payload_t *this);
53
};
54
55
/**
56
 * Creates an empty Vendor ID payload.
57
 *
58
 * @return            vendor ID payload
59
 */
60
vendor_id_payload_t *vendor_id_payload_create();
61
62
/**
63
 * Creates a vendor ID payload using a chunk of data
64
 *
65
 * @param data        data to use in vendor ID payload, gets owned by payload
66
 * @return            vendor ID payload
67
 */
68
vendor_id_payload_t *vendor_id_payload_create_data(chunk_t data);
69
70
#endif /** VENDOR_ID_PAYLOAD_H_ @}*/