Skip to content

Commit

Permalink
[host] app: do not try to use deprecated interfaces automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
gnif committed Mar 11, 2024
1 parent 989fe2b commit 90398bc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions host/include/interface/capture.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ typedef struct CaptureInterface
{
const char * shortName;
const bool asyncCapture;
const bool deprecated;

const char * (*getName )(void);
void (*initOptions )(void);

Expand Down
14 changes: 12 additions & 2 deletions host/src/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,8 +894,18 @@ int app_main(int argc, char * argv[])
CaptureInterface * iface = NULL;
for(int i = 0; CaptureInterfaces[i]; ++i)
{
if (*ifaceName && strcasecmp(ifaceName, CaptureInterfaces[i]->shortName))
continue;
if (*ifaceName)
{
if (strcasecmp(ifaceName, CaptureInterfaces[i]->shortName) != 0)
continue;
}
else
{
/* do not try to init deprecated interfaces unless they are explicity
selected in the host configuration */
if (CaptureInterfaces[i]->deprecated)
continue;
}

iface = CaptureInterfaces[i];
DEBUG_INFO("Trying : %s", iface->getName());
Expand Down

0 comments on commit 90398bc

Please sign in to comment.