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