static void dump_he_entry(void) { DPFSO0("hostDiskEntry"); DPFS1("host", afs_inet_ntoa(he_cursor.he.host)); DPFV1("port", "u", he_cursor.he.port); DPFX1("hostFlags", he_cursor.he.hostFlags); DPFV1("Console", "u", he_cursor.he.Console); DPFV1("hcpsfailed", "u", he_cursor.he.hcpsfailed); DPFV1("hcps_valid", "u", he_cursor.he.hcps_valid); if (hdrs.hdr.stats_detailed) { #ifdef FS_STATS_DETAILED DPFV1("InSameNetwork", "u", he_cursor.he.InSameNetwork); #else DPFV1("InSameNetwork", "u", he_cursor.he.padding1[0]); #endif } DPFV1("hcps_len", "u", he_cursor.he.hcps_len); DPFT1("LastCall", he_cursor.he.LastCall); DPFT1("ActiveCall", he_cursor.he.ActiveCall); DPFT1("cpsCall", he_cursor.he.cpsCall); DPFV1("cblist", "u", he_cursor.he.cblist); DPFV1("index", "u", he_cursor.he.index); DPFSC0; }
static void dump_fe_hdr(void) { DPFSO0("callback_state_entry_header"); DPFX1("magic", fe_cursor.hdr.magic); DPFV1("len", "u", fe_cursor.hdr.len); DPFV1("nCBs", "u", fe_cursor.hdr.nCBs); DPFSC0; if (fe_cursor.hdr.magic != CALLBACK_STATE_ENTRY_MAGIC) { fprintf(stderr, "* magic check failed\n"); } }
static void dump_he_hdr(void) { DPFSO0("host_state_entry_header"); DPFX1("magic", he_cursor.hdr.magic); DPFV1("len", "u", he_cursor.hdr.len); DPFV1("interfaces", "u", he_cursor.hdr.interfaces); DPFV1("hcps", "u", he_cursor.hdr.hcps); DPFSC0; if (he_cursor.hdr.magic != HOST_STATE_ENTRY_MAGIC) { fprintf(stderr, "* magic check failed\n"); } }
static void dump_cb_hdr(void) { afs_uint32 hi, lo; if (get_cb_hdr()) return; DPFOFF(hdrs.cb_hdr_p); DPFSO0("callback_state_header"); DPFSO1("stamp"); DPFX2("magic", hdrs.cb_hdr.stamp.magic); DPFV2("version", "u", hdrs.cb_hdr.stamp.version); DPFSC1; DPFV1("nFEs", "u", hdrs.cb_hdr.nFEs); DPFV1("nCBs", "u", hdrs.cb_hdr.nCBs); DPFV1("fe_max", "u", hdrs.cb_hdr.fe_max); DPFV1("cb_max", "u", hdrs.cb_hdr.cb_max); DPFV1("tfirst", "d", hdrs.cb_hdr.tfirst); SplitInt64(hdrs.cb_hdr.timeout_offset, hi, lo); DPFSO1("timeout_offset"); DPFV2("hi", "u", hi); DPFV2("lo", "u", lo); DPFSC1; SplitInt64(hdrs.cb_hdr.fehash_offset, hi, lo); DPFSO1("fehash_offset"); DPFV2("hi", "u", hi); DPFV2("lo", "u", lo); DPFSC1; SplitInt64(hdrs.cb_hdr.fe_offset, hi, lo); DPFSO1("fe_offset"); DPFV2("hi", "u", hi); DPFV2("lo", "u", lo); DPFSC1; DPFSC0; if (hdrs.cb_hdr.stamp.magic != CALLBACK_STATE_MAGIC) { fprintf(stderr, "* magic check failed\n"); } if (hdrs.cb_hdr.stamp.version != CALLBACK_STATE_VERSION) { fprintf(stderr, "* version check failed\n"); } }
static void dump_hdr(void) { char uuid_str[40]; afs_uint32 hi, lo; if (get_hdr()) return; DPFOFF(map); DPFSO0("fs_state_header"); DPFSO1("stamp"); DPFX2("magic", hdrs.hdr.stamp.magic); DPFV2("version", "u", hdrs.hdr.stamp.version); DPFSC1; DPFT1("timestamp", hdrs.hdr.timestamp); DPFV1("sys_name", "u", hdrs.hdr.sys_name); afsUUID_to_string(&hdrs.hdr.server_uuid, uuid_str, sizeof(uuid_str)); DPFS1("server_uuid", uuid_str); DPFV1("valid", "d", hdrs.hdr.valid); DPFV1("endianness", "d", hdrs.hdr.endianness); DPFV1("stats_detailed", "d", hdrs.hdr.stats_detailed); SplitInt64(hdrs.hdr.h_offset, hi, lo); DPFSO1("h_offset"); DPFV2("hi", "u", hi); DPFV2("lo", "u", lo); DPFSC1; SplitInt64(hdrs.hdr.cb_offset, hi, lo); DPFSO1("cb_offset"); DPFV2("hi", "u", hi); DPFV2("lo", "u", lo); DPFSC1; DPFS1("server_version_string", hdrs.hdr.server_version_string); DPFSC0; if (hdrs.hdr.stamp.magic != FS_STATE_MAGIC) { fprintf(stderr, "* magic check failed\n"); } if (hdrs.hdr.stamp.version != FS_STATE_VERSION) { fprintf(stderr, "* version check failed\n"); } }
static void dump_h_hdr(void) { if (get_h_hdr()) return; DPFOFF(hdrs.h_hdr_p); DPFSO0("host_state_header"); DPFSO1("stamp"); DPFX2("magic", hdrs.h_hdr.stamp.magic); DPFV2("version", "u", hdrs.h_hdr.stamp.version); DPFSC1; DPFV1("records", "u", hdrs.h_hdr.records); DPFV1("index_max", "u", hdrs.h_hdr.index_max); DPFSC0; if (hdrs.h_hdr.stamp.magic != HOST_STATE_MAGIC) { fprintf(stderr, "* magic check failed\n"); } if (hdrs.h_hdr.stamp.version != HOST_STATE_VERSION) { fprintf(stderr, "* version check failed\n"); } }
static void dump_cb_fehash(void) { int i; if (get_cb_hdr()) return; if (get_cb_fehash_hdr()) return; if (get_cb_fehash()) return; DPFOFF(hdrs.fehash_hdr_p); DPFSO0("callback_state_fehash_header"); DPFX1("magic", hdrs.fehash_hdr.magic); DPFV1("len", "u", hdrs.fehash_hdr.len); DPFV1("records", "u", hdrs.fehash_hdr.records); DPFSC0; if (hdrs.fehash_hdr.magic != CALLBACK_STATE_FEHASH_MAGIC) { fprintf(stderr, "* magic check failed\n"); } DPFOFF(hdrs.fehash_p); DPFAO0("fehash"); for (i = 0; i < hdrs.fehash_hdr.records - 1; i++) { DPFAE("u", hdrs.fehash[i]); if ((i % 8) == 7) { DPFAN; DPFA1; } } DPFALE("u", hdrs.fehash[hdrs.fehash_hdr.records-1]); DPFAC0; }
static void dump_cb_timeout(void) { int i; if (get_cb_hdr()) return; if (get_cb_timeout_hdr()) return; if (get_cb_timeout()) return; DPFOFF(hdrs.timeout_hdr_p); DPFSO0("callback_state_timeout_header"); DPFX1("magic", hdrs.timeout_hdr.magic); DPFV1("len", "u", hdrs.timeout_hdr.len); DPFV1("records", "u", hdrs.timeout_hdr.records); DPFSC0; if (hdrs.timeout_hdr.magic != CALLBACK_STATE_TIMEOUT_MAGIC) { fprintf(stderr, "* magic check failed\n"); } DPFOFF(hdrs.timeout_p); DPFAO0("timeout"); for (i = 0; i < 127; i++) { DPFAE("u", hdrs.timeout[i]); if ((i % 8) == 7) { DPFAN; DPFA1; } } DPFALE("u", hdrs.timeout[127]); DPFAC0; }
static void dump_fe_entry(void) { DPFSO0("FEDiskEntry"); DPFSO1("fe"); DPFV2("vnode", "u", fe_cursor.fe.fe.vnode); DPFV2("unique", "u", fe_cursor.fe.fe.unique); DPFV2("volid", "u", fe_cursor.fe.fe.volid); DPFV2("fnext", "u", fe_cursor.fe.fe.fnext); DPFV2("ncbs", "u", fe_cursor.fe.fe.ncbs); DPFV2("firstcb", "u", fe_cursor.fe.fe.firstcb); DPFV2("status", "u", fe_cursor.fe.fe.status); DPFSC1; DPFV1("index", "u", fe_cursor.fe.index); DPFSC0; }
static void dump_cb_entry(void) { DPFSO0("CBDiskEntry"); DPFSO1("cb"); DPFV2("cnext", "u", cb_cursor.cb.cb.cnext); DPFV2("fhead", "u", cb_cursor.cb.cb.fhead); DPFV2("thead", "u", (afs_uint32)cb_cursor.cb.cb.thead); DPFV2("status", "u", (afs_uint32)cb_cursor.cb.cb.status); DPFV2("hhead", "u", cb_cursor.cb.cb.hhead); DPFV2("tprev", "u", cb_cursor.cb.cb.tprev); DPFV2("tnext", "u", cb_cursor.cb.cb.tnext); DPFV2("hprev", "u", cb_cursor.cb.cb.hprev); DPFV2("hnext", "u", cb_cursor.cb.cb.hnext); DPFSC1; DPFV1("index", "u", cb_cursor.cb.index); DPFSC0; }
static void dump_he_entry(void) { char hoststr[16]; DPFSO0("hostDiskEntry"); DPFS1("host", afs_inet_ntoa_r(he_cursor.he.host, hoststr)); DPFV1("port", "u", he_cursor.he.port); DPFX1("hostFlags", he_cursor.he.hostFlags); DPFV1("Console", "u", he_cursor.he.Console); DPFV1("hcpsfailed", "u", he_cursor.he.hcpsfailed); DPFV1("hcps_valid", "u", he_cursor.he.hcps_valid); if (hdrs.hdr.stats_detailed) { DPFV1("InSameNetwork", "u", he_cursor.he.InSameNetwork); } DPFV1("hcps_len", "u", he_cursor.he.hcps_len); DPFT1("LastCall", he_cursor.he.LastCall); DPFT1("ActiveCall", he_cursor.he.ActiveCall); DPFT1("cpsCall", he_cursor.he.cpsCall); DPFV1("cblist", "u", he_cursor.he.cblist); DPFV1("index", "u", he_cursor.he.index); DPFSC0; }
static void dump_he_interfaces(void) { char temp_str[40]; struct Interface * ifp; int len, i; char hoststr[16]; if (!he_cursor.hdr.interfaces) return; len = sizeof(struct Interface) + ((he_cursor.hdr.interfaces-1)*sizeof(struct AddrPort)); ifp = malloc(len); assert(ifp != NULL); memcpy(ifp, he_cursor.ifp, len); DPFSO0("Interface"); DPFV1("numberOfInterfaces", "u", ifp->numberOfInterfaces); afsUUID_to_string(&ifp->uuid, temp_str, sizeof(temp_str)); DPFS1("uuid", temp_str); for (i = 0; i < he_cursor.hdr.interfaces; i++) { snprintf(temp_str, sizeof(temp_str), "interface[%d]", i); DPFSO1(temp_str); DPFS2("addr", afs_inet_ntoa_r(ifp->interface[i].addr, hoststr)); DPFV2("port", "u", ifp->interface[i].port); DPFSC1; } DPFSC0; if (he_cursor.hdr.interfaces != ifp->numberOfInterfaces) { fprintf(stderr, "* interface count mismatch between header and Interface struct\n"); } free(ifp); }