]>
git.ipfire.org Git - thirdparty/strongswan.git/blob - src/charon-tkm/src/tkm/tkm_utils.h
2 * Copyright (C) 2012 Reto Buerki
3 * Copyright (C) 2012 Adrian-Ken Rueegsegger
4 * Hochschule fuer Technik Rapperswil
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>.
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
18 * @defgroup tkm-utils utils
25 #include <utils/chunk.h>
26 #include <tkm/types.h>
29 * Convert byte sequence to chunk.
31 * @param first pointer to first byte of sequence
32 * @param len length of byte sequence
33 * @param chunk pointer to chunk struct
35 void sequence_to_chunk(const byte_t
* const first
, const uint32_t len
,
36 chunk_t
* const chunk
);
39 * Convert chunk to variable-length byte sequence.
41 * @param chunk pointer to chunk struct
42 * @param sequence pointer to variable-length sequence
43 * @param typelen length of sequence type
45 void chunk_to_sequence(const chunk_t
* const chunk
, void *sequence
,
46 const uint32_t typelen
);
48 #endif /** TKM_UTILS_H_ @}*/