A path to a known destination.
An instance of this class represents a path to a known
destination d.
The instance members are:
`gw': the gateway of the route. Our next hop. It is an instance of the
| class AggregatedNeighbour.
`rem_at_gw': a REM (Route Efficience Measure) of the path from the
| gateway to the destination d. It is an instance of the class
| REM or a derivative.
`hops': a List of HCoord of the hops represented by this
| path from the gateway gw to the destination d.
| gw and d are not included.
`gid': a instance of GNodeid, it is the ID of the gnode that this class
| represents, as it is reported by this path.
GNode I.D.
An instance is valid when we have all three values:
|#1 (elderliness) is the elderliness of the gnode inside its upper level gnode.
|#2 (eldest_internal_elderliness) is the elderliness of the eldest gnode inside me.
|#3 (eldest_internal_id) is the ID of the eldest gnode inside me. And it's also my gnode's ID.
In more details:
| . for a gnode of level 0, values #2 has no meaning (will always be 0)
| . for a gnode of level 'levels', values #1 and #2 have no meaning. Its value #3 is the netid.
This class (and the following classes and interfaces) is used to perform
RPC call using the following form:
var x = remote_instance.property1.property2.method0(p1, p2, p3);
instead of:
RemoteCall rc = new RemoteCall();
rc.method_name = "property1.property2.method0";
rc.params = new ISerializable[3];
rc.params[0] = p1;
rc.params[1] = p2;
rc.params[2] = p3;
var x = (SerClass)remote_instance.rpc_call(rc);
int
COORD_DUPLICATION
int
MAX_BNODES
uchar
[] data, out uchar
[] response)
This callback is used to interpret a request. It is called this way:
| rpcdispatcher, data, response = self.callback(caller, data_request)
where the arguments are:
| caller: a CallerInfo instance.
| data_request: what has been read from socket as a request.
and the results are:
| rpcdispatcher: if not None, we must do the call to the remotable method:
| rpcdispatcher.marshalled_dispatch(caller, data)
| response: if rpcdispatcher is None and response is not None then send response.
| if rpcdispatcher is None and response is None then do nothing.
List
<RPCDispatcher> rpcdispatchers, out uchar
[] data)
uchar
[] data, out List
<string
> devs_response)
string
nic_name)
int
lvl_to_bits (int
levels, int
gsize, int
lvl)
int
bits_to_lvl (int
levels, int
gsize, int
bits)
string
nip_to_str (int
levels, int
gsize, NIP nip)
int
levels, int
gsize, string
ipstr)
ArrayList
<int
> valid_ids (int
levels, int
gsize, int
lvl, PartialNIP partial_nip)
int
gsize, out string
ipstr, out string
bits)
int
levels, int
gsize, string
ipstr, string
bits)
uint32
fnv_32 (uchar
[] buf)
string
cmdline, out string
cmdout, out string
cmderr, out int
exit_status)
string
iproute (string
args) throws IPROUTECommandError
string
args)
string
iptables (string
args) throws IPTABLESCommandError
string
args)
bool
check_ping (string
ipstr)
A Tasklet instance represents a thread that has been spawned to execute a
certain function.
In order to spawn a thread to execute a method of an object proceed this way:
* prepare a function, or a static method, with the signature void *(*)(void *)
* prepare a struct which will contain:
* * the instance of the class which the method is invoked in,
* * the parameters (simple types or objects) that will be passed.
* in the function do this:
* * cast the void* to a pointer to your struct
* * if you pass a ref-counted class, assign it to a local variable in order to increase the refcounter
* * if you pass a simple type, assign it to a local variable in order to copy its value
* * call Tasklet.schedule_back() in order to let the caller decide when to start the new thread
* * call the method with the object and parameters that you just copied in local variables
* when you want to spawn, allocate in the stack a struct of the type
* populate the struct with data
* call Tasklet.spawn(function, &my_struct)
The real function/method will not start immediately, but the struct can be safely freed right now.
Features:
* method schedule gives a chance to the scheduler to assign the cpu to other threads;
* method schedule can select a particular tasklet to be scheduled;
* method schedule_back schedules the previous tasklet;
* method join waits for a thread to complete and can get a void* from it;
* ...
long
msec)
Variant
int_to_variant (int
i)
int
variant_to_int (Variant
v)
Variant
int64_to_variant (int64
i)
int64
variant_to_int64 (Variant
v)
Variant
uchar_to_variant (uchar
y)
uchar
variant_to_uchar (Variant
v)
Variant
string_to_variant (string
s)
string
variant_to_string (Variant
v)
Variant
int_array_to_variant (int
[] ai)
int
[] variant_to_int_array (Variant
v)
Variant
uchar_array_to_variant (uchar
[] auc)
uchar
[] variant_to_uchar_array (Variant
v)
Variant
string_array_to_variant (string
[] ars)
string
[] variant_to_string_array (Variant
v)
Variant
variant_array_to_variant (Variant
[] av)
Variant
[] variant_to_variant_array (Variant
v)
Variant
tuple_to_variant (Variant
v0, Variant
v1)
Variant
v, out Variant
v0, out Variant
v1)
Variant
tuple_to_variant_3 (Variant
v0, Variant
v1, Variant
v2)
Variant
v, out Variant
v0, out Variant
v1, out Variant
v2)
Variant
tuple_to_variant_4 (Variant
v0, Variant
v1, Variant
v2, Variant
v3)
Variant
v, out Variant
v0, out Variant
v1, out Variant
v2, out Variant
v3)
Variant
tuple_to_variant_5 (Variant
v0, Variant
v1, Variant
v2, Variant
v3, Variant
v4)
Variant
v, out Variant
v0, out Variant
v1, out Variant
v2, out Variant
v3, out Variant
v4)
string
s_addr_to_string (string
family, uint32
s_addr)
uint32
string_to_s_addr (string
family, string
dotted)
string
pip_to_dotted (string
family, uchar
[] pip)
uchar
[] dotted_to_pip (string
family, string
dotted)
int
MAX_PRIORITY
int
STD_PRIORITY
int
MIN_PRIORITY
Error
Error