return hasEntry;
}
private static boolean isInFecFile(SrvAddr srv)
{
boolean hasEntry = false;
csv csvf = new csv(fecCacheFile);
try
{
String s, hdr;
int fec_col = -1,ip_col = -1 ,port_col = -1,prot_col = -1;
boolean done = false;
while((s=csvf.readLine()) != null)
{
if (s.length() == 0) continue;
if (s.startsWith("#") || s.startsWith(";") || s.startsWith("%")) continue;
if (!done)
{
hdr = s;
if ((fec_col=csvf.findcol(hdr,"FEC_NAME")) < 0) throw new NoSuchFieldException();
if ((ip_col=csvf.findcol(hdr,"IP_ADDR")) < 0) throw new NoSuchFieldException();
if ((port_col=csvf.findcol(hdr,"PORT_OFFSET")) < 0) throw new NoSuchFieldException();
prot_col = csvf.findcol(hdr,"TINE_PROTOCOL");
done = true;
continue;
}
if (csvf.namcmp(srv.fecName,s,fec_col) != 0) continue;
if (csvf.namcmp(srv.ipAddr,s,ip_col) != 0) continue;
try
{
if (srv.portOffset != Integer.parseInt(csvf.colptr(port_col,s))) continue;
if (prot_col < 0) continue;
if (srv.tineProtocol != Integer.parseInt(csvf.colptr(prot_col,s))) continue;
}
catch (Exception e)
{
continue;
}
hasEntry = true;
break;
}
}
catch (Exception e)
{ // database corrupt or not found
MsgLog.log("TSrvEntry.isInFecFile", e.getMessage(),TErrorList.database_not_loaded,e,1);
hasEntry = false;
}
finally
{
csvf.close();
}
return hasEntry;
}