summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2010-12-19 05:56:19 +0100
committerJan Engelhardt <jengelh@medozas.de>2010-12-19 06:12:23 +0100
commit404c46381d01088867fdcd92ea6b97978f4c95a7 (patch)
tree6edd126f56509f3b936d795e983f6866d079c21a /lib
parent8673a740e4279e553e31e1b82ac8e4061ab5dc6f (diff)
libipset: const annotations
Diffstat (limited to 'lib')
-rw-r--r--lib/mnl.c2
-rw-r--r--lib/parse.c2
-rw-r--r--lib/print.c2
-rw-r--r--lib/session.c8
-rw-r--r--lib/types.c2
5 files changed, 8 insertions, 8 deletions
diff --git a/lib/mnl.c b/lib/mnl.c
index aa98a7c..683dba2 100644
--- a/lib/mnl.c
+++ b/lib/mnl.c
@@ -31,7 +31,7 @@ struct ipset_handle {
};
/* Netlink flags of the commands */
-static uint16_t cmdflags[] = {
+static const uint16_t cmdflags[] = {
[IPSET_CMD_CREATE-1] = NLM_F_REQUEST|NLM_F_ACK|NLM_F_CREATE|NLM_F_EXCL,
[IPSET_CMD_DESTROY-1] = NLM_F_REQUEST|NLM_F_ACK,
[IPSET_CMD_FLUSH-1] = NLM_F_REQUEST|NLM_F_ACK,
diff --git a/lib/parse.c b/lib/parse.c
index 437ff61..169d2e0 100644
--- a/lib/parse.c
+++ b/lib/parse.c
@@ -345,7 +345,7 @@ int
ipset_parse_proto(struct ipset_session *session,
enum ipset_opt opt, const char *str)
{
- struct protoent *protoent;
+ const struct protoent *protoent;
uint8_t proto = 0;
assert(session);
diff --git a/lib/print.c b/lib/print.c
index 87a9f2b..767fd04 100644
--- a/lib/print.c
+++ b/lib/print.c
@@ -454,7 +454,7 @@ ipset_print_proto(char *buf, unsigned int len,
const struct ipset_data *data, enum ipset_opt opt,
uint8_t env UNUSED)
{
- struct protoent *protoent;
+ const struct protoent *protoent;
uint8_t proto;
assert(buf);
diff --git a/lib/session.c b/lib/session.c
index d043806..628c1b9 100644
--- a/lib/session.c
+++ b/lib/session.c
@@ -690,7 +690,7 @@ retry:
static int
list_adt(struct ipset_session *session, struct nlattr *nla[])
{
- struct ipset_data *data = session->data;
+ const struct ipset_data *data = session->data;
const struct ipset_type *type;
const struct ipset_arg *arg;
uint8_t family;
@@ -774,7 +774,7 @@ list_adt(struct ipset_session *session, struct nlattr *nla[])
static int
list_create(struct ipset_session *session, struct nlattr *nla[])
{
- struct ipset_data *data = session->data;
+ const struct ipset_data *data = session->data;
const struct ipset_type *type;
const struct ipset_arg *arg;
uint8_t family;
@@ -1016,7 +1016,7 @@ static int
callback_header(struct ipset_session *session, struct nlattr *nla[])
{
const char *setname;
- struct ipset_data *data = session->data;
+ const struct ipset_data *data = session->data;
if (!nla[IPSET_ATTR_SETNAME])
FAILURE("Broken HEADER kernel message: missing setname!");
@@ -1047,7 +1047,7 @@ callback_header(struct ipset_session *session, struct nlattr *nla[])
static int
callback_type(struct ipset_session *session, struct nlattr *nla[])
{
- struct ipset_data *data = session->data;
+ const struct ipset_data *data = session->data;
const char *typename, *orig;
if (!(nla[IPSET_ATTR_TYPENAME]
diff --git a/lib/types.c b/lib/types.c
index d979c24..1bd4274 100644
--- a/lib/types.c
+++ b/lib/types.c
@@ -393,7 +393,7 @@ ipset_type_get(struct ipset_session *session, enum ipset_cmd cmd)
const struct ipset_type *
ipset_type_check(struct ipset_session *session)
{
- struct ipset_type *t, *match = NULL;
+ const struct ipset_type *t, *match = NULL;
struct ipset_data *data;
const char *typename;
uint8_t family, revision;