226         static long next = 0L;            
   230         static long multiplier = 1L;      
   242                 error(0, 
"no user specified, challenging regardless");
   259             if (difftime(now, (time_t) next_time) < 0) {
   260                 error(0, 
"another try from %s, not much time used", 
   267             error(0, 
"user %s is not allowed by users list, challenging",
   273             error(0, 
"wrong or missing password in request from %s, challenging" , 
   288         reply(c, push_headers);
   296         next = next + multiplier * 
ADDITION;
   319         error(0, 
"Number %s not allowed by user %s (wrong prefix)", 
   325         error(0, 
"Number %s not allowed by user %s (blacklisted)", 
   331         error(0, 
"Number %s not allowed by user %s (not whitelisted)", 
   360     configured_ip = NULL;
   458     if (grpname == NULL) {
   459         error(0, 
"all users group (wap-push-user) are missing");
   481     if (u->
name == NULL) {
   482         warning(0, 
"user name missing, dump follows");
   491         warning(0, 
"login name for user %s missing, dump follows", 
   498         warning(0, 
"password for user %s missing, dump follows", 
   590         debug(
"wap.push.ppg.pushuser", 0, 
"no user found");
   594     debug(
"wap.push.ppg.pushuser", 0, 
"Dumping user data: Name of the user:");
   596     debug(
"wap.push.ppg.pushuser", 0, 
"username:");
   598     debug(
"wap.push.ppg.pushuser", 0, 
"omitting password");
   599     debug(
"wap-push.ppg.pushuser", 0, 
"country prefix");
   601     debug(
"wap.push.ppg.pushuser", 0, 
"allowed prefix list:");            
   603     debug(
"wap.push.ppg.pushuser", 0, 
"denied prefix list:");         
   605     debug(
"wap.push.ppg.pushuser", 0, 
"denied ip list:");                         
   607     debug(
"wap.push.ppg.pushuser", 0, 
"allowed ip list:");                   
   609     debug(
"wap.push.ppg.pushuser", 0, 
"send via smsc-id:");                   
   611     debug(
"wap.push.ppg.pushuser", 0, 
"use default smsc:");
   613     debug(
"wap.push.ppg.pushuser", 0, 
"end of the dump");
   680     for (i = 0; i < 
gwlist_len(ip_fragments); ++i) {
   682         needle_fragment = 
gwlist_get(needle_fragments, i);
   708         warning(0, 
"user not found from the users list");
   743     warning(0, 
"ip not found from either ip list, deny it");
   780             "Authorization")) == NULL)
   809     debug(
"wap.push.ppg.pushuser", 0, 
"we have an username and a password in"    810           " authorization header");
   871     denied = 
octstr_imm(
"You are not allowed to use this service. Do not retry.\n");
   898         goto no_configuration;
   919         goto no_allowed_config;
  1025     unsigned char *prefix;
  1036         prefix = gw_malloc(
start);
 Dict * dict_create(long size_hint, void(*destroy_value)(void *))
 
regex_t * allowed_prefix_regex
 
void error(int err, const char *fmt,...)
 
Octstr * wap_push_ppg_pushuser_dlr_url_get(Octstr *username)
 
void http_header_add(List *headers, char *name, char *contents)
 
static int whitelisted(WAPPushUser *u, Octstr *number)
 
gw_assert(wtls_machine->packet_to_send !=NULL)
 
regex_t * black_list_regex
 
void dict_put(Dict *dict, Octstr *key, void *value)
 
void gwlist_append(List *list, void *item)
 
Octstr * wap_push_ppg_pushuser_smsc_id_get(Octstr *username)
 
void octstr_append(Octstr *ostr1, const Octstr *ostr2)
 
Octstr * wap_push_ppg_pushuser_smsbox_id_get(Octstr *username)
 
static void oneuser_dump(WAPPushUser *u)
 
long gwlist_len(List *list)
 
void * gwlist_get(List *list, long pos)
 
static int password_matches(WAPPushUser *u, Octstr *password)
 
long octstr_search(const Octstr *haystack, const Octstr *needle, long pos)
 
static void destroy_users_list(void *l)
 
#define cfg_get(grp, varname)
 
regex_t * white_list_regex
 
static Octstr * default_smsc(WAPPushUser *u)
 
static int parse_cgivars_for_password(List *cgivars, Octstr **password)
 
int wap_push_ppg_pushuser_list_add(List *list, long number_of_pushes, long number_of_users)
 
void numhash_destroy(Numhash *table)
 
void octstr_insert_data(Octstr *ostr, long pos, const char *data, long len)
 
void octstr_strip_blanks(Octstr *text)
 
#define octstr_get_cstr(ostr)
 
long octstr_search_char(const Octstr *ostr, int ch, long pos)
 
static Octstr * smsbox_id
 
static struct pid_list * found
 
static int blacklisted(WAPPushUser *u, Octstr *number)
 
Numhash * numhash_create(const char *seek_url)
 
Octstr * http_cgi_variable(List *list, char *name)
 
static int compare_octstr_sequence(Octstr *os1, Octstr *os2, long start)
 
void http_destroy_headers(List *headers)
 
static int oneuser_add(CfgGroup *cfg)
 
static long number_of_users
 
void http_send_reply(HTTPClient *client, int status, List *headers, Octstr *body)
 
Octstr * octstr_imm(const char *cstr)
 
void octstr_insert(Octstr *ostr1, const Octstr *ostr2, long pos)
 
void * dict_remove(Dict *dict, Octstr *key)
 
int numhash_find_number(Numhash *table, Octstr *nro)
 
void * gwlist_extract_first(List *list)
 
void * dict_get(Dict *dict, Octstr *key)
 
void octstr_delete(Octstr *ostr1, long pos, long len)
 
static int wildcarded_ip_found(Octstr *ip, Octstr *needle, Octstr *ip_sep)
 
static WAPPushUserList * pushusers_create(long number_of_users)
 
List * http_create_empty_headers(void)
 
int wap_push_ppg_pushuser_search_ip_from_wildcarded_list(Octstr *haystack, Octstr *needle, Octstr *gwlist_sep, Octstr *ip_sep)
 
int octstr_ncompare(const Octstr *ostr1, const Octstr *ostr2, long n)
 
static void destroy_oneuser(void *p)
 
#define octstr_duplicate(ostr)
 
#define octstr_dump(ostr, level,...)
 
int wap_push_ppg_pushuser_client_phone_number_acceptable(Octstr *username, Octstr *number)
 
#define http_header_find_first(headers, name)
 
static int ip_allowed_by_user(WAPPushUser *u, Octstr *ip)
 
void warning(int err, const char *fmt,...)
 
static WAPPushUserList * users
 
void wap_push_ppg_pushuser_list_destroy(void)
 
Octstr * octstr_format(const char *fmt,...)
 
void octstr_destroy(Octstr *ostr)
 
void octstr_destroy_item(void *os)
 
Octstr * get_official_name(void)
 
int wap_push_ppg_pushuser_authenticate(HTTPClient *c, List *cgivars, Octstr *ip, List *push_headers, Octstr **username)
 
void octstr_base64_to_binary(Octstr *ostr)
 
static long number_of_pushes
 
long octstr_len(const Octstr *ostr)
 
static WAPPushUser * create_oneuser(CfgGroup *grp)
 
void dict_destroy(Dict *dict)
 
regex_t * denied_prefix_regex
 
void debug(const char *place, int err, const char *fmt,...)
 
long http_header_remove_all(List *headers, char *name)
 
static int prefix_allowed(WAPPushUser *u, Octstr *number)
 
long octstr_parse_long(long *nump, Octstr *ostr, long pos, int base)
 
void octstr_format_append(Octstr *os, const char *fmt,...)
 
static int parse_cgivars_for_username(List *cgivars, Octstr **username)
 
static int response(List *push_headers, Octstr **username, Octstr **password)
 
static void challenge(HTTPClient *c, List *push_headers)
 
void octstr_get_many_chars(char *buf, Octstr *ostr, long pos, long len)
 
static Octstr * forced_smsc(WAPPushUser *u)
 
List * octstr_split(const Octstr *os, const Octstr *sep)
 
static void reply(HTTPClient *c, List *push_headers)
 
static WAPPushUser * user_find_by_username(Octstr *username)
 
int octstr_compare(const Octstr *ostr1, const Octstr *ostr2)
 
void gwlist_destroy(List *list, gwlist_item_destructor_t *destructor)