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