~ubuntu-branches/debian/sid/kamailio/sid

« back to all changes in this revision

Viewing changes to modules/ipops/doc/ipops_admin.xml

  • Committer: Package Import Robot
  • Author(s): Victor Seva
  • Date: 2014-01-06 11:47:13 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20140106114713-t8xidp4arzrnyeya
Tags: 4.1.1-1
* New upstream release
* debian/patches:
  - add upstream fixes
* Added tls outbound websocket autheph dnssec modules
  - openssl exception added to their license
* removing sparc and ia64 from supported archs
  for mono module (Closes: #728915)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
    <title>Overview</title>
20
20
         
21
21
    <para>
22
 
      This module offers operations for handling IP addresses, both IPv4 and IPv6.
 
22
      The IPops module offers operations for handling IP addresses, both IPv4 and IPv6.
23
23
    </para>
24
24
    <para>
25
25
      IPv6 is defined in <ulink url="http://tools.ietf.org/html/rfc2460">RFC 2460</ulink>.
93
93
 
94
94
    <title>Functions</title>
95
95
             
96
 
    <section>
 
96
    <section id="ipops.f.is_ip">
97
97
      <title>
98
98
        <function moreinfo="none">is_ip (ip)</function>
99
99
      </title>
131
131
 
132
132
    </section>
133
133
 
134
 
    <section>
 
134
    <section id="ipops.f.is_pur_ip">
135
135
      <title>
136
136
        <function moreinfo="none">is_pure_ip (ip)</function>
137
137
      </title>
170
170
 
171
171
    </section>
172
172
 
173
 
    <section>
 
173
    <section id="ipops.f.is_ipv4">
174
174
      <title>
175
175
        <function moreinfo="none">is_ipv4 (ip)</function>
176
176
      </title>
208
208
 
209
209
    </section>
210
210
 
211
 
    <section>
 
211
    <section id="ipops.f.is_ipv6">
212
212
      <title>
213
213
        <function moreinfo="none">is_ipv6 (ip)</function>
214
214
      </title>
246
246
 
247
247
    </section>
248
248
 
249
 
    <section>
 
249
    <section id="ipops.f.is_ipv6_reference">
250
250
      <title>
251
251
        <function moreinfo="none">is_ipv6_reference (ip)</function>
252
252
      </title>
284
284
 
285
285
    </section>
286
286
 
287
 
    <section>
 
287
    <section id="ipops.f.is_ip_type">
288
288
      <title>
289
289
        <function moreinfo="none">ip_type (ip)</function>
290
290
      </title>
359
359
 
360
360
    </section>
361
361
 
362
 
    <section>
 
362
    <section id="ipops.f.compare_ips">
363
363
      <title>
364
364
        <function moreinfo="none">compare_ips (ip1, ip2)</function>
365
365
      </title>
403
403
 
404
404
    </section>
405
405
 
406
 
    <section>
 
406
    <section id="ipops.f.compare_pure_ips">
407
407
      <title>
408
408
        <function moreinfo="none">compare_pure_ips (ip1, ip2)</function>
409
409
      </title>
447
447
 
448
448
    </section>
449
449
 
450
 
    <section>
 
450
    <section id="ipops.f.is_ip_rfc1918">
451
451
      <title>
452
452
        <function moreinfo="none">is_ip_rfc1918 (ip)</function>
453
453
      </title>
485
485
 
486
486
    </section>
487
487
 
488
 
    <section>
 
488
    <section id="ipops.f.is_in_subnet">
489
489
      <title>
490
490
        <function moreinfo="none">is_in_subnet (ip, subnet)</function>
491
491
      </title>
529
529
 
530
530
    </section>
531
531
 
 
532
    <section id="ipops.f.dns_sys_match_ip">
 
533
      <title>
 
534
        <function moreinfo="none">dns_sys_match_ip(hostname, ipaddr)</function>
 
535
      </title>
 
536
 
 
537
      <para>
 
538
                  Returns TRUE if ipaddr is associated by DNS to hostname. FALSE otherwise. It
 
539
                  does not use the internal DNS resolver, but directly getaddrinfo(...). All
 
540
                  addresses returned for the hostname are checked. Note that some hosts may
 
541
                  return different lists of IP addresses for each query, if the DNS server
 
542
                  is configured in that way (e.g., for providing load balancing through DNS).
 
543
      </para>
 
544
 
 
545
      <para>Parameters:</para>
 
546
 
 
547
      <itemizedlist>
 
548
        <listitem>
 
549
          <para>
 
550
                          <emphasis>hostname</emphasis> - string or pseudo-variable containing the hostname.
 
551
                          The resulting IP addresses from DNS query are compared with ipaddr.
 
552
          </para>
 
553
        </listitem>
 
554
        <listitem>
 
555
          <para>
 
556
            <emphasis>ipaddr</emphasis> - string or pseudo-variable containing the ip address.
 
557
          </para>
 
558
        </listitem>
 
559
      </itemizedlist>
 
560
 
 
561
      <para>
 
562
        This function can be used from ANY_ROUTE.
 
563
      </para>
 
564
 
 
565
      <example>
 
566
        <title>
 
567
          <function>dns_sys_match_ip</function> usage
 
568
        </title>
 
569
        <programlisting format="linespecific">
 
570
...
 
571
if (!dns_sys_match_ip("myhost.com", "1.2.3.4")) {
 
572
    xdbg("ip address not associated with hostname\n");
 
573
}
 
574
...
 
575
        </programlisting>
 
576
      </example>
 
577
 
 
578
    </section>
 
579
 
 
580
    <section id="ipops.f.dns_int_match_ip">
 
581
      <title>
 
582
        <function moreinfo="none">dns_int_match_ip(hostname, ipaddr)</function>
 
583
      </title>
 
584
 
 
585
      <para>
 
586
                  Returns TRUE if ipaddr is associated by DNS to hostname. FALSE otherwise. It
 
587
                  uses internal DNS resolver. At this moment, the function might not check all
 
588
                  the IP addresses as returned by dns_sys_match_ip(), because the internal
 
589
                  resolver targets to discover the first address to be used for relaying
 
590
                  SIP traffic. Thus is better to use dns_sys_match_ip() if the host you want
 
591
                  to check has many IP addresses, in different address famililies (IPv4/6).
 
592
      </para>
 
593
 
 
594
      <para>Parameters:</para>
 
595
 
 
596
      <itemizedlist>
 
597
        <listitem>
 
598
          <para>
 
599
                          <emphasis>hostname</emphasis> - string or pseudo-variable containing the hostname.
 
600
                          The resulting IP addresses from DNS query are compared with ipaddr.
 
601
          </para>
 
602
        </listitem>
 
603
        <listitem>
 
604
          <para>
 
605
            <emphasis>ipaddr</emphasis> - string or pseudo-variable containing the ip address.
 
606
          </para>
 
607
        </listitem>
 
608
      </itemizedlist>
 
609
 
 
610
      <para>
 
611
        This function can be used from ANY_ROUTE.
 
612
      </para>
 
613
 
 
614
      <example>
 
615
        <title>
 
616
          <function>dns_int_match_ip</function> usage
 
617
        </title>
 
618
        <programlisting format="linespecific">
 
619
...
 
620
if (!dns_int_match_ip("myhost.com", "1.2.3.4")) {
 
621
    xdbg("ip address not associated with hostname\n");
 
622
}
 
623
...
 
624
        </programlisting>
 
625
      </example>
 
626
 
 
627
    </section>
 
628
 
 
629
    <section id="ipops.f.dns_query">
 
630
      <title>
 
631
        <function moreinfo="none">dns_query(hostname, pvid)</function>
 
632
      </title>
 
633
 
 
634
      <para>
 
635
                  Store the IP addresses and their type that correspond to hostname
 
636
                  in a config variable $dns(pvid=>key).
 
637
      </para>
 
638
 
 
639
      <para>Parameters:</para>
 
640
 
 
641
      <itemizedlist>
 
642
        <listitem>
 
643
          <para>
 
644
                          <emphasis>hostname</emphasis> - string or pseudo-variable containing the hostname.
 
645
                          The resulting IP addresses from DNS query are compared with ipaddr.
 
646
          </para>
 
647
        </listitem>
 
648
        <listitem>
 
649
          <para>
 
650
            <emphasis>pvid</emphasis> - container id for script variable.
 
651
          </para>
 
652
        </listitem>
 
653
      </itemizedlist>
 
654
 
 
655
      <para>
 
656
        This function can be used from ANY_ROUTE.
 
657
      </para>
 
658
 
 
659
      <example>
 
660
        <title>
 
661
          <function>dns_query</function> usage
 
662
        </title>
 
663
        <programlisting format="linespecific">
 
664
...
 
665
if(dns_query("test.com", "xyz"))
 
666
{
 
667
    xlog(" number of addresses: $dns(xyz=>count)\n");
 
668
    xlog(" ipv4 address found: $dns(xyz=>ipv4)\n");
 
669
    xlog(" ipv6 address found: $dns(xyz=>ipv6)\n");
 
670
    $var(i) = 0;
 
671
    while($var(i)&lt;$dns(xyz=>count)) {
 
672
        xlog(" #[$var(i)] type ($dns(xyz=>type[$var(i)]))"
 
673
             " addr [$dns(xyz=>addr[$var(i)])]\n");
 
674
        $var(i) = $var(i) + 1;
 
675
    }
 
676
}
 
677
...
 
678
        </programlisting>
 
679
      </example>
 
680
 
 
681
    </section>
 
682
 
532
683
  </section>
533
684
 
534
685
</chapter>