]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
network: Remove deprecated loc_network_is_subnet_of function
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 20 Nov 2020 18:44:42 +0000 (18:44 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 20 Nov 2020 18:44:42 +0000 (18:44 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libloc.sym
src/loc/network.h
src/network.c
src/python/network.c

index 9f41c89ad1a02a79b1a98d6668fe823816560feb..b2d8a31e2889273072c5833d2c888b731dd1d38f 100644 (file)
@@ -118,7 +118,6 @@ global:
        loc_network_gt;
        loc_network_has_flag;
        loc_network_is_subnet;
-       loc_network_is_subnet_of;
        loc_network_match_asn;
        loc_network_match_country_code;
        loc_network_match_flag;
index 7b2ae4c6fc3c1718fa9f103cc4895f899c61c2ce..b31c8a269b499a2a5a76f59ab9d0f2ea983cc05a 100644 (file)
@@ -62,7 +62,6 @@ int loc_network_eq(struct loc_network* self, struct loc_network* other);
 int loc_network_gt(struct loc_network* self, struct loc_network* other);
 int loc_network_overlaps(struct loc_network* self, struct loc_network* other);
 int loc_network_is_subnet(struct loc_network* self, struct loc_network* other);
-int loc_network_is_subnet_of(struct loc_network* self, struct loc_network* other);
 int loc_network_subnets(struct loc_network* network, struct loc_network** subnet1, struct loc_network** subnet2);
 struct loc_network_list* loc_network_exclude(
                struct loc_network* self, struct loc_network* other);
index e52b58c63af2ec4ef69cfa31a94956980c170c99..72b77e65e7e8ed2cb03e60f58978aadf16faf57f 100644 (file)
@@ -522,11 +522,6 @@ LOC_EXPORT int loc_network_is_subnet(struct loc_network* self, struct loc_networ
        return 1;
 }
 
-// XXX DEPRECATED - I find this too difficult to use
-LOC_EXPORT int loc_network_is_subnet_of(struct loc_network* self, struct loc_network* other) {
-       return loc_network_is_subnet(other, self);
-}
-
 LOC_EXPORT int loc_network_subnets(struct loc_network* network,
                struct loc_network** subnet1, struct loc_network** subnet2) {
        int r;
@@ -589,7 +584,7 @@ static int __loc_network_exclude(struct loc_network* network,
                if (r)
                        goto ERROR;
 
-       } else  if (loc_network_is_subnet_of(other, subnet1)) {
+       } else  if (loc_network_is_subnet(subnet1, other)) {
                r = loc_network_list_push(list, subnet2);
                if (r)
                        goto ERROR;
@@ -598,7 +593,7 @@ static int __loc_network_exclude(struct loc_network* network,
                if (r)
                        goto ERROR;
 
-       } else if (loc_network_is_subnet_of(other, subnet2)) {
+       } else if (loc_network_is_subnet(subnet2, other)) {
                r = loc_network_list_push(list, subnet1);
                if (r)
                        goto ERROR;
@@ -645,7 +640,7 @@ LOC_EXPORT struct loc_network_list* loc_network_exclude(
        }
 
        // Other must be a subnet of self
-       if (!loc_network_is_subnet_of(other, self)) {
+       if (!loc_network_is_subnet(self, other)) {
                DEBUG(self->ctx, "Network %p is not contained in network %p\n", other, self);
 
                return NULL;
@@ -726,7 +721,7 @@ LOC_EXPORT struct loc_network_list* loc_network_exclude_list(
                        }
 
                        // Drop this subnet if is a subnet of another subnet
-                       if (loc_network_is_subnet_of(subnet, subnet_to_check)) {
+                       if (loc_network_is_subnet(subnet_to_check, subnet)) {
                                passed = 0;
                                loc_network_unref(subnet);
                                break;
index 742b472186db90040927c9fe9cc014939b4afa1d..b6e92fbc8f8fe7a8dc4603fd48a71ae8c91301ee 100644 (file)
@@ -194,7 +194,7 @@ static PyObject* Network_is_subnet_of(NetworkObject* self, PyObject* args) {
        if (!PyArg_ParseTuple(args, "O!", &NetworkType, &other))
                return NULL;
 
-       if (loc_network_is_subnet_of(self->network, other->network))
+       if (loc_network_is_subnet(other->network, self->network))
                Py_RETURN_TRUE;
 
        Py_RETURN_FALSE;