portset.c revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
/*
* Copyright (C) 2008, 2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* $Id: portset.c,v 1.4 2008/06/24 23:24:35 marka Exp $ */
/*! \file */
#include <config.h>
/*%
* Internal representation of portset. It's an array of 32-bit integers, each
* bit corresponding to a single port in the ascending order. For example,
* the second most significant bit of buf[0] corresponds to port 1.
*/
struct isc_portset {
unsigned int nports; /*%< number of ports in the set */
};
static inline isc_boolean_t
}
static inline void
}
}
static inline void
}
}
return (ISC_R_NOMEMORY);
/* Make the set 'empty' by default */
return (ISC_R_SUCCESS);
}
void
}
}
unsigned int
}
void
}
void
}
void
{
in_port_t p;
p = port_lo;
do {
portset_add(portset, p);
} while (p++ < port_hi);
}
void
{
in_port_t p;
p = port_lo;
do {
portset_remove(portset, p);
} while (p++ < port_hi);
}