1 /*	$NetBSD: convert.h,v 1.1.1.3 2014/07/12 11:57:57 spz Exp $	*/
2 /* convert.h
3 
4    Safe copying of integers into and out of a non-aligned memory buffer. */
5 
6 /*
7  * Copyright (c) 2004,2009,2014 by Internet Systems Consortium, Inc. ("ISC")
8  * Copyright (c) 1996-2003 by Internet Software Consortium
9  *
10  * Permission to use, copy, modify, and distribute this software for any
11  * purpose with or without fee is hereby granted, provided that the above
12  * copyright notice and this permission notice appear in all copies.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
15  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
17  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
20  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21  *
22  *   Internet Systems Consortium, Inc.
23  *   950 Charter Street
24  *   Redwood City, CA 94063
25  *   <info@isc.org>
26  *   https://www.isc.org/
27  *
28  */
29 
30 #ifndef OMAPI_CONVERT_H
31 #define OMAPI_CONVERT_H
32 
33 u_int32_t getULong (const unsigned char *);
34 int32_t getLong (const unsigned char *);
35 u_int32_t getUShort (const unsigned char *);
36 int32_t getShort (const unsigned char *);
37 u_int32_t getUChar (const unsigned char *);
38 void putULong (unsigned char *, u_int32_t);
39 void putLong (unsigned char *, int32_t);
40 void putUShort (unsigned char *, u_int32_t);
41 void putShort (unsigned char *, int32_t);
42 void putUChar (unsigned char *, u_int32_t);
43 int converted_length (const unsigned char *, unsigned int, unsigned int);
44 int binary_to_ascii (unsigned char *, const unsigned char *,
45 		     unsigned int, unsigned int);
46 
47 #endif /* OMAPI_CONVERT_H */
48