Changeset 22 for trunk/include


Ignore:
Timestamp:
Feb 23, 2006, 12:03:58 AM (19 years ago)
Author:
rainer
Message:

Minor code revisions.

Location:
trunk/include
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/samhain.h

    r20 r22  
    290290/*@null@*/ extern sh_key_t  *skey;
    291291
     292/**************************************************
     293 *
     294 * macros
     295 *
     296 **************************************************/
     297
     298/* signal-safe log function
     299 */
     300int safe_logger (int signal, int method, char * details);
     301int safe_fatal  (int signal, int method, char * details, char *f, int l);
     302
     303#define SH_VAL_EQ(a,b) \
     304     do { \
     305         if ((a) != (b)) safe_fatal(0, 0, #a " != " #b, FIL__, __LINE__);\
     306     } while (0)
     307
    292308
    293309#if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK)
  • trunk/include/sh_calls.h

    r20 r22  
    3333/* Set aud functions
    3434 */
    35 int sh_aud_set_functions(char * str_s);
     35int sh_aud_set_functions(const char * str_s);
    3636
    3737
  • trunk/include/sh_database.h

    r1 r22  
    55int sh_database_insert (char * message);
    66
    7 int sh_database_use_persistent (char * str);
     7int sh_database_use_persistent (const char * str);
    88
    9 int sh_database_set_database (char * str);
    10 int sh_database_set_table (char * str);
    11 int sh_database_set_host (char * str);
    12 int sh_database_set_user (char * str);
    13 int sh_database_set_password (char * str);
    14 int sh_database_add_to_hash  (char * str);
    15 int set_enter_wrapper (char * str);
     9int sh_database_set_database (const char * str);
     10int sh_database_set_table (const char * str);
     11int sh_database_set_host (const char * str);
     12int sh_database_set_user (const char * str);
     13int sh_database_set_password (const char * str);
     14int sh_database_add_to_hash  (const char * str);
     15int set_enter_wrapper (const char * str);
    1616#endif
  • trunk/include/sh_error.h

    r20 r22  
    8181/* set mask for message class
    8282 */
    83 int sh_error_log_mask (char * c);
    84 int sh_error_print_mask (char * c);
    85 int sh_error_mail_mask (char * c);
    86 int sh_error_export_mask (char * c);
    87 int sh_error_syslog_mask (char * c);
    88 int sh_error_external_mask (char * c);
    89 int sh_error_database_mask (char * c);
    90 int sh_error_prelude_mask (char * c);
     83int sh_error_log_mask (const char * c);
     84int sh_error_print_mask (const char * c);
     85int sh_error_mail_mask (const char * c);
     86int sh_error_export_mask (const char * c);
     87int sh_error_syslog_mask (const char * c);
     88int sh_error_external_mask (const char * c);
     89int sh_error_database_mask (const char * c);
     90int sh_error_prelude_mask (const char * c);
    9191
    9292
     
    9999#ifdef SH_WITH_SERVER
    100100void sh_error_set_peer(const char * str);
    101 int  set_flag_sep_log (char * str);
     101int  set_flag_sep_log (const char * str);
    102102#endif
    103103
     
    108108/* convert a string to a numeric priority
    109109 */
    110 int sh_error_convert_level (char * str_s);
     110int sh_error_convert_level (const char * str_s);
    111111
    112112/* only to stderr (GOOD/BAD)
     
    116116/* set syslog facility
    117117 */
    118 int  sh_log_set_facility (char * c);
     118int  sh_log_set_facility (const char * c);
    119119
    120120/* define message header
    121121 */
    122 int sh_error_ehead (/*@null@*/char * s);
     122int sh_error_ehead (/*@null@*/const char * s);
    123123
    124124/* set level for error logging
     
    128128/* set severity levels
    129129 */
    130 int sh_error_set_iv (int iv, char *  severity_s);
     130int sh_error_set_iv (int iv, const char *  severity_s);
    131131
    132132/* set priorities
     
    178178/* (re)set the console device(s)
    179179 */
    180 int sh_log_set_console (char * address);
     180int sh_log_set_console (const char * address);
    181181void reset_count_dev_console(void);
    182182
     
    188188/* enable message queue
    189189 */
    190 int enable_msgq(char * foo);
     190int enable_msgq(const char * foo);
    191191#endif
    192192 
  • trunk/include/sh_extern.h

    r1 r22  
    4343 * -- add CL argument, return # of arguments
    4444 */
    45 int sh_ext_tas_add_argv(sh_tas_t * tas, char * val);
     45int sh_ext_tas_add_argv(sh_tas_t * tas, const char * val);
    4646/*
    4747 * -- remove last CL argument
     
    5151 * -- add environment variable, return # of variables
    5252 */
    53 int sh_ext_tas_add_envv(sh_tas_t * tas, char * key, char * val);
     53int sh_ext_tas_add_envv(sh_tas_t * tas, const char * key, const char * val);
    5454/*
    5555 * -- set command
    5656 */
    57 void sh_ext_tas_command(sh_tas_t * tas, char * command);
     57void sh_ext_tas_command(sh_tas_t * tas, const char * command);
    5858/*
    5959 * -- initialize task structure
     
    7171 * -- start a new external command, and add it to the list
    7272 */
    73 int sh_ext_setcommand(char * cmd);
     73int sh_ext_setcommand(const char * cmd);
    7474
    7575/*
     
    8181 * -- set deadtime
    8282 */
    83 int sh_ext_deadtime (char * str);
     83int sh_ext_deadtime (const char * str);
    8484
    8585/*
    8686 * -- add keywords to the OR filter
    8787 */
    88 int sh_ext_add_or (char * str);
     88int sh_ext_add_or (const char * str);
    8989
    9090/*
    9191 * -- add keywords to the AND filter
    9292 */
    93 int sh_ext_add_and (char * str);
     93int sh_ext_add_and (const char * str);
    9494
    9595/*
    9696 * -- add keywords to the NOT filter
    9797 */
    98 int sh_ext_add_not (char * str);
     98int sh_ext_add_not (const char * str);
    9999
    100100/*
    101101 * -- add keywords to the CL argument list
    102102 */
    103 int sh_ext_add_argv (char * str);
     103int sh_ext_add_argv (const char * str);
    104104
    105105/*
    106106 * -- add a path to the environment
    107107 */
    108 int sh_ext_add_default (char * str);
     108int sh_ext_add_default (const char * str);
    109109
    110110/*
    111111 * -- add an environment variable
    112112 */
    113 int sh_ext_add_environ (char * str);
     113int sh_ext_add_environ (const char * str);
    114114
    115115/*
    116116 * -- define type
    117117 */
    118 int sh_ext_type (char * str);
     118int sh_ext_type (const char * str);
    119119
    120120/*
    121121 * -- define checksum
    122122 */
    123 int sh_ext_checksum (char * str);
     123int sh_ext_checksum (const char * str);
    124124
    125125/*
    126126 * -- choose privileges
    127127 */
    128 int sh_ext_priv (char * c);
     128int sh_ext_priv (const char * c);
    129129
    130130/*
  • trunk/include/sh_files.h

    r20 r22  
    2323/* register exceptions to hardlink check
    2424 */
    25 int sh_files_hle_reg (char * str);
     25int sh_files_hle_reg (const char * str);
    2626
    2727/* check the setup
     
    3535/* activate hardlink check
    3636 */
    37 int sh_files_check_hardlinks (char * opt);
     37int sh_files_check_hardlinks (const char * opt);
    3838
    3939/* set recursion depth
     
    4343/* report only once
    4444 */
    45 int sh_files_reportonce(char * c);
     45int sh_files_reportonce(const char * c);
    4646
    4747/* report full details
    4848 */
    49 int sh_files_fulldetail(char * c);
     49int sh_files_fulldetail(const char * c);
    5050
    5151/* reset the 'checked' flag
     
    6767/* push a directory on the stack USER0
    6868 */
    69 int  sh_files_pushdir_user0 (char * dirName);
     69int  sh_files_pushdir_user0 (const char * dirName);
    7070
    7171/* push a directory on the stack USER1
    7272 */
    73 int  sh_files_pushdir_user1 (char * dirName);
     73int  sh_files_pushdir_user1 (const char * dirName);
    7474
    7575/* push a directory on the stack PRELINK
    7676 */
    77 int  sh_files_pushdir_prelink (char * dirName);
     77int  sh_files_pushdir_prelink (const char * dirName);
    7878
    7979/* push a directory on the stack ATTR
    8080 */
    81 int  sh_files_pushdir_attr (char * dirName);
     81int  sh_files_pushdir_attr (const char * dirName);
    8282
    8383/* push a directory on the stack READONLY
    8484 */
    85 int  sh_files_pushdir_ro (char * dirName);
     85int  sh_files_pushdir_ro (const char * dirName);
    8686
    8787/* push a directory on the stack LOGFILE
    8888 */
    89 int  sh_files_pushdir_log (char * dirName);
     89int  sh_files_pushdir_log (const char * dirName);
    9090
    9191/* push a directory on the stack GROWING LOGFILE
    9292 */
    93 int  sh_files_pushdir_glog (char * dirName);
     93int  sh_files_pushdir_glog (const char * dirName);
    9494
    9595/* push a directory on the stack IGNORE NONE
    9696 */
    97 int  sh_files_pushdir_noig (char * dirName);
     97int  sh_files_pushdir_noig (const char * dirName);
    9898
    9999/* push a directory on the stack IGNORE ALL
    100100 */
    101 int  sh_files_pushdir_allig (char * dirName);
     101int  sh_files_pushdir_allig (const char * dirName);
    102102
    103103
    104104/* push a file on the stack USER0
    105105 */
    106 int  sh_files_pushfile_user0 (char * dirName);
     106int  sh_files_pushfile_user0 (const char * dirName);
    107107
    108108/* push a file on the stack USER1
    109109 */
    110 int  sh_files_pushfile_user1 (char * dirName);
     110int  sh_files_pushfile_user1 (const char * dirName);
    111111
    112112/* push a file on the stack PRELINK
    113113 */
    114 int  sh_files_pushfile_prelink (char * dirName);
     114int  sh_files_pushfile_prelink (const char * dirName);
    115115
    116116/* push a file on the stack ATTR
    117117 */
    118 int  sh_files_pushfile_attr (char * dirName);
     118int  sh_files_pushfile_attr (const char * dirName);
    119119
    120120/* push a file on the stack READONLY
    121121 */
    122 int  sh_files_pushfile_ro (char * dirName);
     122int  sh_files_pushfile_ro (const char * dirName);
    123123
    124124/* push a file on the stack LOGFILE
    125125 */
    126 int  sh_files_pushfile_log (char * dirName);
     126int  sh_files_pushfile_log (const char * dirName);
    127127
    128128/* push a file on the stack GROWING LOGFILE
    129129 */
    130 int  sh_files_pushfile_glog (char * dirName);
     130int  sh_files_pushfile_glog (const char * dirName);
    131131
    132132/* push a file on the stack IGNORE NONE
    133133 */
    134 int  sh_files_pushfile_noig (char * dirName);
     134int  sh_files_pushfile_noig (const char * dirName);
    135135
    136136/* push a file on the stack IGNORE ALL
    137137 */
    138 int  sh_files_pushfile_allig (char * dirName);
     138int  sh_files_pushfile_allig (const char * dirName);
    139139
    140140
     
    153153/* redefine policies
    154154 */
    155 int sh_files_redef_user0(char * str);
    156 int sh_files_redef_user1(char * str);
    157 int sh_files_redef_prelink(char * str);
    158 int sh_files_redef_readonly(char * str);
    159 int sh_files_redef_loggrow(char * str);
    160 int sh_files_redef_logfiles(char * str);
    161 int sh_files_redef_attributes(char * str);
    162 int sh_files_redef_noignore(char * str);
    163 int sh_files_redef_allignore(char * str);
     155int sh_files_redef_user0(const char * str);
     156int sh_files_redef_user1(const char * str);
     157int sh_files_redef_prelink(const char * str);
     158int sh_files_redef_readonly(const char * str);
     159int sh_files_redef_loggrow(const char * str);
     160int sh_files_redef_logfiles(const char * str);
     161int sh_files_redef_attributes(const char * str);
     162int sh_files_redef_noignore(const char * str);
     163int sh_files_redef_allignore(const char * str);
    164164
    165165
  • trunk/include/sh_forward.h

    r20 r22  
    3232/* set time limit
    3333 */
    34 int sh_forward_set_time_limit(char * str);
     34int sh_forward_set_time_limit(const char * str);
    3535
    3636/* error level for lookup failure
    3737 */
    38 int sh_forward_lookup_level (char * c);
     38int sh_forward_lookup_level (const char * c);
    3939
    4040/* create client entry for given password
     
    4545
    4646#ifdef INET_SYSLOG
    47 int set_syslog_active(char * c);
     47int set_syslog_active(const char * c);
    4848#endif
    4949
     
    5555 * and set by accept()
    5656 */
    57 int set_socket_peer (char * c);
     57int set_socket_peer (const char * c);
    5858
    5959/* whether to use client severity
    6060 */
    61 int sh_forward_use_clt_sev (char * c);
     61int sh_forward_use_clt_sev (const char * c);
    6262
    6363/* whether to use client class
    6464 */
    65 int sh_forward_use_clt_class (char * c);
     65int sh_forward_use_clt_class (const char * c);
    6666
    6767/* server port
    6868 */
    69 int sh_forward_set_port(char * c);
     69int sh_forward_set_port(const char * c);
    7070
    7171/* server interface
    7272 */
    73 int sh_forward_set_interface(char * c);
     73int sh_forward_set_interface(const char * c);
    7474
    7575/* a wrapper function
     
    7979/* register a client
    8080 */
    81 int sh_forward_register_client (char * str);
     81int sh_forward_register_client (const char * str);
    8282
    8383/* start server
     
    103103/* set log server
    104104 */
    105 int sh_forward_setlogserver (char * address);
     105int sh_forward_setlogserver (const char * address);
    106106void reset_count_dev_server(void);
    107107
  • trunk/include/sh_hash.h

    r20 r22  
    4242/* version string for database
    4343 */
    44 int sh_hash_version_string(char * str);
     44int sh_hash_version_string(const char * str);
    4545
    4646/* List database content
  • trunk/include/sh_ignore.h

    r1 r22  
    22#define SH_IGNORE_H
    33
    4 int sh_ignore_add_del (char * addpath);
    5 int sh_ignore_add_new (char * addpath);
     4int sh_ignore_add_del (const char * addpath);
     5int sh_ignore_add_new (const char * addpath);
    66
    77int sh_ignore_chk_del (const char * chkpath);
  • trunk/include/sh_mail.h

    r20 r22  
    2626/* set a relay server
    2727 */
    28 int sh_mail_set_relay (char * str_s);
     28int sh_mail_set_relay (const char * str_s);
    2929
    3030/* send to all recpts. in one mail
    3131 */
    32 int sh_mail_setFlag (char * str);
     32int sh_mail_setFlag (const char * str);
    3333
    3434/* set the subject string
    3535 */
    36 int set_mail_subject (char * str);
     36int set_mail_subject (const char * str);
    3737
    3838/* test mailbox
     
    4444#define SH_MAX_FAIL    48
    4545
    46 int sh_mail_setNum (char * str);
     46int sh_mail_setNum (const char * str);
    4747
    48 int sh_mail_setaddress (char * address);
     48int sh_mail_setaddress (const char * address);
    4949void reset_count_dev_mail(void);
    50 int sh_mail_setaddress_int (char * address);
     50int sh_mail_setaddress_int (const char * address);
    5151
    5252/* call if not urgent
     
    6060/* set sender of mail
    6161 */
    62 int sh_mail_set_sender (char *str);
     62int sh_mail_set_sender (const char *str);
    6363
    64 int sh_mail_add_or  (char * str);
    65 int sh_mail_add_and (char * str);
    66 int sh_mail_add_not (char * str);
     64int sh_mail_add_or  (const char * str);
     65int sh_mail_add_and (const char * str);
     66int sh_mail_add_not (const char * str);
    6767
    6868#endif
  • trunk/include/sh_prelink.h

    r1 r22  
    1414/* configuration
    1515 */
    16 int sh_prelink_set_path (char * str);
    17 int sh_prelink_set_hash (char * str);
     16int sh_prelink_set_path (const char * str);
     17int sh_prelink_set_hash (const char * str);
    1818#endif
  • trunk/include/sh_prelude.h

    r1 r22  
    66int  sh_prelude_init();
    77
    8 int sh_prelude_set_profile(char *arg);
     8int sh_prelude_set_profile(const char *arg);
    99
    1010int sh_prelude_alert (int priority, int class, char * message,
     
    1313/* map severity levels
    1414 */
    15 int sh_prelude_map_info (char * str);
    16 int sh_prelude_map_low (char * str);
    17 int sh_prelude_map_medium (char * str);
    18 int sh_prelude_map_high (char * str);
     15int sh_prelude_map_info (const char * str);
     16int sh_prelude_map_low (const char * str);
     17int sh_prelude_map_medium (const char * str);
     18int sh_prelude_map_high (const char * str);
    1919
    2020#endif
  • trunk/include/sh_tiger.h

    r20 r22  
    2222/* NEW Thu Oct 18 19:59:08 CEST 2001
    2323 */
    24 int sh_tiger_hashtype (char * c);
     24int sh_tiger_hashtype (const char * c);
    2525char * sh_tiger_generic_hash (char * filename, TigerType what,
    2626                              UINT64 Length, int timeout);
  • trunk/include/sh_unix.h

    r20 r22  
    148148/* whether to use localtime for file timesatams in logs
    149149 */
    150 int sh_unix_uselocaltime (char * c);
     150int sh_unix_uselocaltime (const char * c);
    151151
    152152/* set I/O limit
    153153 */
    154 int  sh_unix_set_io_limit (char * c);
     154int  sh_unix_set_io_limit (const char * c);
    155155void sh_unix_io_pause ();
    156156
     
    199199/* checksum of own binary
    200200 */
    201 int sh_unix_self_hash (char * c);
     201int sh_unix_self_hash (const char * c);
    202202
    203203/* return BAD on failure
     
    207207/* add a trusted user to the list
    208208 */
    209 int tf_add_trusted_user(char *);
     209int tf_add_trusted_user(const char *);
    210210
    211211/* check a file
     
    224224/* set the timeserver address
    225225 */
    226 int sh_unix_settimeserver (char * address);
     226int sh_unix_settimeserver (const char * address);
    227227void reset_count_dev_time(void);
    228228
  • trunk/include/sh_utils.h

    r20 r22  
    6565/* set signature type HASH-TIGER/HMAC-TIGER
    6666 */
    67 int sh_util_sigtype (char * c);
     67int sh_util_sigtype (const char * c);
    6868
    6969/* compute a signature
     
    8383/* don't log output files
    8484 */
    85 int sh_util_hidesetup(char * c);
     85int sh_util_hidesetup(const char * c);
    8686
    8787/* exceptions to obscure name check
    8888 */
    89 int sh_util_obscure_ok (char * str);
     89int sh_util_obscure_ok (const char * str);
    9090
    9191/* read a hexchar
Note: See TracChangeset for help on using the changeset viewer.