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);
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;
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;
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;
}
// 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;
}
// 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;
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;