HEC generation code is courtesy of Charles Michael Heard (initially written for ATM, but adapted for GTKG, with leading coset leader changed).
|
Defines |
#define | GUID_PONG_CACHING 0x01 |
#define | GUID_PERSISTENT 0x02 |
#define | GUID_REQUERY 0x01 /**< Cleared means initial query */ |
| Cleared means initial query.
|
#define | HEC_GENERATOR 0x107 /**< x^8 + x^2 + x + 1 */ |
| x^8 + x^2 + x + 1
|
#define | HEC_GTKG_MASK 0x0c3 /**< HEC GTKG's mask */ |
| HEC GTKG's mask.
|
Functions |
| RCSID ("$Id:guid.c, v 1.12 2005/08/27 14:54:27 rmanfredi Exp $") |
void | guid_gen_syndrome_table (void) |
| Generate a table of CRC-8 syndromes for all possible input bytes.
|
guint16 | guid_gtkg_encode_version (guint major, guint minor, gboolean rel) |
| Encode major/minor version into 16 bits.
|
guint8 | guid_hec (const gchar *xuid) |
| Compute GUID's HEC over bytes 1..15.
|
void | guid_init (void) |
| Initialize GUID management.
|
void | guid_flag_modern (gchar *muid) |
| Make sure the MUID we use in initial handshaking pings are marked specially to indicate we're modern nodes.
|
void | guid_flag_gtkg (gchar *xuid) |
| Flag a GUID/MUID as being from GTKG, by patching `xuid' in place.
|
gboolean | guid_extract_gtkg_info (const guint8 *xuid, gint start, guint8 *majp, guint8 *minp, gboolean *relp) |
| Decode major/minor and release information from the specified two contiguous GUID bytes.
|
gboolean | guid_is_gtkg (const gchar *guid, guint8 *majp, guint8 *minp, gboolean *relp) |
| Test whether GUID is that of GTKG, and extract version major/minor, along with release status provided the `majp', `minp' and `relp' are non-NULL.
|
gboolean | guid_is_requery (const gchar *xuid) |
| Test whether a GTKG MUID in a Query is marked as being a retry.
|
void | guid_random_muid (gchar *muid) |
| Generate a new random GUID, flagged as GTKG.
|
void | guid_ping_muid (gchar *muid) |
| Generate a new random (modern) message ID for pings.
|
void | guid_query_muid (gchar *muid, gboolean initial) |
| Generate a new random message ID for queries.
|
void | guid_flag_oob_gtkg (gchar *xuid) |
| Flag a MUID for OOB queries as being from GTKG, by patching `xuid' in place.
|
gboolean | guid_oob_is_gtkg (const gchar *guid, guint8 *majp, guint8 *minp, gboolean *relp) |
| Test whether GUID is that of GTKG, and extract version major/minor, along with release status provided the `majp', `minp' and `relp' are non-NULL.
|
gboolean | guid_query_muid_is_gtkg (const gchar *guid, gboolean oob, guint8 *majp, guint8 *minp, gboolean *relp) |
| Check whether the MUID of a query is that of GTKG.
|
void | guid_query_oob_muid (gchar *muid, const host_addr_t addr, guint16 port, gboolean initial) |
| Generate GUID for a query with OOB results delivery.
|
void | guid_oob_get_addr_port (const gchar *guid, host_addr_t *addr, guint16 *port) |
| Extract the IP and port number from the GUID of queries marked for OOB query hit delivery.
|
Variables |
const gchar | blank_guid [GUID_RAW_SIZE] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } |
guint8 | syndrome_table [256] |
guint16 | gtkg_version_mark |