1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1997-2000 by Sun Microsystems, Inc.
3*7c478bd9Sstevel@tonic-gate  * All rights reserved.
4*7c478bd9Sstevel@tonic-gate  */
5*7c478bd9Sstevel@tonic-gate 
6*7c478bd9Sstevel@tonic-gate /*
7*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1996,1999 by Internet Software Consortium.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * Permission to use, copy, modify, and distribute this software for any
10*7c478bd9Sstevel@tonic-gate  * purpose with or without fee is hereby granted, provided that the above
11*7c478bd9Sstevel@tonic-gate  * copyright notice and this permission notice appear in all copies.
12*7c478bd9Sstevel@tonic-gate  *
13*7c478bd9Sstevel@tonic-gate  * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
14*7c478bd9Sstevel@tonic-gate  * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
15*7c478bd9Sstevel@tonic-gate  * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
16*7c478bd9Sstevel@tonic-gate  * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
17*7c478bd9Sstevel@tonic-gate  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
18*7c478bd9Sstevel@tonic-gate  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
19*7c478bd9Sstevel@tonic-gate  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
20*7c478bd9Sstevel@tonic-gate  * SOFTWARE.
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate 
23*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
24*7c478bd9Sstevel@tonic-gate 
25*7c478bd9Sstevel@tonic-gate #ifndef lint
26*7c478bd9Sstevel@tonic-gate static const char rcsid[] = "$Id: ns_netint.c,v 8.4 1999/10/13 16:39:35 vixie Exp $";
27*7c478bd9Sstevel@tonic-gate #endif
28*7c478bd9Sstevel@tonic-gate 
29*7c478bd9Sstevel@tonic-gate /* Import. */
30*7c478bd9Sstevel@tonic-gate 
31*7c478bd9Sstevel@tonic-gate #include "port_before.h"
32*7c478bd9Sstevel@tonic-gate 
33*7c478bd9Sstevel@tonic-gate #include <arpa/nameser.h>
34*7c478bd9Sstevel@tonic-gate 
35*7c478bd9Sstevel@tonic-gate #include "port_after.h"
36*7c478bd9Sstevel@tonic-gate 
37*7c478bd9Sstevel@tonic-gate /* Public. */
38*7c478bd9Sstevel@tonic-gate 
39*7c478bd9Sstevel@tonic-gate u_int
40*7c478bd9Sstevel@tonic-gate ns_get16(const u_char *src) {
41*7c478bd9Sstevel@tonic-gate 	u_int dst;
42*7c478bd9Sstevel@tonic-gate 
43*7c478bd9Sstevel@tonic-gate 	NS_GET16(dst, src);
44*7c478bd9Sstevel@tonic-gate 	return (dst);
45*7c478bd9Sstevel@tonic-gate }
46*7c478bd9Sstevel@tonic-gate 
47*7c478bd9Sstevel@tonic-gate u_long
48*7c478bd9Sstevel@tonic-gate ns_get32(const u_char *src) {
49*7c478bd9Sstevel@tonic-gate 	u_long dst;
50*7c478bd9Sstevel@tonic-gate 
51*7c478bd9Sstevel@tonic-gate 	NS_GET32(dst, src);
52*7c478bd9Sstevel@tonic-gate 	return (dst);
53*7c478bd9Sstevel@tonic-gate }
54*7c478bd9Sstevel@tonic-gate 
55*7c478bd9Sstevel@tonic-gate void
56*7c478bd9Sstevel@tonic-gate ns_put16(u_int src, u_char *dst) {
57*7c478bd9Sstevel@tonic-gate 	NS_PUT16(src, dst);
58*7c478bd9Sstevel@tonic-gate }
59*7c478bd9Sstevel@tonic-gate 
60*7c478bd9Sstevel@tonic-gate void
61*7c478bd9Sstevel@tonic-gate ns_put32(u_long src, u_char *dst) {
62*7c478bd9Sstevel@tonic-gate 	NS_PUT32(src, dst);
63*7c478bd9Sstevel@tonic-gate }
64