#include "dce-manager.h"
#include "process.h"
#include "utils.h"
#include "exec-utils.h"
#include "dce-errno.h"
#include "dce-libc-private.h"
#include "dce-signal.h"
#include "dce-netdb.h"
#include "dce-unistd.h"
#include "dce-time.h"
#include "sys/dce-socket.h"
#include "dce-pthread.h"
#include "dce-stdio.h"
#include "dce-stdarg.h"
#include "dce-stdlib.h"
#include "dce-locale.h"
#include "sys/dce-ioctl.h"
#include "dce-sched.h"
#include "arpa/dce-inet.h"
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include <limits.h>
#include <fcntl.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include "dce-random.h"
#include "net/dce-if.h"
#include "ns3/node.h"
#include "ns3/log.h"
#include "ns3/simulator.h"
#include "ns3/names.h"
#include "ns3/random-variable.h"
#include "ns3/ipv4-l3-protocol.h"
#include "socket-fd-factory.h"
Go to the source code of this file.
Functions | |
int * | dce___errno_location (void) |
void | dce_abort () |
unsigned int | dce_alarm (unsigned int s) |
int | dce_chdir (const char *path) |
int | dce_daemon (int nochdir, int noclose) |
double | dce_drand48 (void) |
double | dce_erand48 (unsigned short xsubi[3]) |
int | dce_execl (const char *path, const char *arg,...) |
int | dce_execle (const char *path, const char *arg,...) |
int | dce_execlp (const char *file, const char *arg,...) |
int | dce_execv (const char *path, char *const argv[]) |
int | dce_execve (const char *path, char *const argv[], char *const envp[]) |
int | dce_execvp (const char *file, char *const argv[]) |
int | dce_fchdir (int fd) |
pid_t | dce_fork (void) |
char * | dce_get_current_dir_name (void) |
char * | dce_getcwd (char *buf, size_t size) |
uid_t | dce_geteuid (void) |
int | dce_getitimer (int which, struct itimerval *value) |
int | dce_getopt (int argc, char *const argv[], const char *optstring) |
int | dce_getopt_long (int argc, char *const argv[], const char *optstring, const struct option *longopts, int *longindex) |
pid_t | dce_getpid (void) |
pid_t | dce_getppid (void) |
int | dce_gettimeofday (struct timeval *tv, struct timezone *tz) |
uid_t | dce_getuid (void) |
char * | dce_getwd (char *buf) |
char * | dce_if_indextoname (unsigned ifindex, char *ifname) |
unsigned | dce_if_nametoindex (const char *ifname) |
const char * | dce_inet_ntop (int af, const void *src, char *dst, socklen_t cnt) |
long int | dce_jrand48 (unsigned short int xsubi[3]) |
int | dce_kill (pid_t pid, int sig) |
void | dce_lcong48 (unsigned short param[7]) |
long int | dce_lrand48 (void) |
long int | dce_mrand48 (void) |
int | dce_nanosleep (const struct timespec *req, struct timespec *rem) |
long int | dce_nrand48 (unsigned short int xsubi[3]) |
int | dce_pause (void) |
int | dce_rand (void) |
long int | dce_random (void) |
ssize_t | dce_readlink (const char *path, char *buf, size_t bufsize) |
int | dce_sched_yield (void) |
unsigned short int * | dce_seed48 (unsigned short int seed16v[3]) |
int | dce_setegid (gid_t egid) |
int | dce_seteuid (uid_t euid) |
int | dce_setgid (gid_t gid) |
int | dce_setitimer (int which, const struct itimerval *value, struct itimerval *ovalue) |
char * | dce_setlocale (int category, const char *locale) |
int | dce_setregid (gid_t rgid, gid_t egid) |
int | dce_setresgid (gid_t rgid, gid_t egid, gid_t sgid) |
int | dce_setresuid (uid_t ruid, uid_t euid, uid_t suid) |
int | dce_setreuid (uid_t ruid, uid_t euid) |
int | dce_setuid (uid_t uid) |
unsigned int | dce_sleep (unsigned int seconds) |
void | dce_srand (unsigned int seed) |
void | dce_srand48 (long int seedval) |
void | dce_srandom (unsigned int seed) |
int | dce_sysinfo (struct sysinfo *info) |
int | dce_usleep (useconds_t usec) |
static bool | is_gcapable (void) |
static bool | is_set_gcapable (gid_t gid) |
static bool | is_set_ucapable (uid_t uid) |
static bool | is_ucapable (void) |
static void | Itimer (Process *process) |
NS_LOG_COMPONENT_DEFINE ("Dce") |
int* dce___errno_location | ( | void | ) |
Definition at line 41 of file dce.cc.
References GET_CURRENT_NOLOG.
void dce_abort | ( | ) |
Definition at line 258 of file dce.cc.
References ns3::Current(), dce_exit(), and ns3::UtilsSendSignal().
Referenced by map_newlink().
unsigned int dce_alarm | ( | unsigned int | s | ) |
Definition at line 939 of file dce.cc.
References dce_getitimer(), and dce_setitimer().
int dce_chdir | ( | const char * | path | ) |
Definition at line 614 of file dce.cc.
References ns3::Current(), ns3::Process::cwd, ns3::Thread::err, errno, ns3::Thread::process, ns3::UtilsGetNodeId(), ns3::UtilsGetRealFilePath(), and ns3::UtilsGetVirtualFilePath().
double dce_drand48 | ( | void | ) |
Definition at line 335 of file dce.cc.
References ns3::Current(), ns3::Thread::process, and ns3::Process::seed48Current.
double dce_erand48 | ( | unsigned short | xsubi[3] | ) |
Definition at line 376 of file dce.cc.
References ns3::Current(), ns3::Thread::process, and ns3::Process::seed48Current.
int dce_execl | ( | const char * | path, |
const char * | arg, | ||
... | |||
) |
Definition at line 736 of file dce.cc.
References ns3::Current(), dce_free(), dce_malloc(), ns3::Thread::err, ns3::DceManager::Execve(), ns3::Process::manager, ns3::Process::penvp, ns3::Thread::process, ns3::SearchExecFile(), and ns3::UtilsGetNodeId().
int dce_execle | ( | const char * | path, |
const char * | arg, | ||
... | |||
) |
Definition at line 870 of file dce.cc.
References ns3::Current(), dce_free(), dce_malloc(), ns3::Thread::err, ns3::DceManager::Execve(), ns3::Process::manager, ns3::Thread::process, ns3::SearchExecFile(), and ns3::UtilsGetNodeId().
int dce_execlp | ( | const char * | file, |
const char * | arg, | ||
... | |||
) |
Definition at line 797 of file dce.cc.
References ns3::Current(), dce_free(), dce_malloc(), ns3::Thread::err, ns3::DceManager::Execve(), ns3::Process::manager, ns3::Process::penvp, ns3::Thread::process, ns3::SearchExecFile(), ns3::seek_env(), and ns3::UtilsGetNodeId().
int dce_execv | ( | const char * | path, |
char *const | argv[] | ||
) |
Definition at line 721 of file dce.cc.
References ns3::Current(), ns3::Thread::err, ns3::DceManager::Execve(), ns3::Process::manager, ns3::Process::penvp, ns3::Thread::process, ns3::SearchExecFile(), and ns3::UtilsGetNodeId().
int dce_execve | ( | const char * | path, |
char *const | argv[], | ||
char *const | envp[] | ||
) |
Definition at line 781 of file dce.cc.
References ns3::Current(), ns3::Thread::err, ns3::DceManager::Execve(), ns3::Process::manager, ns3::Thread::process, ns3::SearchExecFile(), and ns3::UtilsGetNodeId().
int dce_execvp | ( | const char * | file, |
char *const | argv[] | ||
) |
Definition at line 849 of file dce.cc.
References ns3::Current(), ns3::Thread::err, ns3::DceManager::Execve(), ns3::Process::manager, ns3::Process::penvp, ns3::Thread::process, ns3::SearchExecFile(), ns3::seek_env(), and ns3::UtilsGetNodeId().
int dce_fchdir | ( | int | fd | ) |
Definition at line 633 of file dce.cc.
References ns3::Current(), ns3::Process::cwd, ns3::Thread::err, ns3::getRealFd(), ns3::PathOfFd(), ns3::Thread::process, ns3::UtilsGetCurrentDirName(), ns3::UtilsGetNodeId(), ns3::UtilsGetRealFilePath(), and ns3::UtilsGetVirtualFilePath().
pid_t dce_fork | ( | void | ) |
Definition at line 713 of file dce.cc.
References ns3::DceManager::Clone(), ns3::Current(), ns3::Process::manager, and ns3::Thread::process.
char* dce_get_current_dir_name | ( | void | ) |
Definition at line 607 of file dce.cc.
References ns3::Current(), dce_getcwd(), and ns3::UtilsGetNodeId().
Referenced by ns3::SearchExecFile().
char* dce_getcwd | ( | char * | buf, |
size_t | size | ||
) |
Definition at line 561 of file dce.cc.
References ns3::Current(), ns3::Process::cwd, dce_malloc(), ns3::Thread::err, ns3::Thread::process, and ns3::UtilsGetNodeId().
Referenced by dce_get_current_dir_name().
uid_t dce_geteuid | ( | void | ) |
Definition at line 61 of file dce.cc.
References GET_CURRENT_NOLOG.
int dce_getitimer | ( | int | which, |
struct itimerval * | value | ||
) |
Definition at line 511 of file dce.cc.
References ns3::Current(), ns3::Thread::err, ns3::Process::itimer, ns3::Process::itimerInterval, ns3::Thread::process, ns3::UtilsGetNodeId(), and ns3::UtilsTimeToTimeval().
Referenced by dce_alarm().
int dce_getopt | ( | int | argc, |
char *const | argv[], | ||
const char * | optstring | ||
) |
Definition at line 433 of file dce.cc.
References ns3::Current(), optarg, opterr, optind, optopt, ns3::Process::poptarg, ns3::Process::popterr, ns3::Process::poptind, ns3::Process::poptopt, ns3::Thread::process, and ns3::UtilsGetNodeId().
int dce_getopt_long | ( | int | argc, |
char *const | argv[], | ||
const char * | optstring, | ||
const struct option * | longopts, | ||
int * | longindex | ||
) |
Definition at line 462 of file dce.cc.
References ns3::Current(), optarg, opterr, optind, optopt, ns3::Process::poptarg, ns3::Process::popterr, ns3::Process::poptind, ns3::Process::poptopt, ns3::Thread::process, and ns3::UtilsGetNodeId().
pid_t dce_getpid | ( | void | ) |
Definition at line 46 of file dce.cc.
References GET_CURRENT_NOLOG.
pid_t dce_getppid | ( | void | ) |
Definition at line 51 of file dce.cc.
References GET_CURRENT_NOLOG.
int dce_gettimeofday | ( | struct timeval * | tv, |
struct timezone * | tz | ||
) |
Definition at line 278 of file dce.cc.
References ns3::Current(), ns3::UtilsGetNodeId(), ns3::UtilsSimulationTimeToTime(), and ns3::UtilsTimeToTimeval().
uid_t dce_getuid | ( | void | ) |
Definition at line 56 of file dce.cc.
References GET_CURRENT_NOLOG.
char* dce_getwd | ( | char * | buf | ) |
Definition at line 592 of file dce.cc.
References ns3::Current(), ns3::Process::cwd, ns3::Thread::err, ns3::Thread::process, and ns3::UtilsGetNodeId().
char* dce_if_indextoname | ( | unsigned | ifindex, |
char * | ifname | ||
) |
Definition at line 697 of file dce.cc.
References dce_ioctl(), and dce_socket().
unsigned dce_if_nametoindex | ( | const char * | ifname | ) |
Definition at line 656 of file dce.cc.
References ns3::Current(), dce_ioctl(), dce_socket(), ns3::Thread::err, errno, ns3::Process::manager, and ns3::Thread::process.
const char* dce_inet_ntop | ( | int | af, |
const void * | src, | ||
char * | dst, | ||
socklen_t | cnt | ||
) |
Definition at line 421 of file dce.cc.
References ns3::Current(), ns3::Thread::err, errno, and ns3::UtilsGetNodeId().
long int dce_jrand48 | ( | unsigned short int | xsubi[3] | ) |
Definition at line 385 of file dce.cc.
References ns3::Current(), ns3::Thread::process, and ns3::Process::seed48Current.
int dce_kill | ( | pid_t | pid, |
int | sig | ||
) |
Definition at line 241 of file dce.cc.
References ns3::Current(), ns3::Thread::err, ns3::Process::manager, ns3::Thread::process, ns3::DceManager::SearchProcess(), ns3::UtilsGetNodeId(), and ns3::UtilsSendSignal().
void dce_lcong48 | ( | unsigned short | param[7] | ) |
Definition at line 403 of file dce.cc.
References ns3::Current(), ns3::Thread::process, and ns3::Process::seed48Current.
long int dce_lrand48 | ( | void | ) |
Definition at line 354 of file dce.cc.
References ns3::Current(), ns3::Thread::process, and ns3::Process::seed48Current.
long int dce_mrand48 | ( | void | ) |
Definition at line 365 of file dce.cc.
References ns3::Current(), ns3::Thread::process, and ns3::Process::seed48Current.
int dce_nanosleep | ( | const struct timespec * | req, |
struct timespec * | rem | ||
) |
Definition at line 286 of file dce.cc.
References ns3::Current(), ns3::Thread::err, ns3::Process::manager, ns3::Thread::process, ns3::UtilsGetNodeId(), ns3::UtilsTimespecToTime(), ns3::UtilsTimeToTimespec(), and ns3::DceManager::Wait().
long int dce_nrand48 | ( | unsigned short int | xsubi[3] | ) |
Definition at line 344 of file dce.cc.
References ns3::Current(), ns3::Thread::process, and ns3::Process::seed48Current.
int dce_rand | ( | void | ) |
Definition at line 323 of file dce.cc.
References ns3::Current(), ns3::Thread::process, and ns3::Process::rndVarible.
long int dce_random | ( | void | ) |
Definition at line 318 of file dce.cc.
References ns3::Current(), ns3::Thread::process, and ns3::Process::rndVarible.
ssize_t dce_readlink | ( | const char * | path, |
char * | buf, | ||
size_t | bufsize | ||
) |
Definition at line 959 of file dce.cc.
References ns3::Current(), ns3::Thread::err, errno, ns3::UtilsGetNodeId(), and ns3::UtilsGetRealFilePath().
int dce_sched_yield | ( | void | ) |
Definition at line 493 of file dce.cc.
References ns3::Current(), ns3::Process::manager, ns3::Thread::process, ns3::UtilsGetNodeId(), and ns3::DceManager::Yield().
unsigned short int* dce_seed48 | ( | unsigned short int | seed16v[3] | ) |
Definition at line 328 of file dce.cc.
References ns3::Current(), ns3::Thread::process, and ns3::Process::seed48Current.
int dce_setegid | ( | gid_t | egid | ) |
Definition at line 180 of file dce.cc.
References dce_setresgid(), and GET_CURRENT.
int dce_seteuid | ( | uid_t | euid | ) |
Definition at line 175 of file dce.cc.
References dce_setresuid(), and GET_CURRENT.
int dce_setgid | ( | gid_t | gid | ) |
Definition at line 204 of file dce.cc.
References GET_CURRENT, and is_set_gcapable().
int dce_setitimer | ( | int | which, |
const struct itimerval * | value, | ||
struct itimerval * | ovalue | ||
) |
Definition at line 528 of file dce.cc.
References ns3::Current(), ns3::TaskManager::Current(), ns3::Thread::err, ns3::Process::itimer, Itimer(), ns3::Process::itimerInterval, ns3::Thread::process, ns3::TaskManager::ScheduleMain(), ns3::UtilsGetNodeId(), ns3::UtilsTimeToTimeval(), and ns3::UtilsTimevalToTime().
Referenced by dce_alarm().
int dce_setregid | ( | gid_t | rgid, |
gid_t | egid | ||
) |
Definition at line 169 of file dce.cc.
References dce_setresgid(), and GET_CURRENT.
int dce_setresgid | ( | gid_t | rgid, |
gid_t | egid, | ||
gid_t | sgid | ||
) |
Definition at line 129 of file dce.cc.
References GET_CURRENT, and is_set_ucapable().
Referenced by dce_setegid(), and dce_setregid().
int dce_setresuid | ( | uid_t | ruid, |
uid_t | euid, | ||
uid_t | suid | ||
) |
Definition at line 93 of file dce.cc.
References GET_CURRENT, and is_set_ucapable().
Referenced by dce_seteuid(), and dce_setreuid().
int dce_setreuid | ( | uid_t | ruid, |
uid_t | euid | ||
) |
Definition at line 164 of file dce.cc.
References dce_setresuid(), and GET_CURRENT.
int dce_setuid | ( | uid_t | uid | ) |
Definition at line 185 of file dce.cc.
References GET_CURRENT, and is_set_ucapable().
unsigned int dce_sleep | ( | unsigned int | seconds | ) |
Definition at line 224 of file dce.cc.
References ns3::Current(), ns3::Process::manager, ns3::Thread::process, ns3::UtilsGetNodeId(), and ns3::DceManager::Wait().
void dce_srand48 | ( | long int | seedval | ) |
Definition at line 396 of file dce.cc.
References ns3::Current(), ns3::Thread::process, and ns3::Process::seed48Current.
int dce_sysinfo | ( | struct sysinfo * | info | ) |
Definition at line 920 of file dce.cc.
References ns3::Current(), ns3::Thread::err, ns3::UtilsGetNodeId(), and ns3::UtilsSimulationTimeToTime().
int dce_usleep | ( | useconds_t | usec | ) |
Definition at line 232 of file dce.cc.
References ns3::Current(), ns3::Process::manager, ns3::Thread::process, ns3::UtilsGetNodeId(), and ns3::DceManager::Wait().
|
static |
Definition at line 71 of file dce.cc.
References GET_CURRENT_NOLOG.
Referenced by is_set_gcapable().
|
static |
Definition at line 84 of file dce.cc.
References GET_CURRENT, and is_gcapable().
Referenced by dce_setgid().
|
static |
Definition at line 76 of file dce.cc.
References GET_CURRENT, and is_ucapable().
Referenced by dce_setresgid(), dce_setresuid(), and dce_setuid().
|
static |
Definition at line 66 of file dce.cc.
References GET_CURRENT_NOLOG.
Referenced by is_set_ucapable().
|
static |
Definition at line 501 of file dce.cc.
References ns3::Process::itimer, ns3::Process::itimerInterval, and ns3::UtilsSendSignal().
Referenced by dce_setitimer().
NS_LOG_COMPONENT_DEFINE | ( | "Dce" | ) |