ns-3 Direct Code Execution
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
utils.h File Reference
#include <string>
#include <list>
#include <sys/time.h>
#include <sys/stat.h>
#include "ns3/nstime.h"
+ Include dependency graph for utils.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  ns3
 Every class exported by the ns3 library is enclosed in the ns3 namespace.

Macros

#define GET_CURRENT(x)
#define GET_CURRENT_NOLOG()
#define MAX_FDS   1024
#define OPENED_FD_METHOD(rettype, args)   OPENED_FD_METHOD_ERR (-1, rettype, args)
#define OPENED_FD_METHOD_ERR(errCode, rettype, args)

Functions

bool ns3::CheckExeMode (struct stat *st, uid_t uid, gid_t gid)
bool ns3::CheckFdExists (Process *const p, int const fd, bool const opened)
bool ns3::CheckShellScript (std::string fileName, std::ostringstream &shellName, std::ostringstream &optionalArg)
Thread * ns3::Current (void)
void ns3::FdDecUsage (int fd)
std::string ns3::FindExecFile (std::string root, std::string envPath, std::string fileName, uid_t uid, gid_t gid, int *errNo)
int ns3::getRealFd (int fd, Thread *current)
std::string ns3::GetTimeStamp ()
bool ns3::HasPendingSignal (void)
std::string ns3::PathOfFd (int fd)
char * ns3::seek_env (const char *name, char **array)
std::list< std::string > ns3::Split (std::string input, std::string sep)
void ns3::UtilsAdvanceTime (Thread *current)
int ns3::UtilsAllocateFd (void)
void ns3::UtilsDoSignal (void)
void ns3::UtilsEnsureAllDirectoriesExist (std::string realPath)
void ns3::UtilsEnsureDirectoryExists (std::string realPath)
std::string ns3::UtilsGetAbsRealFilePath (uint32_t node, std::string path)
std::string ns3::UtilsGetCurrentDirName (void)
uint32_t ns3::UtilsGetNodeId (void)
std::string ns3::UtilsGetRealFilePath (std::string path)
std::string ns3::UtilsGetVirtualFilePath (std::string path)
void ns3::UtilsSendSignal (Process *process, int signum)
Time ns3::UtilsSimulationTimeToTime (Time time)
Time ns3::UtilsTimespecToTime (struct timespec tm)
Time ns3::UtilsTimeToSimulationTime (Time time)
struct timespec ns3::UtilsTimeToTimespec (Time time)
struct timeval ns3::UtilsTimeToTimeval (Time time)
Time ns3::UtilsTimevalToTime (struct timeval tv)
Time ns3::UtilsTimevalToTime (const struct timeval *tv)

Macro Definition Documentation

#define GET_CURRENT_NOLOG ( )
Value:
Thread * current; \
current = Current (); \
do { \
NS_LOG_FUNCTION (current << UtilsGetNodeId ()); \
NS_ASSERT (current != 0); \
} while (false)

Definition at line 17 of file utils.h.

Referenced by dce___errno_location(), dce_geteuid(), dce_getpid(), dce_getppid(), dce_getuid(), is_gcapable(), and is_ucapable().

#define MAX_FDS   1024

Definition at line 67 of file utils.h.

Referenced by dce_dup2(), and ns3::UtilsAllocateFd().

#define OPENED_FD_METHOD_ERR (   errCode,
  rettype,
  args 
)
Value:
std::map < int,FileUsage * > ::iterator it = current->process->openFiles.find (fd); \
if (current->process->openFiles.end () == it) \
{ \
current->err = EBADF; \
return (rettype) errCode; \
} \
FileUsage *fu = it->second; \
if (fu->IsClosed ()) \
{ \
current->err = EBADF; \
return (rettype) errCode; \
} \
UnixFd *unixFd = fu->GetFileInc (); \
rettype retval = unixFd->args; \
if (fu && fu->DecUsage ()) \
{ \
current->process->openFiles.erase (fd); \
delete fu; \
fu = 0; \
} \
\
return retval;

Definition at line 69 of file utils.h.

Referenced by dce_mmap64().