constraint.h 607 B

1234567891011121314151617
  1. #ifndef CONSTRAINT_H
  2. #define CONSTRAINT_H
  3. #include <stdint.h>
  4. typedef struct _constraint constraint_t;
  5. typedef unsigned int value_t;
  6. constraint_t* constraint_init(value_t value);
  7. void constraint_free(constraint_t *con);
  8. void constraint_set(constraint_t *con, uint32_t prefix, int len, value_t value);
  9. value_t constraint_lookup_ip(constraint_t *con, uint32_t address);
  10. uint64_t constraint_count_ips(constraint_t *con, value_t value);
  11. uint32_t constraint_lookup_index(constraint_t *con, uint64_t index, value_t value);
  12. void constraint_paint_value(constraint_t *con, value_t value);
  13. #endif //_CONSTRAINT_H