fgms 0.11.8
The
FlightGear MultiPlayer Server
project
fg_common.hxx File Reference
#include "error.h"
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/uio.h>
#include <sys/un.h>
#include <sys/wait.h>
#include <time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <syslog.h>
#include <string.h>
#include <unistd.h>
#include <sys/ipc.h>
#include <sys/msg.h>

Go to the source code of this file.

Classes

struct  if_nameindex
 
struct  unp_in_pktinfo
 

Macros

#define AF_LOCAL   AF_UNIX
 
#define BUFFSIZE   8192 /* buffer size for reads and writes */
 
#define bzero(ptr, n)    memset (ptr, 0, n)
 
#define CMSG_LEN(size)    (sizeof(struct cmsghdr) + (size))
 
#define CMSG_SPACE(size)    (sizeof(struct cmsghdr) + (size))
 
#define DIR_MODE   (FILE_MODE | S_IXUSR | S_IXGRP | S_IXOTH)
 
#define FILE_MODE   (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
 
#define gethostbyname2(host, family)    gethostbyname((host))
 
#define HAVE_IF_NAMEINDEX_STRUCT
 
#define INADDR_NONE   0xffffffff /* should have been in <netinet/in.h> */
 
#define INFTIM   (-1) /* infinite poll timeout */
 
#define LISTENQ   1024 /* 2nd argument to listen () */
 
#define MAXLINE   4096 /* max text line length */
 
#define MSG_NOSIGNAL   0
 
#define MSGMAXLINE   504 /*Maximun character in msg: 503. char in [504] = '\0'. Note that MSGMAXLINE should be 512n-8 bytes. The "reserved" 8 bytes is for 64 bit pointer.*/
 
#define PF_LOCAL   PF_UNIX
 
#define SA   struct sockaddr
 
#define SERV_PORT   9877 /* TCP and UDP */
 
#define SERV_PORT_STR   "9877" /* TCP and UDP */
 
#define SHUT_RD   0 /* shutdown for reading */
 
#define SHUT_RDWR   2 /* shutdown for reading and writing */
 
#define SHUT_WR   1 /* shutdown for writing */
 
#define SUN_LEN
 
#define UNIXDG_PATH   "/tmp/unix.dg" /* Unix domain datagram */
 
#define UNIXSTR_PATH   "/tmp/unix.str" /* Unix domain stream */
 

Typedefs

typedef void Sigfunc(int)
 

Functions

void write_msg_log (const char *msg, int len, char *src=0)
 

Macro Definition Documentation

#define AF_LOCAL   AF_UNIX

Definition at line 157 of file fg_common.hxx.

#define BUFFSIZE   8192 /* buffer size for reads and writes */

Definition at line 181 of file fg_common.hxx.

#define bzero (   ptr,
 
)    memset (ptr, 0, n)

Definition at line 122 of file fg_common.hxx.

Referenced by main().

#define CMSG_LEN (   size)    (sizeof(struct cmsghdr) + (size))

Definition at line 140 of file fg_common.hxx.

#define CMSG_SPACE (   size)    (sizeof(struct cmsghdr) + (size))

Definition at line 143 of file fg_common.hxx.

#define DIR_MODE   (FILE_MODE | S_IXUSR | S_IXGRP | S_IXOTH)

Definition at line 194 of file fg_common.hxx.

#define FILE_MODE   (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)

Definition at line 192 of file fg_common.hxx.

#define gethostbyname2 (   host,
  family 
)    gethostbyname((host))

Definition at line 127 of file fg_common.hxx.

#define HAVE_IF_NAMEINDEX_STRUCT

Definition at line 205 of file fg_common.hxx.

#define INADDR_NONE   0xffffffff /* should have been in <netinet/in.h> */

Definition at line 93 of file fg_common.hxx.

#define INFTIM   (-1) /* infinite poll timeout */

Definition at line 168 of file fg_common.hxx.

#define LISTENQ   1024 /* 2nd argument to listen () */

Definition at line 176 of file fg_common.hxx.

#define MSG_NOSIGNAL   0

Definition at line 81 of file fg_common.hxx.

#define MSGMAXLINE   504 /*Maximun character in msg: 503. char in [504] = '\0'. Note that MSGMAXLINE should be 512n-8 bytes. The "reserved" 8 bytes is for 64 bit pointer.*/

Definition at line 180 of file fg_common.hxx.

Referenced by doit(), and FG_TRACKER::TrackerRead().

#define PF_LOCAL   PF_UNIX

Definition at line 160 of file fg_common.hxx.

#define SA   struct sockaddr

Definition at line 190 of file fg_common.hxx.

Referenced by doit(), and main().

#define SERV_PORT   9877 /* TCP and UDP */

Definition at line 184 of file fg_common.hxx.

#define SERV_PORT_STR   "9877" /* TCP and UDP */

Definition at line 185 of file fg_common.hxx.

#define SHUT_RD   0 /* shutdown for reading */

Definition at line 97 of file fg_common.hxx.

#define SHUT_RDWR   2 /* shutdown for reading and writing */

Definition at line 99 of file fg_common.hxx.

Referenced by netSocket::shutdown().

#define SHUT_WR   1 /* shutdown for writing */

Definition at line 98 of file fg_common.hxx.

#define SUN_LEN
Value:
(su) \
(sizeof (*(su)) - sizeof ((su)->sun_path) + strlen((su)->sun_path))

Definition at line 150 of file fg_common.hxx.

#define UNIXDG_PATH   "/tmp/unix.dg" /* Unix domain datagram */

Definition at line 187 of file fg_common.hxx.

#define UNIXSTR_PATH   "/tmp/unix.str" /* Unix domain stream */

Definition at line 186 of file fg_common.hxx.

Typedef Documentation

typedef void Sigfunc(int)

Definition at line 197 of file fg_common.hxx.

Function Documentation

void write_msg_log ( const char *  msg,
int  len,
char *  src = 0 
)