ns_netint.c revision 267654
11590Srgrimes/* 21590Srgrimes * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") 31590Srgrimes * Copyright (c) 1996,1999 by Internet Software Consortium. 41590Srgrimes * 51590Srgrimes * Permission to use, copy, modify, and distribute this software for any 61590Srgrimes * purpose with or without fee is hereby granted, provided that the above 71590Srgrimes * copyright notice and this permission notice appear in all copies. 81590Srgrimes * 91590Srgrimes * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES 101590Srgrimes * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 111590Srgrimes * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR 121590Srgrimes * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 131590Srgrimes * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 141590Srgrimes * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 151590Srgrimes * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 161590Srgrimes */ 171590Srgrimes 181590Srgrimes#ifndef lint 191590Srgrimesstatic const char rcsid[] = "$Id: ns_netint.c,v 1.2.18.1 2005/04/27 05:01:08 sra Exp $"; 201590Srgrimes#endif 211590Srgrimes 221590Srgrimes/* Import. */ 231590Srgrimes 241590Srgrimes#include "port_before.h" 251590Srgrimes 261590Srgrimes#include <arpa/nameser.h> 271590Srgrimes 281590Srgrimes#include "port_after.h" 291590Srgrimes 301590Srgrimes/* Public. */ 3174769Smikeh 321590Srgrimesu_int 3374769Smikehns_get16(const u_char *src) { 341590Srgrimes u_int dst; 3599112Sobrien 3699112Sobrien NS_GET16(dst, src); 371590Srgrimes return (dst); 3891227Sbde} 3991227Sbde 401590Srgrimesu_long 411590Srgrimesns_get32(const u_char *src) { 421590Srgrimes u_long dst; 431590Srgrimes 441590Srgrimes NS_GET32(dst, src); 451590Srgrimes return (dst); 461590Srgrimes} 471590Srgrimes 481590Srgrimesvoid 4992921Simpns_put16(u_int src, u_char *dst) { 5077274Smikeh NS_PUT16(src, dst); 511590Srgrimes} 521590Srgrimes 531590Srgrimesvoid 541590Srgrimesns_put32(u_long src, u_char *dst) { 55216564Scharnier NS_PUT32(src, dst); 561590Srgrimes} 571590Srgrimes 581590Srgrimes/*! \file */ 591590Srgrimes