4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/*
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Copyright (c) 1996 by Internet Software Consortium.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync *
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Permission to use, copy, modify, and distribute this software for any
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * purpose with or without fee is hereby granted, provided that the above
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * copyright notice and this permission notice appear in all copies.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync *
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * SOFTWARE.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync */
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#ifndef lint
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncstatic char rcsid[] = "$Id: ns_netint.c,v 1.1.1.1 2003/11/19 01:51:33 kyu3 Exp $";
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#endif
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/* Import. */
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <sys/types.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <sys/socket.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <netinet/in.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <arpa/nameser.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncuint16_t
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncns_get16(const u_char *src) {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync uint16_t dst;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync NS_GET16(dst, src);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return (dst);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncuint32_t
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncns_get32(const u_char *src) {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync uint32_t dst;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync NS_GET32(dst, src);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return (dst);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncvoid
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncns_put16(uint16_t src, u_char *dst) {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync NS_PUT16(src, dst);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncvoid
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncns_put32(uint32_t src, u_char *dst) {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync NS_PUT32(src, dst);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync}