]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
device: constify string args
authorVictor Julien <victor@inliniac.net>
Sat, 7 Nov 2015 18:28:25 +0000 (19:28 +0100)
committerVictor Julien <victor@inliniac.net>
Sun, 6 Dec 2015 09:49:28 +0000 (10:49 +0100)
src/util-device.c
src/util-device.h

index c08e30f0b89d29b7af3b7b44d5ea4e3cdaf230ff..fb2c04f649eb0530628c55b327f2d98d3a7bb1ac 100644 (file)
@@ -42,7 +42,7 @@ static int live_devices_stats = 1;
  *  \retval 0 on success.
  *  \retval -1 on failure.
  */
-int LiveRegisterDevice(char *dev)
+int LiveRegisterDevice(const char *dev)
 {
     LiveDevice *pd = SCMalloc(sizeof(LiveDevice));
     if (unlikely(pd == NULL)) {
@@ -113,7 +113,7 @@ char *LiveGetDeviceName(int number)
  *  \retval ptr pointer to the string containing the device
  *  \retval NULL on error
  */
-LiveDevice *LiveGetDevice(char *name)
+LiveDevice *LiveGetDevice(const char *name)
 {
     int i = 0;
     LiveDevice *pd;
@@ -136,12 +136,12 @@ LiveDevice *LiveGetDevice(char *name)
 
 
 
-int LiveBuildDeviceList(char * runmode)
+int LiveBuildDeviceList(const char *runmode)
 {
     return LiveBuildDeviceListCustom(runmode, "interface");
 }
 
-int LiveBuildDeviceListCustom(char * runmode, char * itemname)
+int LiveBuildDeviceListCustom(const char *runmode, const char *itemname)
 {
     ConfNode *base = ConfGetNode(runmode);
     ConfNode *child;
index fd6a82131333acd5c0b12af41cdc0534de1ff382..1fabdbe59665f84c77b3f1ee65d773cbddc666c9 100644 (file)
@@ -32,14 +32,14 @@ typedef struct LiveDevice_ {
 } LiveDevice;
 
 
-int LiveRegisterDevice(char *dev);
+int LiveRegisterDevice(const char *dev);
 int LiveGetDeviceCount(void);
 char *LiveGetDeviceName(int number);
-LiveDevice *LiveGetDevice(char *dev);
-int LiveBuildDeviceList(char * base);
+LiveDevice *LiveGetDevice(const char *dev);
+int LiveBuildDeviceList(const char *base);
 void LiveDeviceHasNoStats(void);
 int LiveDeviceListClean(void);
-int LiveBuildDeviceListCustom(char * base, char * itemname);
+int LiveBuildDeviceListCustom(const char *base, const char *itemname);
 
 #ifdef BUILD_UNIX_SOCKET
 TmEcode LiveDeviceIfaceStat(json_t *cmd, json_t *server_msg, void *data);