Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a824add

Browse files
committed
Remove unused INET functions for D'Arcy.
1 parent d7fc00c commit a824add

File tree

3 files changed

+3
-121
lines changed

3 files changed

+3
-121
lines changed

src/backend/utils/adt/inet.c

+1-110
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* is for IP V4 CIDR notation, but prepared for V6: just
44
* add the necessary bits where the comments indicate.
55
*
6-
* $Id: inet.c,v 1.5 1998/10/17 04:08:40 momjian Exp $
6+
* $Id: inet.c,v 1.6 1998/10/20 23:03:19 momjian Exp $
77
*/
88

99
#include <sys/types.h>
@@ -312,115 +312,6 @@ inet_masklen(inet *ip)
312312
return ip_bits(ip);
313313
}
314314

315-
text *
316-
inet_host(inet *ip)
317-
{
318-
char *dst,
319-
tmp[sizeof("255.255.255.255/32")];
320-
321-
if (ip_family(ip) == AF_INET)
322-
{
323-
#ifdef BAD
324-
/* It's an IP V4 address: */
325-
if (inet_cidr_ntop(AF_INET, &ip_v4addr(ip), 4, -1,
326-
tmp, sizeof(tmp)) < 0)
327-
{
328-
elog(ERROR, "unable to print host (%s)", strerror(errno));
329-
return (NULL);
330-
}
331-
#endif
332-
}
333-
else
334-
{
335-
/* Go for an IPV6 address here, before faulting out: */
336-
elog(ERROR, "unknown address family (%d)", ip_family(ip));
337-
return (NULL);
338-
}
339-
dst = palloc(strlen(tmp) + 1);
340-
if (dst == NULL)
341-
{
342-
elog(ERROR, "unable to allocate memory in inet_out()");
343-
return (NULL);
344-
}
345-
strcpy(dst, tmp);
346-
return (dst);
347-
348-
}
349-
350-
text *
351-
inet_network_without_bits(inet *ip)
352-
{
353-
char *dst,
354-
tmp[sizeof("255.255.255.255/32")];
355-
356-
if (ip_family(ip) == AF_INET)
357-
{
358-
/* It's an IP V4 address: */
359-
int addr = ip_v4addr(ip) & (-1 << (32 - ip_bits(ip)));
360-
#ifdef BAD
361-
362-
if (inet_cidr_ntop(AF_INET, &addr, (int)(ip_bits(ip)/8), -1,
363-
tmp, sizeof(tmp)) < 0)
364-
{
365-
elog(ERROR, "unable to print address (%s)", strerror(errno));
366-
return (NULL);
367-
}
368-
#endif
369-
}
370-
else
371-
{
372-
/* Go for an IPV6 address here, before faulting out: */
373-
elog(ERROR, "unknown address family (%d)", ip_family(ip));
374-
return (NULL);
375-
}
376-
dst = palloc(strlen(tmp) + 1);
377-
if (dst == NULL)
378-
{
379-
elog(ERROR, "unable to allocate memory in inet_out()");
380-
return (NULL);
381-
}
382-
strcpy(dst, tmp);
383-
return (dst);
384-
385-
}
386-
387-
text *
388-
inet_network_with_bits(inet *ip)
389-
{
390-
char *dst,
391-
tmp[sizeof("255.255.255.255/32")];
392-
393-
if (ip_family(ip) == AF_INET)
394-
{
395-
/* It's an IP V4 address: */
396-
int addr = ip_v4addr(ip) & (-1 << (32 - ip_bits(ip)));
397-
#ifdef BAD
398-
399-
if (inet_cidr_ntop(AF_INET, &addr, (int)(ip_bits(ip)/8),
400-
ip_bits(ip), tmp, sizeof(tmp)) < 0)
401-
{
402-
elog(ERROR, "unable to print address (%s)", strerror(errno));
403-
return (NULL);
404-
}
405-
#endif
406-
}
407-
else
408-
{
409-
/* Go for an IPV6 address here, before faulting out: */
410-
elog(ERROR, "unknown address family (%d)", ip_family(ip));
411-
return (NULL);
412-
}
413-
dst = palloc(strlen(tmp) + 1);
414-
if (dst == NULL)
415-
{
416-
elog(ERROR, "unable to allocate memory in inet_out()");
417-
return (NULL);
418-
}
419-
strcpy(dst, tmp);
420-
return (dst);
421-
422-
}
423-
424315
text *
425316
inet_broadcast(inet *ip)
426317
{

src/include/catalog/pg_proc.h

+1-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: pg_proc.h,v 1.73 1998/10/12 04:07:48 momjian Exp $
9+
* $Id: pg_proc.h,v 1.74 1998/10/20 23:03:19 momjian Exp $
1010
*
1111
* NOTES
1212
* The script catalog/genbki.sh reads this file and generates .bki
@@ -2101,12 +2101,6 @@ DATA(insert OID = 940 ( inet_netmask PGUID 11 f t f 1 f 25 "869" 100 0 0 100
21012101
DESCR("netmask of inet address");
21022102
DATA(insert OID = 941 ( inet_masklen PGUID 11 f t f 1 f 23 "869" 100 0 0 100 foo bar ));
21032103
DESCR("netmask length");
2104-
DATA(insert OID = 942 ( inet_host PGUID 11 f t f 1 f 25 "869" 100 0 0 100 foo bar ));
2105-
DESCR("host adress");
2106-
DATA(insert OID = 943 ( inet_network_without_bits PGUID 11 f t f 1 f 25 "869" 100 0 0 100 foo bar ));
2107-
DESCR("netmask without bits");
2108-
DATA(insert OID = 944 ( inet_network_with_bits PGUID 11 f t f 1 f 25 "869" 100 0 0 100 foo bar ));
2109-
DESCR("netmask with bits");
21102104
DATA(insert OID = 945 ( inet_broadcast PGUID 11 f t f 1 f 25 "869" 100 0 0 100 foo bar ));
21112105
DESCR("broadcast address");
21122106

src/include/utils/builtins.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: builtins.h,v 1.61 1998/10/12 04:07:51 momjian Exp $
9+
* $Id: builtins.h,v 1.62 1998/10/20 23:03:20 momjian Exp $
1010
*
1111
* NOTES
1212
* This should normally only be included by fmgr.h.
@@ -535,9 +535,6 @@ int4 inet_cmp(inet * a1, inet * a2);
535535

536536
text *inet_netmask(inet * addr);
537537
int4 inet_masklen(inet * addr);
538-
text *inet_host(inet * addr);
539-
text *inet_network_without_bits(inet * addr);
540-
text *inet_network_with_bits(inet * addr);
541538
text *inet_broadcast(inet * addr);
542539

543540

0 commit comments

Comments
 (0)