Added Linux get_pinhole_uid_by_index.

This commit is contained in:
Markus Stenberg 2014-05-10 15:27:03 +02:00 committed by Thomas Bernard
parent e907d7bba6
commit 7c7407099e
2 changed files with 12 additions and 0 deletions

View File

@ -384,6 +384,16 @@ get_pinhole_info(unsigned short uid,
return 0;
}
int get_pinhole_uid_by_index(int index)
{
struct pinhole_t * p;
for(p = pinhole_list.lh_first; p != NULL; p = p->entries.le_next)
if (!index--)
return p->uid;
return -1;
}
int
clean_pinhole_list(unsigned int * next_timestamp)
{

View File

@ -27,6 +27,8 @@ get_pinhole_info(unsigned short uid,
unsigned int * timestamp,
u_int64_t * packets, u_int64_t * bytes);
int get_pinhole_uid_by_index(int index);
int clean_pinhole_list(unsigned int * next_timestamp);
#endif /* ENABLE_UPNPPINHOLE */