Struct interface to NSC stack. More...
#include <sim_interface.h>
Public Member Functions | |
| virtual | ~INetStack () |
| virtual void | add_default_gateway (const char *addr)=0 |
| Add a default gateway to the interface. More... | |
| virtual void | buffer_size (int size)=0 |
| Set the buffer size. More... | |
| virtual int | cmd (const char *) |
| Simple interface to support sending any textual command to a stack. More... | |
| virtual int | get_hz ()=0 |
| Get the timer_interrupt frequency. More... | |
| virtual int | get_id ()=0 |
| Returns the internal id of the stack instance. More... | |
| virtual const char * | get_name ()=0 |
| Return a short one-word name of the stack. More... | |
| virtual bool | get_var (const char *var, char *result, int result_len) |
| Optional function to get variables for this stack. More... | |
| virtual void | if_attach (const char *addr, const char *mask, int mtu)=0 |
| Attach an interface to the stack. More... | |
| virtual void | if_receive_packet (int if_id, const void *data, int datalen)=0 |
| Deliver complete packet to the NSC network stack. More... | |
| virtual void | if_send_finish (int if_id)=0 |
| Signal the completion of send procedure to the NSC network stack. More... | |
| virtual void | if_send_packet (const void *data, int datalen)=0 |
| Send complete packet to the NSC network stack. More... | |
| virtual void | increment_ticks ()=0 |
| Increment the time ticks. More... | |
| virtual void | init (int hz)=0 |
| Initialize the stack. More... | |
| virtual struct INetStreamSocket * | new_sctp_socket () |
| Create a new SCTP socket. More... | |
| virtual struct INetStreamSocket * | new_tcp_socket () |
| Create a new TCP socket. More... | |
| virtual struct INetDatagramSocket * | new_udp_socket () |
| Create a new UDP socket. More... | |
| virtual void | set_diagnostic (int level) |
| Set the level of debugging or diagnostic information to print out. More... | |
| virtual bool | set_var (const char *var, const char *val) |
| Optional function to set variables for this stack. More... | |
| virtual void | show_config () |
| Show the NSC configuration. More... | |
| virtual int | sysctl (const char *sysctl_name, void *oldval, size_t *oldlenp, void *newval, size_t newlen) |
| use sysctl to modify system parameters More... | |
| virtual int | sysctl_get (const char *name, char *value, size_t len) |
| Get system parameters using sysctl. More... | |
| 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[]. More... | |
| virtual int | sysctl_set (const char *name, const char *value) |
| Set system parameters using sysctl. More... | |
| virtual void | timer_interrupt ()=0 |
| The stack timer_interrupt function. More... | |
Struct interface to NSC stack.
Definition at line 31 of file sim_interface.h.
|
inlinevirtual |
Definition at line 33 of file sim_interface.h.
|
pure virtual |
Add a default gateway to the interface.
| addr | gateway address |
Referenced by ns3::NscTcpL4Protocol::AddInterface().
Here is the caller graph for this function:
|
pure virtual |
Set the buffer size.
|
inlinevirtual |
Simple interface to support sending any textual command to a stack.
Definition at line 245 of file sim_interface.h.
|
pure virtual |
Get the timer_interrupt frequency.
This is used so the simulator can call the stack timer_interrupt function the correct amount of times per second. For example, lwip has a hz of 10, which it returns here to say that it's timer_interrupt should be called 10 times a second. FreeBSD uses 100, as does Linux 2.4, while Linux 2.6 uses 1000. (This is often configurable in the kernel in question, also.)
Referenced by ns3::NscTcpL4Protocol::SetNode().
Here is the caller graph for this function:
|
pure virtual |
Returns the internal id of the stack instance.
Purely for debugging/diagnostic purposes.
|
pure virtual |
Return a short one-word name of the stack.
Should return a short one-word name of the stack. Eg. Linux 2.4.x -> linux24, FreeBSD 5.x -> freebsd5. This can be used to identify output from a stack, for example a packet trace file.
Referenced by ns3::Ns3NscStack::GetInstanceTypeId().
Here is the caller graph for this function:
|
inlinevirtual |
Optional function to get variables for this stack.
| var | the variable |
| result | the result |
| result_len | result length |
Definition at line 214 of file sim_interface.h.
|
pure virtual |
Attach an interface to the stack.
| addr | address |
| mask | network mask |
| mtu | MTU |
Referenced by ns3::NscTcpL4Protocol::AddInterface().
Here is the caller graph for this function:
|
pure virtual |
Deliver complete packet to the NSC network stack.
| if_id | interface ID |
| data | data |
| datalen | data length |
Referenced by ns3::NscTcpL4Protocol::Receive().
Here is the caller graph for this function:
|
pure virtual |
Signal the completion of send procedure to the NSC network stack.
| if_id | interface ID |
Referenced by ns3::NscTcpL4Protocol::send_callback().
Here is the caller graph for this function:
|
pure virtual |
Send complete packet to the NSC network stack.
| data | data |
| datalen | data length |
|
pure virtual |
Increment the time ticks.
Referenced by ns3::NscTcpL4Protocol::SoftInterrupt().
Here is the caller graph for this function:
|
pure virtual |
Initialize the stack.
| hz | timer_interrupt frequency |
Referenced by ns3::NscTcpL4Protocol::SetNode().
Here is the caller graph for this function:
|
inlinevirtual |
Create a new SCTP socket.
Definition at line 130 of file sim_interface.h.
|
inlinevirtual |
Create a new TCP socket.
Definition at line 126 of file sim_interface.h.
|
inlinevirtual |
Create a new UDP socket.
Definition at line 122 of file sim_interface.h.
|
inlinevirtual |
Set the level of debugging or diagnostic information to print out.
This normally means kernel messages printed out during initialisation but may also include extra debugging messages that are part of NSC.
| level | debugging/diagnostic level |
Definition at line 238 of file sim_interface.h.
|
inlinevirtual |
Optional function to set variables for this stack.
| var | the variable |
| val | the new value |
Definition at line 225 of file sim_interface.h.
|
inlinevirtual |
Show the NSC configuration.
Definition at line 202 of file sim_interface.h.
|
inlinevirtual |
use sysctl to modify system parameters
| sysctl_name | name of the parameter to modify |
| oldval | old value |
| oldlenp | old value length |
| newval | new value |
| newlen | new value length |
Definition at line 143 of file sim_interface.h.
|
inlinevirtual |
Get system parameters using sysctl.
| name | name of the parameter to modify |
| value | value |
| len | value length |
Definition at line 174 of file sim_interface.h.
Referenced by ns3::Ns3NscStack::Get(), and ns3::Ns3NscStack::GetInstanceTypeId().
Here is the caller graph for this function:
|
inlinevirtual |
Tell the cradle code to put the name of sysctl number 'idx' into name[].
The idea is that this can be used to get a list of all available sysctls:
char buf[256] for (i=0; sysctl_getnum(i, buf, sizeof(buf)) > 0 ;i++) puts(buf);
| idx | index |
| name | sysctl name |
| len | sysctl length |
Definition at line 194 of file sim_interface.h.
Referenced by ns3::Ns3NscStack::GetInstanceTypeId().
Here is the caller graph for this function:
|
inlinevirtual |
Set system parameters using sysctl.
| name | name of the parameter to modify |
| value | new value |
Definition at line 159 of file sim_interface.h.
Referenced by ns3::Ns3NscStack::Set().
Here is the caller graph for this function:
|
pure virtual |
The stack timer_interrupt function.
Referenced by ns3::NscTcpL4Protocol::SoftInterrupt().
Here is the caller graph for this function: