Show UDP name server status in casr 2+ output
This commit is contained in:
@@ -814,7 +814,7 @@ static void log_one_client (struct client *client, unsigned level)
|
||||
ipAddrToDottedIP (&client->addr, clientIP, sizeof(clientIP));
|
||||
|
||||
if ( client->proto == IPPROTO_UDP ) {
|
||||
printf ( " UDP Name server\n\tLast name request was from %s:\n",
|
||||
printf ( "\tLast name requested by %s:\n",
|
||||
clientIP );
|
||||
}
|
||||
else if ( client->proto == IPPROTO_TCP ) {
|
||||
@@ -875,15 +875,15 @@ static void log_one_client (struct client *client, unsigned level)
|
||||
bytes_reserved += countChanListBytes (
|
||||
client, & client->chanPendingUpdateARList );
|
||||
printf( "\t%d bytes allocated\n", bytes_reserved);
|
||||
printf( "\tSend Lock:\n\t ");
|
||||
printf( "\tSend Lock:\n\t ");
|
||||
epicsMutexShow(client->lock,1);
|
||||
printf( "\tPut Notify Lock:\n\t ");
|
||||
printf( "\tPut Notify Lock:\n\t ");
|
||||
epicsMutexShow (client->putNotifyLock,1);
|
||||
printf( "\tAddress Queue Lock:\n\t ");
|
||||
printf( "\tAddress Queue Lock:\n\t ");
|
||||
epicsMutexShow (client->chanListLock,1);
|
||||
printf( "\tEvent Queue Lock:\n\t ");
|
||||
printf( "\tEvent Queue Lock:\n\t ");
|
||||
epicsMutexShow (client->eventqLock,1);
|
||||
printf( "\tBlock Semaphore:\n\t ");
|
||||
printf( "\tBlock Semaphore:\n\t ");
|
||||
epicsEventShow (client->blockSem,1);
|
||||
}
|
||||
}
|
||||
@@ -938,17 +938,24 @@ void casr (unsigned level)
|
||||
#else
|
||||
if (iface->udpbcast==INVALID_SOCKET) {
|
||||
printf(" CAS-UDP name server on %s\n", buf);
|
||||
if (level >= 2)
|
||||
log_one_client(iface->client, level - 2);
|
||||
}
|
||||
else {
|
||||
printf(" CAS-UDP unicast name server on %s\n", buf);
|
||||
if (level >= 2)
|
||||
log_one_client(iface->client, level - 2);
|
||||
ipAddrToDottedIP (&iface->udpbcastAddr.ia, buf, sizeof(buf));
|
||||
printf(" CAS-UDP broadcast name server on %s\n", buf);
|
||||
if (level >= 2)
|
||||
log_one_client(iface->bclient, level - 2);
|
||||
}
|
||||
#endif
|
||||
|
||||
iface = (rsrv_iface_config *) ellNext(&iface->node);
|
||||
}
|
||||
}
|
||||
|
||||
if (level>=1) {
|
||||
osiSockAddrNode * pAddr;
|
||||
char buf[40];
|
||||
|
||||
@@ -128,10 +128,6 @@ void cast_server(void *pParm)
|
||||
recv_addr_size = sizeof(new_recv_addr);
|
||||
|
||||
reply_sock = conf->udp;
|
||||
if(conf->startbcast)
|
||||
recv_sock = conf->udpbcast;
|
||||
else
|
||||
recv_sock = conf->udp;
|
||||
|
||||
/*
|
||||
* setup new client structure but reuse old structure if
|
||||
@@ -145,6 +141,14 @@ void cast_server(void *pParm)
|
||||
}
|
||||
epicsThreadSleep(300.0);
|
||||
}
|
||||
if (conf->startbcast) {
|
||||
recv_sock = conf->udpbcast;
|
||||
conf->bclient = client;
|
||||
}
|
||||
else {
|
||||
recv_sock = conf->udp;
|
||||
conf->client = client;
|
||||
}
|
||||
client->udpRecv = recv_sock;
|
||||
|
||||
casAttachThreadToClient ( client );
|
||||
|
||||
@@ -144,6 +144,7 @@ typedef struct {
|
||||
udpAddr, /* UDP name unicast receiver endpoint */
|
||||
udpbcastAddr; /* UDP name broadcast receiver endpoint */
|
||||
SOCKET tcp, udp, udpbcast;
|
||||
struct client *client, *bclient;
|
||||
|
||||
unsigned int startbcast:1;
|
||||
} rsrv_iface_config;
|
||||
|
||||
Reference in New Issue
Block a user