X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=lcradmin.c;h=fbd0015a5980a9881ed67f6e3608409a1b39ad91;hp=cf97f6928f8f6192359a42635426308c2118343d;hb=d2b113f2c4f11acfaee1b2e0fd2f03744a89f6d4;hpb=5ad4c41dc406a15beaa0a7b73d9dada1df74f939 diff --git a/lcradmin.c b/lcradmin.c index cf97f69..fbd0015 100644 --- a/lcradmin.c +++ b/lcradmin.c @@ -76,7 +76,7 @@ char red = 1, #define LOGLINES 128 char logline[LOGLINES][512]; -unsigned long logcur = 0; +unsigned int logcur = 0; int logfh = -1; char logfile[128]; @@ -209,7 +209,7 @@ int debug_port(struct admin_message *msg, struct admin_message *m, int line, int } int debug_epoint(struct admin_message *msg, struct admin_message *m, int line, int i, int vline) { - unsigned long epoint = m[i].u.e.serial; + unsigned int epoint = m[i].u.e.serial; char buffer[256]; unsigned char c; int j, jj; @@ -359,7 +359,7 @@ int debug_epoint(struct admin_message *msg, struct admin_message *m, int line, i } /* loop all related ports */ ltee = 0; - j = msg->u.s.interfaces+msg->u.s.joins+msg->u.s.epoints; + j = msg->u.s.interfaces+msg->u.s.remotes+msg->u.s.joins+msg->u.s.epoints; jj = j + msg->u.s.ports; while(j < jj) { @@ -392,7 +392,7 @@ int debug_epoint(struct admin_message *msg, struct admin_message *m, int line, i } int debug_join(struct admin_message *msg, struct admin_message *m, int line, int i) { - unsigned long join = m[i].u.j.serial; + unsigned int join = m[i].u.j.serial; char buffer[256]; int j, jj; @@ -416,7 +416,7 @@ int debug_join(struct admin_message *msg, struct admin_message *m, int line, int addstr(buffer); } /* find number of epoints */ - j = msg->u.s.interfaces+msg->u.s.joins; + j = msg->u.s.interfaces+msg->u.s.remotes+msg->u.s.joins; jj = j + msg->u.s.epoints; i = 0; while(j < jj) @@ -426,7 +426,7 @@ int debug_join(struct admin_message *msg, struct admin_message *m, int line, int j++; } /* loop all related endpoints */ - j = msg->u.s.interfaces+msg->u.s.joins; + j = msg->u.s.interfaces+msg->u.s.remotes+msg->u.s.joins; jj = j + msg->u.s.epoints; while(j < jj) { @@ -457,7 +457,7 @@ char *admin_state(int sock, char *argv[]) *p; int line, offset = 0, hoffset = 0; int i, ii, j, jj, k; - unsigned long l, ll; + unsigned int l, ll; int num; int len; int off; @@ -681,6 +681,27 @@ char *admin_state(int sock, char *argv[]) } color((m[i].u.i.l1link)?green:blue); addstr((m[i].u.i.l1link)?" L1 ACTIVE":" L1 inactive"); + if (m[i].u.i.los) + { + color(red); + addstr(" LOS"); + } + if (m[i].u.i.ais) + { + color(red); + addstr(" AIS"); + } + if (m[i].u.i.rdi) + { + color(red); + addstr(" RDI"); + } + if (m[i].u.i.slip_tx || m[i].u.i.slip_rx) + { + color(red); + SPRINT(buffer, " SLIP(tx:%d rx:%d)", m[i].u.i.slip_tx, m[i].u.i.slip_rx); + addstr(buffer); + } if (m[i].u.i.block) { color(red); @@ -757,7 +778,7 @@ char *admin_state(int sock, char *argv[]) if (m[i].u.i.port[j]) { /* search for port */ - l = msg.u.s.interfaces+msg.u.s.joins+msg.u.s.epoints; + l = msg.u.s.interfaces+msg.u.s.remotes+msg.u.s.joins+msg.u.s.epoints; ll = l+msg.u.s.ports; while(l < ll) { @@ -813,7 +834,7 @@ char *admin_state(int sock, char *argv[]) i++; anything = 1; } - i = 0; + i = msg.u.s.interfaces; ii = i + msg.u.s.remotes; while(i < ii) { @@ -832,7 +853,7 @@ char *admin_state(int sock, char *argv[]) if (show_calls == 1) { anything = 0; - i = msg.u.s.interfaces+msg.u.s.joins; + i = msg.u.s.interfaces+msg.u.s.remotes+msg.u.s.joins; ii = i+msg.u.s.epoints; while(i < ii) { @@ -871,7 +892,7 @@ char *admin_state(int sock, char *argv[]) i++; anything = 1; } - j = msg.u.s.interfaces; + j = msg.u.s.interfaces+msg.u.s.remotes; jj = j+msg.u.s.joins; while(j < jj) { @@ -880,7 +901,7 @@ char *admin_state(int sock, char *argv[]) color(white); SPRINT(buffer, "(%d):", m[j].u.j.serial); addstr(buffer); - i = msg.u.s.interfaces+msg.u.s.joins; + i = msg.u.s.interfaces+msg.u.s.remotes+msg.u.s.joins; ii = i+msg.u.s.epoints; while(i < ii) { @@ -922,7 +943,7 @@ char *admin_state(int sock, char *argv[]) { /* show all ports with no epoint */ anything = 0; - i = msg.u.s.interfaces+msg.u.s.joins+msg.u.s.epoints; + i = msg.u.s.interfaces+msg.u.s.remotes+msg.u.s.joins+msg.u.s.epoints; ii = i+msg.u.s.ports; while(i < ii) { @@ -942,7 +963,7 @@ char *admin_state(int sock, char *argv[]) /* show all epoints with no call */ anything = 0; - i = msg.u.s.interfaces+msg.u.s.joins; + i = msg.u.s.interfaces+msg.u.s.remotes+msg.u.s.joins; ii = i+msg.u.s.epoints; while(i < ii) { @@ -962,7 +983,7 @@ char *admin_state(int sock, char *argv[]) /* show all joins */ anything = 0; - i = msg.u.s.interfaces; + i = msg.u.s.interfaces+msg.u.s.remotes; ii = i+msg.u.s.joins; while(i < ii) { @@ -1325,7 +1346,7 @@ char *admin_testcall(int sock, int argc, char *argv[]) int stimeout = 0, ptimeout = 0, atimeout = 0, ctimeout = 0; int l; double timer = 0, now_d; - unsigned long on = 1; + unsigned int on = 1; struct timeval now_tv; struct timezone now_tz;