1*aa6411e2SAugustin Cavalier /* $NetBSD: ns_netint.c,v 1.7 2012/03/13 21:13:39 christos Exp $ */
2*aa6411e2SAugustin Cavalier
3*aa6411e2SAugustin Cavalier /*
4*aa6411e2SAugustin Cavalier * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
5*aa6411e2SAugustin Cavalier * Copyright (c) 1996,1999 by Internet Software Consortium.
6*aa6411e2SAugustin Cavalier *
7*aa6411e2SAugustin Cavalier * Permission to use, copy, modify, and distribute this software for any
8*aa6411e2SAugustin Cavalier * purpose with or without fee is hereby granted, provided that the above
9*aa6411e2SAugustin Cavalier * copyright notice and this permission notice appear in all copies.
10*aa6411e2SAugustin Cavalier *
11*aa6411e2SAugustin Cavalier * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
12*aa6411e2SAugustin Cavalier * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13*aa6411e2SAugustin Cavalier * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
14*aa6411e2SAugustin Cavalier * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15*aa6411e2SAugustin Cavalier * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16*aa6411e2SAugustin Cavalier * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
17*aa6411e2SAugustin Cavalier * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18*aa6411e2SAugustin Cavalier */
19*aa6411e2SAugustin Cavalier
20*aa6411e2SAugustin Cavalier #include <sys/cdefs.h>
21*aa6411e2SAugustin Cavalier #ifndef lint
22*aa6411e2SAugustin Cavalier #ifdef notdef
23*aa6411e2SAugustin Cavalier static const char rcsid[] = "Id: ns_netint.c,v 1.3 2005/04/27 04:56:40 sra Exp";
24*aa6411e2SAugustin Cavalier #else
25*aa6411e2SAugustin Cavalier //__RCSID("$NetBSD: ns_netint.c,v 1.7 2012/03/13 21:13:39 christos Exp $");
26*aa6411e2SAugustin Cavalier #endif
27*aa6411e2SAugustin Cavalier #endif
28*aa6411e2SAugustin Cavalier
29*aa6411e2SAugustin Cavalier /* Import. */
30*aa6411e2SAugustin Cavalier
31*aa6411e2SAugustin Cavalier #include "port_before.h"
32*aa6411e2SAugustin Cavalier
33*aa6411e2SAugustin Cavalier #include <arpa/nameser.h>
34*aa6411e2SAugustin Cavalier
35*aa6411e2SAugustin Cavalier #include "port_after.h"
36*aa6411e2SAugustin Cavalier
37*aa6411e2SAugustin Cavalier /* Public. */
38*aa6411e2SAugustin Cavalier
39*aa6411e2SAugustin Cavalier uint16_t
ns_get16(const u_char * src)40*aa6411e2SAugustin Cavalier ns_get16(const u_char *src) {
41*aa6411e2SAugustin Cavalier uint16_t dst;
42*aa6411e2SAugustin Cavalier
43*aa6411e2SAugustin Cavalier NS_GET16(dst, src);
44*aa6411e2SAugustin Cavalier return dst;
45*aa6411e2SAugustin Cavalier }
46*aa6411e2SAugustin Cavalier
47*aa6411e2SAugustin Cavalier uint32_t
ns_get32(const u_char * src)48*aa6411e2SAugustin Cavalier ns_get32(const u_char *src) {
49*aa6411e2SAugustin Cavalier u_int32_t dst;
50*aa6411e2SAugustin Cavalier
51*aa6411e2SAugustin Cavalier NS_GET32(dst, src);
52*aa6411e2SAugustin Cavalier return dst;
53*aa6411e2SAugustin Cavalier }
54*aa6411e2SAugustin Cavalier
55*aa6411e2SAugustin Cavalier void
ns_put16(uint16_t src,u_char * dst)56*aa6411e2SAugustin Cavalier ns_put16(uint16_t src, u_char *dst) {
57*aa6411e2SAugustin Cavalier NS_PUT16(src, dst);
58*aa6411e2SAugustin Cavalier }
59*aa6411e2SAugustin Cavalier
60*aa6411e2SAugustin Cavalier void
ns_put32(uint32_t src,u_char * dst)61*aa6411e2SAugustin Cavalier ns_put32(uint32_t src, u_char *dst) {
62*aa6411e2SAugustin Cavalier NS_PUT32(src, dst);
63*aa6411e2SAugustin Cavalier }
64*aa6411e2SAugustin Cavalier
65*aa6411e2SAugustin Cavalier /*! \file */
66