Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
a824add4
Commit
a824add4
authored
Oct 20, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused INET functions for D'Arcy.
parent
d7fc00c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
121 deletions
+3
-121
src/backend/utils/adt/inet.c
src/backend/utils/adt/inet.c
+1
-110
src/include/catalog/pg_proc.h
src/include/catalog/pg_proc.h
+1
-7
src/include/utils/builtins.h
src/include/utils/builtins.h
+1
-4
No files found.
src/backend/utils/adt/inet.c
View file @
a824add4
...
...
@@ -3,7 +3,7 @@
* is for IP V4 CIDR notation, but prepared for V6: just
* add the necessary bits where the comments indicate.
*
* $Id: inet.c,v 1.
5 1998/10/17 04:08:40
momjian Exp $
* $Id: inet.c,v 1.
6 1998/10/20 23:03:19
momjian Exp $
*/
#include <sys/types.h>
...
...
@@ -312,115 +312,6 @@ inet_masklen(inet *ip)
return
ip_bits
(
ip
);
}
text
*
inet_host
(
inet
*
ip
)
{
char
*
dst
,
tmp
[
sizeof
(
"255.255.255.255/32"
)];
if
(
ip_family
(
ip
)
==
AF_INET
)
{
#ifdef BAD
/* It's an IP V4 address: */
if
(
inet_cidr_ntop
(
AF_INET
,
&
ip_v4addr
(
ip
),
4
,
-
1
,
tmp
,
sizeof
(
tmp
))
<
0
)
{
elog
(
ERROR
,
"unable to print host (%s)"
,
strerror
(
errno
));
return
(
NULL
);
}
#endif
}
else
{
/* Go for an IPV6 address here, before faulting out: */
elog
(
ERROR
,
"unknown address family (%d)"
,
ip_family
(
ip
));
return
(
NULL
);
}
dst
=
palloc
(
strlen
(
tmp
)
+
1
);
if
(
dst
==
NULL
)
{
elog
(
ERROR
,
"unable to allocate memory in inet_out()"
);
return
(
NULL
);
}
strcpy
(
dst
,
tmp
);
return
(
dst
);
}
text
*
inet_network_without_bits
(
inet
*
ip
)
{
char
*
dst
,
tmp
[
sizeof
(
"255.255.255.255/32"
)];
if
(
ip_family
(
ip
)
==
AF_INET
)
{
/* It's an IP V4 address: */
int
addr
=
ip_v4addr
(
ip
)
&
(
-
1
<<
(
32
-
ip_bits
(
ip
)));
#ifdef BAD
if
(
inet_cidr_ntop
(
AF_INET
,
&
addr
,
(
int
)(
ip_bits
(
ip
)
/
8
),
-
1
,
tmp
,
sizeof
(
tmp
))
<
0
)
{
elog
(
ERROR
,
"unable to print address (%s)"
,
strerror
(
errno
));
return
(
NULL
);
}
#endif
}
else
{
/* Go for an IPV6 address here, before faulting out: */
elog
(
ERROR
,
"unknown address family (%d)"
,
ip_family
(
ip
));
return
(
NULL
);
}
dst
=
palloc
(
strlen
(
tmp
)
+
1
);
if
(
dst
==
NULL
)
{
elog
(
ERROR
,
"unable to allocate memory in inet_out()"
);
return
(
NULL
);
}
strcpy
(
dst
,
tmp
);
return
(
dst
);
}
text
*
inet_network_with_bits
(
inet
*
ip
)
{
char
*
dst
,
tmp
[
sizeof
(
"255.255.255.255/32"
)];
if
(
ip_family
(
ip
)
==
AF_INET
)
{
/* It's an IP V4 address: */
int
addr
=
ip_v4addr
(
ip
)
&
(
-
1
<<
(
32
-
ip_bits
(
ip
)));
#ifdef BAD
if
(
inet_cidr_ntop
(
AF_INET
,
&
addr
,
(
int
)(
ip_bits
(
ip
)
/
8
),
ip_bits
(
ip
),
tmp
,
sizeof
(
tmp
))
<
0
)
{
elog
(
ERROR
,
"unable to print address (%s)"
,
strerror
(
errno
));
return
(
NULL
);
}
#endif
}
else
{
/* Go for an IPV6 address here, before faulting out: */
elog
(
ERROR
,
"unknown address family (%d)"
,
ip_family
(
ip
));
return
(
NULL
);
}
dst
=
palloc
(
strlen
(
tmp
)
+
1
);
if
(
dst
==
NULL
)
{
elog
(
ERROR
,
"unable to allocate memory in inet_out()"
);
return
(
NULL
);
}
strcpy
(
dst
,
tmp
);
return
(
dst
);
}
text
*
inet_broadcast
(
inet
*
ip
)
{
...
...
src/include/catalog/pg_proc.h
View file @
a824add4
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_proc.h,v 1.7
3 1998/10/12 04:07:48
momjian Exp $
* $Id: pg_proc.h,v 1.7
4 1998/10/20 23:03:19
momjian Exp $
*
* NOTES
* 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
DESCR
(
"netmask of inet address"
);
DATA
(
insert
OID
=
941
(
inet_masklen
PGUID
11
f
t
f
1
f
23
"869"
100
0
0
100
foo
bar
));
DESCR
(
"netmask length"
);
DATA
(
insert
OID
=
942
(
inet_host
PGUID
11
f
t
f
1
f
25
"869"
100
0
0
100
foo
bar
));
DESCR
(
"host adress"
);
DATA
(
insert
OID
=
943
(
inet_network_without_bits
PGUID
11
f
t
f
1
f
25
"869"
100
0
0
100
foo
bar
));
DESCR
(
"netmask without bits"
);
DATA
(
insert
OID
=
944
(
inet_network_with_bits
PGUID
11
f
t
f
1
f
25
"869"
100
0
0
100
foo
bar
));
DESCR
(
"netmask with bits"
);
DATA
(
insert
OID
=
945
(
inet_broadcast
PGUID
11
f
t
f
1
f
25
"869"
100
0
0
100
foo
bar
));
DESCR
(
"broadcast address"
);
...
...
src/include/utils/builtins.h
View file @
a824add4
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: builtins.h,v 1.6
1 1998/10/12 04:07:51
momjian Exp $
* $Id: builtins.h,v 1.6
2 1998/10/20 23:03:20
momjian Exp $
*
* NOTES
* This should normally only be included by fmgr.h.
...
...
@@ -535,9 +535,6 @@ int4 inet_cmp(inet * a1, inet * a2);
text
*
inet_netmask
(
inet
*
addr
);
int4
inet_masklen
(
inet
*
addr
);
text
*
inet_host
(
inet
*
addr
);
text
*
inet_network_without_bits
(
inet
*
addr
);
text
*
inet_network_with_bits
(
inet
*
addr
);
text
*
inet_broadcast
(
inet
*
addr
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment