- first attempt for connection loading and starting via "stroke"

- some improvements here and there
This commit is contained in:
Martin Willi
2006-03-14 13:22:48 +00:00
parent 8a49112907
commit b1953ccd05
20 changed files with 465 additions and 266 deletions
+17 -1
View File
@@ -66,12 +66,14 @@ typedef struct traffic_selector_t traffic_selector_t;
* @brief Object representing a traffic selector entry.
*
* A traffic selector defines an range of addresses
* and a range of ports.
* and a range of ports. IPv6 is not fully supported yet.
*
* @b Constructors:
* - traffic_selector_create_from_bytes()
* - traffic_selector_create_from_string()
*
* @todo Add IPv6 support
*
* @ingroup config
*/
struct traffic_selector_t {
@@ -161,6 +163,18 @@ struct traffic_selector_t {
* @return protocol id
*/
u_int8_t (*get_protocol) (traffic_selector_t *this);
/**
* @brief Get the netmask of the address range.
*
* Returns the number of bits associated to the subnet.
* (As the "24" in "192.168.0.0/24"). This is approximated
* if the address range is not a complete subnet!
*
* @param this calling obect
* @return netmask as "bits for subnet"
*/
u_int8_t (*get_netmask) (traffic_selector_t *this);
/**
* @brief Destroys the ts object
@@ -208,4 +222,6 @@ traffic_selector_t *traffic_selector_create_from_string(u_int8_t protocol, ts_ty
*/
traffic_selector_t *traffic_selector_create_from_bytes(u_int8_t protocol, ts_type_t type, chunk_t from_address, int16_t from_port, chunk_t to_address, u_int16_t to_port);
traffic_selector_t *traffic_selector_create_from_subnet(host_t *net, u_int8_t netbits);
#endif //_TRAFFIC_SELECTOR_H_