#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdarg.h>
#include <time.h>
#include <stdio.h>
#include <fcntl.h>
#include "../../sr_module.h"
#include "../../resolve.h"
#include "../../dprint.h"
#include "../../ut.h"
#include "../../mem/mem.h"
#include "../../mem/shm_mem.h"
#include "../../mi/mi.h"
#include "../../ip_addr.h"
#include "mi_datagram.h"
#include "datagram_fnc.h"
#include "mi_datagram_parser.h"
#include "mi_datagram_writer.h"

Go to the source code of this file.
Defines | |
| #define | AF_LOCAL AF_UNIX |
| #define | MAX_CTIME_LEN 128 |
| #define | MAX_NB_PORT 65535 |
| #define | PF_LOCAL PF_UNIX |
Functions | |
| static void | datagram_process (int rank) |
| static int | mi_child_init (int rank) |
| static int | mi_destroy (void) |
| static int | mi_mod_init (void) |
| static int | post_datagram_process (void) |
| static int | pre_datagram_process (void) |
Variables | |
| struct module_exports | exports |
| static sockaddr_dtgram | mi_dtgram_addr |
| static param_export_t | mi_params [] |
| static MODULE_VERSION proc_export_t | mi_procs [] |
| static char * | mi_reply_indent = DEFAULT_MI_REPLY_IDENT |
| static char * | mi_socket = 0 |
| static int | mi_socket_domain = AF_LOCAL |
| int | mi_socket_timeout = 2000 |
| static int | mi_unix_socket_gid = -1 |
| static char * | mi_unix_socket_gid_s = 0 |
| static int | mi_unix_socket_mode = S_IRUSR| S_IWUSR| S_IRGRP| S_IWGRP |
| static int | mi_unix_socket_uid = -1 |
| static char * | mi_unix_socket_uid_s = 0 |
| static rx_tx_sockets | sockets |
Definition in file mi_datagram.c.
| #define AF_LOCAL AF_UNIX |
Definition at line 67 of file mi_datagram.c.
| #define MAX_CTIME_LEN 128 |
Definition at line 74 of file mi_datagram.c.
| #define MAX_NB_PORT 65535 |
| #define PF_LOCAL PF_UNIX |
Definition at line 70 of file mi_datagram.c.
Referenced by init_twrite_sock(), and write_to_unixsock().
| static void datagram_process | ( | int | rank | ) | [static] |
Definition at line 285 of file mi_datagram.c.
References DATAGRAM_SOCK_BUF_SIZE, init_mi_child(), LM_CRIT, LM_ERR, LM_INFO, mi_datagram_server(), mi_datagram_writer_init(), mi_init_datagram_buffer(), mi_reply_indent, rx_tx::rx_sock, and rx_tx::tx_sock.
| static int mi_child_init | ( | int | rank | ) | [static] |
Definition at line 256 of file mi_datagram.c.
References DATAGRAM_SOCK_BUF_SIZE, LM_CRIT, mi_datagram_writer_init(), mi_reply_indent, and PROC_TIMER.
| static int mi_destroy | ( | void | ) | [static] |
| static int mi_mod_init | ( | void | ) | [static] |
Definition at line 145 of file mi_datagram.c.
References AF_LOCAL, group2gid(), hostent2su(), _str::len, LM_DBG, LM_ERR, LM_INFO, LM_WARN, MAX_NB_PORT, mi_socket, mi_socket_domain, mi_unix_socket_gid, mi_unix_socket_gid_s, mi_unix_socket_mode, mi_unix_socket_uid, mi_unix_socket_uid_s, NULL, port_no, resolvehost(), _str::s, str2int(), sockaddr_dtgram::udp_addr, sockaddr_dtgram::unix_addr, and user2uid().
| static int post_datagram_process | ( | void | ) | [static] |
| static int pre_datagram_process | ( | void | ) | [static] |
Definition at line 268 of file mi_datagram.c.
References LM_CRIT, mi_init_datagram_server(), mi_socket_domain, mi_unix_socket_gid, mi_unix_socket_mode, and mi_unix_socket_uid.
| struct module_exports exports |
Definition at line 129 of file mi_datagram.c.
sockaddr_dtgram mi_dtgram_addr [static] |
Definition at line 86 of file mi_datagram.c.
param_export_t mi_params[] [static] |
Definition at line 115 of file mi_datagram.c.
MODULE_VERSION proc_export_t mi_procs[] [static] |
Initial value:
{
{"MI Datagram", pre_datagram_process, post_datagram_process,
datagram_process, MI_CHILD_NO },
{0,0,0,0,0}
}
Definition at line 108 of file mi_datagram.c.
char* mi_reply_indent = DEFAULT_MI_REPLY_IDENT [static] |
Definition at line 101 of file mi_datagram.c.
char* mi_socket = 0 [static] |
int mi_socket_domain = AF_LOCAL [static] |
Definition at line 85 of file mi_datagram.c.
| int mi_socket_timeout = 2000 |
Timeout for sending replies in milliseconds
Definition at line 90 of file mi_datagram.c.
Referenced by datagram_close_async(), and mi_datagram_server().
int mi_unix_socket_gid = -1 [static] |
Definition at line 96 of file mi_datagram.c.
Referenced by mi_mod_init(), and pre_datagram_process().
char* mi_unix_socket_gid_s = 0 [static] |
int mi_unix_socket_mode = S_IRUSR| S_IWUSR| S_IRGRP| S_IWGRP [static] |
Definition at line 98 of file mi_datagram.c.
Referenced by mi_mod_init(), and pre_datagram_process().
int mi_unix_socket_uid = -1 [static] |
Definition at line 94 of file mi_datagram.c.
Referenced by mi_mod_init(), and pre_datagram_process().
char* mi_unix_socket_uid_s = 0 [static] |
rx_tx_sockets sockets [static] |
Definition at line 91 of file mi_datagram.c.
1.5.6