¾�ΥС�������ʸ�� �� 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9.6 | 9.5 | 9.4 | 9.3 | 9.2 | 9.1 | 9.0 | 8.4 | 8.3 | 8.2 | 8.1 | 8.0 | 7.4 | 7.3 | 7.2

9.12. �ͥåȥ�����ɥ쥹�ؿ��ȱ黻��

表9-33�ˡ�inet�������cidr���ǻ��Ѳ�ǽ�ʱ黻�Ҥ򼨤��ޤ����黻�� <<��<<=��>>�������>>=�ϥ��֥ͥåȤ˴ޤޤ�Ƥ��뤫�ɤ�����Ĵ�٤��ΤǤ����ͥåȥ������ʬ�Τߤ��θ�ʥͥåȥ�����ɥ쥹�Υۥ�����ʬ��̵��ˤ���2�ĤΥͥåȥ�����ɥ쥹�������������⤷���ϰ����Υͥåȥ����¾���Υ��֥ͥåȤˤʤäƤ��뤫�����ꤷ�ޤ���

表 9-33. cidr��inet�黻��

�黻��������
< ̤��inet '192.168.1.5' < inet '192.168.1.6'
<= ̤���⤷�����������ʰʲ���inet '192.168.1.5' <= inet '192.168.1.5'
= ������inet '192.168.1.5' = inet '192.168.1.5'
>= ����礭���⤷�����������ʰʾ��inet '192.168.1.5' >= inet '192.168.1.5'
> ����礭��inet '192.168.1.5' > inet '192.168.1.4'
<> �������ʤ�inet '192.168.1.5' <> inet '192.168.1.4'
<< ���񤵤��inet '192.168.1.5' << inet '192.168.1/24'
<<= ���񤵤�뤫������inet '192.168.1/24' <<= inet '192.168.1/24'
>> ���񤹤�inet '192.168.1/24' >> inet '192.168.1.5'
>>= ���񤹤뤫������inet '192.168.1/24' >>= inet '192.168.1/24'
~ �ӥå�����~ inet '192.168.1.6'
& �ӥå���inet '192.168.1.6' & inet '0.0.0.255'
| �ӥå���inet '192.168.1.6' | inet '0.0.0.255'
+ �û�inet '192.168.1.6' + 25
- ����inet '192.168.1.43' - 36
- ����inet '192.168.1.43' - inet '192.168.1.19'

表9-34�ˡ�inet�������cidr���ǻ��Ѳ�ǽ�ʴؿ��򼨤��ޤ��� �ؿ�abbrev��host()�������text()���ϼ�Ȥ��ơ����ؤ�����ɽ�����󶡤�����Ū�Τ�ΤǤ���

表 9-34. cidr�����inet���ؿ�

�ؿ���������������
abbrev(inet) textɽ���ѥƥ����Ⱦ�ά��abbrev(inet '10.1.0.0/16')10.1.0.0/16
abbrev(cidr)textɽ���ѥƥ����Ⱦ�ά��abbrev(cidr '10.1.0.0/16')10.1/16
broadcast(inet) inet�ͥåȥ���֥����ɥ��㥹�ȥ��ɥ쥹broadcast('192.168.1.5/24')192.168.1.255/24
family(inet) int���ɥ쥹�ե��ߥ�μ��Ф���IPv4�Ǥ�4��IPv6�Ǥ�6��family('::1')6
host(inet) textIP���ɥ쥹��ƥ����Ȥ����host('192.168.1.5/24')192.168.1.5
hostmask(inet) inet�ͥåȥ���ѤΥۥ��ȥޥ����ι���hostmask('192.168.23.20/30')0.0.0.3
masklen(inet) int�ͥåȥޥ���Ĺ�����masklen('192.168.1.5/24')24
netmask(inet) inet�ͥåȥ���ѥͥåȥޥ����ι���netmask('192.168.1.5/24')255.255.255.0
network(inet) cidr�ͥåȥ�����ɥ쥹����ͥåȥ���������network('192.168.1.5/24')192.168.1.0/24
set_masklen(inet, int) inetinet�ͤΥͥåȥޥ���Ĺ������set_masklen('192.168.1.5/24', 16)192.168.1.5/16
set_masklen(cidr, int)cidrcidr�ͤΥͥåȥޥ���Ĺ������set_masklen('192.168.1.0/24'::cidr, 16)192.168.0.0/16
text(inet) textIP���ɥ쥹�ȥͥåȥޥ���Ĺ��ƥ����Ȥ����text(inet '192.168.1.5')192.168.1.5/32

cidr�ͤϤ��٤ơ�����Ū�ޤ�������Ū��inet���˥��㥹�Ȳ�ǽ�Ǥ��� �������äơ���Ǽ�����inet���Ф�������Ԥ��ؿ���cidr�ͤǤ�ư��ޤ�����inet��cidr���̡��˴ؿ���¸�ߤ��ޤ���������ϡ�����2�Ĥ�ư��˰㤤�����뤿��Ǥ����ˤޤ���inet�ͤ���cidr�ؤΥ��㥹�Ȥ������ޤ������줬�Ԥ���ȡ��ͥåȥޥ����α�¦�ΥӥåȤϡ�cidr�Ȥ���ͭ�����ͤȤ��뤿���0�Ȥʤ�ޤ�������ˡ��̾�Υ��㥹�ȹ�ʸ���㤨�С�inet(expression)��colname::cidr����Ѥ��ơ��ƥ������ͤ�inet��cidr�˥��㥹�Ȥ��뤳�Ȥ�Ǥ��ޤ���

表9-35�ˡ�macaddr���ǻ��Ѳ�ǽ�ʴؿ��򼨤��ޤ����ؿ�trunc(macaddr)�Ͻ�����3�Х��Ȥ����������ꤵ�줿MAC���ɥ쥹���֤��ޤ�������ϡ��Ĥä���Ƭ������¤�Ԥ��б������뤳�Ȥ˻Ȥ��ޤ���

表 9-35. macaddr���ؿ�

�ؿ���������������
trunc(macaddr) macaddr�����Σ��Х��Ȥ򥼥�������trunc(macaddr '12:34:56:78:90:ab')12:34:56:00:00:00

macaddr���ϡ�>��<=���Ρ˼����Խ�����¤٤�ɸ��ط��黻�Ҥ�NOT��AND��OR�Υӥåȱ黻��(~��&��|)�⥵�ݡ��Ȥ��Ƥ��ޤ���