Convert global port to local port

It is sometimes needed to convert a global port value to a local port. You can have this information with the pok_global_ports_to_local_ports.

The definition of this array is different on all nodes. It specifies the local port identifier on the current node with each global port. If the global port is not on the current node, we specify the invalid_port value.

An example is given below. We can see that the three last ports are not located on the current node.

   uint8_t pok_global_ports_to_local_ports[POK_CONFIG_NB_GLOBAL_PORTS] =
   {node1_partition_secret_outgoing,
    node1_partition_topsecret_outgoing,
    node1_partition_unclassified_outgoing,
    invalid_local_port,
    invalid_local_port,
    invalid_local_port};

When you use code generation, this declaration is automatically created in the deployment.c file.



Copyright 2009 POK Team