19 #include "ns3/string.h" 101 std::string name =
"ns3::Ns3NscStack<";
116 tid =
TypeId (name.c_str ());
126 Create<NscStackStringAccessor> (buf),
142 return std::string (buf);
151 NS_FATAL_ERROR (
"setting " << name <<
" to " << value <<
"failed (retval " << ret <<
")");
158 Ns3NscStack::Ns3NscStack::GetTypeId (
void)
Ptr< const AttributeChecker > MakeStringChecker(void)
TypeId AddAttribute(std::string name, std::string help, const AttributeValue &initialValue, Ptr< const AttributeAccessor > accessor, Ptr< const AttributeChecker > checker, SupportLevel supportLevel=SUPPORTED, const std::string &supportMsg="")
Record in this TypeId the fact that a new attribute exists.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Hold variables of type string.
void Set(const std::string &value)
Set the value.
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Hold a value for an Attribute.
This object represent the underlying nsc stack attributes and provide a ns-3-like system to access th...
This object represents the underlying nsc stack, which is aggregated to a Node object, and which provides access to the sysctls of the nsc stack through attributes.
virtual bool Set(ObjectBase *object, const AttributeValue &val) const
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
static bool LookupByNameFailSafe(std::string name, TypeId *tid)
Get a TypeId by name.
Anchor the ns-3 type and attribute system.
virtual bool Get(const ObjectBase *object, AttributeValue &val) const
virtual bool HasSetter(void) const
virtual bool HasGetter(void) const
std::string Get(void) const
virtual const char * get_name()=0
Return a short one-word name of the stack.
allow setting and getting the value of an attribute.
NscStackStringAccessor(std::string name)
Constructor.
virtual int sysctl_set(const char *name, const char *value)
Set system parameters using sysctl.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TypeId GetTypeId(void)
Get the type ID.
std::string m_name
name of the attribute
virtual int sysctl_getnum(size_t idx, char *name, size_t len)
Tell the cradle code to put the name of sysctl number 'idx' into name[].
void Set(std::string name, std::string value)
Set an attribute.
std::string Get(std::string name) const
Get an attribute.
A base class which provides memory management and object aggregation.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
INetStack * m_stack
the underlying stack
virtual int sysctl_get(const char *name, char *value, size_t len)
Get system parameters using sysctl.