Specify the port type

The kernel must know the kind of each port (queuing or sampling). We specify that requirement with the pok_ports_kind array. There is an example of a such declaration below.

   pok_port_kind_t pok_ports_kind[POK_CONFIG_NB_PORTS] =
   {POK_PORT_KIND_SAMPLING,POK_PORT_KIND_SAMPLING,POK_PORT_KIND_SAMPLING};

Here, the three local ports are sampling ports. You can have three kind of ports:

  1. Sampling ports (POK_PORT_KIND_SAMPLING) : stores data but does not queue them.
  2. Queuing ports (POK_PORT_KIND_QUEUEING) : queues every new instance of the data.
  3. Virtual ports (POK_PORT_KIND_VIRTUAL) : this port is not stored in the kernel and this is a virtual port. This port belongs to another machine. We add it only to create the routing policy in the distributed network. You cannot write or read data on/from virtual ports, only get the port identifier associated with them.

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



Copyright 2009 POK Team