ipa.h File Reference

Go to the source code of this file.

Classes

struct  IPAContext
 IPA Context data structure. More...
struct  IPAAssoc
 An IPA result record containing an IP address range, a label for that range,and a scalar value associated with the range. More...

Enumerations

enum  IPAStatus {
  IPA_OK = 0, IPA_ERR_NOTFOUND, IPA_ERR_FILEIO, IPA_ERR_SQL,
  IPA_ERR_INVALID, IPA_ERR_UNKNOWN
}
 

The following error return values are defined for IPA:

More...
enum  IPACatalogType {
  IPA_CAT_NONE = 0, IPA_CAT_SET, IPA_CAT_BAG, IPA_CAT_PMAP,
  IPA_CAT_MMAP
}
 

IPA catalogs hold one of the following types of data.

More...
enum  IPAContextState {
  IPA_STATE_INITIAL = 0, IPA_STATE_EXPORT, IPA_STATE_IMPORT, IPA_STATE_QUERY,
  IPA_STATE_QUERY_DONE
}

Functions

int ipa_create_context (IPAContext **ipa, char *db_uri, char *uname)
 Create a handle to an IPA data store.
void ipa_destroy_context (IPAContext **ipa)
 Destroy an IPA context that was created with ipa_create_context().
void ipa_begin (IPAContext *ipa)
 Begin an IPA transaction.
void ipa_commit (IPAContext *ipa)
 Commit (complete) an IPA transaction.
void ipa_rollback (IPAContext *ipa)
 Rollback (abort) an IPA transaction.
int ipa_add_dataset (IPAContext *ipa, const char *catname, const char *catdesc, IPACatalogType type, const char *begin, const char *end)
 Add a new IPA dataset to the database.
int ipa_add_assoc (IPAContext *ipa, uint32_t addr1, uint32_t addr2, char *label, uint64_t value)
 Add an IP range to a dataset with an optional label and/or scalar value.
int ipa_add_cidr (IPAContext *ipa, uint32_t addr, uint32_t prefix, char *label, uint64_t value)
 Convenience function for adding CIDRized IP ranges.
int ipa_get_dataset (IPAContext *ipa, const char *catalog_name, const char *dataset_time)
 Retrieve a dataset record.
int ipa_get_assoc (IPAContext *ipa, IPAAssoc *assoc)
 Retrieve the next range in an open dataset.
int ipa_do_assoc_query (IPAContext *ipa, const char *catalog, const char *range, const char *label, const char *value, const char *t1, const char *t2, int displayfields)
 Get associations matching all of the supplied parameters.

Detailed Description