Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
a824add4
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a824add4
编写于
10月 20, 1998
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unused INET functions for D'Arcy.
上级
d7fc00c2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
3 addition
and
121 deletion
+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
未找到文件。
src/backend/utils/adt/inet.c
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录