INSEE 05.04.2011
Interconnection Nertworks Simulation and Evaluation Environment
|
Definition of FSIN functions for packet management. More...
Functions | |
void | pkt_init () |
void | free_pkt (unsigned long n) |
unsigned long | get_pkt () |
Variables | |
packet_t * | pkt_space |
long | pkt_max |
long * | f_pkt |
long | last |
Definition of FSIN functions for packet management.
FSIN Functional Simulator of Interconnection Networks Copyright (2003-2011) J. Miguel-Alonso, J. Navaridas
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
void free_pkt | ( | unsigned long | n | ) |
Frees a packet.
Add the packet id. to the free packets
n | The id of the packet to free. |
unsigned long get_pkt | ( | ) |
Get a free packet.
void pkt_init | ( | ) |
Initiates the memory allocation & the free packets structure.
In pkt_space we allocate all the space needed for packet contain. This way our Memory needs are always the same and we must not alloc and free memory each time we use a packet.
long* f_pkt |
A list with ids of all the free packets.
long last |
The last position in use on the list.
long pkt_max |
The maximum number of packets allowed.
Normally is the number of nodes multiplied by the maximun capacity of each router.