input stringlengths 16 454k | output stringlengths 13 350k | function_name stringlengths 1 100 | repo_name stringlengths 6 43 | category stringclasses 76
values | sample_id stringlengths 22 88 | decompiler stringclasses 1
value | opt_level stringclasses 1
value |
|---|---|---|---|---|---|---|---|
int list_iterator_hasnext(const list_t *l) {
return l->iter_active && l->iter_pos < l->numels;
} | int list_iterator_hasnext(const list_t *restrict l) {
if (!l->iter_active)
return 0;
return (l->iter_pos < l->numels);
} | list_iterator_hasnext | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-fw-hosts | ida | O0 |
void *list_iterator_next(list_t *l) {
void *toret;
if (!l->iter_active)
return 0;
toret = l->iter_curentry->data;
l->iter_curentry = l->iter_curentry->next;
++l->iter_pos;
return toret;
} | void *list_iterator_next(list_t *restrict l) {
void *toret;
if (!l->iter_active)
return NULL;
toret = l->iter_curentry->data;
l->iter_curentry = l->iter_curentry->next;
l->iter_pos++;
return toret;
} | list_iterator_next | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-fw-hosts | ida | O0 |
int list_iterator_start(list_t *l) {
if (l->iter_active)
return 0;
l->iter_pos = 0;
l->iter_active = 1;
l->iter_curentry = l->head_sentinel->next;
return 1;
} | int list_iterator_start(list_t *restrict l) {
if (l->iter_active)
return 0;
l->iter_pos = 0;
l->iter_active = 1;
l->iter_curentry = l->head_sentinel->next;
return 1;
} | list_iterator_start | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-fw-hosts | ida | O0 |
int list_iterator_stop(list_t *l) {
if (!l->iter_active)
return 0;
l->iter_pos = 0;
l->iter_active = 0;
return 1;
} | int list_iterator_stop(list_t *restrict l) {
if (!l->iter_active)
return 0;
l->iter_pos = 0;
l->iter_active = 0;
return 1;
} | list_iterator_stop | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-fw-hosts | ida | O0 |
int list_locate(const list_t *l, const void *data) {
int pos;
list_entry_s *el;
pos = 0;
if (l->attrs.comparator) {
el = l->head_sentinel->next;
while (el != l->tail_sentinel && l->attrs.comparator(data, el->data)) {
el = el->next;
++pos;
}
} else {
el = l->head_sentinel->next;
... | int list_locate(const list_t *restrict l, const void *data) {
struct list_entry_s *el;
int pos = 0;
if (l->attrs.comparator != NULL) {
for (el = l->head_sentinel->next; el != l->tail_sentinel;
el = el->next, pos++) {
if (l->attrs.comparator(data, el->data) == 0)
break;
}
} else ... | list_locate | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-fw-hosts | ida | O0 |
size_t list_meter_string(const void *el) {
return strlen((const char *)el) + 1;
} | SIMCLIST_METER(int8_t)
SIMCLIST_METER(int16_t)
SIMCLIST_METER(int32_t)
SIMCLIST_METER(int64_t)
SIMCLIST_METER(uint8_t)
SIMCLIST_METER(uint16_t)
SIMCLIST_METER(uint32_t)
SIMCLIST_METER(uint64_t)
SIMCLIST_METER(float)
SIMCLIST_METER(double)
size_t list_meter_string(const void *el) {
return strlen((const char *)el) +... | list_meter_string | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-fw-hosts | ida | O0 |
int list_prepend(list_t *l, const void *data) {
return list_insert_at(l, data, 0);
} | int list_prepend(list_t *restrict l, const void *data) {
return list_insert_at(l, data, 0);
} | list_prepend | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-fw-hosts | ida | O0 |
void *list_seek(list_t *l, const void *indicator) {
list_entry_s *iter;
if (!l->attrs.seeker)
return 0;
for (iter = l->head_sentinel->next; iter != l->tail_sentinel;
iter = iter->next) {
if (l->attrs.seeker(iter->data, indicator))
return iter->data;
}
return 0;
} | void *list_seek(list_t *restrict l, const void *indicator) {
const struct list_entry_s *iter;
if (l->attrs.seeker == NULL)
return NULL;
for (iter = l->head_sentinel->next; iter != l->tail_sentinel;
iter = iter->next) {
if (l->attrs.seeker(iter->data, indicator) != 0)
return iter->data;
}
... | list_seek | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-fw-hosts | ida | O0 |
unsigned int list_size(const list_t *l) { return l->numels; } | unsigned int list_size(const list_t *restrict l) { return l->numels; } | list_size | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-fw-hosts | ida | O0 |
int list_sort(list_t *l, int versus) {
if (l->iter_active || !l->attrs.comparator && !l->attrs.keymaker)
return -1;
if (l->numels > 1)
list_sort_quicksort(l, versus, 0, l->head_sentinel->next, l->numels - 1,
l->tail_sentinel->prev);
return 0;
} | int list_sort(list_t *restrict l, int versus) {
if (l->iter_active ||
(l->attrs.comparator == NULL && l->attrs.keymaker == NULL))
return -1;
if (l->numels <= 1)
return 0;
list_sort_quicksort(l, versus, 0, l->head_sentinel->next, l->numels - 1,
l->tail_sentinel->prev);
assert... | list_sort | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-fw-hosts | ida | O0 |
void list_sort_quicksort(list_t *l, int versus, unsigned int first,
list_entry_s *fel, unsigned int last,
list_entry_s *lel) {
list_entry_s *v6;
unsigned int pivotid;
unsigned int i;
unsigned int ia;
list_entry_s *left;
list_entry_s *right;
void *tmpdata;
... | static void list_sort_quicksort(list_t *restrict l, int versus,
unsigned int first, struct list_entry_s *fel,
unsigned int last, struct list_entry_s *lel) {
unsigned int pivotid;
unsigned int i;
register struct list_entry_s *pivot;
struct list_entr... | list_sort_quicksort | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-fw-hosts | ida | O0 |
void list_sort_selectionsort(list_t *l, int versus, unsigned int first,
list_entry_s *fel, unsigned int last,
list_entry_s *lel) {
list_entry_s *cursor;
list_entry_s *toswap;
void *tmpdata;
if (last > first) {
while (fel != lel) {
toswap = fel... | static inline void list_sort_selectionsort(list_t *restrict l, int versus,
unsigned int first,
struct list_entry_s *fel,
unsigned int last,
struct l... | list_sort_selectionsort | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-fw-hosts | ida | O0 |
int main(int argc, const char **argv, const char **envp) {
backend_main("sshg-fw-hosts");
return 0;
} | int main() { backend_main("sshg-fw-hosts"); } | main | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-fw-hosts | ida | O0 |
FILE *make_temporary_conffile() {
FILE *f;
f = fopen(tempflname, "w+");
if (!f)
return 0;
if (!chmod(tempflname, 0x1A4u))
return f;
perror("could not chmod");
fclose(f);
unlink(tempflname);
return 0;
} | static FILE *make_temporary_conffile(void) {
FILE *f;
f = fopen(tempflname, "w+");
if (f == NULL)
return NULL;
if (chmod(tempflname, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) != 0) {
perror("could not chmod");
fclose(f);
unlink(tempflname);
return NULL;
}
return f;
} | make_temporary_conffile | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-fw-hosts | ida | O0 |
gboolean graphite_module_init(PluginContext *context, CfgArgs *args) {
plugin_register(context, graphite_plugins, 1);
return 1;
} | gboolean graphite_module_init(PluginContext *context, CfgArgs *args) {
plugin_register(context, graphite_plugins, G_N_ELEMENTS(graphite_plugins));
return TRUE;
} | graphite_module_init | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libgraphite.so | ida | O0 |
void tf_graphite_call(LogTemplateFunction *self, gpointer s,
const LogTemplateInvokeArgs *args, GString *result) {
gint i;
gboolean r;
gsize orig_size;
r = 1;
orig_size = result->len;
for (i = 0; i < args->num_messages; ++i)
r &= tf_graphite_format(result, *(ValuePairs **)s, args-... | static void tf_graphite_call(LogTemplateFunction *self, gpointer s,
const LogTemplateInvokeArgs *args,
GString *result) {
TFGraphiteState *state = (TFGraphiteState *)s;
gint i;
gboolean r = TRUE;
gsize orig_size = result->len;
for (i = 0; i < args->nu... | tf_graphite_call | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libgraphite.so | ida | O0 |
gboolean tf_graphite_foreach_func(const gchar *name, TypeHint type,
const gchar *value, gsize value_len,
gpointer user_data) {
g_string_append(*((_QWORD *)user_data + 1), name);
g_string_append_c_inline(*((GString **)user_data + 1), 32);
g_string... | static gboolean tf_graphite_foreach_func(const gchar *name, TypeHint type,
const gchar *value, gsize value_len,
gpointer user_data) {
TFGraphiteForeachUserData *data = (TFGraphiteForeachUserData *)user_data;
g_string_append(data->res... | tf_graphite_foreach_func | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libgraphite.so | ida | O0 |
gboolean tf_graphite_format(GString *result, ValuePairs *vp, LogMessage *msg,
LogTemplate *timestamp_template,
LogTemplateEvalOptions *options) {
gboolean return_value;
TFGraphiteForeachUserData userdata;
long v11;
int v12;
int v13;
long v14;
unsigne... | static gboolean tf_graphite_format(GString *result, ValuePairs *vp,
LogMessage *msg,
LogTemplate *timestamp_template,
LogTemplateEvalOptions *options) {
TFGraphiteForeachUserData userdata;
gboolean return_value;... | tf_graphite_format | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libgraphite.so | ida | O0 |
void tf_graphite_free_state(gpointer s) {
value_pairs_unref(*(_QWORD *)s);
log_template_unref(*((_QWORD *)s + 1));
} | static void tf_graphite_free_state(gpointer s) {
TFGraphiteState *state = (TFGraphiteState *)s;
value_pairs_unref(state->vp);
log_template_unref(state->timestamp_template);
} | tf_graphite_free_state | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libgraphite.so | ida | O0 |
gboolean tf_graphite_parse_command_line_arguments(TFGraphiteState *self,
gint *argc, gchar ***argv,
LogTemplate *parent) {
gboolean success;
GError *error;
GOptionContext *ctx;
GOptionGroup *og;
TFGraphiteArgum... | static gboolean tf_graphite_parse_command_line_arguments(TFGraphiteState *self,
gint *argc,
gchar ***argv,
LogTemplate *parent) {
GOptionContext *c... | tf_graphite_parse_command_line_arguments | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libgraphite.so | ida | O0 |
gboolean tf_graphite_prepare(LogTemplateFunction *self, gpointer s,
LogTemplate *parent, gint argc, gchar **argv,
GError **error) {
LogTemplate *v7;
ValuePairs *v8;
long v9;
gchar **argva;
gint argca;
LogTemplate *parenta;
gpointer sa;
LogTemplat... | static gboolean tf_graphite_prepare(LogTemplateFunction *self, gpointer s,
LogTemplate *parent, gint argc,
gchar *argv[], GError **error) {
TFGraphiteState *state = (TFGraphiteState *)s;
ValuePairsTransformSet *vpts;
if (!tf_graphite_parse_c... | tf_graphite_prepare | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libgraphite.so | ida | O0 |
gboolean tf_graphite_set_timestamp(const gchar *option_name, const gchar *value,
gpointer data, GError **error) {
long v4;
v4 = *(_QWORD *)data;
*(_QWORD *)(v4 + 8) = log_template_new(*((_QWORD *)data + 1), 0);
if ((unsigned int)log_template_compile(*(_QWORD *)(*(_QWORD *)dat... | static gboolean tf_graphite_set_timestamp(const gchar *option_name,
const gchar *value, gpointer data,
GError **error) {
TFGraphiteArgumentsUserData *args = (TFGraphiteArgumentsUserData *)data;
args->state->timestamp_template = log... | tf_graphite_set_timestamp | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libgraphite.so | ida | O0 |
gboolean thread_check_exit_criteria(ThreadData *thread_context) {
gchar *base;
gchar *base_0;
timeval now;
unsigned long v5;
v5 = __readfsqword(0x28u);
if (thread_context->option->number_of_messages &&
thread_context->sent_messages >=
thread_context->option->number_of_messages) {
if ((u... | gboolean thread_check_exit_criteria(ThreadData *thread_context) {
if (thread_context->option->number_of_messages != 0 &&
thread_context->sent_messages >=
thread_context->option->number_of_messages) {
DEBUG(
"(thread %d) number of sent messages reached the defined limit (%d)\n",
thr... | thread_check_exit_criteria | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libloggen_plugin-3.35.so.0.0.0 | ida | O0 |
gboolean thread_check_time_bucket(ThreadData *thread_context) {
long v1;
double v2;
double v3;
long rate;
__suseconds_t tv_usec;
long msec;
timeval now;
timespec tspec;
unsigned long v10;
v10 = __readfsqword(0x28u);
gettimeofday(&now, 0);
v1 = time_val_diff_in_usec(&now, &thread_context->last_t... | gboolean thread_check_time_bucket(ThreadData *thread_context) {
struct timeval now;
gettimeofday(&now, NULL);
double diff_usec =
time_val_diff_in_usec(&now, &thread_context->last_throttle_check);
if (thread_context->buckets == 0 || diff_usec > 1e5) {
long new_buckets =
(long)((thread_context... | thread_check_time_bucket | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libloggen_plugin-3.35.so.0.0.0 | ida | O0 |
void kmsg_init_boot_time() {
int pos;
int posa;
int fd;
long rc;
guint64 tdiff;
timeval curr_time;
gchar buf[1032];
unsigned long v7;
v7 = __readfsqword(0x28u);
pos = 0;
fd = open64("/proc/uptime", 0);
if (fd != -1) {
rc = read(fd, buf, 0x400u);
if (rc > 0) {
close(fd);
gett... | static void kmsg_init_boot_time(void) {
int fd, pos = 0;
gchar buf[1024];
ssize_t rc;
struct timeval curr_time;
guint64 tdiff;
if ((fd = open("/proc/uptime", O_RDONLY)) == -1)
return;
if ((rc = read(fd, buf, sizeof(buf))) <= 0) {
close(fd);
return;
}
close(fd);
gettimeofday(&curr_time... | kmsg_init_boot_time | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
gboolean kmsg_is_key_value_pair_device(const guchar *name, gsize length) {
return strncmp((const char *)name, "DEVICE=", length + 1) == 0;
} | static gboolean kmsg_is_key_value_pair_device(const guchar *name,
gsize length) {
if (strncmp((const char *)name, "DEVICE=", length + 1) == 0)
return TRUE;
return FALSE;
} | kmsg_is_key_value_pair_device | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
void kmsg_parse_device_dev_t(const gchar *type, const guchar *value,
gsize length, LogMessage *msg) {
gsize seppos;
seppos = 0;
log_msg_set_value(msg, KMSG_LM_V_DEV_TYPE, type, -1);
while (seppos < length && value[seppos] != 58)
++seppos;
log_msg_set_value(msg, KMSG_LM_V_DEV_... | static void kmsg_parse_device_dev_t(const gchar *type, const guchar *value,
gsize length, LogMessage *msg) {
gsize seppos = 0;
log_msg_set_value(msg, KMSG_LM_V_DEV_TYPE, type, -1);
while (seppos < length && value[seppos] != ':')
seppos++;
log_msg_set_value(msg, KMSG_LM... | kmsg_parse_device_dev_t | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
void kmsg_parse_device_key_value_pair(const guchar *value, gsize length,
LogMessage *msg) {
int v3;
v3 = *value;
if (v3 == 110) {
kmsg_parse_device_netdev(value + 1, length - 1, msg);
return;
}
if (*value <= 0x6Eu) {
if (v3 == 99) {
kmsg_parse_device_de... | static void kmsg_parse_device_key_value_pair(const guchar *value, gsize length,
LogMessage *msg) {
switch (value[0]) {
case 'b':
kmsg_parse_device_dev_t("block", value + 1, length - 1, msg);
break;
case 'c':
kmsg_parse_device_dev_t("char", value + 1, length... | kmsg_parse_device_key_value_pair | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
void kmsg_parse_device_netdev(const guchar *value, gsize length,
LogMessage *msg) {
log_msg_set_value(msg, KMSG_LM_V_DEV_TYPE, "netdev", -1);
log_msg_set_value(msg, KMSG_LM_V_NETDEV_INDEX, value, length);
} | static void kmsg_parse_device_netdev(const guchar *value, gsize length,
LogMessage *msg) {
log_msg_set_value(msg, KMSG_LM_V_DEV_TYPE, "netdev", -1);
log_msg_set_value(msg, KMSG_LM_V_NETDEV_INDEX, (const gchar *)value, length);
} | kmsg_parse_device_netdev | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
void kmsg_parse_device_subsys(const guchar *value, gsize length,
LogMessage *msg) {
gsize seppos;
for (seppos = 0; seppos < length && value[seppos] != 58; ++seppos)
;
log_msg_set_value(msg, KMSG_LM_V_DEV_TYPE, value, seppos);
log_msg_set_value(msg, KMSG_LM_V_DEV_NAME, &value[s... | static void kmsg_parse_device_subsys(const guchar *value, gsize length,
LogMessage *msg) {
gsize seppos = 0;
while (seppos < length && value[seppos] != ':')
seppos++;
log_msg_set_value(msg, KMSG_LM_V_DEV_TYPE, (const gchar *)value, seppos);
log_msg_set_value(msg, KMSG_... | kmsg_parse_device_subsys | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
void kmsg_parse_device_unknown(const guchar *value, gsize length,
LogMessage *msg) {
log_msg_set_value(msg, KMSG_LM_V_DEV_TYPE, "<unknown>", -1);
log_msg_set_value(msg, KMSG_LM_V_DEV_NAME, value, length);
} | static void kmsg_parse_device_unknown(const guchar *value, gsize length,
LogMessage *msg) {
log_msg_set_value(msg, KMSG_LM_V_DEV_TYPE, "<unknown>", -1);
log_msg_set_value(msg, KMSG_LM_V_DEV_NAME, (const gchar *)value, length);
} | kmsg_parse_device_unknown | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
gboolean kmsg_parse_key_value_pair(const guchar *data, gsize *pos, gsize length,
LogMessage *msg) {
long value_handle;
gsize name_start;
gsize name_len;
gsize value_start;
gsize value_len;
GString *name;
while (length > *pos && (data[*pos] == 32 || data[*pos] == 9))
... | static gboolean kmsg_parse_key_value_pair(const guchar *data, gsize *pos,
gsize length, LogMessage *msg) {
gsize name_start, name_len, value_start, value_len;
GString *name;
while (*pos < length && (data[*pos] == ' ' || data[*pos] == '\t'))
(*pos)++;
if (*pos == le... | kmsg_parse_key_value_pair | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
gsize kmsg_parse_message(const guchar *data, gsize *pos, gsize length,
LogMessage *msg) {
gsize start;
start = *pos;
while (length > *pos && data[*pos] != 10)
++*pos;
if (data[*pos] != 10)
return 0;
log_msg_set_value(msg, 3, &data[start], *pos - start);
return 1;
} | static gsize kmsg_parse_message(const guchar *data, gsize *pos, gsize length,
LogMessage *msg) {
gsize start = *pos;
while (*pos < length && data[*pos] != '\n')
(*pos)++;
if (data[*pos] != '\n')
return FALSE;
log_msg_set_value(msg, LM_V_MESSAGE, (const gchar *)data + st... | kmsg_parse_message | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
gboolean kmsg_parse_prio(const guchar *data, gsize *pos, gsize length,
LogMessage *msg) {
guint16 pri;
pri = 0;
while (length > *pos && data[*pos] != 44) {
if (((*__ctype_b_loc())[data[*pos]] & 0x800) == 0)
return 0;
pri = 10 * pri + data[(*pos)++] - 48;
}
if (data[*pos... | static gboolean kmsg_parse_prio(const guchar *data, gsize *pos, gsize length,
LogMessage *msg) {
gint pri = 0;
while (*pos < length && data[*pos] != ',') {
if (isdigit(data[*pos]))
pri = pri * 10 + ((data[*pos]) - '0');
else
return FALSE;
(*pos)++;
}
if (... | kmsg_parse_prio | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
gboolean kmsg_parse_seq(const guchar *data, gsize *pos, gsize length,
LogMessage *msg) {
gsize start;
start = *pos;
while (length > *pos && data[*pos] != 44) {
if (((*__ctype_b_loc())[data[*pos]] & 0x800) == 0)
return 1;
++*pos;
}
if (data[*pos] != 44 || length == *pos)
... | static gboolean kmsg_parse_seq(const guchar *data, gsize *pos, gsize length,
LogMessage *msg) {
gsize start = *pos;
while (*pos < length && data[*pos] != ',') {
if (!isdigit(data[*pos]))
return TRUE;
(*pos)++;
}
if (data[*pos] != ',' || *pos == length)
return FA... | kmsg_parse_seq | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
gboolean kmsg_parse_timestamp(const guchar *data, gsize *pos, gsize length,
LogMessage *msg) {
long timestamp;
gsize start;
timestamp = 0;
start = *pos;
while (length > *pos && data[*pos] != 44 && data[*pos] != 59) {
if (((*__ctype_b_loc())[data[*pos]] & 0x800) == 0)
r... | static gboolean kmsg_parse_timestamp(const guchar *data, gsize *pos,
gsize length, LogMessage *msg) {
guint64 timestamp = 0;
gsize start = *pos;
while (*pos < length && data[*pos] != ',' && data[*pos] != ';') {
if (isdigit(data[*pos]))
timestamp = timestamp * 10 + (... | kmsg_parse_timestamp | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
gboolean kmsg_skip_to_message(const guchar *data, gsize *pos, gsize length) {
while (length > *pos && data[*pos] != 59)
++*pos;
return data[*pos] == 59 && length != *pos;
} | static gboolean kmsg_skip_to_message(const guchar *data, gsize *pos,
gsize length) {
while (*pos < length && data[*pos] != ';')
(*pos)++;
if (data[*pos] != ';' || *pos == length)
return FALSE;
return TRUE;
} | kmsg_skip_to_message | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
guint64 kmsg_timeval_diff(timeval *t1, timeval *t2) {
return 1000000 * (t1->tv_sec - t2->tv_sec) + t1->tv_usec - t2->tv_usec;
} | static guint64 kmsg_timeval_diff(struct timeval *t1, struct timeval *t2) {
return ((guint64)t1->tv_sec - (guint64)t2->tv_sec) * G_USEC_PER_SEC +
((guint64)t1->tv_usec - (guint64)t2->tv_usec);
} | kmsg_timeval_diff | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
void kmsg_to_absolute_time(guint64 timestamp, UnixTime *dest) {
guint64 t;
t = 1000000 * (boot_time.tv_sec + timestamp / 0xF4240) + boot_time.tv_usec +
timestamp % 0xF4240;
dest->ut_sec = t / 0xF4240;
dest->ut_usec = t % 0xF4240;
} | static void kmsg_to_absolute_time(guint64 timestamp, UnixTime *dest) {
guint64 t;
t = (boot_time.tv_sec + (timestamp / G_USEC_PER_SEC)) * G_USEC_PER_SEC +
boot_time.tv_usec + (timestamp % G_USEC_PER_SEC);
dest->ut_sec = t / G_USEC_PER_SEC;
dest->ut_usec = t % G_USEC_PER_SEC;
} | kmsg_to_absolute_time | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
gpointer linux_kmsg_format_construct(Plugin *self) {
return &linux_kmsg_handler;
} | static gpointer linux_kmsg_format_construct(Plugin *self) {
return (gpointer)&linux_kmsg_handler;
} | linux_kmsg_format_construct | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
gboolean linux_kmsg_format_handler(const MsgFormatOptions *parse_options,
LogMessage *msg, const guchar *data,
gsize length, gsize *problem_position) {
gboolean result;
while (length && (data[length - 1] == 10 || !data[length - 1]))
--length... | gboolean linux_kmsg_format_handler(const MsgFormatOptions *parse_options,
LogMessage *msg, const guchar *data,
gsize length, gsize *problem_position) {
gboolean success;
while (length > 0 && (data[length - 1] == '\n' || data[length - 1] == '\0')... | linux_kmsg_format_handler | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
gboolean linux_kmsg_format_module_init(PluginContext *context, CfgArgs *args) {
linux_msg_format_init();
plugin_register(context, &linux_kmsg_format_plugin, 1);
return 1;
} | gboolean linux_kmsg_format_module_init(PluginContext *context, CfgArgs *args) {
linux_msg_format_init();
plugin_register(context, &linux_kmsg_format_plugin, 1);
return TRUE;
} | linux_kmsg_format_module_init | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
void linux_msg_format_init() {
if (!initialized_0) {
KMSG_LM_V_DEV_TYPE = log_msg_get_value_handle(".linux.DEVICE.type");
KMSG_LM_V_DEV_MINOR = log_msg_get_value_handle(".linux.DEVICE.minor");
KMSG_LM_V_DEV_MAJOR = log_msg_get_value_handle(".linux.DEVICE.major");
KMSG_LM_V_DEV_NAME = log_msg_get_value... | void linux_msg_format_init(void) {
static gboolean initialized = FALSE;
if (!initialized) {
KMSG_LM_V_DEV_TYPE = log_msg_get_value_handle(".linux.DEVICE.type");
KMSG_LM_V_DEV_MINOR = log_msg_get_value_handle(".linux.DEVICE.minor");
KMSG_LM_V_DEV_MAJOR = log_msg_get_value_handle(".linux.DEVICE.major");
... | linux_msg_format_init | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
gboolean log_msg_parse_kmsg(LogMessage *msg, const guchar *data, gsize length,
gsize *position) {
gsize pos[2];
pos[1] = __readfsqword(0x28u);
pos[0] = 0;
if (kmsg_parse_prio(data, pos, length, msg)) {
++pos[0];
if (kmsg_parse_seq(data, pos, length, msg)) {
++pos[0];
... | static gboolean log_msg_parse_kmsg(LogMessage *msg, const guchar *data,
gsize length, gsize *position) {
gsize pos = 0;
if (!kmsg_parse_prio(data, &pos, length, msg))
goto error;
pos++;
if (!kmsg_parse_seq(data, &pos, length, msg))
goto error;
pos++;
if (!kmsg_p... | log_msg_parse_kmsg | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/liblinux-kmsg-format.so | ida | O0 |
int attack_addr_seeker(const void *el, const void *key) {
if (!el || !key)
__assert_fail("atk != NULL && adr != NULL", "attack.c", 0x1Cu,
"attack_addr_seeker");
return *((_DWORD *)el + 12) == *((_DWORD *)key + 12) &&
strcmp((const char *)el, (const char *)key) == 0;
} | int attack_addr_seeker(const void *el, const void *key) {
const sshg_address_t *adr = (const sshg_address_t *)key;
const attacker_t *atk = (const attacker_t *)el;
assert(atk != NULL && adr != NULL);
if (atk->attack.address.kind != adr->kind)
return 0;
return (strcmp(atk->attack.address.value, adr->value)... | attack_addr_seeker | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
size_t attacker_el_meter(const void *el) { return 96; } | static size_t attacker_el_meter(const void *el) {
if (el) {
}
return sizeof(attacker_t);
} | attacker_el_meter | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void attackerinit(attacker_t *ipe, const attack_t *attack) {
if (!ipe || !attack)
__assert_fail("ipe != NULL && attack != NULL", "attack.c", 0xFu,
"attackerinit");
strcpy(ipe->attack.address.value, attack->address.value);
ipe->attack.address.kind = attack->address.kind;
ipe->attack.service... | void attackerinit(attacker_t *restrict ipe, const attack_t *restrict attack) {
assert(ipe != NULL && attack != NULL);
strcpy(ipe->attack.address.value, attack->address.value);
ipe->attack.address.kind = attack->address.kind;
ipe->attack.service = attack->service;
ipe->whenfirst = ipe->whenlast = time(NULL);
... | attackerinit | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
int attackt_whenlast_comparator(const void *a, const void *b) {
return (*((_QWORD *)a + 9) > *((_QWORD *)b + 9)) -
(*((_QWORD *)a + 9) < *((_QWORD *)b + 9));
} | int attackt_whenlast_comparator(const void *a, const void *b) {
const attacker_t *aa = (const attacker_t *)a;
const attacker_t *bb = (const attacker_t *)b;
return ((aa->whenlast > bb->whenlast) - (aa->whenlast < bb->whenlast));
} | attackt_whenlast_comparator | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void blacklist_add(const attacker_t *newel) {
int *v1;
char *v2;
if (!blacklist_file || !blacklist)
__assert_fail("blacklist_file != NULL && blacklist != NULL",
"sshguard_blacklist.c", 0x79u, "blacklist_add");
if (blacklist_contains(&newel->attack.address)) {
syslog(4, "blacklist: %s ... | void blacklist_add(const attacker_t *restrict newel) {
assert(blacklist_file != NULL && blacklist != NULL);
if (blacklist_contains(&newel->attack.address)) {
sshguard_log(LOG_WARNING, "blacklist: %s is already blacklisted",
newel->attack.address.value);
return;
}
int retval = fprintf(b... | blacklist_add | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void blacklist_close() {
if (!blacklist_file || !blacklist)
__assert_fail("blacklist_file != NULL && blacklist != NULL",
"sshguard_blacklist.c", 0x30u, "blacklist_close");
fclose(blacklist_file);
blacklist_file = 0;
list_destroy(blacklist);
free(blacklist);
blacklist = 0;
} | static void blacklist_close() {
assert(blacklist_file != NULL && blacklist != NULL);
fclose(blacklist_file);
blacklist_file = NULL;
list_destroy(blacklist);
free(blacklist);
blacklist = NULL;
} | blacklist_close | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
int blacklist_contains(const sshg_address_t *addr) {
if (!blacklist)
return -1;
list_attributes_seeker(blacklist, (element_seeker)attack_addr_seeker);
return list_seek(blacklist, addr) != 0;
} | int blacklist_contains(const sshg_address_t *restrict addr) {
if (blacklist == NULL) {
return -1;
}
list_attributes_seeker(blacklist, attack_addr_seeker);
attacker_t *restrict el = list_seek(blacklist, addr);
return (el != NULL);
} | blacklist_contains | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
list_t *blacklist_load(const char *filename) {
int service_no;
unsigned int linecnt;
long blacklist_time;
attacker_t newattacker;
char blacklist_line[1032];
unsigned long v7;
v7 = __readfsqword(0x28u);
if (blacklist_file || blacklist)
__assert_fail("blacklist_file == NULL && blacklist == NULL",
... | list_t *blacklist_load(const char *filename) {
char blacklist_line[BL_MAXBUF];
unsigned int linecnt;
assert(blacklist_file == NULL && blacklist == NULL);
blacklist_file = fopen(filename, "a+");
if (blacklist_file == NULL) {
return NULL;
}
blacklist = (list_t *)malloc(sizeof(list_t));
list_init(bla... | blacklist_load | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void blacklist_load_and_block() {
unsigned int v0;
list_t *blacklist;
blacklist = blacklist_load(opts.blacklist_filename);
if (!blacklist) {
syslog(3, "blacklist: could not open %s: %m", opts.blacklist_filename);
exit(66);
}
v0 = list_size(blacklist);
syslog(6, "blacklist: blocking %u addresses",... | void blacklist_load_and_block() {
list_t *blacklist = blacklist_load(opts.blacklist_filename);
if (blacklist == NULL) {
sshguard_log(LOG_ERR, "blacklist: could not open %s: %m",
opts.blacklist_filename);
exit(66);
}
sshguard_log(LOG_INFO, "blacklist: blocking %u addresses",
... | blacklist_load_and_block | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void block_list(list_t *list) {
attacker_t *next;
list_iterator_start(list);
while (list_iterator_hasnext(list)) {
next = (attacker_t *)list_iterator_next(list);
fw_block(&next->attack);
}
list_iterator_stop(list);
} | static void block_list(list_t *list) {
list_iterator_start(list);
while (list_iterator_hasnext(list)) {
attacker_t *next = list_iterator_next(list);
fw_block(&next->attack);
}
list_iterator_stop(list);
} | block_list | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void blocklist_add(attacker_t *tmpent) {
fw_block(&tmpent->attack);
pthread_mutex_lock(&list_mutex);
list_append(&hell, tmpent);
pthread_mutex_unlock(&list_mutex);
} | void blocklist_add(attacker_t *tmpent) {
fw_block(&tmpent->attack);
pthread_mutex_lock(&list_mutex);
list_append(&hell, tmpent);
pthread_mutex_unlock(&list_mutex);
} | blocklist_add | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
bool blocklist_contains(attack_t attack) {
attacker_t *tmpent;
pthread_mutex_lock(&list_mutex);
tmpent = (attacker_t *)list_seek(&hell, &attack);
pthread_mutex_unlock(&list_mutex);
return tmpent != 0;
} | bool blocklist_contains(attack_t attack) {
attacker_t *tmpent = NULL;
pthread_mutex_lock(&list_mutex);
tmpent = list_seek(&hell, &attack.address);
pthread_mutex_unlock(&list_mutex);
return tmpent != NULL;
} | blocklist_contains | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void blocklist_init() {
pthread_t tid[2];
tid[1] = __readfsqword(0x28u);
list_init(&hell);
list_attributes_seeker(&hell, (element_seeker)attack_addr_seeker);
pthread_mutex_init(&list_mutex, 0);
if (pthread_create(tid, 0, (void *(*)(void *))unblock_loop, 0)) {
perror("pthread_create()");
exit(2);
... | void blocklist_init() {
pthread_t tid;
list_init(&hell);
list_attributes_seeker(&hell, attack_addr_seeker);
pthread_mutex_init(&list_mutex, NULL);
if (pthread_create(&tid, NULL, unblock_loop, NULL) != 0) {
perror("pthread_create()");
exit(2);
}
} | blocklist_init | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void finishup() {
const char *v0;
if (exit_sig == 1)
v0 = "SIGHUP";
else
v0 = "signal";
syslog(6, "Exiting on %s.", v0);
whitelist_fin();
closelog();
} | static void finishup(void) {
sshguard_log(LOG_INFO, "Exiting on %s.",
exit_sig == SIGHUP ? "SIGHUP" : "signal");
whitelist_fin();
closelog();
} | finishup | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
Fnv32_t fnv_32a_str(const char *str, Fnv32_t hval) {
const char *v2;
while (*str) {
v2 = str++;
hval = 16777619 * (*(unsigned char *)v2 ^ hval);
}
return hval;
} | Fnv32_t fnv_32a_str(const char *str, Fnv32_t hval) {
unsigned const char *s = (unsigned char *)str;
while (*s) {
hval ^= (Fnv32_t)*s++;
#if defined(NO_FNV_GCC_OPTIMIZATION)
hval *= FNV_32_PRIME;
#else
hval +=
(hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24);
#endif
}
... | fnv_32a_str | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void fw_block(const attack_t *attack) {
unsigned int subnet_size;
subnet_size = fw_block_subnet_size(attack->address.kind);
printf("block %s %d %u\n", attack->address.value, attack->address.kind,
subnet_size);
fflush(stdout);
} | static void fw_block(const attack_t *attack) {
unsigned int subnet_size = fw_block_subnet_size(attack->address.kind);
printf("block %s %d %u\n", attack->address.value, attack->address.kind,
subnet_size);
fflush(stdout);
} | fw_block | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
unsigned int fw_block_subnet_size(int inet_family) {
if (inet_family == 6)
return opts.subnet_ipv6;
if (inet_family != 4)
__assert_fail("0", "blocklist.c", 0x1Au, "fw_block_subnet_size");
return opts.subnet_ipv4;
} | unsigned int fw_block_subnet_size(int inet_family) {
if (inet_family == 6) {
return opts.subnet_ipv6;
} else if (inet_family == 4) {
return opts.subnet_ipv4;
}
assert(0);
} | fw_block_subnet_size | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void fw_release(const attack_t *attack) {
unsigned int subnet_size;
subnet_size = fw_block_subnet_size(attack->address.kind);
printf("release %s %d %u\n", attack->address.value, attack->address.kind,
subnet_size);
fflush(stdout);
} | static void fw_release(const attack_t *attack) {
unsigned int subnet_size = fw_block_subnet_size(attack->address.kind);
printf("release %s %d %u\n", attack->address.value, attack->address.kind,
subnet_size);
fflush(stdout);
} | fw_release | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
int get_options_cmdline(int argc, char **argv) {
size_t v2;
int optch;
options_init(&opts);
while (1) {
optch = getopt(argc, argv, "b:p:s:a:w:i:N:n:");
if (optch == -1)
break;
switch (optch) {
case 'N':
opts.subnet_ipv6 = strtol(optarg, 0, 10);
continue;
case 'a':
op... | int get_options_cmdline(int argc, char *argv[]) {
int optch;
options_init(&opts);
while ((optch = getopt(argc, argv, "b:p:s:a:w:i:N:n:")) != -1) {
switch (optch) {
case 'b':
opts.blacklist_filename = (char *)malloc(strlen(optarg) + 1);
if (sscanf(optarg, "%u:%s", &opts.blacklist_threshold,
... | get_options_cmdline | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void init_log(int debug) {
int flags;
int dest;
flags = 9;
dest = 32;
if (debug) {
flags = 41;
dest = 176;
} else {
setlogmask(127);
}
tzset();
openlog("sshguard", flags, dest);
} | static void init_log(int debug) {
int flags = LOG_NDELAY | LOG_PID;
int dest = LOG_AUTH;
if (debug) {
flags |= LOG_PERROR;
dest = LOG_LOCAL6;
} else {
setlogmask(LOG_UPTO(LOG_INFO));
}
tzset();
openlog("sshguard", flags, dest);
} | init_log | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void log_block(attacker_t *tmpent, attacker_t *offenderent) {
unsigned int subnet_size;
time_t time;
char time_msg[136];
unsigned long v5;
v5 = __readfsqword(0x28u);
strcpy(time_msg, "forever");
memset(&time_msg[8], 0, 120);
time = tmpent->pardontime;
subnet_size = fw_block_subnet_size(tmpent->attack... | void log_block(attacker_t *tmpent, attacker_t *offenderent) {
char time_msg[128] = "forever";
const time_t time = tmpent->pardontime;
unsigned int subnet_size = fw_block_subnet_size(tmpent->attack.address.kind);
if (time > 0) {
if (snprintf(time_msg, sizeof(time_msg), "for %lld secs", (long long)time) <
... | log_block | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
int main(int argc, const char **argv, const char **envp) {
unsigned int v3;
_BOOL4 sshg_debugging;
attack_t parsed_attack;
char buf[1032];
unsigned long v8;
v8 = __readfsqword(0x28u);
sshg_debugging = getenv("SSHGUARD_DEBUG") != 0;
init_log(sshg_debugging);
v3 = time(0);
srand(v3);
list_init(&lim... | int main(int argc, char *argv[]) {
int sshg_debugging = (getenv("SSHGUARD_DEBUG") != NULL);
init_log(sshg_debugging);
srand(time(NULL));
list_init(&limbo);
list_attributes_seeker(&limbo, attack_addr_seeker);
blocklist_init();
list_init(&offenders);
list_attributes_seeker(&offenders, attack_addr_seeker... | main | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
int match_ip4(in_addr_t addr1, in_addr_t addr2, in_addr_t mask) {
return (mask & (addr2 ^ addr1)) == 0;
} | static int match_ip4(in_addr_t addr1, in_addr_t addr2, in_addr_t mask) {
return ((addr1 & mask) == (addr2 & mask)) ? 1 : 0;
} | match_ip4 | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
int match_ip6(const in6_addr *addr1, const in6_addr *addr2,
const in6_addr *mask) {
unsigned int i;
for (i = 0; i <= 0xF && mask->__u6_addr8[i]; ++i) {
if (((unsigned char)(addr2->__u6_addr8[i] ^ addr1->__u6_addr8[i]) &
mask->__u6_addr8[i]) != 0)
return 0;
}
return 1;
} | static int match_ip6(const struct in6_addr *restrict addr1,
const struct in6_addr *restrict addr2,
const struct in6_addr *restrict mask) {
for (unsigned int i = 0; i < sizeof(addr1->s6_addr) && mask->s6_addr[i] != 0;
i++) {
if ((addr1->s6_addr[i] & mask->s6_addr[i]... | match_ip6 | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void options_init(sshg_opts *opt) {
opt->pardon_threshold = 120;
opt->stale_threshold = 1800;
opt->abuse_threshold = 30;
opt->blacklist_threshold = 0;
opt->blacklist_filename = 0;
opt->subnet_ipv6 = 128;
opt->subnet_ipv4 = 32;
} | static void options_init(sshg_opts *opt) {
opt->pardon_threshold = 2 * 60;
opt->stale_threshold = 30 * 60;
opt->abuse_threshold = 30;
opt->blacklist_threshold = 0;
opt->blacklist_filename = NULL;
opt->subnet_ipv6 = 128;
opt->subnet_ipv4 = 32;
} | options_init | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void purge_limbo_stale() {
unsigned int pos;
time_t now;
attacker_t *tmpent;
syslog(7, "Purging old attackers.");
now = time(0);
for (pos = 0; pos < list_size(&limbo); ++pos) {
tmpent = (attacker_t *)list_get_at(&limbo, pos);
if (now - tmpent->whenfirst > opts.stale_threshold) {
list_delete_a... | static void purge_limbo_stale(void) {
sshguard_log(LOG_DEBUG, "Purging old attackers.");
time_t now = time(NULL);
for (unsigned int pos = 0; pos < list_size(&limbo); pos++) {
attacker_t *tmpent = list_get_at(&limbo, pos);
if (now - tmpent->whenfirst > opts.stale_threshold) {
list_delete_at(&limbo, p... | purge_limbo_stale | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void report_address(attack_t attack) {
int dangerousness;
const char *v2;
unsigned int v3;
unsigned int i;
attacker_t *tmpent;
attacker_t *offenderent;
if (!memchr(&attack, 0, 0x2Eu))
__assert_fail("memchr(attack.address.value, '\\0', "
"sizeof(attack.address.value)) != NULL",
... | static void report_address(attack_t attack) {
attacker_t *tmpent = NULL;
attacker_t *offenderent;
assert(attack.address.value != NULL);
assert(memchr(attack.address.value, '\0', sizeof(attack.address.value)) !=
NULL);
purge_limbo_stale();
if (blocklist_contains(attack)) {
sshguard_log(LOG_DE... | report_address | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
const char *service_to_name(service code) {
unsigned int i;
for (i = 0; i <= 0x14; ++i) {
if (code == services[i].code)
return services[i].name;
}
return "unknown service";
} | const char *service_to_name(enum service code) {
for (unsigned int i = 0; i < sizeof(services) / sizeof(struct service_s);
i++) {
if (code == services[i].code) {
return services[i].name;
}
}
return "unknown service";
} | service_to_name | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void sigfin_handler(int sig) {
exit_sig = sig;
exit(0);
} | static void sigfin_handler(int sig) {
exit_sig = sig;
exit(0);
} | sigfin_handler | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void unblock_expired() {
unsigned int v0;
int ret;
unsigned int pos;
time_t now;
attacker_t *tmpel;
unsigned long v5;
v5 = __readfsqword(0x28u);
now = time(0);
pthread_testcancel();
pthread_setcancelstate(1, &ret);
pthread_mutex_lock(&list_mutex);
for (pos = 0;; ++pos) {
v0 = list_size(&hel... | static void unblock_expired() {
attacker_t *tmpel;
int ret;
time_t now = time(NULL);
pthread_testcancel();
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &ret);
pthread_mutex_lock(&list_mutex);
for (unsigned int pos = 0; pos < list_size(&hell); pos++) {
tmpel = list_get_at(&hell, pos);
if (tmpe... | unblock_expired | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void *unblock_loop() {
unsigned int v0;
while (1) {
v0 = rand();
sleep(v0 % (opts.pardon_threshold / 2 + 1) + 1);
unblock_expired();
}
} | static void *unblock_loop() {
while (1) {
sleep(1 + ((unsigned int)rand() % (1 + opts.pardon_threshold / 2)));
unblock_expired();
}
pthread_exit(NULL);
return NULL;
} | unblock_loop | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void usage() {
fwrite("sshg-blocker: invalid command-line\n", 1u, 0x23u, stderr);
} | static void usage(void) {
fprintf(stderr, "sshg-blocker: invalid command-line\n");
} | usage | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
int whitelist_add(const char *str) {
unsigned int masklen;
char *pos;
char buf[56];
unsigned long v5;
v5 = __readfsqword(0x28u);
if (regexec(&wl_ip4reg, str, 0, 0, 0)) {
if (regexec(&wl_ip6reg, str, 0, 0, 0)) {
if (regexec(&wl_hostreg, str, 0, 0, 0)) {
if (strrchr(str, 47)) {
st... | int whitelist_add(const char *str) {
if (regexec(&wl_ip4reg, str, 0, NULL, 0) == 0) {
sshguard_log(LOG_DEBUG, "whitelist: add '%s' as plain IPv4.", str);
return whitelist_add_ipv4(str);
} else if (regexec(&wl_ip6reg, str, 0, NULL, 0) == 0) {
sshguard_log(LOG_DEBUG, "whitelist: add '%s' as plain IPv6.",... | whitelist_add | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
int whitelist_add_block4(const char *address, int masklen) {
int *v2;
char *v3;
addrblock_t ab;
unsigned long v6;
v6 = __readfsqword(0x28u);
ab.addrkind = 4;
if (inet_pton(2, address, &ab.address) == 1) {
ab.address.ip4.mask = htonl(-1 << (32 - masklen));
if (list_contains(&whitelist, &ab)) {
... | int whitelist_add_block4(const char *restrict address, int masklen) {
addrblock_t ab;
ab.addrkind = ADDRKIND_IPv4;
if (inet_pton(AF_INET, address, &ab.address.ip4.address) != 1) {
sshguard_log(LOG_WARNING,
"whitelist: could not interpret address '%s': %s.", address,
strerror... | whitelist_add_block4 | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
int whitelist_add_block6(const char *address, int masklen) {
int *v2;
char *v3;
int bytelen;
addrblock_t ab;
unsigned long v7;
v7 = __readfsqword(0x28u);
ab.addrkind = 6;
if (inet_pton(10, address, &ab.address) == 1) {
bytelen = masklen / 8;
memset(&ab.address.ip6.mask, 255, masklen / 8);
i... | int whitelist_add_block6(const char *restrict address, int masklen) {
addrblock_t ab;
int bytelen, bitlen;
uint8_t bitmask;
ab.addrkind = ADDRKIND_IPv6;
if (inet_pton(AF_INET6, address, &ab.address.ip6.address.s6_addr) != 1) {
sshguard_log(LOG_WARNING,
"whitelist: could not interpret add... | whitelist_add_block6 | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
int whitelist_add_host(const char *host) {
const char *v1;
int ai_family;
int numaddresses;
int ret;
addrinfo *hostaddrs;
addrinfo *addriter;
char addrstring[56];
unsigned long v9;
v9 = __readfsqword(0x28u);
ret = getaddrinfo(host, 0, 0, &hostaddrs);
if (ret) {
v1 = gai_strerror(ret);
sys... | int whitelist_add_host(const char *restrict host) {
struct addrinfo *hostaddrs;
struct addrinfo *addriter;
int ret, numaddresses;
ret = getaddrinfo(host, NULL, NULL, &hostaddrs);
if (ret != 0) {
sshguard_log(LOG_ERR, "Could not resolve hostname '%s': %s.", host,
gai_strerror(ret));
r... | whitelist_add_host | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
int whitelist_add_ipv4(const char *ip_0) {
addrblock_t ab;
unsigned long v3;
v3 = __readfsqword(0x28u);
ab.addrkind = 4;
inet_pton(2, ip_0, &ab.address);
ab.address.ip4.mask = -1;
if (list_contains(&whitelist, &ab)) {
syslog(7, "whitelist: skipping plain IPv4 %s -- already present.", ip_0);
} else ... | int whitelist_add_ipv4(const char *restrict ip) {
addrblock_t ab;
ab.addrkind = ADDRKIND_IPv4;
inet_pton(AF_INET, ip, &ab.address.ip4.address);
ab.address.ip4.mask = 0xFFFFFFFF;
if (!list_contains(&whitelist, &ab)) {
list_append(&whitelist, &ab);
sshguard_log(LOG_DEBUG, "whitelist: add plain IPv4 %s... | whitelist_add_ipv4 | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
int whitelist_add_ipv6(const char *ip_0) {
addrblock_t ab;
unsigned long v3;
v3 = __readfsqword(0x28u);
ab.addrkind = 6;
if (inet_pton(10, ip_0, &ab.address) == 1) {
memset(&ab.address.ip6.mask, 255, sizeof(ab.address.ip6.mask));
if (list_contains(&whitelist, &ab)) {
syslog(7, "whitelist: skipp... | int whitelist_add_ipv6(const char *restrict ip) {
addrblock_t ab;
ab.addrkind = ADDRKIND_IPv6;
if (inet_pton(AF_INET6, ip, &ab.address.ip6.address.s6_addr) != 1) {
sshguard_log(LOG_ERR, "whitelist: add ipv6: Could not add %s.", ip);
return -1;
}
memset(ab.address.ip6.mask.s6_addr, 0xFF,
si... | whitelist_add_ipv6 | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
int whitelist_compare(const void *a, const void *b) {
int ret;
int reta;
if (*(_DWORD *)a != *(_DWORD *)b) {
if (*(_DWORD *)a <= *(_DWORD *)b)
return -1;
else
return 1;
}
if (*(_DWORD *)a != 4) {
if (*(_DWORD *)a == 6) {
ret = memcmp((char *)a + 4, (char *)b + 4, 0x10u);
i... | static int whitelist_compare(const void *a, const void *b) {
int ret;
const addrblock_t *A = (const addrblock_t *)a;
const addrblock_t *B = (const addrblock_t *)b;
if (A->addrkind != B->addrkind)
return (A->addrkind > B->addrkind ? 1 : -1);
switch (A->addrkind) {
case ADDRKIND_IPv4:
if (A->address... | whitelist_compare | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void whitelist_conf_fin() {
regfree(&wl_ip4reg);
regfree(&wl_ip6reg);
regfree(&wl_hostreg);
} | void whitelist_conf_fin() {
regfree(&wl_ip4reg);
regfree(&wl_ip6reg);
regfree(&wl_hostreg);
} | whitelist_conf_fin | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
int whitelist_file(const char *filename) {
int *v2;
char *v3;
int lineno;
char *pos;
FILE *src;
size_t len;
char line[312];
unsigned long v9;
v9 = __readfsqword(0x28u);
lineno = 0;
if (!filename)
return -1;
src = fopen(filename, "r");
if (src) {
while (fgets(line, 300, src)) {
+... | int whitelist_file(const char *restrict filename) {
FILE *src;
char line[WHITELIST_SRCLINE_LEN];
int lineno = 0;
size_t len;
char *pos;
if (filename == NULL)
return -1;
src = fopen(filename, "r");
if (src == NULL) {
sshguard_log(LOG_ERR, "whitelist: unable to open input file %s: %s",
... | whitelist_file | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void whitelist_fin() { list_destroy(&whitelist); } | void whitelist_fin() { list_destroy(&whitelist); } | whitelist_fin | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void whitelist_init() {
list_init(&whitelist);
list_attributes_copy(&whitelist, (element_meter)whitelist_meter, 1);
list_attributes_comparator(&whitelist, (element_comparator)whitelist_compare);
if (regcomp(&wl_ip4reg,
"^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?|0)(\\.(25[0-5]|2[0-"
... | void whitelist_init() {
list_init(&whitelist);
list_attributes_copy(&whitelist, whitelist_meter, 1);
list_attributes_comparator(&whitelist, whitelist_compare);
if (regcomp(&wl_ip4reg, "^" REGEXLIB_IPV4 "$", REG_EXTENDED) != 0) {
abort();
}
if (regcomp(&wl_ip6reg, "^" REGEXLIB_IPV6 "$", REG_EXTENDED) !... | whitelist_init | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
int whitelist_match(const char *addr, int addrkind) {
in_addr_t addrent;
addrblock_t *entry;
in6_addr addrent6;
unsigned long v6;
v6 = __readfsqword(0x28u);
if (addrkind == 4) {
if (inet_pton(2, addr, &addrent) != 1) {
syslog(4, "whitelist: could not interpret ip address '%s'.", addr);
retu... | int whitelist_match(const char *restrict addr, int addrkind) {
in_addr_t addrent;
struct in6_addr addrent6;
addrblock_t *entry;
switch (addrkind) {
case ADDRKIND_IPv4:
if (inet_pton(AF_INET, addr, &addrent) != 1) {
sshguard_log(LOG_WARNING,
"whitelist: could not interpret ip addr... | whitelist_match | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
size_t whitelist_meter() { return 36; } | static size_t whitelist_meter() { return sizeof(addrblock_t); } | whitelist_meter | sshguard-2.4.2 | app-admin | O0/app-admin/sshguard-2.4.2/sshg-blocker | ida | O0 |
void afuser_dd_free(LogPipe *s) {
g_string_free(s[1].init, 1);
log_dest_driver_free(s);
} | void afuser_dd_free(LogPipe *s) {
AFUserDestDriver *self = (AFUserDestDriver *)s;
g_string_free(self->username, TRUE);
log_dest_driver_free(s);
} | afuser_dd_free | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libafuser.so | ida | O0 |
gboolean afuser_dd_init(LogPipe *s) {
GlobalConfig *cfg;
cfg = log_pipe_get_config(s);
if (s[1].post_deinit == (void (*)(LogPipe *))-1LL)
s[1].post_deinit = (void (*)(LogPipe *))cfg->time_reopen;
return log_dest_driver_init_method(s);
} | static gboolean afuser_dd_init(LogPipe *s) {
AFUserDestDriver *self = (AFUserDestDriver *)s;
GlobalConfig *cfg = log_pipe_get_config(s);
if (self->time_reopen == -1)
self->time_reopen = cfg->time_reopen;
return log_dest_driver_init_method(s);
} | afuser_dd_init | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libafuser.so | ida | O0 |
LogDriver *afuser_dd_new(gchar *user, GlobalConfig *cfg) {
AFUserDestDriver *self;
self = (AFUserDestDriver *)g_malloc0_n(1, 264);
log_dest_driver_init_instance(self, cfg);
self->super.super.super.init = (gboolean (*)(LogPipe *))afuser_dd_init;
self->super.super.super.queue = (void (*)(
LogPipe *, LogM... | LogDriver *afuser_dd_new(gchar *user, GlobalConfig *cfg) {
AFUserDestDriver *self = g_new0(AFUserDestDriver, 1);
log_dest_driver_init_instance(&self->super, cfg);
self->super.super.super.init = afuser_dd_init;
self->super.super.super.queue = afuser_dd_queue;
self->super.super.super.free_fn = afuser_dd_free;
... | afuser_dd_new | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libafuser.so | ida | O0 |
void afuser_dd_queue(LogPipe *s, LogMessage *msg,
const LogPathOptions *path_options) {
const char *value;
const char *v4;
size_t v5;
long v6;
gchar *utmp_username;
long v8;
long v9;
long v10;
long v11;
gchar *v12;
long v13;
long v14;
size_t v15;
long v16;
long v17;
... | static void afuser_dd_queue(LogPipe *s, LogMessage *msg,
const LogPathOptions *path_options) {
AFUserDestDriver *self = (AFUserDestDriver *)s;
gchar buf[8192];
GString *timestamp;
UtmpEntry *ut;
time_t now;
now = msg->timestamps[LM_TS_RECVD].ut_sec;
if (self->disable_until && ... | afuser_dd_queue | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libafuser.so | ida | O0 |
void afuser_dd_set_time_reopen(LogDriver *s, time_t time_reopen) {
s[1].super.plugin_name = (gchar *)time_reopen;
} | void afuser_dd_set_time_reopen(LogDriver *s, time_t time_reopen) {
AFUserDestDriver *self = (AFUserDestDriver *)s;
self->time_reopen = time_reopen;
} | afuser_dd_set_time_reopen | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libafuser.so | ida | O0 |
gboolean afuser_module_init(PluginContext *context, CfgArgs *args) {
plugin_register(context, afuser_plugins, 1);
return 1;
} | gboolean afuser_module_init(PluginContext *context, CfgArgs *args) {
plugin_register(context, afuser_plugins, G_N_ELEMENTS(afuser_plugins));
return TRUE;
} | afuser_module_init | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libafuser.so | ida | O0 |
int yy_syntax_error_arguments(const yypcontext_t *yyctx, yysymbol_kind_t *yyarg,
int yyargn) {
int v3;
yysymbol_kind_t *v4;
int yycount;
int yyn;
yycount = 0;
if (yyctx->yytoken != yysymbol_kind_t_YYSYMBOL_YYEMPTY) {
if (yyarg)
*yyarg = yyctx->yytoken;
v3 = yyarg... | static int yy_syntax_error_arguments(const yypcontext_t *yyctx,
yysymbol_kind_t yyarg[], int yyargn) {
int yycount = 0;
if (yyctx->yytoken != YYSYMBOL_YYEMPTY) {
int yyn;
if (yyarg)
yyarg[yycount] = yyctx->yytoken;
++yycount;
yyn = yypcontext_expected_tok... | yy_syntax_error_arguments | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libafuser.so | ida | O0 |
void yydestruct(const char *yymsg, yysymbol_kind_t yykind,
AFUSER_STYPE *yyvaluep, AFUSER_LTYPE *yylocationp,
CfgLexer *lexer, LogDriver **instance, gpointer arg) {
if (yykind == yysymbol_kind_t_YYSYMBOL_string ||
yykind <= yysymbol_kind_t_YYSYMBOL_string &&
(yykind == ... | static void yydestruct(const char *yymsg, yysymbol_kind_t yykind,
YYSTYPE *yyvaluep, YYLTYPE *yylocationp, CfgLexer *lexer,
LogDriver **instance, gpointer arg) {
YY_USE(yyvaluep);
YY_USE(yylocationp);
YY_USE(lexer);
YY_USE(instance);
YY_USE(arg);
if (!yymsg)
... | yydestruct | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libafuser.so | ida | O0 |
int yypcontext_expected_tokens(const yypcontext_t *yyctx,
yysymbol_kind_t *yyarg, int yyargn) {
int v3;
int v4;
int v6;
int yycount;
yysymbol_kind_t yyx;
int yyn;
int yyxbegin;
int yyxend;
yycount = 0;
yyn = yypact[*yyctx->yyssp];
if (yyn != -156) {
if (yyn >= 0... | static int yypcontext_expected_tokens(const yypcontext_t *yyctx,
yysymbol_kind_t yyarg[], int yyargn) {
int yycount = 0;
int yyn = yypact[+*yyctx->yyssp];
if (!yypact_value_is_default(yyn)) {
int yyxbegin = yyn < 0 ? -yyn : 0;
int yychecklim = YYLAST - yyn + 1;
... | yypcontext_expected_tokens | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libafuser.so | ida | O0 |
const char *yysymbol_name(yysymbol_kind_t yysymbol) {
return yytname[yysymbol];
} | static const char *yysymbol_name(yysymbol_kind_t yysymbol) {
return yytname[yysymbol];
} | yysymbol_name | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libafuser.so | ida | O0 |
int yysyntax_error(long *yymsg_alloc, char **yymsg, const yypcontext_t *yyctx) {
int v3;
int v5;
int yyi;
int yyi_0;
int yycount;
const char *yyformat;
long yysize;
char *yyp;
long yysize1;
yysymbol_kind_t yyarg[6];
unsigned long v14;
v14 = __readfsqword(0x28u);
v3 = yy_syntax_error_arguments... | static int yysyntax_error(YYPTRDIFF_T *yymsg_alloc, char **yymsg,
const yypcontext_t *yyctx) {
enum { YYARGS_MAX = 5 };
const char *yyformat = YY_NULLPTR;
yysymbol_kind_t yyarg[YYARGS_MAX];
YYPTRDIFF_T yysize = 0;
int yycount = yy_syntax_error_arguments(yyctx, yyarg, YYARGS_MAX);... | yysyntax_error | syslog-ng-3.35.1 | app-admin | O0/app-admin/syslog-ng-3.35.1/libafuser.so | ida | O0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.