Commit e7f928f3 authored by 's avatar

Added hack for devices with colon ":" in their name. Device name beginning...

Added hack for devices with colon ":" in their name. Device name beginning with slash (for example /dev/ntxc0:0) is considered not to be in a form "hostname:devicename" but just "devicename" and can include the colon.

Multi-core support for each single Napatech adapter:
	Added support for multiple feeds in single Napatech card. Feeds can be configured by Napatech config and then used by mapi.



git-svn-id: file:///home/svn/mapi/trunk@1526 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 94103e5d
This diff is collapsed.
...@@ -608,7 +608,7 @@ int mapi_create_flow(const char *dev) ...@@ -608,7 +608,7 @@ int mapi_create_flow(const char *dev)
//check if flow is remote or not and call the appropriate init function //check if flow is remote or not and call the appropriate init function
#ifdef DIMAPI #ifdef DIMAPI
if ( strchr(dev,':')==NULL) { if ( strchr(dev,':')==NULL || dev[0] == '/') {
devgroupdb = devgroupdb_open(3); // try local, global devgroupdb = devgroupdb_open(3); // try local, global
devgroupid = devgroupdb_getgroupidbydevice(devgroupdb, (char *) dev); devgroupid = devgroupdb_getgroupidbydevice(devgroupdb, (char *) dev);
...@@ -627,7 +627,7 @@ int mapi_create_flow(const char *dev) ...@@ -627,7 +627,7 @@ int mapi_create_flow(const char *dev)
} }
else pthread_once(&dmapi_is_initialized, (void*)dmapi_init); else pthread_once(&dmapi_is_initialized, (void*)dmapi_init);
if ((s = strchr(dev,':'))!=NULL) { if ((s = strchr(dev,':'))!=NULL && dev[0] != '/') {
devp=strdup(dev); devp=strdup(dev);
rflow=(remote_flowdescr_t *)malloc(sizeof(remote_flowdescr_t)); rflow=(remote_flowdescr_t *)malloc(sizeof(remote_flowdescr_t));
rflow->fd=++fdseed; rflow->fd=++fdseed;
...@@ -652,7 +652,7 @@ int mapi_create_flow(const char *dev) ...@@ -652,7 +652,7 @@ int mapi_create_flow(const char *dev)
k=strtok(devp, ", "); k=strtok(devp, ", ");
while (k!=NULL) { while (k!=NULL) {
if ((s = strchr(k,':'))!=NULL) { if ((s = strchr(k,':'))!=NULL && dev[0] != '/') {
*s = '\0'; *s = '\0';
hostname = k; hostname = k;
k = s + 1; k = s + 1;
...@@ -4836,14 +4836,14 @@ int mapi_stats(const char *dev, struct mapi_stat *stats) ...@@ -4836,14 +4836,14 @@ int mapi_stats(const char *dev, struct mapi_stat *stats)
//check if flow is remote or not and call the appropriate init function //check if flow is remote or not and call the appropriate init function
#ifdef DIMAPI #ifdef DIMAPI
if ((s = strchr(dev,':'))!=NULL) { if ((s = strchr(dev,':'))!=NULL && dev[0] != '/') {
devp=strdup(dev); devp=strdup(dev);
k=strtok(devp, ", "); k=strtok(devp, ", ");
sem_init(&stats_sem, 0, 0); sem_init(&stats_sem, 0, 0);
while (k!=NULL) { while (k!=NULL) {
if ((s = strchr(k,':'))!=NULL) { if ((s = strchr(k,':'))!=NULL && k[0] != '/') {
*s = '\0'; *s = '\0';
hostname = k; hostname = k;
k = s + 1; k = s + 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment