static gboolean systemd_syslog_sd_init_method(LogPipe *s) { SystemDSyslogSourceDriver *self = (SystemDSyslogSourceDriver*) s; if (service_management_get_type() != SMT_SYSTEMD) { msg_error("Error initializing systemd-syslog() source", evt_tag_str("systemd_status", "not-running"), NULL); return FALSE; } if (self->from_unix_source) { msg_warning("systemd-syslog() source ignores configuration options. " "Please, do not set anything on it", NULL); socket_options_free(self->super.socket_options); self->super.socket_options = socket_options_new(); socket_options_init_instance(self->super.socket_options); } return afsocket_sd_init_method((LogPipe*) &self->super); }
SocketOptions * socket_options_new(void) { SocketOptions *self = g_new0(SocketOptions, 1); socket_options_init_instance(self); return self; }
SocketOptionsInet * socket_options_inet_new_instance(void) { SocketOptionsInet *self = g_new0(SocketOptionsInet, 1); socket_options_init_instance(&self->super); self->super.setup_socket = socket_options_inet_setup_socket; self->super.so_keepalive = TRUE; #if defined(TCP_KEEPTIME) && defined(TCP_KEEPIDLE) && defined(TCP_KEEPCNT) self->tcp_keepalive_time = 60; self->tcp_keepalive_intvl = 10; self->tcp_keepalive_probes = 6; #endif return self; }