xref: /titanic_52/usr/src/lib/libresolv2/common/nameser/ns_netint.c (revision 9525b14bcdeb5b5f6f95ab27c2f48f18bd2ec829)
17c478bd9Sstevel@tonic-gate /*
2*9525b14bSRao Shoaib  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
37c478bd9Sstevel@tonic-gate  * Copyright (c) 1996,1999 by Internet Software Consortium.
47c478bd9Sstevel@tonic-gate  *
57c478bd9Sstevel@tonic-gate  * Permission to use, copy, modify, and distribute this software for any
67c478bd9Sstevel@tonic-gate  * purpose with or without fee is hereby granted, provided that the above
77c478bd9Sstevel@tonic-gate  * copyright notice and this permission notice appear in all copies.
87c478bd9Sstevel@tonic-gate  *
9*9525b14bSRao Shoaib  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
10*9525b14bSRao Shoaib  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11*9525b14bSRao Shoaib  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
12*9525b14bSRao Shoaib  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13*9525b14bSRao Shoaib  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14*9525b14bSRao Shoaib  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
15*9525b14bSRao Shoaib  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
167c478bd9Sstevel@tonic-gate  */
177c478bd9Sstevel@tonic-gate 
187c478bd9Sstevel@tonic-gate #ifndef lint
19*9525b14bSRao Shoaib static const char rcsid[] = "$Id: ns_netint.c,v 1.3 2005/04/27 04:56:40 sra Exp $";
207c478bd9Sstevel@tonic-gate #endif
217c478bd9Sstevel@tonic-gate 
227c478bd9Sstevel@tonic-gate /* Import. */
237c478bd9Sstevel@tonic-gate 
247c478bd9Sstevel@tonic-gate #include "port_before.h"
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #include <arpa/nameser.h>
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate #include "port_after.h"
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate /* Public. */
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate u_int
337c478bd9Sstevel@tonic-gate ns_get16(const u_char *src) {
347c478bd9Sstevel@tonic-gate 	u_int dst;
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate 	NS_GET16(dst, src);
377c478bd9Sstevel@tonic-gate 	return (dst);
387c478bd9Sstevel@tonic-gate }
397c478bd9Sstevel@tonic-gate 
407c478bd9Sstevel@tonic-gate u_long
417c478bd9Sstevel@tonic-gate ns_get32(const u_char *src) {
427c478bd9Sstevel@tonic-gate 	u_long dst;
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate 	NS_GET32(dst, src);
457c478bd9Sstevel@tonic-gate 	return (dst);
467c478bd9Sstevel@tonic-gate }
477c478bd9Sstevel@tonic-gate 
487c478bd9Sstevel@tonic-gate void
497c478bd9Sstevel@tonic-gate ns_put16(u_int src, u_char *dst) {
507c478bd9Sstevel@tonic-gate 	NS_PUT16(src, dst);
517c478bd9Sstevel@tonic-gate }
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate void
547c478bd9Sstevel@tonic-gate ns_put32(u_long src, u_char *dst) {
557c478bd9Sstevel@tonic-gate 	NS_PUT32(src, dst);
567c478bd9Sstevel@tonic-gate }
57*9525b14bSRao Shoaib 
58*9525b14bSRao Shoaib /*! \file */
59