NTOHL / HTONL removal.
authorJoerg Sonnenberger <joerg@dragonflybsd.org>
Wed, 28 Jul 2004 12:27:40 +0000 (12:27 +0000)
committerJoerg Sonnenberger <joerg@dragonflybsd.org>
Wed, 28 Jul 2004 12:27:40 +0000 (12:27 +0000)
sbin/routed/if.c
sbin/routed/input.c
sbin/routed/output.c
sbin/routed/parms.c
sbin/routed/rtquery/rtquery.c
sbin/routed/table.c

index 850a1c4..1758a85 100644 (file)
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sbin/routed/if.c,v 1.6.2.1 2000/08/14 17:00:03 sheldonh Exp $
- * $DragonFly: src/sbin/routed/if.c,v 1.2 2003/06/17 04:27:34 dillon Exp $
+ * $DragonFly: src/sbin/routed/if.c,v 1.3 2004/07/28 12:27:40 joerg Exp $
  */
 
 #include "defs.h"
@@ -285,7 +285,7 @@ iflookup(naddr addr)
 naddr                                  /* host byte order */
 std_mask(naddr addr)                   /* network byte order */
 {
-       NTOHL(addr);                    /* was a host, not a network */
+       addr = ntohl(addr);             /* was a host, not a network */
 
        if (addr == 0)                  /* default route has mask 0 */
                return 0;
@@ -373,7 +373,7 @@ ripv1_mask_host(naddr addr,         /* in network byte order */
 int                                    /* 0=bad */
 check_dst(naddr addr)
 {
-       NTOHL(addr);
+       addr = ntohl(addr);
 
        if (IN_CLASSA(addr)) {
                if (addr == 0)
index 83cc693..f590f88 100644 (file)
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sbin/routed/input.c,v 1.7.2.1 2001/08/01 09:01:45 obrien Exp $
- * $DragonFly: src/sbin/routed/input.c,v 1.2 2003/06/17 04:27:34 dillon Exp $
+ * $DragonFly: src/sbin/routed/input.c,v 1.3 2004/07/28 12:27:40 joerg Exp $
  */
 
 #include "defs.h"
@@ -278,7 +278,7 @@ input(struct sockaddr_in *from,             /* received from this IP address */
                clr_ws_buf(&v12buf, ap);
 
                do {
-                       NTOHL(n->n_metric);
+                       n->n_metric = ntohl(n->n_metric);
 
                        /* A single entry with family RIP_AF_UNSPEC and
                         * metric HOPCNT_INFINITY means "all routes".
@@ -414,7 +414,7 @@ input(struct sockaddr_in *from,             /* received from this IP address */
                                            v12buf.n->n_nhop = rt->rt_gate;
                                }
                        }
-                       HTONL(v12buf.n->n_metric);
+                       v12buf.n->n_metric = htonl(v12buf.n->n_metric);
 
                        /* Stop paying attention if we fill the output buffer.
                         */
@@ -583,7 +583,7 @@ input(struct sockaddr_in *from,             /* received from this IP address */
                        if (n->n_family == RIP_AF_AUTH)
                                continue;
 
-                       NTOHL(n->n_metric);
+                       n->n_metric = ntohl(n->n_metric);
                        dst = n->n_dst;
                        if (n->n_family != RIP_AF_INET
                            && (n->n_family != RIP_AF_UNSPEC
index 8c320ee..b0fc207 100644 (file)
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sbin/routed/output.c,v 1.5.2.1 2000/08/14 17:00:03 sheldonh Exp $
- * $DragonFly: src/sbin/routed/output.c,v 1.2 2003/06/17 04:27:34 dillon Exp $
+ * $DragonFly: src/sbin/routed/output.c,v 1.3 2004/07/28 12:27:40 joerg Exp $
  */
 
 #include "defs.h"
@@ -420,7 +420,7 @@ supply_out(struct ag_info *ag)
                wb->n->n_metric = ((stopint || ag->ag_metric < 1)
                                   ? HOPCNT_INFINITY
                                   : ag->ag_metric);
-               HTONL(wb->n->n_metric);
+               wb->n->n_metric = htonl(wb->n->n_metric);
                /* Any non-zero bits in the supposedly unused RIPv1 fields
                 * cause the old `routed` to ignore the route.
                 * That means the mask and so forth cannot be sent
index ce6a6e9..0905cc2 100644 (file)
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sbin/routed/parms.c,v 1.7.2.1 2000/08/14 17:00:03 sheldonh Exp $
- * $DragonFly: src/sbin/routed/parms.c,v 1.2 2003/06/17 04:27:34 dillon Exp $
+ * $DragonFly: src/sbin/routed/parms.c,v 1.3 2004/07/28 12:27:40 joerg Exp $
  */
 
 #include "defs.h"
@@ -250,7 +250,7 @@ gwkludge(void)
                                       dname, lptr);
                                continue;
                        }
-                       HTONL(dst);     /* make network # into IP address */
+                       dst = htonl(dst); /* make network # into IP address */
                } else {
                        msglog("bad \"%s\" in "_PATH_GATEWAYS
                               " entry \"%s\"", net_host, lptr);
@@ -613,7 +613,7 @@ parse_parms(char *line,
                        free(intnetp);
                        return bad_str(line);
                }
-               HTONL(intnetp->intnet_addr);
+               intnetp->intnet_addr = htonl(intnetp->intnet_addr);
                intnetp->intnet_next = intnets;
                intnets = intnetp;
                return 0;
@@ -946,7 +946,7 @@ getnet(char *name,
                if (0 == (in.s_addr & 0xff000000))
                        in.s_addr <<= 8;
        } else if (inet_aton(name, &in) == 1) {
-               NTOHL(in.s_addr);
+               in.s_addr = ntohl(in.s_addr);
        } else if (!mname && !strcasecmp(name,"default")) {
                in.s_addr = RIP_DEFAULT;
        } else {
index 6a18522..8e21973 100644 (file)
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sbin/routed/rtquery/rtquery.c,v 1.13 1999/08/28 00:14:21 peter Exp $
- * $DragonFly: src/sbin/routed/rtquery/rtquery.c,v 1.2 2003/06/17 04:27:34 dillon Exp $
+ * $DragonFly: src/sbin/routed/rtquery/rtquery.c,v 1.3 2004/07/28 12:27:40 joerg Exp $
  */
 
 char copyright[] =
@@ -783,7 +783,7 @@ rip_input(struct sockaddr_in *from,
 static u_int
 std_mask(u_int addr)                   /* in network order */
 {
-       NTOHL(addr);                    /* was a host, not a network */
+       addr = ntohl(addr);             /* was a host, not a network */
 
        if (addr == 0)                  /* default route has mask 0 */
                return 0;
@@ -826,7 +826,7 @@ getnet(char *name,
        if (nentp != 0) {
                in.s_addr = nentp->n_net;
        } else if (inet_aton(name, &in) == 1) {
-               NTOHL(in.s_addr);
+               in.s_addr = ntohl(in.s_addr);
        } else {
                return 0;
        }
index 3c8d5ed..860fcd4 100644 (file)
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sbin/routed/table.c,v 1.9.2.2 2000/08/14 17:00:04 sheldonh Exp $
- * $DragonFly: src/sbin/routed/table.c,v 1.3 2004/02/04 17:40:01 joerg Exp $
+ * $DragonFly: src/sbin/routed/table.c,v 1.4 2004/07/28 12:27:40 joerg Exp $
  */
 
 #include "defs.h"
@@ -299,7 +299,7 @@ ag_check(naddr      dst,
        naddr xaddr;
        int x;
 
-       NTOHL(dst);
+       dst = ntohl(dst);
 
        /* Punt non-contiguous subnet masks.
         *