Rename LiveGetDevice to LiveGetDeviceName

The function LiveGetDevice is returning a point to
the name of the interface. This patch renames it to
LiveGetDeviceName which is more appropriate.
remotes/origin/master-1.2.x
Eric Leblond 14 years ago committed by Victor Julien
parent 1d1271fd38
commit e893e860d4

@ -71,14 +71,14 @@ int LiveGetDeviceCount(void) {
} }
/** /**
* \brief Get a pointer to the device at idx * \brief Get a pointer to the device name at idx
* *
* \param number idx of the device in our list * \param number idx of the device in our list
* *
* \retval ptr pointer to the string containing the device * \retval ptr pointer to the string containing the device
* \retval NULL on error * \retval NULL on error
*/ */
char *LiveGetDevice(int number) { char *LiveGetDeviceName(int number) {
int i = 0; int i = 0;
LiveDevice *pd; LiveDevice *pd;

@ -29,7 +29,7 @@ typedef struct LiveDevice_ {
int LiveRegisterDevice(char *dev); int LiveRegisterDevice(char *dev);
int LiveGetDeviceCount(void); int LiveGetDeviceCount(void);
char *LiveGetDevice(int number); char *LiveGetDeviceName(int number);
int LiveBuildDeviceList(char * base); int LiveBuildDeviceList(char * base);
#endif /* __UTIL_DEVICE_H__ */ #endif /* __UTIL_DEVICE_H__ */

@ -106,7 +106,7 @@ int RunModeSetLiveCaptureAuto(DetectEngineCtx *de_ctx,
SCLogInfo("Using %d live device(s).", nlive); SCLogInfo("Using %d live device(s).", nlive);
for (thread = 0; thread < nlive; thread++) { for (thread = 0; thread < nlive; thread++) {
char *live_dev = LiveGetDevice(thread); char *live_dev = LiveGetDeviceName(thread);
char *tnamec = NULL; char *tnamec = NULL;
void *aconf; void *aconf;
@ -484,7 +484,7 @@ int RunModeSetLiveCaptureAutoFp(DetectEngineCtx *de_ctx,
int lthread; int lthread;
for (lthread = 0; lthread < nlive; lthread++) { for (lthread = 0; lthread < nlive; lthread++) {
char *live_dev = LiveGetDevice(lthread); char *live_dev = LiveGetDeviceName(lthread);
void *aconf; void *aconf;
int threads_count; int threads_count;
@ -701,7 +701,7 @@ int RunModeSetLiveCaptureWorkers(DetectEngineCtx *de_ctx,
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} else { } else {
live_dev_c = LiveGetDevice(ldev); live_dev_c = LiveGetDeviceName(ldev);
aconf = ConfigParser(live_dev_c); aconf = ConfigParser(live_dev_c);
} }
RunModeSetLiveCaptureWorkersForDevice(de_ctx, RunModeSetLiveCaptureWorkersForDevice(de_ctx,
@ -736,7 +736,7 @@ int RunModeSetLiveCaptureSingle(DetectEngineCtx *de_ctx,
if (live_dev != NULL) { if (live_dev != NULL) {
aconf = ConfigParser(live_dev); aconf = ConfigParser(live_dev);
} else { } else {
char *live_dev_c = LiveGetDevice(0); char *live_dev_c = LiveGetDeviceName(0);
aconf = ConfigParser(live_dev_c); aconf = ConfigParser(live_dev_c);
/* \todo Set threads number in config to 1 */ /* \todo Set threads number in config to 1 */
} }
@ -769,7 +769,7 @@ int RunModeSetIPSAuto(DetectEngineCtx *de_ctx,
for (int i = 0; i < nqueue; i++) { for (int i = 0; i < nqueue; i++) {
/* create the threads */ /* create the threads */
cur_queue = LiveGetDevice(i); cur_queue = LiveGetDeviceName(i);
if (cur_queue == NULL) { if (cur_queue == NULL) {
printf("ERROR: Invalid queue number\n"); printf("ERROR: Invalid queue number\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@ -984,7 +984,7 @@ int RunModeSetIPSAutoFp(DetectEngineCtx *de_ctx,
for (int i = 0; i < nqueue; i++) { for (int i = 0; i < nqueue; i++) {
/* create the threads */ /* create the threads */
cur_queue = LiveGetDevice(i); cur_queue = LiveGetDeviceName(i);
if (cur_queue == NULL) { if (cur_queue == NULL) {
printf("ERROR: Invalid queue number\n"); printf("ERROR: Invalid queue number\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@ -1156,7 +1156,7 @@ int RunModeSetIPSWorker(DetectEngineCtx *de_ctx,
for (int i = 0; i < nqueue; i++) { for (int i = 0; i < nqueue; i++) {
/* create the threads */ /* create the threads */
cur_queue = LiveGetDevice(i); cur_queue = LiveGetDeviceName(i);
if (cur_queue == NULL) { if (cur_queue == NULL) {
printf("ERROR: Invalid queue number\n"); printf("ERROR: Invalid queue number\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);

Loading…
Cancel
Save