mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
Missed a few files that were added with the lib/modules patch...
This commit is contained in:
131
contrib/ip_and_mac/ip.sql.in
Normal file
131
contrib/ip_and_mac/ip.sql.in
Normal file
@@ -0,0 +1,131 @@
|
||||
--
|
||||
-- PostgreSQL code for IP addresses.
|
||||
--
|
||||
-- $Id: ip.sql.in,v 1.1 1998/04/22 04:20:30 scrappy Exp $
|
||||
--
|
||||
|
||||
load '_OBJWD_/ip_DLSUFFIX_';
|
||||
|
||||
--
|
||||
-- Input and output functions and the type itself:
|
||||
--
|
||||
|
||||
create function ipaddr_in(opaque)
|
||||
returns opaque
|
||||
as '_OBJWD_/ip_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
create function ipaddr_out(opaque)
|
||||
returns opaque
|
||||
as '_OBJWD_/ip_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
create type ipaddr (
|
||||
internallength = 6,
|
||||
externallength = variable,
|
||||
input = ipaddr_in,
|
||||
output = ipaddr_out
|
||||
);
|
||||
|
||||
--
|
||||
-- The various boolean tests:
|
||||
--
|
||||
|
||||
create function ipaddr_lt(ipaddr, ipaddr)
|
||||
returns bool
|
||||
as '_OBJWD_/ip_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
create function ipaddr_le(ipaddr, ipaddr)
|
||||
returns bool
|
||||
as '_OBJWD_/ip_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
create function ipaddr_eq(ipaddr, ipaddr)
|
||||
returns bool
|
||||
as '_OBJWD_/ip_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
create function ipaddr_ge(ipaddr, ipaddr)
|
||||
returns bool
|
||||
as '_OBJWD_/ip_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
create function ipaddr_gt(ipaddr, ipaddr)
|
||||
returns bool
|
||||
as '_OBJWD_/ip_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
create function ipaddr_ne(ipaddr, ipaddr)
|
||||
returns bool
|
||||
as '_OBJWD_/ip_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
create function ipaddr_in_net(ipaddr, ipaddr)
|
||||
returns bool
|
||||
as '_OBJWD_/ip_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
create function ipaddr_mask(ipaddr)
|
||||
returns ipaddr
|
||||
as '_OBJWD_/ip_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
create function ipaddr_bcast(ipaddr)
|
||||
returns ipaddr
|
||||
as '_OBJWD_/ip_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
--
|
||||
-- Now the operators. Note how some of the parameters to some
|
||||
-- of the 'create operator' commands are commented out. This
|
||||
-- is because they reference as yet undefined operators, and
|
||||
-- will be implicitly defined when those are, further down.
|
||||
--
|
||||
|
||||
create operator < (
|
||||
leftarg = ipaddr,
|
||||
rightarg = ipaddr,
|
||||
-- negator = >=,
|
||||
procedure = ipaddr_lt
|
||||
);
|
||||
|
||||
create operator <= (
|
||||
leftarg = ipaddr,
|
||||
rightarg = ipaddr,
|
||||
-- negator = >,
|
||||
procedure = ipaddr_le
|
||||
);
|
||||
|
||||
create operator = (
|
||||
leftarg = ipaddr,
|
||||
rightarg = ipaddr,
|
||||
commutator = =,
|
||||
-- negator = <>,
|
||||
procedure = ipaddr_eq
|
||||
);
|
||||
|
||||
create operator >= (
|
||||
leftarg = ipaddr,
|
||||
rightarg = ipaddr,
|
||||
negator = <,
|
||||
procedure = ipaddr_ge
|
||||
);
|
||||
|
||||
create operator > (
|
||||
leftarg = ipaddr,
|
||||
rightarg = ipaddr,
|
||||
negator = <=,
|
||||
procedure = ipaddr_gt
|
||||
);
|
||||
|
||||
create operator <> (
|
||||
leftarg = ipaddr,
|
||||
rightarg = ipaddr,
|
||||
negator = =,
|
||||
procedure = ipaddr_ne
|
||||
);
|
||||
|
||||
--
|
||||
-- eof
|
||||
--
|
125
contrib/ip_and_mac/mac.sql.in
Normal file
125
contrib/ip_and_mac/mac.sql.in
Normal file
@@ -0,0 +1,125 @@
|
||||
--
|
||||
-- PostgreSQL code for MAC addresses.
|
||||
--
|
||||
-- $Id: mac.sql.in,v 1.1 1998/04/22 04:20:36 scrappy Exp $
|
||||
--
|
||||
|
||||
load '_OBJWD_/mac_DLSUFFIX_';
|
||||
|
||||
--
|
||||
-- Input and output functions and the type itself:
|
||||
--
|
||||
|
||||
create function macaddr_in(opaque)
|
||||
returns opaque
|
||||
as '_OBJWD_/mac_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
create function macaddr_out(opaque)
|
||||
returns opaque
|
||||
as '_OBJWD_/mac_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
create type macaddr (
|
||||
internallength = 6,
|
||||
externallength = variable,
|
||||
input = macaddr_in,
|
||||
output = macaddr_out
|
||||
);
|
||||
|
||||
--
|
||||
-- The boolean tests:
|
||||
--
|
||||
|
||||
create function macaddr_lt(macaddr, macaddr)
|
||||
returns bool
|
||||
as '_OBJWD_/mac_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
create function macaddr_le(macaddr, macaddr)
|
||||
returns bool
|
||||
as '_OBJWD_/mac_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
create function macaddr_eq(macaddr, macaddr)
|
||||
returns bool
|
||||
as '_OBJWD_/mac_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
create function macaddr_ge(macaddr, macaddr)
|
||||
returns bool
|
||||
as '_OBJWD_/mac_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
create function macaddr_gt(macaddr, macaddr)
|
||||
returns bool
|
||||
as '_OBJWD_/mac_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
create function macaddr_ne(macaddr, macaddr)
|
||||
returns bool
|
||||
as '_OBJWD_/mac_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
--
|
||||
-- Now the operators. Note how some of the parameters to some
|
||||
-- of the 'create operator' commands are commented out. This
|
||||
-- is because they reference as yet undefined operators, and
|
||||
-- will be implicitly defined when those are, further down.
|
||||
--
|
||||
|
||||
create operator < (
|
||||
leftarg = macaddr,
|
||||
rightarg = macaddr,
|
||||
-- negator = >=,
|
||||
procedure = macaddr_lt
|
||||
);
|
||||
|
||||
create operator <= (
|
||||
leftarg = macaddr,
|
||||
rightarg = macaddr,
|
||||
-- negator = >,
|
||||
procedure = macaddr_le
|
||||
);
|
||||
|
||||
create operator = (
|
||||
leftarg = macaddr,
|
||||
rightarg = macaddr,
|
||||
commutator = =,
|
||||
-- negator = <>,
|
||||
procedure = macaddr_eq
|
||||
);
|
||||
|
||||
create operator >= (
|
||||
leftarg = macaddr,
|
||||
rightarg = macaddr,
|
||||
negator = <,
|
||||
procedure = macaddr_ge
|
||||
);
|
||||
|
||||
create operator > (
|
||||
leftarg = macaddr,
|
||||
rightarg = macaddr,
|
||||
negator = <=,
|
||||
procedure = macaddr_gt
|
||||
);
|
||||
|
||||
create operator <> (
|
||||
leftarg = macaddr,
|
||||
rightarg = macaddr,
|
||||
negator = =,
|
||||
procedure = macaddr_ne
|
||||
);
|
||||
|
||||
--
|
||||
-- Finally, the special manufacurer matching function:
|
||||
--
|
||||
|
||||
create function macaddr_manuf(macaddr)
|
||||
returns text
|
||||
as '_OBJWD_/mac_DLSUFFIX_'
|
||||
language 'c';
|
||||
|
||||
--
|
||||
-- eof
|
||||
--
|
Reference in New Issue
Block a user