minor fix to return E_USAGE on -V instead of exit(0);
[oss-qm-packages.git] / lib / loopback.c
blob0f08ac2e177dfb1b73989bb9bd8ba5dc8f2eb1c4
1 /*
2 * lib/loopback.c This file contains the general hardware types.
4 * Version: $Id: loopback.c,v 1.7 1999/09/27 11:00:48 philip Exp $
6 * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
7 * Copyright 1993 MicroWalt Corporation
9 * Modifications:
10 * 1998-07-01 - Arnaldo Carvalho de Melo - GNU gettext instead of catgets
12 * This program is free software; you can redistribute it
13 * and/or modify it under the terms of the GNU General
14 * Public License as published by the Free Software
15 * Foundation; either version 2 of the License, or (at
16 * your option) any later version.
18 #include "config.h"
20 #include <sys/types.h>
21 #include <sys/socket.h>
22 #include <net/if_arp.h>
23 #include <stdlib.h>
24 #include <stdio.h>
25 #include <errno.h>
26 #include <ctype.h>
27 #include <string.h>
28 #include <unistd.h>
29 #include "net-support.h"
30 #include "pathnames.h"
31 #include "intl.h"
32 #include "util.h"
34 /* Display an UNSPEC address. */
35 static char *pr_unspec(unsigned char *ptr)
37 static char buff[64];
38 char *pos;
39 unsigned int i;
41 pos = buff;
42 for (i = 0; i < sizeof(struct sockaddr); i++) {
43 pos += sprintf(pos, "%02X-", (*ptr++ & 0377));
45 buff[strlen(buff) - 1] = '\0';
46 return (buff);
49 struct hwtype unspec_hwtype =
51 "unspec", NULL, /*"UNSPEC", */ -1, 0,
52 pr_unspec, NULL, NULL
55 struct hwtype loop_hwtype =
57 "loop", NULL, /*"Local Loopback", */ ARPHRD_LOOPBACK, 0,
58 NULL, NULL, NULL