Browse code

htable: regenerated readme

Charles Chance authored on 09/01/2015 17:08:46
Showing 1 changed files
... ...
@@ -23,7 +23,7 @@ Ovidiu Sas
23 23
 
24 24
    <osas@voipembedded.com>
25 25
 
26
-   Copyright � 2008-2011 http://www.asipto.com
26
+   Copyright © 2008-2011 http://www.asipto.com
27 27
      __________________________________________________________________
28 28
 
29 29
    Table of Contents
... ...
@@ -199,7 +199,7 @@ Chapter 1. Admin Guide
199 199
    You can read more about hash tables at:
200 200
    http://en.wikipedia.org/wiki/Hash_table.
201 201
 
202
-   The "name" can be a static string or can include pseudo- variables that
202
+   The “name” can be a static string or can include pseudo- variables that
203 203
    will be replaced at runtime.
204 204
 
205 205
    Example 1.1. Accessing $sht(htname=>key)
... ...
@@ -213,7 +213,7 @@ $sht(a=>$ci::srcip) = $si;
213 213
    Next example shows a way to protect against dictionary attacks. If
214 214
    someone fails to authenticate 3 times, it is forbidden for 15min.
215 215
    Authenticatiion against database is expensive as it does a select on
216
-   the "subscriberthe" table. By disabling the DB auth for 15min,
216
+   the “subscriberthe” table. By disabling the DB auth for 15min,
217 217
    resources on the server are saved and time to discover the password is
218 218
    increased substantially. Additional alerting can be done by writing a
219 219
    message to syslog or sending email, etc.
... ...
@@ -222,7 +222,7 @@ $sht(a=>$ci::srcip) = $si;
222 222
    the failed authentications per user and one for storing the time of
223 223
    last authentication attempt. To ensure a unique name per user, the hash
224 224
    table uses a combination of authentication username and text
225
-   "::auth_count" and "::last_auth".
225
+   “::auth_count” and “::last_auth”.
226 226
 
227 227
    Example 1.2. Dictionary attack limitation
228 228
 ...
... ...
@@ -447,7 +447,7 @@ $ kamcmd htable.dump htable
447 447
        however, in which case this attribute can be set to 0.
448 448
      * dmqreplicate - if set to 1, any actions (set, update, delete etc.)
449 449
        performed upon entries in this table will be replicated to other
450
-       nodes (htable peers). Please note, module parameter "enable_dmq"
450
+       nodes (htable peers). Please note, module parameter “enable_dmq”
451 451
        must also be set in order for this to apply (see below). Default is
452 452
        0 (no replication).
453 453
 
... ...
@@ -596,6 +596,9 @@ modparam("htable", "db_expires", 1)
596 596
    table definition (size, autoexpire etc.) is identical across all
597 597
    instances.
598 598
 
599
+   Important: If this parameter is enabled, the DMQ module must be loaded
600
+   first - otherwise, startup will fail.
601
+
599 602
    Currently, values are not replicated on load from DB as it is expected
600 603
    that in these cases, all servers will load their values from the same
601 604
    DB.
... ...
@@ -619,7 +622,7 @@ modparam("htable", "enable_dmq", 1)
619 622
    4.8. sht_iterator_end(iname)
620 623
    4.9. sht_iterator_next(iname)
621 624
 
622
-4.1. sht_print()
625
+4.1.  sht_print()
623 626
 
624 627
    Dump content of hash table to L_ERR log level. Intended for debug
625 628
    purposes.
... ...
@@ -632,7 +635,7 @@ modparam("htable", "enable_dmq", 1)
632 635
 sht_print();
633 636
 ...
634 637
 
635
-4.2. sht_rm_name_re(htable=>regexp)
638
+4.2.  sht_rm_name_re(htable=>regexp)
636 639
 
637 640
    Delete all entries in the htable that match the name against regular
638 641
    expression.
... ...
@@ -645,7 +648,7 @@ sht_print();
645 648
 sht_rm_name_re("ha=>.*");
646 649
 ...
647 650
 
648
-4.3. sht_rm_value_re(htable=>regexp)
651
+4.3.  sht_rm_value_re(htable=>regexp)
649 652
 
650 653
    Delete all entries in the htable that match the value against regular
651 654
    expression.
... ...
@@ -658,7 +661,7 @@ sht_rm_name_re("ha=>.*");
658 661
 sht_rm_value_re("ha=>.*");
659 662
 ...
660 663
 
661
-4.4. sht_reset(htable)
664
+4.4.  sht_reset(htable)
662 665
 
663 666
    Delete all entries in the htable. The name of the hash table can be a
664 667
    dynamic string with variables.
... ...
@@ -670,7 +673,7 @@ sht_rm_value_re("ha=>.*");
670 673
 sht_reset("ha$var(x)");
671 674
 ...
672 675
 
673
-4.5. sht_lock(htable=>key)
676
+4.5.  sht_lock(htable=>key)
674 677
 
675 678
    Lock the slot in htable corespoding to the key item. Note that the
676 679
    locking is re-entrant for the process, therefore the lock and unlock
... ...
@@ -683,7 +686,7 @@ sht_reset("ha$var(x)");
683 686
 sht_lock("ha=>test");
684 687
 ...
685 688
 
686
-4.6. sht_unlock(htable=>key)
689
+4.6.  sht_unlock(htable=>key)
687 690
 
688 691
    Unlock the slot in htable corespoding to the key item. Note that the
689 692
    locking is re-entrant for the process, therefore the lock and unlock
... ...
@@ -698,7 +701,7 @@ $sht(ha=>test) = $sht(ha=>test) + 10;
698 701
 sht_unlock("ha=>test");
699 702
 ...
700 703
 
701
-4.7. sht_iterator_start(iname, hname)
704
+4.7.  sht_iterator_start(iname, hname)
702 705
 
703 706
    Start an iterator for hash table named by the value of parameter hname.
704 707
    The parameter iname is used to identify the iterator. There can be up
... ...
@@ -718,7 +721,7 @@ sht_unlock("ha=>test");
718 721
 sht_iterator_start("i1", "h1");
719 722
 ...
720 723
 
721
-4.8. sht_iterator_end(iname)
724
+4.8.  sht_iterator_end(iname)
722 725
 
723 726
    Close the iterator identified by iname parameter and release the hash
724 727
    table slot aquired by the iterator. The iname value must be the same
... ...
@@ -733,7 +736,7 @@ sht_iterator_start("i1", "h1");
733 736
 sht_iterator_end("i1");
734 737
 ...
735 738
 
736
-4.9. sht_iterator_next(iname)
739
+4.9.  sht_iterator_next(iname)
737 740
 
738 741
    Move the iterator to the next item in hash table. It must be called
739 742
    also after sht_iterator_start() to get the first item in the hash
... ...
@@ -778,7 +781,7 @@ sht_iterator_end("i1");
778 781
    6.2. sht_dump
779 782
    6.3. sht_delete
780 783
 
781
-6.1. sht_reload
784
+6.1.  sht_reload
782 785
 
783 786
    Reload a hash table from database.
784 787
 
... ...
@@ -791,7 +794,7 @@ sht_iterator_end("i1");
791 794
                 _hash_table_name_
792 795
                 _empty_line_
793 796
 
794
-6.2. sht_dump
797
+6.2.  sht_dump
795 798
 
796 799
    Dump content of a hash table via MI.
797 800
 
... ...
@@ -804,7 +807,7 @@ sht_iterator_end("i1");
804 807
                 _hash_table_name_
805 808
                 _empty_line_
806 809
 
807
-6.3. sht_delete
810
+6.3.  sht_delete
808 811
 
809 812
    Delete a key from a hash table via MI.
810 813
 
... ...
@@ -834,7 +837,7 @@ sht_iterator_end("i1");
834 837
    7.7. htable.listTables
835 838
    7.8. htable.stats
836 839
 
837
-7.1. htable.get htable key
840
+7.1.  htable.get htable key
838 841
 
839 842
    Lists one value in a hash table
840 843
 
... ...
@@ -853,7 +856,7 @@ kamcmd htable.get students daniel
853 856
 kamcmd htable.get students course[0]
854 857
 ...
855 858
 
856
-7.2. htable.delete htable key
859
+7.2.  htable.delete htable key
857 860
 
858 861
    Delete one value in a hash table
859 862
 
... ...
@@ -872,7 +875,7 @@ kamcmd htable.delete students anna
872 875
 kamcmd htable.delete students course[0]
873 876
 ...
874 877
 
875
-7.3. htable.sets htable key value
878
+7.3.  htable.sets htable key value
876 879
 
877 880
    Set an item in hash table to string value.
878 881
 
... ...
@@ -892,7 +895,7 @@ kamcmd htable.sets test x abc
892 895
 kamcmd htable.sets test x[0] abc
893 896
 ...
894 897
 
895
-7.4. htable.seti htable key value
898
+7.4.  htable.seti htable key value
896 899
 
897 900
    Set an item in hash table to integer value.
898 901
 
... ...
@@ -912,7 +915,7 @@ kamcmd htable.seti test x 123
912 915
 kamcmd htable.sets test x[0] 123
913 916
 ...
914 917
 
915
-7.5. htable.dump htable
918
+7.5.  htable.dump htable
916 919
 
917 920
    Lists all the values in a hash table
918 921
 
... ...
@@ -926,7 +929,7 @@ kamcmd htable.sets test x[0] 123
926 929
 kamcmd htable.dump ipban
927 930
 ...
928 931
 
929
-7.6. htable.reload htable
932
+7.6.  htable.reload htable
930 933
 
931 934
    Reload hash table from database.
932 935
 
... ...
@@ -940,7 +943,7 @@ kamcmd htable.dump ipban
940 943
 kamcmd htable.reload ipban
941 944
 ...
942 945
 
943
-7.7. htable.listTables
946
+7.7.  htable.listTables
944 947
 
945 948
    Lists all defined tables
946 949
 
... ...
@@ -954,7 +957,7 @@ kamcmd htable.reload ipban
954 957
 kamcmd htable.listTables
955 958
 ...
956 959
 
957
-7.8. htable.stats
960
+7.8.  htable.stats
958 961
 
959 962
    Get statistics for hash tables - name, number of slots, number of
960 963
    items, max number of items per slot, min number of items per slot.
... ...
@@ -974,7 +977,7 @@ kamcmd htable.stats
974 977
    8.1. htable:mod-init
975 978
    8.2. htable:expired:<table>
976 979
 
977
-8.1. htable:mod-init
980
+8.1.  htable:mod-init
978 981
 
979 982
    When defined, the module calls event_route[htable:mod-init] after all
980 983
    modules have been initialized. A typical use case is to initialise
... ...
@@ -987,7 +990,7 @@ event_route[htable:mod-init] {
987 990
 }
988 991
 ...
989 992
 
990
-8.2. htable:expired:<table>
993
+8.2.  htable:expired:<table>
991 994
 
992 995
    When defined, the module calls event_route[htable:expired:<table>] when
993 996
    an entry in the given table expires. In this event route, the key and