]> git.ipfire.org Git - thirdparty/ipset.git/commitdiff
libipset: const annotations
authorJan Engelhardt <jengelh@medozas.de>
Sun, 19 Dec 2010 04:56:19 +0000 (05:56 +0100)
committerJan Engelhardt <jengelh@medozas.de>
Sun, 19 Dec 2010 05:12:23 +0000 (06:12 +0100)
lib/mnl.c
lib/parse.c
lib/print.c
lib/session.c
lib/types.c

index aa98a7c969f6c8696de87b1d74022f9d6a5ebac0..683dba2218b33159e6f0f6d64e4ab3f12b7dafae 100644 (file)
--- 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,
index 437ff61c556e6f0d2d849ca917ce758ff3acbdcc..169d2e01f07e942f816af306f7a1e43512455002 100644 (file)
@@ -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);
index 87a9f2b71d5b89906f346d6e41cbb3d0056854c6..767fd044634facc3e2ff8c3091dfc16d7eb1cf0e 100644 (file)
@@ -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);
index d04380693c856c86cd843f580231a7e79687f6a7..628c1b98ab331098ae44631662bed85f6b1db748 100644 (file)
@@ -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]
index d979c24af9cb34fb8ed7f8a6eed046f1ccd5ddf0..1bd4274d1f4fcfe4fe463cc65f4844eef9e76bbb 100644 (file)
@@ -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;