ISC DHCP  4.4.1
A reference DHCPv4 and DHCPv6 implementation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
convert.h
Go to the documentation of this file.
1 /* convert.h
2 
3  Safe copying of integers into and out of a non-aligned memory buffer. */
4 
5 /*
6  * Copyright (c) 2004-2017 by Internet Systems Consortium, Inc. ("ISC")
7  * Copyright (c) 1996-2003 by Internet Software Consortium
8  *
9  * This Source Code Form is subject to the terms of the Mozilla Public
10  * License, v. 2.0. If a copy of the MPL was not distributed with this
11  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
14  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
16  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
19  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20  *
21  * Internet Systems Consortium, Inc.
22  * 950 Charter Street
23  * Redwood City, CA 94063
24  * <info@isc.org>
25  * https://www.isc.org/
26  *
27  */
28 
29 #ifndef OMAPI_CONVERT_H
30 #define OMAPI_CONVERT_H
31 
32 u_int32_t getULong (const unsigned char *);
33 int32_t getLong (const unsigned char *);
34 u_int32_t getUShort (const unsigned char *);
35 int32_t getShort (const unsigned char *);
36 u_int32_t getUChar (const unsigned char *);
37 void putULong (unsigned char *, u_int32_t);
38 void putLong (unsigned char *, int32_t);
39 void putUShort (unsigned char *, u_int32_t);
40 void putShort (unsigned char *, int32_t);
41 void putUChar (unsigned char *, u_int32_t);
42 int converted_length (const unsigned char *, unsigned int, unsigned int);
43 int binary_to_ascii (unsigned char *, const unsigned char *,
44  unsigned int, unsigned int);
45 
46 #endif /* OMAPI_CONVERT_H */
void putLong(unsigned char *, int32_t)
Definition: convert.c:78
int32_t getShort(const unsigned char *)
int32_t getLong(const unsigned char *)
void putULong(unsigned char *, u_int32_t)
Definition: convert.c:70
int binary_to_ascii(unsigned char *, const unsigned char *, unsigned int, unsigned int)
Definition: convert.c:150
u_int32_t getUShort(const unsigned char *)
void putShort(unsigned char *, int32_t)
Definition: convert.c:94
u_int32_t getULong(const unsigned char *)
void putUChar(unsigned char *, u_int32_t)
Definition: convert.c:102
u_int32_t getUChar(const unsigned char *)
int converted_length(const unsigned char *, unsigned int, unsigned int)
void putUShort(unsigned char *, u_int32_t)
Definition: convert.c:86