]> sjero.net Git - iperf/blob - include/List.h
Native IPv6 support for iperf
[iperf] / include / List.h
1
2 /*--------------------------------------------------------------- 
3  * Copyright (c) 1999,2000,2001,2002,2003                              
4  * The Board of Trustees of the University of Illinois            
5  * All Rights Reserved.                                           
6  *--------------------------------------------------------------- 
7  * Permission is hereby granted, free of charge, to any person    
8  * obtaining a copy of this software (Iperf) and associated       
9  * documentation files (the "Software"), to deal in the Software  
10  * without restriction, including without limitation the          
11  * rights to use, copy, modify, merge, publish, distribute,        
12  * sublicense, and/or sell copies of the Software, and to permit     
13  * persons to whom the Software is furnished to do
14  * so, subject to the following conditions: 
15  *
16  *     
17  * Redistributions of source code must retain the above 
18  * copyright notice, this list of conditions and 
19  * the following disclaimers. 
20  *
21  *     
22  * Redistributions in binary form must reproduce the above 
23  * copyright notice, this list of conditions and the following 
24  * disclaimers in the documentation and/or other materials 
25  * provided with the distribution. 
26  * 
27  *     
28  * Neither the names of the University of Illinois, NCSA, 
29  * nor the names of its contributors may be used to endorse 
30  * or promote products derived from this Software without
31  * specific prior written permission. 
32  * 
33  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
34  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 
35  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
36  * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTIBUTORS OR COPYRIGHT 
37  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
38  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
39  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE
40  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
41  * ________________________________________________________________
42  * National Laboratory for Applied Network Research 
43  * National Center for Supercomputing Applications 
44  * University of Illinois at Urbana-Champaign 
45  * http://www.ncsa.uiuc.edu
46  * ________________________________________________________________ 
47  *
48  * List.h
49  * by Kevin Gibbs <kgibbs@ncsa.uiuc.edu> 
50  * ------------------------------------------------------------------- 
51  */
52
53 #ifndef Iperf_LIST_H
54 #define Iperf_LIST_H
55
56 #include "headers.h"
57 #include "Settings.hpp"
58 #include "Reporter.h"
59 #include "Mutex.h"
60
61 /*
62  * List handling utilities to replace STD vector
63  */
64
65 /*
66  * A List entry that consists of a sockaddr
67  * a pointer to the Audience that sockaddr is
68  * associated with and a pointer to the next
69  * entry
70  */
71 struct Iperf_ListEntry {
72     struct sockaddr_storage data;
73     MultiHeader *holder;
74     thread_Settings *server;
75     Iperf_ListEntry *next;
76 };
77
78 extern Mutex clients_mutex;
79 extern Iperf_ListEntry *clients;
80
81 /*
82  * Functions to modify or search the List
83  */
84 void Iperf_pushback ( Iperf_ListEntry *add, Iperf_ListEntry **root );
85
86 void Iperf_delete ( struct sockaddr_storage *del, Iperf_ListEntry **root );
87
88 void Iperf_destroy ( Iperf_ListEntry **root );
89
90 Iperf_ListEntry* Iperf_present ( struct sockaddr_storage *find, Iperf_ListEntry *root );
91
92 Iperf_ListEntry* Iperf_hostpresent ( struct sockaddr_storage *find, Iperf_ListEntry *root );
93
94 #endif