/*
* Delete Entry del from the List
*/
-void Iperf_delete ( iperf_sockaddr *del, Iperf_ListEntry **root ) {
+void Iperf_delete (struct sockaddr_storage *del, Iperf_ListEntry **root)
+{
Iperf_ListEntry *temp = Iperf_present( del, *root );
if ( temp != NULL ) {
if ( temp == *root ) {
/*
* Check if the exact Entry find is present
*/
-Iperf_ListEntry* Iperf_present ( iperf_sockaddr *find, Iperf_ListEntry *root ) {
- Iperf_ListEntry *itr = root;
- while ( itr != NULL ) {
- if ( SockAddr_are_Equal( (sockaddr*)itr, (sockaddr*)find ) ) {
+Iperf_ListEntry* Iperf_present(struct sockaddr_storage *find, Iperf_ListEntry *root)
+{
+ Iperf_ListEntry *itr;
+
+ for (itr = root; itr != NULL; itr = itr->next)
+ if (SockAddr_are_Equal(find, &itr->data))
return itr;
- }
- itr = itr->next;
- }
return NULL;
}
* Check if a Entry find is in the List or if any
* Entry exists that has the same host as the
* Entry find
+ * FIXME: The `or' condition was not implemented
*/
-Iperf_ListEntry* Iperf_hostpresent ( iperf_sockaddr *find, Iperf_ListEntry *root ) {
- Iperf_ListEntry *itr = root;
- while ( itr != NULL ) {
- if ( SockAddr_Hostare_Equal( (sockaddr*)itr, (sockaddr*)find ) ) {
- return itr;
- }
- itr = itr->next;
- }
- return NULL;
+Iperf_ListEntry* Iperf_hostpresent(struct sockaddr_storage *find, Iperf_ListEntry *root)
+{
+ return Iperf_present(find, root);
}