diff options
author | millert <> | 2004-07-13 21:06:58 +0000 |
---|---|---|
committer | millert <> | 2004-07-13 21:06:58 +0000 |
commit | b30926eb26089ec41bda98ce642ae145915f9a26 (patch) | |
tree | d423ee16a9f7aca1505824f4c0176d858fbe91e3 | |
parent | a9a5272957f8121d84dc118a506ba3bac7e02bbd (diff) | |
download | openbsd-b30926eb26089ec41bda98ce642ae145915f9a26.tar.gz openbsd-b30926eb26089ec41bda98ce642ae145915f9a26.tar.bz2 openbsd-b30926eb26089ec41bda98ce642ae145915f9a26.zip |
Remove iso_addr() and iso_ntoa() as part of the netiso removal.
From henning@, OK deraadt@
-rw-r--r-- | src/lib/libc/net/Makefile.inc | 7 | ||||
-rw-r--r-- | src/lib/libc/net/iso_addr.3 | 107 | ||||
-rw-r--r-- | src/lib/libc/net/iso_addr.c | 115 |
3 files changed, 3 insertions, 226 deletions
diff --git a/src/lib/libc/net/Makefile.inc b/src/lib/libc/net/Makefile.inc index 81348fa0ff..b4d9feedd9 100644 --- a/src/lib/libc/net/Makefile.inc +++ b/src/lib/libc/net/Makefile.inc | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile.inc,v 1.32 2004/02/10 18:11:58 jmc Exp $ | 1 | # $OpenBSD: Makefile.inc,v 1.33 2004/07/13 21:06:58 millert Exp $ |
2 | 2 | ||
3 | # net sources | 3 | # net sources |
4 | .PATH: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/net ${LIBCSRCDIR}/net | 4 | .PATH: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/net ${LIBCSRCDIR}/net |
@@ -12,7 +12,7 @@ SRCS+= base64.c freeaddrinfo.c gai_strerror.c getaddrinfo.c gethostnamadr.c \ | |||
12 | herror.c if_indextoname.c if_nameindex.c if_nametoindex.c inet_addr.c \ | 12 | herror.c if_indextoname.c if_nameindex.c if_nametoindex.c inet_addr.c \ |
13 | inet_lnaof.c inet_makeaddr.c inet_neta.c inet_netof.c inet_network.c \ | 13 | inet_lnaof.c inet_makeaddr.c inet_neta.c inet_netof.c inet_network.c \ |
14 | inet_net_ntop.c inet_net_pton.c inet_ntoa.c inet_ntop.c inet_pton.c \ | 14 | inet_net_ntop.c inet_net_pton.c inet_ntoa.c inet_ntop.c inet_pton.c \ |
15 | ipx_addr.c ipx_ntoa.c iso_addr.c linkaddr.c ns_addr.c ns_ntoa.c \ | 15 | ipx_addr.c ipx_ntoa.c linkaddr.c ns_addr.c ns_ntoa.c \ |
16 | nsap_addr.c \ | 16 | nsap_addr.c \ |
17 | net_addrcmp.c \ | 17 | net_addrcmp.c \ |
18 | rcmd.c rresvport.c recv.c res_comp.c res_data.c res_debug.c \ | 18 | rcmd.c rresvport.c recv.c res_comp.c res_data.c res_debug.c \ |
@@ -30,7 +30,7 @@ SRCS+= ip6opt.c rthdr.c vars6.c | |||
30 | 30 | ||
31 | MAN+= byteorder.3 ethers.3 getaddrinfo.3 gethostbyname.3 getifaddrs.3 \ | 31 | MAN+= byteorder.3 ethers.3 getaddrinfo.3 gethostbyname.3 getifaddrs.3 \ |
32 | getnameinfo.3 getnetent.3 getprotoent.3 getservent.3 inet.3 \ | 32 | getnameinfo.3 getnetent.3 getprotoent.3 getservent.3 inet.3 \ |
33 | if_indextoname.3 inet_net.3 iso_addr.3 link_addr.3 ns.3 ipx.3 \ | 33 | if_indextoname.3 inet_net.3 link_addr.3 ns.3 ipx.3 \ |
34 | rcmd.3 rcmdsh.3 resolver.3 net_addrcmp.3 \ | 34 | rcmd.3 rcmdsh.3 resolver.3 net_addrcmp.3 \ |
35 | inet6_option_space.3 inet6_rthdr_space.3 \ | 35 | inet6_option_space.3 inet6_rthdr_space.3 \ |
36 | getrrsetbyname.3 | 36 | getrrsetbyname.3 |
@@ -63,7 +63,6 @@ MLINKS+=inet.3 addr.3 inet.3 inet_addr.3 inet.3 inet_aton.3 \ | |||
63 | inet.3 inet_network.3 inet.3 inet_ntoa.3 inet.3 network.3 \ | 63 | inet.3 inet_network.3 inet.3 inet_ntoa.3 inet.3 network.3 \ |
64 | inet.3 ntoa.3 inet.3 inet_ntop.3 inet.3 inet_pton.3 | 64 | inet.3 ntoa.3 inet.3 inet_ntop.3 inet.3 inet_pton.3 |
65 | MLINKS+=inet_net.3 inet_net_ntop.3 inet_net.3 inet_net_pton.3 | 65 | MLINKS+=inet_net.3 inet_net_ntop.3 inet_net.3 inet_net_pton.3 |
66 | MLINKS+=iso_addr.3 iso_ntoa.3 | ||
67 | MLINKS+=link_addr.3 link_ntoa.3 | 66 | MLINKS+=link_addr.3 link_ntoa.3 |
68 | MLINKS+=ipx.3 ipx_addr.3 ipx.3 ipx_ntoa.3 | 67 | MLINKS+=ipx.3 ipx_addr.3 ipx.3 ipx_ntoa.3 |
69 | MLINKS+=ns.3 ns_addr.3 ns.3 ns_ntoa.3 | 68 | MLINKS+=ns.3 ns_addr.3 ns.3 ns_ntoa.3 |
diff --git a/src/lib/libc/net/iso_addr.3 b/src/lib/libc/net/iso_addr.3 deleted file mode 100644 index 896f769482..0000000000 --- a/src/lib/libc/net/iso_addr.3 +++ /dev/null | |||
@@ -1,107 +0,0 @@ | |||
1 | .\" $OpenBSD: iso_addr.3,v 1.5 2003/06/02 20:18:35 millert Exp $ | ||
2 | .\" | ||
3 | .\" Copyright (c) 1993 | ||
4 | .\" The Regents of the University of California. All rights reserved. | ||
5 | .\" | ||
6 | .\" Redistribution and use in source and binary forms, with or without | ||
7 | .\" modification, are permitted provided that the following conditions | ||
8 | .\" are met: | ||
9 | .\" 1. Redistributions of source code must retain the above copyright | ||
10 | .\" notice, this list of conditions and the following disclaimer. | ||
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer in the | ||
13 | .\" documentation and/or other materials provided with the distribution. | ||
14 | .\" 3. Neither the name of the University nor the names of its contributors | ||
15 | .\" may be used to endorse or promote products derived from this software | ||
16 | .\" without specific prior written permission. | ||
17 | .\" | ||
18 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
19 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
24 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
25 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
26 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
28 | .\" SUCH DAMAGE. | ||
29 | .\" | ||
30 | .Dd June 4, 1993 | ||
31 | .Dt ISO_ADDR 3 | ||
32 | .Os | ||
33 | .Sh NAME | ||
34 | .Nm iso_addr , | ||
35 | .Nm iso_ntoa | ||
36 | .Nd "network address conversion routines for Open System Interconnection" | ||
37 | .Sh SYNOPSIS | ||
38 | .Fd #include <sys/types.h> | ||
39 | .Fd #include <netiso/iso.h> | ||
40 | .Ft struct iso_addr * | ||
41 | .Fn iso_addr "char *cp" | ||
42 | .Ft char * | ||
43 | .Fn iso_ntoa "struct iso_addr *isoa" | ||
44 | .Sh DESCRIPTION | ||
45 | The routine | ||
46 | .Fn iso_addr | ||
47 | interprets character strings representing | ||
48 | .Tn OSI | ||
49 | addresses, returning binary information suitable | ||
50 | for use in system calls. | ||
51 | The routine | ||
52 | .Fn iso_ntoa | ||
53 | takes | ||
54 | .Tn OSI | ||
55 | addresses and returns | ||
56 | .Tn ASCII | ||
57 | strings representing NSAPs (network service | ||
58 | access points) in a | ||
59 | notation inverse to that accepted by | ||
60 | .Fn iso_addr . | ||
61 | .Pp | ||
62 | Unfortunately, no universal standard exists for representing | ||
63 | .Tn OSI | ||
64 | network addresses. | ||
65 | .Pp | ||
66 | The format employed by | ||
67 | .Fn iso_addr | ||
68 | is a sequence of hexadecimal | ||
69 | .Dq digits | ||
70 | (optionally separated by periods), | ||
71 | of the form: | ||
72 | .Bd -filled -offset indent | ||
73 | <hex digits>.<hex digits>.<hex digits> | ||
74 | .Ed | ||
75 | .Pp | ||
76 | Each pair of hexadecimal digits represents a byte | ||
77 | with the leading digit indicating the higher-ordered bits. | ||
78 | A period following an even number of bytes has no | ||
79 | effect (but may be used to increase legibility). | ||
80 | A period following an odd number of bytes has the | ||
81 | effect of causing the byte of address being translated | ||
82 | to have its higher order bits filled with zeros. | ||
83 | .Sh RETURN VALUES | ||
84 | .Fn iso_ntoa | ||
85 | always returns a null terminated string. | ||
86 | .Fn iso_addr | ||
87 | always returns a pointer to a | ||
88 | .Li struct iso_addr . | ||
89 | (See | ||
90 | .Sx BUGS . ) | ||
91 | .Sh SEE ALSO | ||
92 | .Xr iso 4 | ||
93 | .Sh HISTORY | ||
94 | The | ||
95 | .Fn iso_addr | ||
96 | and | ||
97 | .Fn iso_ntoa | ||
98 | functions appeared in | ||
99 | .Bx 4.3 Reno . | ||
100 | .Sh BUGS | ||
101 | The returned values | ||
102 | reside in a static memory area. | ||
103 | .Pp | ||
104 | The function | ||
105 | .Fn iso_addr | ||
106 | should diagnose improperly formed input, and there should be an unambiguous | ||
107 | way to recognize this. | ||
diff --git a/src/lib/libc/net/iso_addr.c b/src/lib/libc/net/iso_addr.c deleted file mode 100644 index f0f8444325..0000000000 --- a/src/lib/libc/net/iso_addr.c +++ /dev/null | |||
@@ -1,115 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) 1989, 1993 | ||
3 | * The Regents of the University of California. All rights reserved. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions | ||
7 | * are met: | ||
8 | * 1. Redistributions of source code must retain the above copyright | ||
9 | * notice, this list of conditions and the following disclaimer. | ||
10 | * 2. Redistributions in binary form must reproduce the above copyright | ||
11 | * notice, this list of conditions and the following disclaimer in the | ||
12 | * documentation and/or other materials provided with the distribution. | ||
13 | * 3. Neither the name of the University nor the names of its contributors | ||
14 | * may be used to endorse or promote products derived from this software | ||
15 | * without specific prior written permission. | ||
16 | * | ||
17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
27 | * SUCH DAMAGE. | ||
28 | */ | ||
29 | |||
30 | #if defined(LIBC_SCCS) && !defined(lint) | ||
31 | static char rcsid[] = "$OpenBSD: iso_addr.c,v 1.3 2003/06/02 20:18:35 millert Exp $"; | ||
32 | #endif /* LIBC_SCCS and not lint */ | ||
33 | |||
34 | #include <sys/types.h> | ||
35 | #include <netiso/iso.h> | ||
36 | #include <string.h> | ||
37 | |||
38 | /* States*/ | ||
39 | #define VIRGIN 0 | ||
40 | #define GOTONE 1 | ||
41 | #define GOTTWO 2 | ||
42 | /* Inputs */ | ||
43 | #define DIGIT (4*0) | ||
44 | #define END (4*1) | ||
45 | #define DELIM (4*2) | ||
46 | |||
47 | struct iso_addr * | ||
48 | iso_addr(addr) | ||
49 | register const char *addr; | ||
50 | { | ||
51 | static struct iso_addr out_addr; | ||
52 | register char *cp = out_addr.isoa_genaddr; | ||
53 | char *cplim = cp + sizeof(out_addr.isoa_genaddr); | ||
54 | register int byte = 0, state = VIRGIN, new; | ||
55 | |||
56 | bzero((char *)&out_addr, sizeof(out_addr)); | ||
57 | do { | ||
58 | if ((*addr >= '0') && (*addr <= '9')) { | ||
59 | new = *addr - '0'; | ||
60 | } else if ((*addr >= 'a') && (*addr <= 'f')) { | ||
61 | new = *addr - 'a' + 10; | ||
62 | } else if ((*addr >= 'A') && (*addr <= 'F')) { | ||
63 | new = *addr - 'A' + 10; | ||
64 | } else if (*addr == 0) | ||
65 | state |= END; | ||
66 | else | ||
67 | state |= DELIM; | ||
68 | addr++; | ||
69 | switch (state /* | INPUT */) { | ||
70 | case GOTTWO | DIGIT: | ||
71 | *cp++ = byte; /*FALLTHROUGH*/ | ||
72 | case VIRGIN | DIGIT: | ||
73 | state = GOTONE; byte = new; continue; | ||
74 | case GOTONE | DIGIT: | ||
75 | state = GOTTWO; byte = new + (byte << 4); continue; | ||
76 | default: /* | DELIM */ | ||
77 | state = VIRGIN; *cp++ = byte; byte = 0; continue; | ||
78 | case GOTONE | END: | ||
79 | case GOTTWO | END: | ||
80 | *cp++ = byte; /* FALLTHROUGH */ | ||
81 | case VIRGIN | END: | ||
82 | break; | ||
83 | } | ||
84 | break; | ||
85 | } while (cp < cplim); | ||
86 | out_addr.isoa_len = cp - out_addr.isoa_genaddr; | ||
87 | return (&out_addr); | ||
88 | } | ||
89 | static char hexlist[] = "0123456789abcdef"; | ||
90 | |||
91 | char * | ||
92 | iso_ntoa(isoa) | ||
93 | const struct iso_addr *isoa; | ||
94 | { | ||
95 | static char obuf[64]; | ||
96 | register char *out = obuf; | ||
97 | register int i; | ||
98 | register u_char *in = (u_char *)isoa->isoa_genaddr; | ||
99 | u_char *inlim = in + isoa->isoa_len; | ||
100 | |||
101 | out[1] = 0; | ||
102 | while (in < inlim) { | ||
103 | i = *in++; | ||
104 | *out++ = '.'; | ||
105 | if (i > 0xf) { | ||
106 | out[1] = hexlist[i & 0xf]; | ||
107 | i >>= 4; | ||
108 | out[0] = hexlist[i]; | ||
109 | out += 2; | ||
110 | } else | ||
111 | *out++ = hexlist[i]; | ||
112 | } | ||
113 | *out = 0; | ||
114 | return(obuf + 1); | ||
115 | } | ||