[0001]
[0002]
[0003]
[0004]
[0005]
[0006]
[0007]
[0008]
[0009]
[0010]
[0011]
[0012]
[0013]
[0014]
[0015]
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022]
[0023]
[0024]
[0025]
[0026]
[0027]
[0028]
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048]
[0049]
[0050]
[0051]
[0052]
[0053]
[0054]
[0055]
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
[0064]
[0065]
[0066]
[0067]
[0068]
[0069]
[0070]
[0071]
[0072]
[0073]
[0074]
[0075]
[0076]
[0077]
[0078]
[0079]
[0080]
[0081]
[0082]
[0083]
[0084]
[0085]
[0086]
[0087]
[0088]
[0089]
[0090]
[0091]
[0092]
[0093]
[0094]
[0095]
[0096]
[0097]
[0098]
[0099]
[0100]
[0101]
[0102]
[0103]
[0104]
[0105]
[0106]
[0107]
[0108]
[0109]
[0110]
[0111]
[0112]
[0113]
[0114]
[0115]
[0116]
[0117]
[0118]
[0119]
[0120]
[0121]
[0122]
[0123]
[0124]
[0125]
[0126]
[0127]
[0128]
[0129]
[0130]
[0131]
[0132]
[0133]
[0134]
[0135]
[0136]
[0137]
[0138]
[0139]
[0140]
[0141]
[0142]
[0143]
[0144]
[0145]
[0146]
[0147]
[0148]
[0149]
[0150]
[0151]
[0152]
[0153]
[0154]
[0155]
[0156]
[0157]
[0158]
[0159]
[0160]
[0161]
[0162]
[0163]
[0164]
[0165]
[0166]
[0167]
[0168]
[0169]
[0170]
[0171]
[0172]
[0173]
[0174]
[0175]
[0176]
[0177]
[0178]
[0179]
[0180]
[0181]
[0182]
[0183]
[0184]
[0185]
[0186]
[0187]
[0188]
[0189]
[0190]
[0191]
[0192]
[0193]
[0194]
[0195]
[0196]
[0197]
[0198]
[0199]
[0200]
[0201]
[0202]
[0203]
[0204]
[0205]
[0206]
[0207]
[0208]
[0209]
[0210]
[0211]
[0212]
[0213]
[0214]
[0215]
[0216]
[0217]
[0218]
[0219]
[0220]
[0221]
[0222]
[0223]
[0224]
[0225]
[0226]
[0227]
[0228]
[0229]
[0230]
[0231]
[0232]
[0233]
[0234]
[0235]
[0236]
[0237]
[0238]
[0239]
[0240]
[0241]
[0242]
[0243]
[0244]
[0245]
[0246]
[0247]
[0248]
[0249]
[0250]
[0251]
[0252]
[0253]
[0254]
[0255]
[0256]
[0257]
[0258]
[0259]
[0260]
[0261]
[0262]
[0263]
[0264]
[0265]
[0266]
[0267]
[0268]
[0269]
[0270]
[0271]
[0272]
[0273]
[0274]
[0275]
[0276]
[0277]
[0278]
[0279]
[0280]
[0281]
[0282]
[0283]
[0284]
[0285]
[0286]
[0287]
[0288]
[0289]
[0290]
[0291]
[0292]
[0293]
[0294]
[0295]
[0296]
[0297]
[0298]
[0299]
[0300]
[0301]
[0302]
[0303]
[0304]
[0305]
[0306]
[0307]
[0308]
[0309]
[0310]
[0311]
[0312]
[0313]
[0314]
[0315]
[0316]
[0317]
[0318]
[0319]
[0320]
[0321]
[0322]
[0323]
[0324]
[0325]
[0326]
[0327]
[0328]
[0329]
[0330]
[0331]
[0332]
[0333]
[0334]
[0335]
[0336]
[0337]
[0338]
[0339]
[0340]
[0341]
[0342]
[0343]
[0344]
[0345]
[0346]
[0347]
[0348]
[0349]
[0350]
[0351]
[0352]
[0353]
[0354]
[0355]
[0356]
[0357]
[0358]
[0359]
[0360]
[0361]
[0362]
[0363]
[0364]
[0365]
[0366]
[0367]
[0368]
[0369]
[0370]
[0371]
[0372]
[0373]
[0374]
[0375]
[0376]
[0377]
[0378]
[0379]
[0380]
[0381]
[0382]
[0383]
[0384]
[0385]
[0386]
[0387]
[0388]
[0389]
[0390]
[0391]
[0392]
[0393]
[0394]
[0395]
[0396]
[0397]
[0398]
[0399]
[0400]
[0401]
[0402]
[0403]
[0404]
[0405]
[0406]
[0407]
[0408]
[0409]
[0410]
[0411]
[0412]
[0413]
[0414]
[0415]
[0416]
[0417]
[0418]
[0419]
[0420]
[0421]
[0422]
[0423]
[0424]
[0425]
[0426]
[0427]
[0428]
[0429]
[0430]
[0431]
[0432]
[0433]
[0434]
[0435]
[0436]
[0437]
[0438]
[0439]
[0440]
[0441]
[0442]
[0443]
[0444]
[0445]
[0446]
[0447]
[0448]
[0449]
[0450]
[0451]
[0452]
[0453]
[0454]
[0455]
[0456]
[0457]
[0458]
[0459]
[0460]
[0461]
[0462]
[0463]
[0464]
[0465]
[0466]
[0467]
[0468]
[0469]
[0470]
[0471]
[0472]
[0473]
[0474]
[0475]
[0476]
[0477]
[0478]
[0479]
[0480]
[0481]
[0482]
[0483]
[0484]
[0485]
[0486]
[0487]
[0488]
[0489]
[0490]
[0491]
[0492]
[0493]
[0494]
[0495]
[0496]
[0497]
[0498]
[0499]
[0500]
[0501]
[0502]
[0503]
[0504]
[0505]
[0506]
[0507]
[0508]
[0509]
[0510]
[0511]
[0512]
[0513]
[0514]
[0515]
[0516]
[0517]
[0518]
[0519]
[0520]
[0521]
[0522]
[0523]
[0524]
[0525]
[0526]
[0527]
[0528]
[0529]
[0530]
[0531]
[0532]
[0533]
[0534]
[0535]
[0536]
[0537]
[0538]
[0539]
[0540]
[0541]
[0542]
[0543]
[0544]
[0545]
[0546]
[0547]
[0548]
[0549]
[0550]
[0551]
[0552]
[0553]
[0554]
[0555]
[0556]
[0557]
[0558]
[0559]
[0560]
[0561]
[0562]
[0563]
[0564]
[0565]
[0566]
[0567]
[0568]
[0569]
[0570]
[0571]
[0572]
[0573]
[0574]
[0575]
[0576]
[0577]
[0578]
[0579]
[0580]
[0581]
[0582]
[0583]
[0584]
[0585]
[0586]
[0587]
[0588]
[0589]
[0590]
[0591]
[0592]
[0593]
[0594]
[0595]
[0596]
[0597]
[0598]
[0599]
[0600]
[0601]
[0602]
[0603]
[0604]
[0605]
[0606]
[0607]
[0608]
[0609]
[0610]
[0611]
[0612]
[0613]
[0614]
[0615]
[0616]
[0617]
[0618]
[0619]
[0620]
[0621]
[0622]
[0623]
[0624]
[0625]
[0626]
[0627]
[0628]
[0629]
[0630]
[0631]
[0632]
[0633]
[0634]
[0635]
[0636]
[0637]
[0638]
[0639]
[0640]
[0641]
[0642]
[0643]
[0644]
[0645]
[0646]
[0647]
[0648]
[0649]
[0650]
[0651]
[0652]
[0653]
[0654]
[0655]
[0656]
[0657]
[0658]
[0659]
[0660]
[0661]
[0662]
[0663]
[0664]
[0665]
[0666]
[0667]
[0668]
[0669]
[0670]
[0671]
[0672]
[0673]
[0674]
[0675]
[0676]
[0677]
[0678]
[0679]
[0680]
[0681]
[0682]
[0683]
[0684]
[0685]
[0686]
[0687]
[0688]
[0689]
[0690]
[0691]
[0692]
[0693]
[0694]
[0695]
[0696]
[0697]
[0698]
[0699]
[0700]
[0701]
[0702]
[0703]
[0704]
[0705]
[0706]
[0707]
[0708]
[0709]
[0710]
[0711]
[0712]
[0713]
[0714]
[0715]
[0716]
[0717]
[0718]
[0719]
[0720]
[0721]
[0722]
[0723]
[0724]
[0725]
[0726]
[0727]
[0728]
[0729]
[0730]
[0731]
[0732]
[0733]
[0734]
[0735]
[0736]
[0737]
[0738]
[0739]
[0740]
[0741]
[0742]
[0743]
[0744]
[0745]
[0746]
[0747]
[0748]
[0749]
[0750]
[0751]
[0752]
[0753]
[0754]
[0755]
[0756]
[0757]
[0758]
[0759]
[0760]
[0761]
[0762]
[0763]
[0764]
[0765]
[0766]
[0767]
[0768]
[0769]
[0770]
[0771]
[0772]
[0773]
[0774]
[0775]
[0776]
[0777]
[0778]
[0779]
[0780]
[0781]
[0782]
[0783]
[0784]
[0785]
[0786]
[0787]
[0788]
[0789]
[0790]
[0791]
[0792]
[0793]
[0794]
[0795]
[0796]
[0797]
[0798]
[0799]
[0800]
[0801]
[0802]
[0803]
[0804]
[0805]
[0806]
[0807]
[0808]
[0809]
[0810]
[0811]
[0812]
[0813]
[0814]
[0815]
[0816]
[0817]
[0818]
[0819]
[0820]
[0821]
[0822]
[0823]
[0824]
[0825]
[0826]
[0827]
[0828]
[0829]
[0830]
[0831]
[0832]
[0833]
[0834]
[0835]
[0836]
[0837]
[0838]
[0839]
[0840]
[0841]
[0842]
[0843]
[0844]
[0845]
[0846]
[0847]
[0848]
[0849]
[0850]
[0851]
[0852]
[0853]
[0854]
[0855]
[0856]
[0857]
[0858]
[0859]
[0860]
[0861]
[0862]
[0863]
[0864]
[0865]
[0866]
[0867]
[0868]
[0869]
[0870]
[0871]
[0872]
[0873]
[0874]
[0875]
[0876]
[0877]
[0878]
[0879]
[0880]
[0881]
[0882]
[0883]
[0884]
[0885]
[0886]
[0887]
[0888]
[0889]
[0890]
[0891]
[0892]
[0893]
[0894]
[0895]
[0896]
[0897]
[0898]
[0899]
[0900]
[0901]
[0902]
[0903]
[0904]
[0905]
[0906]
[0907]
[0908]
[0909]
[0910]
[0911]
[0912]
[0913]
[0914]
[0915]
[0916]
[0917]
[0918]
[0919]
[0920]
[0921]
[0922]
[0923]
[0924]
[0925]
[0926]
[0927]
[0928]
[0929]
[0930]
[0931]
[0932]
[0933]
[0934]
[0935]
[0936]
[0937]
[0938]
[0939]
[0940]
[0941]
[0942]
[0943]
[0944]
[0945]
[0946]
[0947]
[0948]
[0949]
[0950]
[0951]
[0952]
[0953]
[0954]
[0955]
[0956]
[0957]
[0958]
[0959]
[0960]
[0961]
[0962]
[0963]
[0964]
[0965]
[0966]
[0967]
[0968]
[0969]
[0970]
[0971]
[0972]
[0973]
[0974]
[0975]
[0976]
[0977]
[0978]
[0979]
[0980]
[0981]
[0982]
[0983]
[0984]
[0985]
[0986]
[0987]
[0988]
[0989]
[0990]
[0991]
[0992]
[0993]
[0994]
[0995]
[0996]
[0997]
[0998]
[0999]
[1000]
[1001]
[1002]
[1003]
[1004]
[1005]
[1006]
[1007]
[1008]
[1009]
[1010]
[1011]
[1012]
[1013]
[1014]
[1015]
[1016]
[1017]
[1018]
[1019]
[1020]
[1021]
[1022]
[1023]
[1024]
[1025]
[1026]
[1027]
[1028]
[1029]
[1030]
[1031]
[1032]
[1033]
[1034]
[1035]
[1036]
[1037]
[1038]
[1039]
[1040]
[1041]
[1042]
[1043]
[1044]
[1045]
[1046]
[1047]
[1048]
[1049]
[1050]
[1051]
[1052]
[1053]
[1054]
[1055]
[1056]
[1057]
[1058]
[1059]
[1060]
[1061]
[1062]
[1063]
[1064]
[1065]
[1066]
[1067]
[1068]
[1069]
[1070]
[1071]
[1072]
[1073]
[1074]
[1075]
[1076]
[1077]
[1078]
[1079]
[1080]
[1081]
[1082]
[1083]
[1084]
[1085]
[1086]
[1087]
[1088]
[1089]
[1090]
[1091]
[1092]
[1093]
[1094]
[1095]
[1096]
[1097]
[1098]
[1099]
[1100]
[1101]
[1102]
[1103]
[1104]
[1105]
[1106]
[1107]
[1108]
[1109]
[1110]
[1111]
[1112]
[1113]
[1114]
[1115]
[1116]
[1117]
[1118]
[1119]
[1120]
[1121]
[1122]
[1123]
[1124]
[1125]
[1126]
[1127]
[1128]
[1129]
[1130]
[1131]
[1132]
[1133]
[1134]
[1135]
[1136]
[1137]
[1138]
[1139]
[1140]
[1141]
[1142]
[1143]
[1144]
[1145]
[1146]
[1147]
[1148]
[1149]
[1150]
[1151]
[1152]
[1153]
[1154]
[1155]
[1156]
[1157]
[1158]
[1159]
[1160]
[1161]
[1162]
[1163]
[1164]
[1165]
[1166]
[1167]
[1168]
[1169]
[1170]
[1171]
[1172]
[1173]
[1174]
[1175]
[1176]
[1177]
[1178]
[1179]
[1180]
[1181]
[1182]
[1183]
[1184]
[1185]
[1186]
[1187]
[1188]
[1189]
[1190]
[1191]
[1192]
[1193]
[1194]
[1195]
[1196]
[1197]
[1198]
[1199]
[1200]
[1201]
[1202]
[1203]
[1204]
[1205]
[1206]
[1207]
[1208]
[1209]
[1210]
[1211]
[1212]
[1213]
[1214]
[1215]
[1216]
[1217]
[1218]
[1219]
[1220]
[1221]
[1222]
[1223]
[1224]
[1225]
[1226]
[1227]
[1228]
[1229]
[1230]
[1231]
[1232]
[1233]
[1234]
[1235]
[1236]
[1237]
[1238]
[1239]
[1240]
[1241]
[1242]
[1243]
[1244]
[1245]
[1246]
[1247]
[1248]
[1249]
[1250]
[1251]
[1252]
[1253]
[1254]
[1255]
[1256]
[1257]
[1258]
[1259]
[1260]
[1261]
[1262]
[1263]
[1264]
[1265]
[1266]
[1267]
[1268]
[1269]
[1270]
[1271]
[1272]
[1273]
[1274]
[1275]
[1276]
[1277]
[1278]
[1279]
[1280]
[1281]
[1282]
[1283]
[1284]
[1285]
[1286]
[1287]
[1288]
[1289]
[1290]
[1291]
[1292]
[1293]
[1294]
[1295]
[1296]
[1297]
[1298]
[1299]
[1300]
[1301]
[1302]
[1303]
[1304]
[1305]
[1306]
[1307]
[1308]
[1309]
[1310]
[1311]
[1312]
[1313]
[1314]
[1315]
[1316]
[1317]
[1318]
[1319]
[1320]
[1321]
[1322]
[1323]
[1324]
[1325]
[1326]
[1327]
[1328]
[1329]
[1330]
[1331]
[1332]
[1333]
[1334]
[1335]
[1336]
[1337]
[1338]
[1339]
[1340]
[1341]
[1342]
[1343]
[1344]
[1345]
[1346]
[1347]
[1348]
[1349]
[1350]
[1351]
[1352]
[1353]
[1354]
[1355]
[1356]
[1357]
[1358]
[1359]
[1360]
[1361]
[1362]
[1363]
[1364]
[1365]
[1366]
[1367]
[1368]
[1369]
[1370]
[1371]
[1372]
[1373]
[1374]
[1375]
[1376]
[1377]
[1378]
[1379]
[1380]
[1381]
[1382]
[1383]
[1384]
[1385]
[1386]
[1387]
[1388]
[1389]
[1390]
[1391]
[1392]
[1393]
[1394]
[1395]
[1396]
[1397]
[1398]
[1399]
[1400]
[1401]
[1402]
[1403]
[1404]
[1405]
[1406]
[1407]
[1408]
[1409]
[1410]
[1411]
[1412]
[1413]
[1414]
[1415]
[1416]
[1417]
[1418]
[1419]
[1420]
[1421]
[1422]
[1423]
[1424]
[1425]
[1426]
[1427]
[1428]
[1429]
[1430]
[1431]
[1432]
[1433]
[1434]
[1435]
[1436]
[1437]
[1438]
[1439]
[1440]
[1441]
[1442]
[1443]
[1444]
[1445]
[1446]
[1447]
[1448]
[1449]
[1450]
[1451]
[1452]
[1453]
[1454]
[1455]
[1456]
[1457]
[1458]
[1459]
[1460]
[1461]
[1462]
[1463]
[1464]
[1465]
[1466]
[1467]
[1468]
[1469]
[1470]
[1471]
[1472]
[1473]
[1474]
[1475]
[1476]
[1477]
[1478]
[1479]
[1480]
[1481]
[1482]
[1483]
[1484]
[1485]
[1486]
[1487]
[1488]
[1489]
[1490]
[1491]
[1492]
[1493]
[1494]
[1495]
[1496]
[1497]
[1498]
[1499]
[1500]
[1501]
[1502]
[1503]
[1504]
[1505]
[1506]
[1507]
[1508]
[1509]
[1510]
[1511]
[1512]
[1513]
[1514]
[1515]
[1516]
[1517]
[1518]
[1519]
[1520]
[1521]
[1522]
[1523]
[1524]
[1525]
[1526]
[1527]
[1528]
[1529]
[1530]
[1531]
[1532]
[1533]
[1534]
[1535]
[1536]
[1537]
[1538]
[1539]
[1540]
[1541]
[1542]
[1543]
[1544]
[1545]
[1546]
[1547]
[1548]
[1549]
[1550]
[1551]
[1552]
[1553]
[1554]
[1555]
[1556]
[1557]
[1558]
[1559]
[1560]
[1561]
[1562]
[1563]
[1564]
[1565]
[1566]
[1567]
[1568]
[1569]
[1570]
[1571]
[1572]
[1573]
[1574]
[1575]
[1576]
[1577]
[1578]
[1579]
[1580]
[1581]
[1582]
[1583]
[1584]
[1585]
[1586]
[1587]
[1588]
[1589]
[1590]
[1591]
[1592]
[1593]
[1594]
[1595]
[1596]
[1597]
[1598]
[1599]
[1600]
[1601]
[1602]
[1603]
[1604]
[1605]
[1606]
[1607]
[1608]
[1609]
[1610]
[1611]
[1612]
[1613]
[1614]
[1615]
[1616]
[1617]
[1618]
[1619]
[1620]
[1621]
[1622]
[1623]
[1624]
[1625]
[1626]
[1627]
[1628]
[1629]
[1630]
[1631]
[1632]
[1633]
[1634]
[1635]
[1636]
[1637]
[1638]
[1639]
[1640]
[1641]
[1642]
[1643]
[1644]
[1645]
[1646]
[1647]
[1648]
[1649]
[1650]
[1651]
[1652]
[1653]
[1654]
[1655]
[1656]
[1657]
[1658]
[1659]
[1660]
[1661]
[1662]
[1663]
[1664]
[1665]
[1666]
[1667]
[1668]
[1669]
[1670]
[1671]
[1672]
[1673]
[1674]
[1675]
[1676]
[1677]
[1678]
[1679]
[1680]
[1681]
[1682]
[1683]
[1684]
[1685]
[1686]
[1687]
[1688]
[1689]
[1690]
[1691]
[1692]
[1693]
[1694]
[1695]
[1696]
[1697]
[1698]
[1699]
[1700]
[1701]
[1702]
[1703]
[1704]
[1705]
[1706]
[1707]
[1708]
[1709]
[1710]
[1711]
[1712]
[1713]
[1714]
[1715]
[1716]
[1717]
[1718]
[1719]
[1720]
[1721]
[1722]
[1723]
[1724]
[1725]
[1726]
[1727]
[1728]
[1729]
[1730]
[1731]
[1732]
[1733]
[1734]
[1735]
[1736]
[1737]
[1738]
[1739]
[1740]
[1741]
[1742]
[1743]
[1744]
[1745]
[1746]
[1747]
[1748]
[1749]
[1750]
[1751]
[1752]
[1753]
[1754]
[1755]
[1756]
[1757]
[1758]
[1759]
[1760]
[1761]
[1762]
[1763]
[1764]
[1765]
[1766]
[1767]
[1768]
[1769]
[1770]
[1771]
[1772]
[1773]
[1774]
[1775]
[1776]
[1777]
[1778]
[1779]
[1780]
[1781]
[1782]
[1783]
[1784]
[1785]
[1786]
[1787]
[1788]
[1789]
[1790]
[1791]
[1792]
[1793]
[1794]
[1795]
[1796]
[1797]
[1798]
[1799]
[1800]
[1801]
[1802]
[1803]
[1804]
[1805]
[1806]
[1807]
[1808]
[1809]
[1810]
[1811]
[1812]
[1813]
[1814]
[1815]
[1816]
[1817]
[1818]
[1819]
[1820]
[1821]
[1822]
[1823]
[1824]
[1825]
[1826]
[1827]
[1828]
[1829]
[1830]
[1831]
[1832]
[1833]
[1834]
[1835]
[1836]
[1837]
[1838]
[1839]
[1840]
[1841]
[1842]
[1843]
[1844]
[1845]
[1846]
[1847]
[1848]
[1849]
[1850]
[1851]
[1852]
[1853]
[1854]
[1855]
[1856]
[1857]
[1858]
[1859]
[1860]
[1861]
[1862]
[1863]
[1864]
[1865]
[1866]
[1867]
[1868]
[1869]
[1870]
[1871]
[1872]
[1873]
[1874]
[1875]
[1876]
[1877]
[1878]
[1879]
[1880]
[1881]
[1882]
[1883]
[1884]
[1885]
[1886]
[1887]
[1888]
[1889]
[1890]
[1891]
[1892]
[1893]
[1894]
[1895]
[1896]
[1897]
[1898]
[1899]
[1900]
[1901]
[1902]
[1903]
[1904]
[1905]
[1906]
[1907]
[1908]
[1909]
[1910]
[1911]
[1912]
[1913]
[1914]
[1915]
[1916]
[1917]
[1918]
[1919]
[1920]
[1921]
[1922]
[1923]
[1924]
[1925]
[1926]
[1927]
[1928]
[1929]
[1930]
[1931]
[1932]
[1933]
[1934]
[1935]
[1936]
[1937]
[1938]
[1939]
[1940]
[1941]
[1942]
[1943]
[1944]
[1945]
[1946]
[1947]
[1948]
[1949]
[1950]
[1951]
[1952]
[1953]
[1954]
[1955]
[1956]
[1957]
[1958]
[1959]
[1960]
[1961]
[1962]
[1963]
[1964]
[1965]
[1966]
[1967]
[1968]
[1969]
[1970]
[1971]
[1972]
[1973]
[1974]
[1975]
[1976]
[1977]
[1978]
[1979]
[1980]
[1981]
[1982]
[1983]
[1984]
[1985]
[1986]
[1987]
[1988]
[1989]
[1990]
[1991]
[1992]
[1993]
[1994]
[1995]
[1996]
[1997]
[1998]
[1999]
[2000]
[2001]
[2002]
[2003]
[2004]
[2005]
[2006]
[2007]
[2008]
[2009]
[2010]
[2011]
[2012]
[2013]
[2014]
[2015]
[2016]
[2017]
[2018]
[2019]
[2020]
[2021]
[2022]
[2023]
[2024]
[2025]
[2026]
[2027]
[2028]
[2029]
[2030]
[2031]
[2032]
[2033]
[2034]
[2035]
[2036]
[2037]
[2038]
[2039]
[2040]
[2041]
[2042]
[2043]
[2044]
[2045]
[2046]
[2047]
[2048]
[2049]
[2050]
[2051]
[2052]
[2053]
[2054]
[2055]
[2056]
[2057]
[2058]
[2059]
[2060]
[2061]
[2062]
[2063]
[2064]
[2065]
[2066]
[2067]
[2068]
[2069]
[2070]
[2071]
[2072]
[2073]
[2074]
[2075]
[2076]
[2077]
[2078]
[2079]
[2080]
[2081]
[2082]
[2083]
[2084]
[2085]
[2086]
[2087]
[2088]
[2089]
[2090]
[2091]
[2092]
[2093]
[2094]
[2095]
[2096]
[2097]
[2098]
[2099]
[2100]
[2101]
[2102]
[2103]
[2104]
[2105]
[2106]
[2107]
[2108]
[2109]
[2110]
[2111]
[2112]
[2113]
[2114]
[2115]
[2116]
[2117]
[2118]
[2119]
[2120]
[2121]
[2122]
[2123]
[2124]
[2125]
[2126]
[2127]
[2128]
[2129]
[2130]
[2131]
[2132]
[2133]
[2134]
[2135]
[2136]
[2137]
[2138]
[2139]
[2140]
[2141]
[2142]
[2143]
[2144]
[2145]
[2146]
[2147]
[2148]
[2149]
[2150]
[2151]
[2152]
[2153]
[2154]
[2155]
[2156]
[2157]
[2158]
[2159]
[2160]
[2161]
[2162]
[2163]
[2164]
[2165]
[2166]
[2167]
[2168]
[2169]
[2170]
[2171]
[2172]
[2173]
[2174]
[2175]
[2176]
[2177]
[2178]
[2179]
[2180]
[2181]
[2182]
[2183]
[2184]
[2185]
[2186]
[2187]
[2188]
[2189]
[2190]
[2191]
[2192]
[2193]
[2194]
[2195]
[2196]
[2197]
[2198]
[2199]
[2200]
[2201]
[2202]
[2203]
[2204]
[2205]
[2206]
[2207]
[2208]
[2209]
[2210]
[2211]
[2212]
[2213]
[2214]
[2215]
[2216]
[2217]
[2218]
[2219]
[2220]
[2221]
[2222]
[2223]
[2224]
[2225]
[2226]
[2227]
[2228]
[2229]
[2230]
[2231]
[2232]
[2233]
[2234]
[2235]
[2236]
[2237]
[2238]
[2239]
[2240]
[2241]
[2242]
[2243]
[2244]
[2245]
[2246]
[2247]
[2248]
[2249]
[2250]
[2251]
[2252]
[2253]
[2254]
[2255]
[2256]
[2257]
[2258]
[2259]
[2260]
[2261]
[2262]
[2263]
[2264]
[2265]
[2266]
[2267]
[2268]
[2269]
[2270]
[2271]
[2272]
[2273]
[2274]
[2275]
[2276]
[2277]
[2278]
[2279]
[2280]
[2281]
[2282]
[2283]
[2284]
[2285]
[2286]
[2287]
[2288]
[2289]
[2290]
[2291]
[2292]
[2293]
[2294]
[2295]
[2296]
[2297]
[2298]
[2299]
[2300]
[2301]
[2302]
[2303]
[2304]
[2305]
[2306]
[2307]
[2308]
[2309]
[2310]
[2311]
[2312]
[2313]
[2314]
[2315]
[2316]
[2317]
[2318]
[2319]
[2320]
[2321]
[2322]
[2323]
[2324]
[2325]
[2326]
[2327]
[2328]
[2329]
[2330]
[2331]
[2332]
[2333]
[2334]
[2335]
[2336]
[2337]
[2338]
[2339]
[2340]
[2341]
[2342]
[2343]
[2344]
[2345]
[2346]
[2347]
[2348]
[2349]
[2350]
[2351]
[2352]
[2353]
[2354]
[2355]
[2356]
[2357]
[2358]
[2359]
[2360]
[2361]
[2362]
[2363]
[2364]
[2365]
[2366]
[2367]
[2368]
[2369]
[2370]
[2371]
[2372]
[2373]
[2374]
[2375]
[2376]
[2377]
[2378]
[2379]
[2380]
[2381]
[2382]
[2383]
[2384]
[2385]
[2386]
[2387]
[2388]
[2389]
[2390]
[2391]
[2392]
[2393]
[2394]
[2395]
[2396]
[2397]
[2398]
[2399]
[2400]
[2401]
[2402]
[2403]
[2404]
[2405]
[2406]
[2407]
[2408]
[2409]
[2410]
[2411]
[2412]
[2413]
[2414]
[2415]
[2416]
[2417]
[2418]
[2419]
[2420]
[2421]
[2422]
[2423]
[2424]
[2425]
[2426]
[2427]
[2428]
[2429]
[2430]
[2431]
[2432]
[2433]
[2434]
[2435]
[2436]
[2437]
[2438]
[2439]
[2440]
[2441]
[2442]
[2443]
[2444]
[2445]
[2446]
[2447]
[2448]
[2449]
[2450]
[2451]
[2452]
[2453]
[2454]
[2455]
[2456]
[2457]
[2458]
[2459]
[2460]
[2461]
[2462]
[2463]
[2464]
[2465]
[2466]
[2467]
[2468]
[2469]
[2470]
[2471]
[2472]
[2473]
[2474]
[2475]
[2476]
[2477]
[2478]
[2479]
[2480]
[2481]
[2482]
[2483]
[2484]
[2485]
[2486]
[2487]
[2488]
[2489]
[2490]
[2491]
[2492]
[2493]
[2494]
[2495]
[2496]
[2497]
[2498]
[2499]
[2500]
[2501]
[2502]
[2503]
[2504]
[2505]
[2506]
[2507]
[2508]
[2509]
[2510]
[2511]
[2512]
[2513]
[2514]
[2515]
[2516]
[2517]
[2518]
[2519]
[2520]
[2521]
[2522]
[2523]
[2524]
[2525]
[2526]
[2527]
[2528]
[2529]
[2530]
[2531]
[2532]
[2533]
[2534]
[2535]
[2536]
[2537]
[2538]
[2539]
[2540]
[2541]
[2542]
[2543]
[2544]
[2545]
[2546]
[2547]
[2548]
[2549]
[2550]
[2551]
[2552]
[2553]
[2554]
[2555]
[2556]
[2557]
[2558]
[2559]
[2560]
[2561]
[2562]
[2563]
[2564]
[2565]
[2566]
[2567]
[2568]
[2569]
[2570]
[2571]
[2572]
[2573]
[2574]
[2575]
[2576]
[2577]
[2578]
[2579]
[2580]
[2581]
[2582]
[2583]
[2584]
[2585]
[2586]
[2587]
[2588]
[2589]
[2590]
[2591]
[2592]
[2593]
[2594]
[2595]
[2596]
[2597]
[2598]
[2599]
[2600]
[2601]
[2602]
[2603]
[2604]
[2605]
[2606]
[2607]
[2608]
[2609]
[2610]
[2611]
[2612]
[2613]
[2614]
[2615]
[2616]
[2617]
[2618]
[2619]
[2620]
[2621]
[2622]
[2623]
[2624]
[2625]
[2626]
[2627]
[2628]
[2629]
[2630]
[2631]
[2632]
[2633]
[2634]
[2635]
[2636]
[2637]
[2638]
[2639]
[2640]
[2641]
[2642]
[2643]
[2644]
[2645]
[2646]
[2647]
[2648]
[2649]
[2650]
[2651]
[2652]
[2653]
[2654]
[2655]
[2656]
[2657]
[2658]
[2659]
[2660]
[2661]
[2662]
[2663]
[2664]
[2665]
[2666]
[2667]
[2668]
[2669]
[2670]
[2671]
[2672]
[2673]
[2674]
[2675]
[2676]
[2677]
[2678]
[2679]
[2680]
[2681]
[2682]
[2683]
[2684]
[2685]
[2686]
[2687]
[2688]
[2689]
[2690]
[2691]
[2692]
[2693]
[2694]
[2695]
[2696]
[2697]
[2698]
[2699]
[2700]
[2701]
[2702]
[2703]
[2704]
[2705]
[2706]
[2707]
[2708]
[2709]
[2710]
[2711]
[2712]
[2713]
[2714]
[2715]
[2716]
[2717]
[2718]
[2719]
[2720]
[2721]
[2722]
[2723]
[2724]
[2725]
[2726]
[2727]
[2728]
[2729]
[2730]
[2731]
[2732]
[2733]
[2734]
[2735]
[2736]
[2737]
[2738]
[2739]
[2740]
[2741]
[2742]
[2743]
[2744]
[2745]
[2746]
[2747]
[2748]
[2749]
[2750]
[2751]
[2752]
[2753]
[2754]
[2755]
[2756]
[2757]
[2758]
[2759]
[2760]
[2761]
[2762]
[2763]
[2764]
[2765]
[2766]
[2767]
[2768]
[2769]
[2770]
[2771]
[2772]
[2773]
[2774]
[2775]
[2776]
[2777]
[2778]
[2779]
[2780]
[2781]
[2782]
[2783]
[2784]
[2785]
[2786]
[2787]
[2788]
[2789]
[2790]
[2791]
[2792]
[2793]
[2794]
[2795]
[2796]
[2797]
[2798]
[2799]
[2800]
[2801]
[2802]
[2803]
[2804]
[2805]
[2806]
[2807]
[2808]
[2809]
[2810]
[2811]
[2812]
[2813]
[2814]
[2815]
[2816]
[2817]
[2818]
[2819]
[2820]
[2821]
[2822]
[2823]
[2824]
[2825]
[2826]
[2827]
[2828]
[2829]
[2830]
[2831]
[2832]
[2833]
[2834]
[2835]
[2836]
[2837]
[2838]
[2839]
[2840]
[2841]
[2842]
[2843]
[2844]
[2845]
[2846]
[2847]
[2848]
[2849]
[2850]
[2851]
[2852]
[2853]
[2854]
[2855]
[2856]
[2857]
[2858]
[2859]
[2860]
[2861]
[2862]
[2863]
[2864]
[2865]
[2866]
[2867]
[2868]
[2869]
[2870]
[2871]
[2872]
[2873]
[2874]
[2875]
[2876]
[2877]
[2878]
[2879]
[2880]
[2881]
[2882]
[2883]
[2884]
[2885]
[2886]
[2887]
[2888]
[2889]
[2890]
[2891]
[2892]
[2893]
[2894]
[2895]
[2896]
[2897]
[2898]
[2899]
[2900]
[2901]
[2902]
[2903]
[2904]
[2905]
[2906]
[2907]
[2908]
[2909]
[2910]
[2911]
[2912]
[2913]
[2914]
[2915]
[2916]
[2917]
[2918]
[2919]
[2920]
[2921]
[2922]
[2923]
[2924]
[2925]
[2926]
[2927]
[2928]
[2929]
[2930]
[2931]
[2932]
[2933]
[2934]
[2935]
[2936]
[2937]
[2938]
[2939]
[2940]
[2941]
[2942]
[2943]
[2944]
[2945]
[2946]
[2947]
[2948]
[2949]
[2950]
[2951]
[2952]
[2953]
[2954]
[2955]
[2956]
[2957]
[2958]
[2959]
[2960]
[2961]
[2962]
[2963]
[2964]
[2965]
[2966]
[2967]
[2968]
[2969]
[2970]
[2971]
[2972]
[2973]
[2974]
[2975]
[2976]
[2977]
[2978]
[2979]
[2980]
[2981]
[2982]
[2983]
[2984]
[2985]
[2986]
[2987]
[2988]
[2989]
[2990]
[2991]
[2992]
[2993]
[2994]
[2995]
[2996]
[2997]
[2998]
[2999]
[3000]
[3001]
[3002]
[3003]
[3004]
[3005]
[3006]
[3007]
[3008]
[3009]
[3010]
[3011]
[3012]
[3013]
[3014]
[3015]
[3016]
[3017]
[3018]
[3019]
[3020]
[3021]
[3022]
[3023]
[3024]
[3025]
[3026]
[3027]
[3028]
[3029]
[3030]
[3031]
[3032]
[3033]
[3034]
[3035]
[3036]
[3037]
[3038]
[3039]
[3040]
[3041]
[3042]
[3043]
[3044]
[3045]
[3046]
[3047]
[3048]
[3049]
[3050]
[3051]
[3052]
[3053]
[3054]
[3055]
[3056]
[3057]
[3058]
[3059]
[3060]
[3061]
[3062]
[3063]
[3064]
[3065]
[3066]
[3067]
[3068]
[3069]
[3070]
[3071]
[3072]
[3073]
[3074]
[3075]
[3076]
[3077]
[3078]
[3079]
[3080]
[3081]
[3082]
[3083]
[3084]
[3085]
[3086]
[3087]
[3088]
[3089]
[3090]
[3091]
[3092]
[3093]
[3094]
[3095]
[3096]
[3097]
[3098]
[3099]
[3100]
[3101]
[3102]
[3103]
[3104]
[3105]
[3106]
[3107]
[3108]
[3109]
[3110]
[3111]
[3112]
[3113]
[3114]
[3115]
[3116]
[3117]
[3118]
[3119]
[3120]
[3121]
[3122]
[3123]
[3124]
[3125]
[3126]
[3127]
[3128]
[3129]
[3130]
[3131]
[3132]
[3133]
[3134]
[3135]
[3136]
[3137]
[3138]
[3139]
[3140]
[3141]
[3142]
[3143]
[3144]
[3145]
[3146]
[3147]
[3148]
[3149]
[3150]
[3151]
[3152]
[3153]
[3154]
[3155]
[3156]
[3157]
[3158]
[3159]
[3160]
[3161]
[3162]
[3163]
[3164]
[3165]
[3166]
[3167]
[3168]
[3169]
[3170]
[3171]
[3172]
[3173]
[3174]
[3175]
[3176]
[3177]
[3178]
[3179]
[3180]
[3181]
[3182]
[3183]
[3184]
[3185]
[3186]
[3187]
[3188]
[3189]
[3190]
[3191]
[3192]
[3193]
[3194]
[3195]
[3196]
[3197]
[3198]
[3199]
[3200]
[3201]
[3202]
[3203]
[3204]
[3205]
[3206]
[3207]
[3208]
[3209]
[3210]
[3211]
[3212]
[3213]
[3214]
[3215]
[3216]
[3217]
[3218]
[3219]
[3220]
[3221]
[3222]
[3223]
[3224]
[3225]
[3226]
[3227]
[3228]
[3229]
[3230]
[3231]
[3232]
[3233]
[3234]
[3235]
[3236]
[3237]
[3238]
[3239]
[3240]
[3241]
[3242]
[3243]
[3244]
[3245]
[3246]
[3247]
[3248]
[3249]
[3250]
[3251]
[3252]
[3253]
[3254]
[3255]
[3256]
[3257]
[3258]
[3259]
[3260]
[3261]
[3262]
[3263]
[3264]
[3265]
[3266]
[3267]
[3268]
[3269]
[3270]
[3271]
[3272]
[3273]
[3274]
[3275]
[3276]
[3277]
[3278]
[3279]
[3280]
[3281]
[3282]
[3283]
[3284]
[3285]
[3286]
[3287]
[3288]
[3289]
[3290]
[3291]
[3292]
[3293]
[3294]
[3295]
[3296]
[3297]
[3298]
[3299]
[3300]
[3301]
[3302]
[3303]
[3304]
[3305]
[3306]
[3307]
[3308]
[3309]
[3310]
[3311]
[3312]
[3313]
[3314]
[3315]
[3316]
[3317]
[3318]
[3319]
[3320]
[3321]
[3322]
[3323]
[3324]
[3325]
[3326]
[3327]
[3328]
[3329]
[3330]
[3331]
[3332]
[3333]
[3334]
[3335]
[3336]
[3337]
[3338]
[3339]
[3340]
[3341]
[3342]
[3343]
[3344]
[3345]
[3346]
[3347]
[3348]
[3349]
[3350]
[3351]
[3352]
[3353]
[3354]
[3355]
[3356]
[3357]
[3358]
[3359]
[3360]
[3361]
[3362]
[3363]
[3364]
[3365]
[3366]
[3367]
[3368]
[3369]
[3370]
[3371]
[3372]
[3373]
[3374]
[3375]
[3376]
[3377]
[3378]
[3379]
[3380]
[3381]
[3382]
[3383]
[3384]
[3385]
[3386]
[3387]
[3388]
[3389]
[3390]
[3391]
[3392]
[3393]
[3394]
[3395]
[3396]
[3397]
[3398]
[3399]
[3400]
[3401]
[3402]
[3403]
[3404]
[3405]
[3406]
[3407]
[3408]
[3409]
[3410]
[3411]
[3412]
[3413]
[3414]
[3415]
[3416]
[3417]
[3418]
[3419]
[3420]
[3421]
[3422]
[3423]
[3424]
[3425]
[3426]
[3427]
[3428]
[3429]
[3430]
[3431]
[3432]
[3433]
[3434]
[3435]
[3436]
[3437]
[3438]
[3439]
[3440]
[3441]
[3442]
[3443]
[3444]
[3445]
[3446]
[3447]
[3448]
[3449]
[3450]
[3451]
[3452]
[3453]
[3454]
[3455]
[3456]
[3457]
[3458]
[3459]
[3460]
[3461]
[3462]
[3463]
[3464]
[3465]
[3466]
[3467]
[3468]
[3469]
[3470]
[3471]
[3472]
[3473]
[3474]
[3475]
[3476]
[3477]
[3478]
[3479]
[3480]
[3481]
[3482]
[3483]
[3484]
[3485]
[3486]
[3487]
[3488]
[3489]
[3490]
[3491]
[3492]
[3493]
[3494]
[3495]
[3496]
[3497]
[3498]
[3499]
[3500]
[3501]
[3502]
[3503]
[3504]
[3505]
[3506]
[3507]
[3508]
[3509]
[3510]
[3511]
[3512]
[3513]
[3514]
[3515]
[3516]
[3517]
[3518]
[3519]
[3520]
[3521]
[3522]
[3523]
[3524]
[3525]
[3526]
[3527]
[3528]
[3529]
[3530]
[3531]
[3532]
[3533]
[3534]
[3535]
[3536]
[3537]
[3538]
[3539]
[3540]
[3541]
[3542]
[3543]
[3544]
[3545]
[3546]
[3547]
[3548]
[3549]
[3550]
[3551]
[3552]
[3553]
[3554]
[3555]
[3556]
[3557]
[3558]
[3559]
[3560]
[3561]
[3562]
[3563]
[3564]
[3565]
[3566]
[3567]
[3568]
[3569]
[3570]
[3571]
[3572]
[3573]
[3574]
[3575]
[3576]
[3577]
[3578]
[3579]
[3580]
[3581]
[3582]
[3583]
[3584]
[3585]
[3586]
[3587]
[3588]
[3589]
[3590]
[3591]
[3592]
[3593]
[3594]
[3595]
[3596]
[3597]
[3598]
[3599]
[3600]
[3601]
[3602]
[3603]
[3604]
[3605]
[3606]
[3607]
[3608]
[3609]
[3610]
[3611]
[3612]
[3613]
[3614]
[3615]
[3616]
[3617]
[3618]
[3619]
[3620]
[3621]
[3622]
[3623]
[3624]
[3625]
[3626]
[3627]
[3628]
[3629]
[3630]
[3631]
[3632]
[3633]
[3634]
[3635]
[3636]
[3637]
[3638]
[3639]
[3640]
[3641]
[3642]
[3643]
[3644]
[3645]
[3646]
[3647]
[3648]
[3649]
[3650]
[3651]
[3652]
[3653]
[3654]
[3655]
[3656]
[3657]
[3658]
[3659]
[3660]
[3661]
[3662]
[3663]
[3664]
[3665]
[3666]
[3667]
[3668]
[3669]
[3670]
[3671]
[3672]
[3673]
[3674]
[3675]
[3676]
[3677]
[3678]
[3679]
[3680]
[3681]
[3682]
[3683]
[3684]
[3685]
[3686]
[3687]
[3688]
[3689]
[3690]
[3691]
[3692]
[3693]
[3694]
[3695]
[3696]
[3697]
[3698]
[3699]
[3700]
[3701]
[3702]
[3703]
[3704]
[3705]
[3706]
[3707]
[3708]
[3709]
[3710]
[3711]
[3712]
[3713]
[3714]
[3715]
[3716]
[3717]
[3718]
[3719]
[3720]
[3721]
[3722]
[3723]
[3724]
[3725]
[3726]
[3727]
[3728]
[3729]
[3730]
[3731]
[3732]
[3733]
[3734]
[3735]
[3736]
[3737]
[3738]
[3739]
[3740]
[3741]
[3742]
[3743]
[3744]
[3745]
[3746]
[3747]
[3748]
[3749]
[3750]
[3751]
[3752]
[3753]
[3754]
[3755]
[3756]
[3757]
[3758]
[3759]
[3760]
[3761]
[3762]
[3763]
[3764]
[3765]
[3766]
[3767]
[3768]
[3769]
[3770]
[3771]
[3772]
[3773]
[3774]
[3775]
[3776]
[3777]
[3778]
[3779]
[3780]
[3781]
[3782]
[3783]
[3784]
[3785]
[3786]
[3787]
[3788]
[3789]
[3790]
[3791]
[3792]
[3793]
[3794]
[3795]
[3796]
[3797]
[3798]
[3799]
[3800]
[3801]
[3802]
[3803]
[3804]
[3805]
[3806]
[3807]
[3808]
[3809]
[3810]
[3811]
[3812]
[3813]
[3814]
[3815]
[3816]
[3817]
[3818]
[3819]
[3820]
[3821]
[3822]
[3823]
[3824]
[3825]
[3826]
[3827]
[3828]
[3829]
[3830]
[3831]
[3832]
[3833]
[3834]
[3835]
[3836]
[3837]
[3838]
[3839]
[3840]
[3841]
[3842]
[3843]
[3844]
[3845]
[3846]
[3847]
[3848]
[3849]
[3850]
[3851]
[3852]
[3853]
[3854]
[3855]
[3856]
[3857]
[3858]
[3859]
[3860]
[3861]
[3862]
[3863]
[3864]
[3865]
[3866]
[3867]
[3868]
[3869]
[3870]
[3871]
[3872]
[3873]
[3874]
[3875]
[3876]
[3877]
[3878]
[3879]
[3880]
[3881]
[3882]
[3883]
[3884]
[3885]
[3886]
[3887]
[3888]
[3889]
[3890]
[3891]
[3892]
[3893]
[3894]
[3895]
[3896]
[3897]
[3898]
[3899]
[3900]
[3901]
[3902]
[3903]
[3904]
[3905]
[3906]
[3907]
[3908]
[3909]
[3910]
[3911]
[3912]
[3913]
[3914]
[3915]
[3916]
[3917]
[3918]
[3919]
[3920]
[3921]
[3922]
[3923]
[3924]
[3925]
[3926]
[3927]
[3928]
[3929]
[3930]
[3931]
[3932]
[3933]
[3934]
[3935]
[3936]
[3937]
[3938]
[3939]
[3940]
[3941]
[3942]
[3943]
[3944]
[3945]
[3946]
[3947]
[3948]
[3949]
[3950]
[3951]
[3952]
[3953]
[3954]
[3955]
[3956]
[3957]
[3958]
[3959]
[3960]
[3961]
[3962]
[3963]
[3964]
[3965]
[3966]
[3967]
[3968]
[3969]
[3970]
[3971]
[3972]
[3973]
[3974]
[3975]
[3976]
[3977]
[3978]
[3979]
[3980]
[3981]
[3982]
[3983]
[3984]
[3985]
[3986]
[3987]
[3988]
[3989]
[3990]
[3991]
[3992]
[3993]
[3994]
[3995]
[3996]
[3997]
[3998]
[3999]
[4000]
[4001]
[4002]
[4003]
[4004]
[4005]
[4006]
[4007]
[4008]
[4009]
[4010]
[4011]
[4012]
[4013]
[4014]
[4015]
[4016]
[4017]
[4018]
[4019]
[4020]
[4021]
[4022]
[4023]
[4024]
[4025]
[4026]
[4027]
[4028]
[4029]
[4030]
[4031]
[4032]
[4033]
[4034]
[4035]
[4036]
[4037]
[4038]
[4039]
[4040]
[4041]
[4042]
[4043]
[4044]
[4045]
[4046]
[4047]
[4048]
[4049]
[4050]
[4051]
[4052]
[4053]
[4054]
[4055]
[4056]
[4057]
[4058]
[4059]
[4060]
[4061]
[4062]
[4063]
[4064]
[4065]
[4066]
[4067]
[4068]
[4069]
[4070]
[4071]
[4072]
[4073]
[4074]
[4075]
[4076]
[4077]
[4078]
[4079]
[4080]
[4081]
[4082]
[4083]
[4084]
[4085]
[4086]
[4087]
[4088]
[4089]
[4090]
[4091]
[4092]
[4093]
[4094]
[4095]
[4096]
[4097]
[4098]
[4099]
[4100]
[4101]
[4102]
[4103]
[4104]
[4105]
[4106]
[4107]
[4108]
[4109]
[4110]
[4111]
[4112]
[4113]
[4114]
[4115]
[4116]
[4117]
[4118]
[4119]
[4120]
[4121]
[4122]
[4123]
[4124]
[4125]
[4126]
[4127]
[4128]
[4129]
[4130]
[4131]
[4132]
[4133]
[4134]
[4135]
[4136]
[4137]
[4138]
[4139]
[4140]
[4141]
[4142]
[4143]
[4144]
[4145]
[4146]
[4147]
[4148]
[4149]
[4150]
[4151]
[4152]
[4153]
[4154]
[4155]
[4156]
[4157]
[4158]
[4159]
[4160]
[4161]
[4162]
[4163]
[4164]
[4165]
[4166]
[4167]
[4168]
[4169]
[4170]
[4171]
[4172]
[4173]
[4174]
[4175]
[4176]
[4177]
[4178]
[4179]
[4180]
[4181]
[4182]
[4183]
[4184]
[4185]
[4186]
[4187]
[4188]
[4189]
[4190]
[4191]
[4192]
[4193]
[4194]
[4195]
[4196]
[4197]
[4198]
[4199]
[4200]
[4201]
[4202]
[4203]
[4204]
[4205]
[4206]
[4207]
[4208]
[4209]
[4210]
[4211]
[4212]
[4213]
[4214]
[4215]
[4216]
[4217]
[4218]
[4219]
[4220]
[4221]
[4222]
[4223]
[4224]
[4225]
[4226]
[4227]
[4228]
[4229]
[4230]
[4231]
[4232]
[4233]
[4234]
[4235]
[4236]
[4237]
[4238]
[4239]
[4240]
[4241]
[4242]
[4243]
[4244]
[4245]
[4246]
[4247]
[4248]
[4249]
[4250]
[4251]
[4252]
[4253]
[4254]
[4255]
[4256]
[4257]
[4258]
[4259]
[4260]
[4261]
[4262]
[4263]
[4264]
[4265]
[4266]
[4267]
[4268]
[4269]
[4270]
[4271]
[4272]
[4273]
[4274]
[4275]
[4276]
[4277]
[4278]
[4279]
[4280]
[4281]
[4282]
[4283]
[4284]
[4285]
[4286]
[4287]
[4288]
[4289]
[4290]
[4291]
[4292]
[4293]
[4294]
[4295]
[4296]
[4297]
[4298]
[4299]
[4300]
[4301]
[4302]
[4303]
[4304]
[4305]
[4306]
[4307]
[4308]
[4309]
[4310]
[4311]
[4312]
[4313]
[4314]
[4315]
[4316]
[4317]
[4318]
[4319]
[4320]
[4321]
[4322]
[4323]
[4324]
[4325]
[4326]
[4327]
[4328]
[4329]
[4330]
[4331]
[4332]
[4333]
[4334]
[4335]
[4336]
[4337]
[4338]
[4339]
[4340]
[4341]
[4342]
[4343]
[4344]
[4345]
[4346]
[4347]
[4348]
[4349]
[4350]
[4351]
[4352]
[4353]
[4354]
[4355]
[4356]
[4357]
[4358]
[4359]
[4360]
[4361]
[4362]
[4363]
[4364]
[4365]
[4366]
[4367]
[4368]
[4369]
[4370]
[4371]
[4372]
[4373]
[4374]
[4375]
[4376]
[4377]
[4378]
[4379]
[4380]
[4381]
[4382]
[4383]
[4384]
[4385]
[4386]
[4387]
[4388]
[4389]
[4390]
[4391]
[4392]
[4393]
[4394]
[4395]
[4396]
[4397]
[4398]
[4399]
[4400]
[4401]
[4402]
[4403]
[4404]
[4405]
[4406]
[4407]
[4408]
[4409]
[4410]
[4411]
[4412]
[4413]
[4414]
[4415]
[4416]
[4417]
[4418]
[4419]
[4420]
[4421]
[4422]
[4423]
[4424]
[4425]
[4426]
[4427]
[4428]
[4429]
[4430]
[4431]
[4432]
[4433]
[4434]
[4435]
[4436]
[4437]
[4438]
[4439]
[4440]
[4441]
[4442]
[4443]
[4444]
[4445]
[4446]
[4447]
[4448]
[4449]
[4450]
[4451]
[4452]
[4453]
[4454]
[4455]
[4456]
[4457]
[4458]
[4459]
[4460]
[4461]
[4462]
[4463]
[4464]
[4465]
[4466]
[4467]
[4468]
[4469]
[4470]
[4471]
[4472]
[4473]
[4474]
[4475]
[4476]
[4477]
[4478]
[4479]
[4480]
[4481]
[4482]
[4483]
[4484]
[4485]
[4486]
[4487]
[4488]
[4489]
[4490]
[4491]
[4492]
[4493]
[4494]
[4495]
[4496]
[4497]
[4498]
[4499]
[4500]
[4501]
[4502]
[4503]
[4504]
[4505]
[4506]
[4507]
[4508]
[4509]
[4510]
[4511]
[4512]
[4513]
[4514]
[4515]
[4516]
[4517]
[4518]
[4519]
[4520]
[4521]
[4522]
[4523]
[4524]
[4525]
[4526]
[4527]
[4528]
[4529]
[4530]
[4531]
[4532]
[4533]
[4534]
[4535]
[4536]
[4537]
[4538]
[4539]
[4540]
[4541]
[4542]
[4543]
[4544]
[4545]
[4546]
[4547]
[4548]
[4549]
[4550]
[4551]
[4552]
[4553]
[4554]
[4555]
[4556]
[4557]
[4558]
[4559]
[4560]
[4561]
[4562]
[4563]
[4564]
[4565]
[4566]
[4567]
[4568]
[4569]
[4570]
[4571]
[4572]
[4573]
[4574]
[4575]
[4576]
[4577]
[4578]
[4579]
[4580]
[4581]
[4582]
[4583]
[4584]
[4585]
[4586]
[4587]
[4588]
[4589]
[4590]
[4591]
[4592]
[4593]
[4594]
[4595]
[4596]
[4597]
[4598]
[4599]
[4600]
[4601]
[4602]
[4603]
[4604]
[4605]
[4606]
[4607]
[4608]
[4609]
[4610]
[4611]
[4612]
[4613]
[4614]
[4615]
[4616]
[4617]
[4618]
[4619]
[4620]
[4621]
[4622]
[4623]
[4624]
[4625]
[4626]
[4627]
[4628]
[4629]
[4630]
[4631]
[4632]
[4633]
[4634]
[4635]
[4636]
[4637]
[4638]
[4639]
[4640]
[4641]
[4642]
[4643]
[4644]
[4645]
[4646]
[4647]
[4648]
[4649]
[4650]
[4651]
[4652]
[4653]
[4654]
[4655]
[4656]
[4657]
[4658]
[4659]
[4660]
[4661]
[4662]
[4663]
[4664]
[4665]
[4666]
[4667]
[4668]
[4669]
[4670]
[4671]
[4672]
[4673]
[4674]
[4675]
[4676]
[4677]
[4678]
[4679]
[4680]
[4681]
[4682]
[4683]
[4684]
[4685]
[4686]
[4687]
[4688]
[4689]
[4690]
[4691]
[4692]
[4693]
[4694]
[4695]
[4696]
[4697]
[4698]
[4699]
[4700]
[4701]
[4702]
[4703]
[4704]
[4705]
[4706]
[4707]
[4708]
[4709]
[4710]
[4711]
[4712]
[4713]
[4714]
[4715]
[4716]
[4717]
[4718]
[4719]
[4720]
[4721]
[4722]
[4723]
[4724]
[4725]
[4726]
[4727]
[4728]
[4729]
[4730]
[4731]
[4732]
[4733]
[4734]
[4735]
[4736]
[4737]
[4738]
[4739]
[4740]
[4741]
[4742]
[4743]
[4744]
[4745]
[4746]
[4747]
[4748]
[4749]
[4750]
[4751]
[4752]
[4753]
[4754]
[4755]
[4756]
[4757]
[4758]
[4759]
[4760]
[4761]
[4762]
[4763]
[4764]
[4765]
[4766]
[4767]
[4768]
[4769]
[4770]
[4771]
[4772]
[4773]
[4774]
[4775]
[4776]
[4777]
[4778]
[4779]
[4780]
[4781]
[4782]
[4783]
[4784]
[4785]
[4786]
[4787]
[4788]
[4789]
[4790]
[4791]
[4792]
[4793]
[4794]
[4795]
[4796]
[4797]
[4798]
[4799]
[4800]
[4801]
[4802]
[4803]
[4804]
[4805]
[4806]
[4807]
[4808]
[4809]
[4810]
[4811]
[4812]
[4813]
[4814]
[4815]
[4816]
[4817]
[4818]
[4819]
[4820]
[4821]
[4822]
[4823]
[4824]
[4825]
[4826]
[4827]
[4828]
[4829]
[4830]
[4831]
[4832]
[4833]
[4834]
[4835]
[4836]
[4837]
[4838]
[4839]
[4840]
[4841]
[4842]
[4843]
[4844]
[4845]
[4846]
[4847]
[4848]
[4849]
[4850]
[4851]
[4852]
[4853]
[4854]
[4855]
[4856]
[4857]
[4858]
[4859]
[4860]
[4861]
[4862]
[4863]
[4864]
[4865]
[4866]
[4867]
[4868]
[4869]
[4870]
[4871]
[4872]
[4873]
[4874]
[4875]
[4876]
[4877]
[4878]
[4879]
[4880]
[4881]
[4882]
[4883]
[4884]
[4885]
[4886]
[4887]
[4888]
[4889]
[4890]
[4891]
[4892]
[4893]
[4894]
[4895]
[4896]
[4897]
[4898]
[4899]
[4900]
[4901]
[4902]
[4903]
[4904]
[4905]
[4906]
[4907]
[4908]
[4909]
[4910]
[4911]
[4912]
[4913]
[4914]
[4915]
[4916]
[4917]
[4918]
[4919]
[4920]
[4921]
[4922]
[4923]
[4924]
[4925]
[4926]
[4927]
[4928]
[4929]
[4930]
[4931]
[4932]
[4933]
[4934]
[4935]
[4936]
[4937]
[4938]
[4939]
[4940]
[4941]
[4942]
[4943]
[4944]
[4945]
[4946]
[4947]
[4948]
[4949]
[4950]
[4951]
[4952]
[4953]
[4954]
[4955]
[4956]
[4957]
[4958]
[4959]
[4960]
[4961]
[4962]
[4963]
[4964]
[4965]
[4966]
[4967]
[4968]
[4969]
[4970]
[4971]
[4972]
[4973]
[4974]
[4975]
[4976]
[4977]
[4978]
[4979]
[4980]
[4981]
[4982]
[4983]
[4984]
[4985]
[4986]
[4987]
[4988]
[4989]
[4990]
[4991]
[4992]
[4993]
[4994]
[4995]
[4996]
[4997]
[4998]
[4999]
[5000]
[5001]
[5002]
[5003]
[5004]
[5005]
[5006]
[5007]
[5008]
[5009]
[5010]
[5011]
[5012]
[5013]
[5014]
[5015]
[5016]
[5017]
[5018]
[5019]
[5020]
[5021]
[5022]
[5023]
[5024]
[5025]
[5026]
[5027]
[5028]
[5029]
[5030]
[5031]
[5032]
[5033]
[5034]
[5035]
[5036]
[5037]
[5038]
[5039]
[5040]
[5041]
[5042]
[5043]
[5044]
[5045]
[5046]
[5047]
[5048]
[5049]
[5050]
[5051]
[5052]
[5053]
[5054]
[5055]
[5056]
[5057]
[5058]
[5059]
[5060]
[5061]
[5062]
[5063]
[5064]
[5065]
[5066]
[5067]
[5068]
[5069]
[5070]
[5071]
[5072]
[5073]
[5074]
[5075]
[5076]
[5077]
[5078]
[5079]
[5080]
[5081]
[5082]
[5083]
[5084]
[5085]
[5086]
[5087]
[5088]
[5089]
[5090]
[5091]
[5092]
[5093]
[5094]
[5095]
[5096]
[5097]
[5098]
[5099]
[5100]
[5101]
[5102]
[5103]
[5104]
[5105]
[5106]
[5107]
[5108]
[5109]
[5110]
[5111]
[5112]
[5113]
[5114]
[5115]
[5116]
[5117]
[5118]
[5119]
[5120]
[5121]
[5122]
[5123]
[5124]
[5125]
[5126]
[5127]
[5128]
[5129]
[5130]
[5131]
[5132]
[5133]
[5134]
[5135]
[5136]
[5137]
[5138]
[5139]
[5140]
[5141]
[5142]
[5143]
[5144]
[5145]
[5146]
[5147]
[5148]
[5149]
[5150]
[5151]
[5152]
[5153]
[5154]
[5155]
[5156]
[5157]
[5158]
[5159]
[5160]
[5161]
[5162]
[5163]
[5164]
[5165]
[5166]
[5167]
[5168]
[5169]
[5170]
[5171]
[5172]
[5173]
[5174]
[5175]
[5176]
[5177]
[5178]
[5179]
[5180]
[5181]
[5182]
[5183]
[5184]
[5185]
[5186]
[5187]
[5188]
[5189]
[5190]
[5191]
[5192]
[5193]
[5194]
[5195]
[5196]
[5197]
[5198]
[5199]
[5200]
[5201]
[5202]
[5203]
[5204]
[5205]
[5206]
[5207]
[5208]
[5209]
[5210]
[5211]
[5212]
[5213]
[5214]
[5215]
[5216]
[5217]
[5218]
[5219]
[5220]
[5221]
[5222]
[5223]
[5224]
[5225]
[5226]
[5227]
[5228]
[5229]
[5230]
[5231]
[5232]
[5233]
[5234]
[5235]
[5236]
[5237]
[5238]
[5239]
[5240]
[5241]
[5242]
[5243]
[5244]
[5245]
[5246]
[5247]
[5248]
[5249]
[5250]
[5251]
[5252]
[5253]
[5254]
[5255]
[5256]
[5257]
[5258]
[5259]
[5260]
[5261]
[5262]
[5263]
[5264]
[5265]
[5266]
[5267]
[5268]
[5269]
[5270]
[5271]
[5272]
[5273]
[5274]
[5275]
[5276]
[5277]
[5278]
[5279]
[5280]
[5281]
[5282]
[5283]
[5284]
[5285]
[5286]
[5287]
[5288]
[5289]
[5290]
[5291]
[5292]
[5293]
[5294]
[5295]
[5296]
[5297]
[5298]
[5299]
[5300]
[5301]
[5302]
[5303]
[5304]
[5305]
[5306]
[5307]
[5308]
[5309]
[5310]
[5311]
[5312]
[5313]
[5314]
[5315]
[5316]
[5317]
[5318]
[5319]
[5320]
[5321]
[5322]
[5323]
[5324]
[5325]
[5326]
[5327]
[5328]
[5329]
[5330]
[5331]
[5332]
[5333]
[5334]
[5335]
[5336]
[5337]
[5338]
[5339]
[5340]
[5341]
[5342]
[5343]
[5344]
[5345]
[5346]
[5347]
[5348]
[5349]
[5350]
[5351]
[5352]
[5353]
[5354]
[5355]
[5356]
[5357]
[5358]
[5359]
[5360]
[5361]
[5362]
[5363]
[5364]
[5365]
[5366]
[5367]
[5368]
[5369]
[5370]
[5371]
[5372]
[5373]
[5374]
[5375]
[5376]
[5377]
[5378]
[5379]
[5380]
[5381]
[5382]
[5383]
[5384]
[5385]
[5386]
[5387]
[5388]
[5389]
[5390]
[5391]
[5392]
[5393]
[5394]
[5395]
[5396]
[5397]
[5398]
[5399]
[5400]
[5401]
[5402]
[5403]
[5404]
[5405]
[5406]
[5407]
[5408]
[5409]
[5410]
[5411]
[5412]
[5413]
[5414]
[5415]
[5416]
[5417]
[5418]
[5419]
[5420]
[5421]
[5422]
[5423]
[5424]
[5425]
[5426]
[5427]
[5428]
[5429]
[5430]
[5431]
[5432]
[5433]
[5434]
[5435]
[5436]
[5437]
[5438]
[5439]
[5440]
[5441]
[5442]
[5443]
[5444]
[5445]
[5446]
[5447]
[5448]
[5449]
[5450]
[5451]
[5452]
[5453]
[5454]
[5455]
[5456]
[5457]
[5458]
[5459]
[5460]
[5461]
[5462]
[5463]
[5464]
[5465]
[5466]
[5467]
[5468]
[5469]
[5470]
[5471]
[5472]
[5473]
[5474]
[5475]
[5476]
[5477]
[5478]
[5479]
[5480]
[5481]
[5482]
[5483]
[5484]
[5485]
[5486]
[5487]
[5488]
[5489]
[5490]
[5491]
[5492]
[5493]
[5494]
[5495]
[5496]
[5497]
[5498]
[5499]
[5500]
[5501]
[5502]
[5503]
[5504]
[5505]
[5506]
[5507]
[5508]
[5509]
[5510]
[5511]
[5512]
[5513]
[5514]
[5515]
[5516]
[5517]
[5518]
[5519]
[5520]
[5521]
[5522]
[5523]
[5524]
[5525]
[5526]
[5527]
[5528]
[5529]
[5530]
[5531]
[5532]
[5533]
[5534]
[5535]
[5536]
[5537]
[5538]
[5539]
[5540]
[5541]
[5542]
[5543]
[5544]
[5545]
[5546]
[5547]
[5548]
[5549]
[5550]
[5551]
[5552]
[5553]
[5554]
[5555]
[5556]
[5557]
[5558]
[5559]
[5560]
[5561]
[5562]
[5563]
[5564]
[5565]
[5566]
[5567]
[5568]
[5569]
[5570]
[5571]
[5572]
[5573]
[5574]
[5575]
[5576]
[5577]
[5578]
[5579]
[5580]
[5581]
[5582]
[5583]
[5584]
[5585]
[5586]
[5587]
[5588]
[5589]
[5590]
[5591]
[5592]
[5593]
[5594]
[5595]
[5596]
[5597]
[5598]
[5599]
[5600]
[5601]
[5602]
[5603]
[5604]
[5605]
[5606]
[5607]
[5608]
[5609]
[5610]
[5611]
[5612]
[5613]
[5614]
[5615]
[5616]
[5617]
[5618]
[5619]
[5620]
[5621]
[5622]
[5623]
[5624]
[5625]
[5626]
[5627]
[5628]
[5629]
[5630]
[5631]
[5632]
[5633]
[5634]
[5635]
[5636]
[5637]
[5638]
[5639]
[5640]
[5641]
[5642]
[5643]
[5644]
[5645]
[5646]
[5647]
[5648]
[5649]
[5650]
[5651]
[5652]
[5653]
[5654]
[5655]
[5656]
[5657]
[5658]
[5659]
[5660]
[5661]
[5662]
[5663]
[5664]
[5665]
[5666]
[5667]
[5668]
[5669]
[5670]
[5671]
[5672]
[5673]
[5674]
[5675]
[5676]
[5677]
[5678]
[5679]
[5680]
[5681]
[5682]
[5683]
[5684]
[5685]
[5686]
[5687]
[5688]
[5689]
[5690]
[5691]
[5692]
[5693]
[5694]
[5695]
[5696]
[5697]
[5698]
[5699]
[5700]
[5701]
[5702]
[5703]
[5704]
[5705]
[5706]
[5707]
[5708]
[5709]
[5710]
[5711]
[5712]
[5713]
[5714]
[5715]
[5716]
[5717]
[5718]
[5719]
[5720]
[5721]
[5722]
[5723]
[5724]
[5725]
[5726]
[5727]
[5728]
[5729]
[5730]
[5731]
[5732]
[5733]
[5734]
[5735]
[5736]
[5737]
[5738]
[5739]
[5740]
[5741]
[5742]
[5743]
[5744]
[5745]
[5746]
[5747]
[5748]
[5749]
[5750]
[5751]
[5752]
[5753]
[5754]
[5755]
[5756]
[5757]
[5758]
[5759]
[5760]
[5761]
[5762]
[5763]
[5764]
[5765]
[5766]
[5767]
[5768]
[5769]
[5770]
[5771]
[5772]
[5773]
[5774]
[5775]
[5776]
[5777]
[5778]
[5779]
[5780]
[5781]
[5782]
[5783]
[5784]
[5785]
[5786]
[5787]
[5788]
[5789]
[5790]
[5791]
[5792]
[5793]
[5794]
[5795]
[5796]
[5797]
[5798]
[5799]
[5800]
[5801]
[5802]
[5803]
[5804]
[5805]
[5806]
[5807]
[5808]
[5809]
[5810]
[5811]
[5812]
[5813]
[5814]
[5815]
[5816]
[5817]
[5818]
[5819]
[5820]
[5821]
[5822]
[5823]
[5824]
[5825]
[5826]
[5827]
[5828]
[5829]
[5830]
[5831]
[5832]
[5833]
[5834]
[5835]
[5836]
[5837]
[5838]
[5839]
[5840]
[5841]
[5842]
[5843]
[5844]
[5845]
[5846]
[5847]
[5848]
[5849]
[5850]
[5851]
[5852]
[5853]
[5854]
[5855]
[5856]
[5857]
[5858]
[5859]
[5860]
[5861]
[5862]
[5863]
[5864]
[5865]
[5866]
[5867]
[5868]
[5869]
[5870]
[5871]
[5872]
[5873]
[5874]
[5875]
[5876]
[5877]
[5878]
[5879]
[5880]
[5881]
[5882]
[5883]
[5884]
[5885]
[5886]
[5887]
[5888]
[5889]
[5890]
[5891]
[5892]
[5893]
[5894]
[5895]
[5896]
[5897]
[5898]
[5899]
[5900]
[5901]
[5902]
[5903]
[5904]
[5905]
[5906]
[5907]
[5908]
[5909]
[5910]
[5911]
[5912]
[5913]
[5914]
[5915]
[5916]
[5917]
[5918]
[5919]
[5920]
[5921]
[5922]
[5923]
[5924]
[5925]
[5926]
[5927]
[5928]
[5929]
[5930]
[5931]
[5932]
[5933]
[5934]
[5935]
[5936]
[5937]
[5938]
[5939]
[5940]
[5941]
[5942]
[5943]
[5944]
[5945]
[5946]
[5947]
[5948]
[5949]
[5950]
[5951]
[5952]
[5953]
[5954]
[5955]
[5956]
[5957]
[5958]
[5959]
[5960]
[5961]
[5962]
[5963]
[5964]
[5965]
[5966]
[5967]
[5968]
[5969]
[5970]
[5971]
[5972]
[5973]
[5974]
[5975]
[5976]
[5977]
[5978]
[5979]
[5980]
[5981]
[5982]
[5983]
[5984]
[5985]
[5986]
[5987]
[5988]
[5989]
[5990]
[5991]
[5992]
[5993]
[5994]
[5995]
[5996]
[5997]
[5998]
[5999]
[6000]
[6001]
[6002]
[6003]
[6004]
[6005]
[6006]
[6007]
[6008]
[6009]
[6010]
[6011]
[6012]
[6013]
[6014]
[6015]
[6016]
[6017]
[6018]
[6019]
[6020]
[6021]
[6022]
[6023]
[6024]
[6025]
[6026]
[6027]
[6028]
[6029]
[6030]
[6031]
[6032]
[6033]
[6034]
[6035]
[6036]
[6037]
[6038]
[6039]
[6040]
[6041]
[6042]
[6043]
[6044]
[6045]
[6046]
[6047]
[6048]
[6049]
[6050]
[6051]
[6052]
[6053]
[6054]
[6055]
[6056]
[6057]
[6058]
[6059]
[6060]
[6061]
[6062]
[6063]
[6064]
[6065]
[6066]
[6067]
[6068]
[6069]
[6070]
[6071]
[6072]
[6073]
[6074]
[6075]
[6076]
[6077]
[6078]
[6079]
[6080]
[6081]
[6082]
[6083]
[6084]
/*****************************************************************************/
/*
                                  WATCH.c

The WATCH facility is a powerful adjunct in server administration.  From the
administration menu it provides an online, real-time, in-browser-window view of
request processing in the running server.  The ability to observe live request
processing on an ad hoc basis, without changing server configuration or
shutting-down/restarting the server process, makes this facility a great
configuration and problem resolution tool.  It allows (amongst other uses)

  o  assessment of mapping rules
  o  assessment of authorization rules
  o  investigation of request processing problems
  o  general observation of server behaviour

A single client per server process can access the WATCH facility at any one
time. The report can be generated for a user-specified number of seconds or
aborted at any time using the browser's stop button.

An event is considered any significant point for which the server code has a
reporting call provided.  These have been selected to provide maximum
information with minimum clutter and impact on server performance.  Obvious
examples are connection acceptance and closure, request path resolution, error
report generation, network reads and writes, etc.  These events may be selected
on a "category" basis from the WATCH menu.

This module also provides functions to display a process using SHOW PROCESS
/ALL via the DCL.C module, and to delete a process, as well as a function to
"peek" at selected fields in the data structures of any request during
processing (intended more as a diagnosis and development tool).

The "module" WATCHing functionality is basically for low-level, on-line
debugging.  It is not intended as a general site administration tool.

There is mention of a "rabbit hole" associated with WATCH.  For HTTP/2 much
more code was required to manage network I/O and managing self-referential
WATCHing around these code paths became a rapid descent into madness.  In
v11.0.0 any concurrent sharing of an HTTP/2 stream by WATCHing and being
WATCHed requests was not supported and reported as a "rabbit hole".  With
v11.1.1 this has been relaxed somewhat to permit WATCHing all items EXCEPT
[x]HTTP/2, [x]SSL and [x]network, any of which result in a "rabbit hole".


EXCLUDING WATCH
---------------
The WATCH menu and associated functionality can be compiled-out of the server
executable using appropriate macros.  The obvious one for elimination is
"module" WATCHing (as mentioned ab ove, generally intended for low-level
debugging).  By default this is not a compile-time inclusion and requires a
WATCH_MOD=1 definition during building.  "Category" WATCHing is intended as a
general site administration tool and so for all but the most demanding sites
should be left compiled in (as it is by default).  To exclude build using a
WATCH_CAT=0 macro.


COMMAND-LINE WATCH
------------------
The command-line version of WATCH accepts a number of variants.

   /WATCH[=NOSTARTUP,][ITEMS=([NO]item[,[NO]item)][,client[,service[,path]]]

The leading keyword NOSTARTUP suppresses WATCH output during server startup.
Items can be any category or module item name (e.g. MAPPING, _MAPURL,
AUTHORIZATION, _AUTH), or ALLCAT or ALLMOD for all categories or modules, and
NOwhatever to turn off a particular WATCH item.  The convenience keyword LIST
provides a list of all category and module keywords that may be used.

   /WATCH=ITEMS=(ALLCAT,NOMAPPING,ALLMOD,NO_FAO)
   /WATCH=NOSTARTUP,ITEMS=(MAPPING,AUTHORIZATION,_CONFIG,_AUTH..)
   /WATCH=ITEMS=(ALLCAT,ALLMOD,NO_FAO,NO_DETAIL),*,*,/HT_ROOT/SRC/*
   /WATCH=LIST


VERSION HISTORY
---------------
02-SEP-2021  MGD  WatchData() and WatchDataDump() constrain length
30-MAY-2021  MGD  WatchDataDump() snip and advise redundant data
21-MAY-2021  MGD  client filter substitutes client host for "me" and "moi" :-)
30-NOV-2019  MGD  bugfix; WatchDataDump() CHARS_PER_LINE calculation (sigh)
26-SEP-2019  MGD  more fiddling with WATCH report data delivery
15-JUL-2019  MGD  move WatchSystemPlus() functionality to sysPLUS.c module
25-AUG-2018  MGD  WatchSystemPlus() et.al.
06-JUL-2018  MGD  WatchPeek() add VM and Zone data
28-APR-2018  MGD  refactor Admin..() AST delivery
05-APR-2018  MGD  refactor WatchWrite() using NetWriteBuffered()
                  bugfix; WatchDataDump() CHARS_PER_LINE calculation
03-JAN-2018  MGD  make WATCH item width flexible using initial value 6 digits
                    with leading 3 digits HTTP/2 stream ID followed by 3 digits
                    connection ID number and on overflow increment by 2
18-NOV-2017  MGD  refactor WatchEnd() (yet again)
25-SEP-2017  MGD  WatchReport() move SSL item into Network group
                  WatchShowCluster() and WatchShowSystem() VMS V6.2 obsolete
                  bugfix; WatchEnd() misplaced use of |rqptr|
08-AUG-2017  MGD  relax HTTP/2 "rabbit hole"
                  bugfix; WatchEnd() remove conditional
                  bugfix; WatchBreakDetect() remove WatchEnd() parameter
18-AUG-2016  MGD  bugfix; WatchPeek() |HeaderFao| data
05-AUG-2015  MGD  HTTP/2 support
                  allow browser WATCH to piggyback on CLI WATCH
                  category TIMER moved to INTERNAL and purpose expanded
10-JUL-2007  MGD  add HTTP status filter
27-JUN-2007  MGD  WatchShowCluster()
31-DEC-2006  MGD  add "WebDAV" item
14-OCT-2006  MGD  significantly enhance original filtering
                  StringMatchRegex() instead of decc$match_wild() for filtering
                    (changes the syntax slightly and adds regex matching)
                  added REG_NEWLINE to REGEX_C_FLAGS so that anchors match
                    newlines in strings to support 'Request' filter in WATCH
10-NOV-2004  MGD  WatchNoticed() and WASD_WATCH_INTERNAL to improve diagnostics
20-JUL-2004  MGD  HTTP/1.1 compliance data
16-JUL-2004  MGD  remove potential %DCL-W-TKNOVF in WatchShowSystem()
19-JUL-2003  MGD  revise detached process candidate identification,
                  revise process report format
05-MAY-2003  MGD  remove 'quotas' WATCH item, add (string) 'match'
25-MAR-2003  MGD  WatchShowProcess() username
31-JAN-2003  MGD  DCL and DECnet record building items,
                  additional items in WatchShowSystem(),
                  no menu difference between category and module WATCHing
08-OCT-2002  MGD  add scripting account information
15-JUN-2002  MGD  bugfix; RequestUriPtr formatting in WatchPeek()
04-JUN-2002  MGD  reserve WATCH across all instances
31-MAR-2002  MGD  add CC command-line
03-FEB-2002  MGD  add server process log options
03-JAN-2002  MGD  refine command-line interface
29-OCT-2001  MGD  PERSONA_MACRO reporting
15-SEP-2001  MGD  WatchShowSystem(),
                  per-node and per-cluster instances
04-AUG-2001  MGD  support module WATCHing (WATCH_MOD),
                  conditional compilation of both WATCH_CAT and WATCH_MOD,
                  bugfix; check ParseQueryField() in WatchBegin() for NULL
18-APR-2001  MGD  move TCP/IP agent analysis to NetTcpIpAgentInfo()
14-MAR-2001  MGD  add WatchPeek() throttle, proxy authorization
06-JAN-2001  MGD  DETAIL category
01-OCT-2000  MGD  DCL task changes
26-AUG-2000  MGD  integrate WATCH peek and processing into WatchBegin()
17-JUN-2000  MGD  add "quotas" as a WATCH item,
                  bugfix; WatchCliSettings() storage
28-MAY-2000  MGD  add process quotas, using $getjpi ...lm values from startup
08-MAY-2000  MGD  make path filter a path/track filter
04-MAR-2000  MGD  use FaolToNet(), et.al.
02-JAN-2000  MGD  add ODS to WatchPackageInfo()
10-NOV-1999  MGD  use decc$match_wild() for the WatchFilter()
30-OCT-1999  MGD  dignified with a module of its own (unbundled from ADMIN.C)
07-NOV-1998  MGD  initial (as part of ADMIN.C)
*/
/*****************************************************************************/

#ifdef WASD_VMS_V7
#undef _VMS__V6__SOURCE
#define _VMS__V6__SOURCE
#undef __VMS_VER
#define __VMS_VER 70000000
#undef __CRTL_VER
#define __CRTL_VER 70000000
#endif

/* standard C header files */
#include <ctype.h>
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>

/* VMS related header files */
#include <descrip.h>
#include <dvidef.h>
#include <dvsdef.h>
#include <iodef.h>
#include <jpidef.h>
#include <libdef.h>
#include <libdtdef.h>
#include <lnmdef.h>
#include <prvdef.h>
#include <ssdef.h>
#include <stsdef.h>
#include <syidef.h>

/* application related header files */
#include "wasd.h"

/* some extra prototypes required for 'watchfunc.h' */
SesolaClientGetCert (void*);
SesolaNetAccept (void*);
SesolaNetEnd (void*);
SesolaNetClientConnect (void*);
SesolaNetClientShutdown (void*);

#include "watchfunc.h"

#define WASD_MODULE "WATCH"

#define DBUG 0

/******************/
/* global storage */
/******************/

char  WatchItemHeader [] =
"|Time_______|Module__|Line|Item!#*_|Category__|Event...|\n";

char  ErrorWatchAuthNeeded [] =
         "Authorization must be enabled to access WATCH!",
      ErrorWatchPersonaNeeded [] =
          "/PERSONA must be enabled to attempt to show this process.",
      ErrorWatchBufferOvf [] = "*ERROR* sys$fao() BUFFEROVF",
      ErrorWatchNumber [] = "Not found in request or HTTP/2 lists.",
#if !WATCH_CAT
      ErrorWatchNoCategory [] = "Category WATCHing is not a compiled option!",
#endif /* !WATCH_CAT */
#if !WATCH_MOD
      ErrorWatchNoModule [] = "Module WATCHing is not a compiled option!",
#endif /* !WATCH_MOD */
      ErrorWatchCannotPeek [] = "Cannot PEEK!",
      ErrorWatchRabbitHole [] = "HTTP/2 rabbit hole!",
      ErrorWatchSelf [] = "Cannot WATCH yourself!",
      ErrorWatchQueryString [] = "WATCH query string problem (no such item).",
      ErrorWatchSysFao [] = "*ERROR* sys$fao()";

char  WatchQuotasAlert [32];

static ulong  WatchRmiMemErrs;

WATCH_STRUCT  Watch;

/********************/
/* external storage */
/********************/

extern BOOL  DclPersonaServicesAvailable,
             DclScriptDetachProcess,
             LoggingEnabled,
#if ODS_DIRECT
             OdsDirect,
#endif /* ODS_DIRECT */
             OdsExtended,
             OperateWithSysPrv,
             PersonaMacro,
             ProtocolHttpsConfigured,
             ProxyServingEnabled;

extern int  DclMailboxBytLmRequired,
            EfnWait,
            GzipFindImageStatus,
            HttpdTickSecond,
            InstanceNodeCurrent,
            NetAcceptBytLmRequired,
            NetListenBytLmRequired,
            SesolaGblSecStructSize;

extern int  ToLowerCase[],
            ToUpperCase[];

extern ulong  MailboxMask[],
              ProcessRightsIdent[],
              WorldMask[];

extern ushort  HttpdTime7[];

extern char  BuildDateTime[],
             CliScriptAs[],
             CommandLine[],
             ErrorSanityCheck[],
             HttpdScriptAsUserName[],
             ServerHostPort[],
             SoftwareID[],
             TcpIpAgentInfo[],
             TimeGmtString[];

extern char  *GzipZlibNamePtr,
             *GzipZlibVersionPtr;

extern CONFIG_STRUCT  Config;
extern MSG_STRUCT  Msgs;
extern LIST_HEAD  Http2List;
extern HTTPD_GBLSEC  *HttpdGblSecPtr;
extern HTTPD_PROCESS  HttpdProcess;
extern LIST_HEAD  RequestList;
extern SUPERVISOR_LIST  SupervisorListArray[];
extern SYS_INFO  SysInfo;

/*****************************************************************************/
/*
Check if the watch facility is already in use, report error if it is.  Provide
form for selection of WATCH parameters.
*/ 

void WatchReport (REQUEST_STRUCT *rqptr)

{
#if WATCH_CAT

   static char  ResponseFao [] =
"<style type=\"text/css\">\n\
.sbttl { display:inline-block; padding-top:0.3em; }\n\
input[type=radio] { margin:0 0 0 0.4em; vertical-align:text-top; }\n\
input[type=text] { font-family:monospace; margin:0; \
vertical-align:text-bottom; }\n\
</style>\n\
<form action=\"!AZ\">\n\
<p><table class=\"ctgry\">\n\
<tr><th class=\"ctttl\">Select WATCH Criteria</th></tr>\n\
<tr><td>\n\
\
<table class=\"lftlft\">\n\
<tr><td>\n\
<a href=\"" ADMIN_REPORT_WATCH_STRUCT "\" \
style=\"color:#000000;text-decoration:none;\">\
\
<span class=\"sbttl\">Request</span></a>\n\
<br><input type=\"checkbox\" name=\"rqp\" value=\"1\" checked> Processing\n\
<br><input type=\"checkbox\" name=\"rqh\" value=\"1\"> Header\n\
<br><input type=\"checkbox\" name=\"rqb\" value=\"1\"> Body\n\
<br><span class=\"sbttl\">Response</span></b><sup>&nbsp;</sup>\n\
<br><input type=\"checkbox\" name=\"rsp\" value=\"1\" checked> Processing\n\
<br><input type=\"checkbox\" name=\"rsh\" value=\"1\"> Header\n\
<br><input type=\"checkbox\" name=\"rsb\" value=\"1\"> Body\n\
</td><td>\n\
\
<span class=\"sbttl\">General</span>\n\
<br><input type=\"checkbox\" name=\"con\" value=\"1\" checked> Connection\n\
<br><input type=\"checkbox\" name=\"map\" value=\"1\"> Mapping\n\
<br><input type=\"checkbox\" name=\"aut\" value=\"1\"> Authorization\n\
<br><input type=\"checkbox\" name=\"err\" value=\"1\" checked> Error\n\
<br><input type=\"checkbox\" name=\"cgi\" value=\"1\"> CGI\n\
<br><input type=\"checkbox\" name=\"dcl\" value=\"1\"> DCL\n\
<br><input type=\"checkbox\" name=\"dnt\" value=\"1\"> DECnet\n\
<br><input type=\"checkbox\" name=\"dav\" value=\"1\"> WebDAV\n\
</nobr></td><td>\n\
\
<span class=\"sbttl\">Network</span>\n\
<br><input type=\"checkbox\" name=\"net\" value=\"1\"> Activity\n\
<br><input type=\"checkbox\" name=\"oct\" value=\"1\"> Data\n\
<br><input type=\"checkbox\" name=\"ht2\" value=\"1\"> HTTP/2\n\
<br><input type=\"checkbox\" name=\"ssl\" value=\"1\"> !AZSSL!AZ\n\
\
<br><span class=\"sbttl\">Other</span><sup>&nbsp;</sup>\n\
<br><input type=\"checkbox\" name=\"log\" value=\"1\"> !AZLogging!AZ\
<br><input type=\"checkbox\" name=\"mat\" value=\"1\"> Match\n\
<br><input type=\"checkbox\" name=\"scr\" value=\"1\"> Script\n\
&nbsp;&nbsp;&nbsp;&nbsp;\n\
<br><input type=\"checkbox\" name=\"int\" value=\"1\"> Internal\n\
</td><td>\n\
\
<span class=\"sbttl\">Proxy</span>\n\
!AZ\
<br><input type=\"checkbox\" name=\"pxy\" value=\"1\"> Processing\n\
<br><input type=\"checkbox\" name=\"prh\" value=\"1\"> Request Header\n\
<br><input type=\"checkbox\" name=\"prb\" value=\"1\"> Request Body\n\
<br><input type=\"checkbox\" name=\"psh\" value=\"1\"> Response Header\n\
<br><input type=\"checkbox\" name=\"psb\" value=\"1\"> Response Body\n\
<br><input type=\"checkbox\" name=\"prk\" value=\"1\"> Rework\n\
!AZ\
</td></tr>\n\
</table>\n\
\
!AZ\
\
<table class=\"lftlft\" style=\"margin-top:-0.7em;\">\n\
<tr><td>\n\
<table class=\"lftlft\">\n\
<tr><td colspan=\"2\"><span class=\"sbttl\">Filtering</span></td>\
<td colspan=\"2\" style=\"vertical-align:bottom;\">\
&nbsp;in&nbsp;out</td></tr>\n\
\
<tr><td colspan=\"2\">\n\
<input type=\"checkbox\" name=\"htp2\" value=\"2\">&nbsp;2&nbsp;\n\
<input type=\"checkbox\" name=\"htp11\" value=\"11\">&nbsp;1.1&nbsp;\n\
<input type=\"checkbox\" name=\"htp10\" value=\"10\">&nbsp;1.0&nbsp;\n\
<input type=\"checkbox\" name=\"htp09\" value=\"09\">&nbsp;0.9\n\
</td><td>\n\
<input type=\"radio\" name=\"htp\" value=\"i\" checked>\
<input type=\"radio\" name=\"htp\" value=\"o\">&nbsp;</td>\
<td>Protocol</td></tr>\n\
\
<tr><td colspan=\"2\">\
<input type=\"text\" name=\"clf\" size=\"40\" value=\"\" \
onfocus=\"this.select()\">\
</td><td>\
<input type=\"radio\" name=\"clo\" value=\"i\" checked>\
<input type=\"radio\" name=\"clo\" value=\"o\"></td><td>Client\
<span style=\"display:inline-block;position:relative;top:-0.2em;\
transform:scale(0.85);\">\
<input type=\"checkbox\" name=\"moi\" value=\"1\">moi</span>\
</td></tr>\n\
\
<tr><td colspan=\"2\">\
<input type=\"text\" name=\"sef\" size=\"40\" value=\"\" \
onfocus=\"this.select()\">\
</td><td>\
<input type=\"radio\" name=\"seo\" value=\"i\" checked>\
<input type=\"radio\" name=\"seo\" value=\"o\"></td>\
<td>Service</td></tr>\n\
\
<tr><td colspan=\"2\">\
<input type=\"text\" name=\"rhf\" size=\"40\" value=\"\" \
onfocus=\"this.select()\">\
</td><td>\
<input type=\"radio\" name=\"rho\" value=\"i\" checked>\
<input type=\"radio\" name=\"rho\" value=\"o\"></td>\
<td>Request</td></tr>\n\
\
<tr><td colspan=\"2\">\
<input type=\"text\" name=\"paf\" size=\"40\" value=\"\" \
onfocus=\"this.select()\">\
</td><td>\
<input type=\"radio\" name=\"uro\" value=\"i\" checked>\
<input type=\"radio\" name=\"uro\" value=\"o\"></td>\
<td>URI</td></tr>\n\
\
<tr><td style=\"margin-right:0;padding-right:0;\">\
<input type=\"text\" name=\"arf\" size=\"18\" value=\"\" \
onfocus=\"this.select()\">\
</td><td class=\"targht\" style=\"margin-left:0;padding-left:0;\">\
<input type=\"text\" name=\"auf\" size=\"18\" value=\"\" \
onfocus=\"this.select()\"></td>\
<td><input type=\"radio\" name=\"auo\" value=\"i\" checked>\
<input type=\"radio\" name=\"auo\" value=\"o\"></td>\
<td>Realm &amp; User&nbsp;</td></tr>\n\
\
<tr><td colspan=\"2\">\
<input type=\"text\" name=\"sts\" size=\"40\" maxlength=\"3\" value=\"\" \
onfocus=\"this.select()\">\
</td><td>\
<input type=\"radio\" name=\"sto\" value=\"i\" checked>\
<input type=\"radio\" disabled=\"disabled\"></td>\
<td>HTTP Status</td></tr>\n\
\
</table>\n\
</td></tr>\n\
</table>\n\
\
<table class=\"lftlft\">\n\
<tr><td>\n\
<select name=\"dul\">\n\
<option> 30\n\
<option selected> 60\n\
<option> 120\n\
<option> 300\n\
<option> 600\n\
</select> or\n\
<input type=\"text\" name=\"dut\" size=\"5\" value=\"\"> Seconds Duration\n\
<br><input type=\"checkbox\" name=\"stdout\" value=\"1\"> \
Include (<input type=\"checkbox\" name=\"only\" value=\"1\">only) \
in Server Process Log\n\
<p><input type=\"submit\" value=\" WATCH \"> &nbsp; \
<input type=reset value=\" reset \">\n\
</td></tr>\n\
</table>\n\
\
</td></tr>\n\
</table>\n\
\
</form>\n\
\
</div>\n\
</body>\n\
</html>\n";

#if WATCH_MOD

   static char  WatchModFao [] =
"<table class=\"lftlft\" style=\"margin-top:-0.7em;\">\n\
<tr><td colspan=\"5\"><span class=\"sbttl\">Module</span></td></tr>\n\
<tr><td>\n\
<input type=\"checkbox\" name=\"_aut\" value=\"1\"> AUTH..\n\
<br><input type=\"checkbox\" name=\"_bod\" value=\"1\"> BODY\n\
<br><input type=\"checkbox\" name=\"_cac\" value=\"1\"> CACHE\n\
<br><input type=\"checkbox\" name=\"_cgi\" value=\"1\"> CGI\n\
<br><input type=\"checkbox\" name=\"_con\" value=\"1\"> CONFIG&nbsp;\n\
<br><input type=\"checkbox\" name=\"_dcl\" value=\"1\"> DCL\n\
</td><td>\n\
<input type=\"checkbox\" name=\"_dec\" value=\"1\"> DECNET\n\
<br><input type=\"checkbox\" name=\"_dir\" value=\"1\"> DIR\n\
<br><input type=\"checkbox\" name=\"_fao\" value=\"1\"> FAO\n\
<br><input type=\"checkbox\" name=\"_fil\" value=\"1\"> FILE\n\
<br><input type=\"checkbox\" name=\"_hta\" value=\"1\"> HTADMIN\n\
<br><input type=\"checkbox\" name=\"_ht2\" value=\"1\"> HTTP2..\n\
</td><td>\n\
<input type=\"checkbox\" name=\"_ins\" value=\"1\"> INSTANCE\n\
<br><input type=\"checkbox\" name=\"_map\" value=\"1\"> MAPURL\n\
<br><input type=\"checkbox\" name=\"_met\" value=\"1\"> METACON\n\
<br><input type=\"checkbox\" name=\"_msg\" value=\"1\"> MSG\n\
<br><input type=\"checkbox\" name=\"_net\" value=\"1\"> NET\n\
<br><input type=\"checkbox\" name=\"_ods\" value=\"1\"> ODS\n\
</td><td>\n\
<input type=\"checkbox\" name=\"_pro\" value=\"1\"> PROXY..\n\
<br><input type=\"checkbox\" name=\"_put\" value=\"1\"> PUT\n\
<br><input type=\"checkbox\" name=\"_req\" value=\"1\"> REQUEST\n\
<br><input type=\"checkbox\" name=\"_res\" value=\"1\"> RESPONSE\n\
<br><input type=\"checkbox\" name=\"_ser\" value=\"1\"> SERVICE\n\
<br><input type=\"checkbox\" name=\"_ses\" value=\"1\"> SESOLA..\n\
</td><td>\n\
<input type=\"checkbox\" name=\"_ssi\" value=\"1\"> SSI\n\
<br><input type=\"checkbox\" name=\"_thr\" value=\"1\"> THROTTLE\n\
<br><input type=\"checkbox\" name=\"_upd\" value=\"1\"> UPD\n\
<br><input type=\"checkbox\" name=\"_vm\" value=\"1\"> VM\n\
<br><input type=\"checkbox\" name=\"_dav\" value=\"1\"> WebDAV\n\
<br><input type=\"checkbox\" name=\"_oth\" value=\"1\"> other\n\
<br><input type=\"checkbox\" name=\"_det\" value=\"1\"> detail\n\
</td></tr>\n\
</table>\n";

#else

   static char  WatchModFao [] = "";

#endif /* WATCH_MOD */

   int  status;
   ulong  FaoVector [32];
   ulong  *vecptr;

   /*********/
   /* begin */
   /*********/

   if (Watch.Disabled)
   {
      rqptr->rqResponse.HttpStatus = 403;
      ErrorGeneral (rqptr, MsgFor(rqptr,MSG_GENERAL_DISABLED), FI_LI);
      AdminEnd (rqptr);
      return;
   }

   if (!rqptr->RemoteUser[0])
   {
      rqptr->rqResponse.HttpStatus = 403;
      ErrorGeneral (rqptr, ErrorWatchAuthNeeded, FI_LI);
      AdminEnd (rqptr);
      return;
   }

   if (WatchInUse (rqptr, false))
   {
      AdminEnd (rqptr);
      return;
   }

   AdminPageTitle (rqptr, "WATCH Report");

   vecptr = FaoVector;
   *vecptr++ = ADMIN_REPORT_WATCH;

   if (ProtocolHttpsConfigured)
   {
      *vecptr++ = "";
      *vecptr++ = "";
   }
   else
   {
      *vecptr++ = "<i>";
      *vecptr++ = "</i>";
   }

   if (LoggingEnabled)
   {
      *vecptr++ = "";
      *vecptr++ = "";
   }
   else
   {
      *vecptr++ = "<i>";
      *vecptr++ = "</i>";
   }

   if (ProxyServingEnabled)
   {
      *vecptr++ = "";
      *vecptr++ = "";
   }
   else
   {
      *vecptr++ = "<i>\n";
      *vecptr++ = "</i>\n";
   }

#if WATCH_MOD
   *vecptr++ = WatchModFao;
#else
   *vecptr++ = "";
#endif

   status = FaolToNet (rqptr, ResponseFao, &FaoVector);
   if (VMSnok (status)) ErrorNoticed (rqptr, status, NULL, FI_LI);

   ResponseHeader200 (rqptr, "text/html", &rqptr->NetWriteBufferDsc);

   AdminEnd (rqptr);

#else /* WATCH_CAT */

   rqptr->rqResponse.HttpStatus = 403;
   ErrorGeneral (rqptr, ErrorWatchNoCategory, FI_LI);
   AdminEnd (rqptr);

#endif /* WATCH_CAT */
}

/*****************************************************************************/
/*
This function provides both a WATCH-processing report, and a WATCH-peek report.
This can be a WATCH-only report, peek-only, or peek-then-WATCH. If we're going
to use the WATCH-processing report then we have to do it exclusively, check if
the WATCH facility is already in use, report error if it is.  Parse the query
string WATCH parameters.  Report any errors.  Place the parameters into the
WATCH global storage.  This reserves the WATCH facility for this client via the
'Watch.RequestPtr' (and indicate this with a flag in the request structure,
which will be detected as the request concludes and the WATCH facility released
for reuse).  Generate a plain-text HTTP header and output a WATCH report
heading.  If a WATCH-peek report is requested call WatchPeek() to generate it. 
For a peek-only report we declares the next function AST there.  If
WATCH-processing was only/also requested generate a WATCH-processing header
then return BUT do not declare any AST to continue processing.  The client will
just "hang" there receiving output from WatchThis() via the structure pointed
to by 'Watch.RequestPtr'.  Can be used to WATCH all new requests (matching any
filter criteria of course) or in a "one-shot" mode where a single request is
selected to display all categories at any point during it's processing.
*/ 

void WatchBegin (REQUEST_STRUCT *rqptr)

{
   /* easiest just to wrap with WatchNone() */
   WatchNone (true);
   WatchBegin2 (rqptr);
   WatchNone (false);
}

void WatchBegin2 (REQUEST_STRUCT *rqptr)

{
#if WATCH_CAT

   static char  ResponseFao [] =
"!20%D  WATCH REPORT  !AZ\n\
!#*-\n\
!AZ (!AZ)\n\
!AZ\n\
!AZ\
$ CC (!#AZ/!UL) !AZ\n\
!AZ with !UL CPU!%s and !AZ running VMS !AZ \
(!AZ, !AZ, !AZ, ODS-DIRECT !AZ, !&@, REGEX !AZ, lksb$b_valblk[!UL])!AZ\n\
$ HTTPD !AZ\n\
!AZ\
!&@\
Process: !AZ !AZ !AZ !AZ\n\
!&@\
!&@\
!&@";

   int  eolcnt, status;
   char  *cptr, *qptr, *sptr, *zptr,
         *InstanceClusterPtr,
         *InstanceNodePtr;
   char  Buffer [8192],
         CategoryList [WATCH_CATEGORY_LIST_SIZE],
         FieldName [256],
         FieldValue [WATCH_FILTER_SIZE];
   ushort  Length;
   ulong  ucnt;
   ulong  *vecptr;
   ulong  FaoVector [64];
   HTTP2_STRUCT  *h2ptr;
   REQUEST_STRUCT  *rqeptr;
   WATCH_STRUCT  WatchConfig;

   /*********/
   /* begin */
   /*********/

   if (Watch.Disabled)
   {
      rqptr->rqResponse.HttpStatus = 403;
      ErrorGeneral (rqptr, MsgFor(rqptr,MSG_GENERAL_DISABLED), FI_LI);
      AdminEnd (rqptr);
      return;
   }

   if (!rqptr->RemoteUser[0])
   {
      rqptr->rqResponse.HttpStatus = 403;
      ErrorGeneral (rqptr, ErrorWatchAuthNeeded, FI_LI);
      AdminEnd (rqptr);
      return;
   }

   if (WatchInUse (rqptr, true))
   {
      AdminEnd (rqptr);
      return;
   }

   memset (&WatchConfig, 0, sizeof(WatchConfig));
   WatchConfig.StatusFilter = -1;

   if (rqptr->rqHeader.QueryStringLength)
   {
      /***************************/
      /* build report parameters */
      /***************************/

      qptr = rqptr->rqHeader.QueryStringPtr;
      while (*qptr)
      {
         status = StringParseQuery (&qptr, FieldName, sizeof(FieldName),
                                           FieldValue, sizeof(FieldValue));
         if (VMSnok (status))
         {
            WatchReset ();
            if (status == SS$_IVCHAR) rqptr->rqResponse.HttpStatus = 400;
            rqptr->rqResponse.ErrorTextPtr = "parsing query string";
            ErrorVmsStatus (rqptr, status, FI_LI);
            AdminEnd (rqptr);
            return;
         }

         if (strsame (FieldName, "at", -1) && FieldValue[0])
         {
            WatchConfig.DoPeek = true;
            WatchConfig.ConnectNumber = strtol (FieldValue, NULL, 10);
         }
         else
         if (strsame (FieldName, "this", -1) && FieldValue[0])
         {
            WatchConfig.Category = WATCH_ONE_SHOT_CAT;
#if WATCH_MOD
            WatchConfig.Module = WATCH_ONE_SHOT_MOD;
#endif /* WATCH_MOD */
            WatchConfig.ConnectNumber = strtol (FieldValue, NULL, 10);
         }
         else
         if (strsame (FieldName, "aut", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_AUTH;
         else
         if (strsame (FieldName, "cgi", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_CGI;
         else
         if (strsame (FieldName, "con", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_CONNECT;
         else
         if (strsame (FieldName, "dcl", -1) && FieldValue[0])
         WatchConfig.Category |= WATCH_DCL;
         else
         if (strsame (FieldName, "dnt", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_DECNET;
         else
         if (strsame (FieldName, "err", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_ERROR;
         else
         if (strsame (FieldName, "ht2", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_HTTP2;
         else
         if (strsame (FieldName, "log", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_LOG;
         else
         if (strsame (FieldName, "map", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_MAPPING;
         else
         if (strsame (FieldName, "mat", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_MATCH;
         else
         if (strsame (FieldName, "net", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_NETWORK;
         else
         if (strsame (FieldName, "oct", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_NETWORK_OCTETS;
         else
         if (strsame (FieldName, "pxy", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_PROXY;
         else
         if (strsame (FieldName, "prh", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_PROXY_REQU_HDR;
         else
         if (strsame (FieldName, "prb", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_PROXY_REQU_BDY;
         else
         if (strsame (FieldName, "psh", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_PROXY_RESP_HDR;
         else
         if (strsame (FieldName, "psb", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_PROXY_RESP_BDY;
         else
         if (strsame (FieldName, "prk", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_PROXY_REWORK;
         else
         if (strsame (FieldName, "rqp", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_REQUEST;
         else
         if (strsame (FieldName, "rqb", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_REQUEST_BODY;
         else
         if (strsame (FieldName, "rqh", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_REQUEST_HEADER;
         else
         if (strsame (FieldName, "rsp", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_RESPONSE;
         else
         if (strsame (FieldName, "rsb", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_RESPONSE_BODY;
         else
         if (strsame (FieldName, "rsh", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_RESPONSE_HEADER;
         else
         if (strsame (FieldName, "scr", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_SCRIPT;
         else
         if (strsame (FieldName, "ssl", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_SESOLA;
         else
         if (strsame (FieldName, "int", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_INTERNAL;
         else
         if (strsame (FieldName, "dav", -1) && FieldValue[0])
            WatchConfig.Category |= WATCH_WEBDAV;
         else
         if (strsame (FieldName, "htp09", -1)) {
            if (FieldValue[0]) WatchConfig.HttpFilter09 = true;
         }
         else
         if (strsame (FieldName, "htp10", -1)) {
            if (FieldValue[0]) WatchConfig.HttpFilter10 = true;
         }
         else
         if (strsame (FieldName, "htp11", -1)) {
            if (FieldValue[0]) WatchConfig.HttpFilter11 = true;
         }
         else
         if (strsame (FieldName, "htp2", -1)) {
            if (FieldValue[0]) WatchConfig.HttpFilter2 = true;
         }
         else
         if (strsame (FieldName, "htp", -1)) {
            if (FieldValue[0] == 'o') WatchConfig.FilterOutHttp = true;
         }
         else
         if (strsame (FieldName, "clf", -1))
         {
            if (strsame (FieldValue, "me", -1) ||
                strsame (FieldValue, "moi", -1))
               strcpy (WatchConfig.ClientFilter,
TcpIpAddressToString (&rqptr->ClientPtr->Lookup.IpAddress, 0));
            else
               strcpy (WatchConfig.ClientFilter, FieldValue);
         }
         else
         if (strsame (FieldName, "moi", -1)) {
            strcpy (WatchConfig.ClientFilter,
TcpIpAddressToString (&rqptr->ClientPtr->Lookup.IpAddress, 0));
         }
         else
         if (strsame (FieldName, "clo", -1)) {
            if (FieldValue[0] == 'o') WatchConfig.FilterOutClient = true;
         }
         else
         if (strsame (FieldName, "sef", -1))
            strcpy (WatchConfig.ServiceFilter, FieldValue);
         else
         if (strsame (FieldName, "seo", -1)) {
            if (FieldValue[0] == 'o') WatchConfig.FilterOutService = true;
         }
         else
         if (strsame (FieldName, "rhf", -1))
            strcpy (WatchConfig.RequestFilter, FieldValue);
         else
         if (strsame (FieldName, "rho", -1)) {
            if (FieldValue[0] == 'o') WatchConfig.FilterOutRequest = true;
         }
         else
         if (strsame (FieldName, "paf", -1))
            strcpy (WatchConfig.PathFilter, FieldValue);
         else
         if (strsame (FieldName, "uro", -1) ||
             /* pre-v11 compatibility */ 
             strsame (FieldName, "pao", -1)) {
            if (FieldValue[0] == 'o') WatchConfig.FilterOutURI = true;
         }
         else
         if (strsame (FieldName, "sts", -1)) {
            if (isdigit(FieldValue[0]))
               WatchConfig.StatusFilter = atoi(FieldValue);
         }
         else
         if (strsame (FieldName, "sto", -1)) {
            /* do absolutely nothing! */
         }
         else
         if (strsame (FieldName, "arf", -1))
            strcpy (WatchConfig.RealmFilter, FieldValue);
         else
         if (strsame (FieldName, "aro", -1)) {
            if (FieldValue[0] == 'o') WatchConfig.FilterOutRealm = true;
         }
         else
         if (strsame (FieldName, "auf", -1))
            strcpy (WatchConfig.UserFilter, FieldValue);
         else
         if (strsame (FieldName, "auo", -1)) {
            if (FieldValue[0] == 'o') WatchConfig.FilterOutUser = true;
         }
         else
         if (strsame (FieldName, "stdout", -1))
            WatchConfig.StdoutToo = true;
         else
         if (strsame (FieldName, "only", -1))
            WatchConfig.StdoutOnly = true;
         else
         if (strsame (FieldName, "dul", -1) ||
             strsame (FieldName, "dut", -1) ||
             strsame (FieldName, "sec", -1) ||
             strsame (FieldName, "seconds", -1))
         {
            for (cptr = FieldValue; *cptr && !isdigit(*cptr); cptr++);
            if (*cptr) WatchConfig.DurationSeconds = atoi (cptr);
         }
         else

#if WATCH_MOD

         if (strsame (FieldName, "_aut", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_AUTH;
         else
         if (strsame (FieldName, "_bod", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_BODY;
         else
         if (strsame (FieldName, "_cac", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_CACHE;
         else
         if (strsame (FieldName, "_cgi", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_CGI;
         else
         if (strsame (FieldName, "_con", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_CONFIG;
         else
         if (strsame (FieldName, "_dcl", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_DCL;
         else
         if (strsame (FieldName, "_det", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD__DETAIL;
         else
         if (strsame (FieldName, "_dec", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_DECNET;
         else
         if (strsame (FieldName, "_dir", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_DIR;
         else
         if (strsame (FieldName, "_fao", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_FAO;
         else
         if (strsame (FieldName, "_fil", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_FILE;
         else
         if (strsame (FieldName, "_hta", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_HTADMIN;
         else
         if (strsame (FieldName, "_ht2", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_HTTP2;
         else
         if (strsame (FieldName, "_ins", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_INSTANCE;
         else
         if (strsame (FieldName, "_map", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_MAPURL;
         else
         if (strsame (FieldName, "_met", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_METACON;
         else
         if (strsame (FieldName, "_msg", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_MSG;
         else
         if (strsame (FieldName, "_net", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_NET;
         else
         if (strsame (FieldName, "_ods", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_ODS;
         else
         if (strsame (FieldName, "_oth", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD__OTHER;
         else
         if (strsame (FieldName, "_pro", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_PROXY;
         else
         if (strsame (FieldName, "_put", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_PUT;
         else
         if (strsame (FieldName, "_req", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_REQUEST;
         else
         if (strsame (FieldName, "_res", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_RESPONSE;
         else
         if (strsame (FieldName, "_ser", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_SERVICE;
         else
         if (strsame (FieldName, "_ses", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_SESOLA;
         else
         if (strsame (FieldName, "_ssi", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_SSI;
         else
         if (strsame (FieldName, "_thr", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_THROTTLE;
         else
         if (strsame (FieldName, "_upd", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_UPD;
         else
         if (strsame (FieldName, "_vm", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_VM;
         else
         if (strsame (FieldName, "_dav", -1) && FieldValue[0])
            WatchConfig.Module |= WATCH_MOD_WEBDAV;
         else

#else

         if (FieldName[0] == '_')
         {
            WatchReset ();
            rqptr->rqResponse.HttpStatus = 403;
            ErrorGeneral (rqptr, ErrorWatchNoModule, FI_LI);
            AdminEnd (rqptr);
            return;
         }
         else

#endif /* WATCH_MOD */

         {
            WatchReset ();
            rqptr->rqResponse.HttpStatus = 403;
            ErrorGeneral (rqptr, ErrorWatchQueryString, FI_LI);
            AdminEnd (rqptr);
            return;
         }
      }
   }

   if (WatchConfig.Category || WatchConfig.Module) WatchConfig.DoWatch = true;

   if (!WatchConfig.DurationSeconds) WatchConfig.DurationSeconds = 60 * 60 * 24;
 
   if (!WatchConfig.DoPeek && !WatchConfig.DoWatch)
   {
      WatchReset ();
      rqptr->rqResponse.HttpStatus = 403;
      ErrorGeneral (rqptr, ErrorWatchQueryString, FI_LI);
      AdminEnd (rqptr);
      return;
   }

   WatchSetWatch (rqptr, 0);

   if (WatchConfig.ConnectNumber)
   {
      /* find this connection number in the current request list */
      h2ptr = NULL;
      for (rqeptr = LIST_GET_HEAD(&RequestList);
           rqeptr != NULL;
           rqeptr = LIST_GET_NEXT(rqeptr))
         if (rqeptr->ConnectNumber == WatchConfig.ConnectNumber) break;
      if (rqeptr == NULL)
      {
         /* if not in the request list look in the HTTP/2 list */
         for (h2ptr = LIST_GET_HEAD(&Http2List);
              h2ptr != NULL;
              h2ptr = LIST_GET_NEXT(h2ptr))
            if (h2ptr->ConnectNumber == WatchConfig.ConnectNumber) break;
      }

      if (rqeptr == NULL && h2ptr == NULL)
      {
         WatchReset ();
         rqptr->rqResponse.HttpStatus = 400;
         ErrorGeneral (rqptr, ErrorWatchNumber, FI_LI);
         AdminEnd (rqptr);
         return;
      }

      if (rqeptr == rqptr)
      {
         WatchReset ();
         rqptr->rqResponse.HttpStatus = 400;
         ErrorGeneral (rqptr, ErrorWatchSelf, FI_LI);
         AdminEnd (rqptr);
         return;
      }

      if (h2ptr != NULL &&
          rqptr->Http2Stream.Http2Ptr != NULL &&
          rqptr->Http2Stream.Http2Ptr->ConnectNumber == h2ptr->ConnectNumber)
      {
         WatchReset ();
         rqptr->rqResponse.HttpStatus = 400;
         ErrorGeneral (rqptr, ErrorWatchSelf, FI_LI);
         AdminEnd (rqptr);
         return;
      }

      if (WatchConfig.Category == WATCH_ONE_SHOT_CAT)
      {
         if (rqeptr)
         {
            if (rqptr->Http2Stream.Http2Ptr &&
                rqptr->Http2Stream.Http2Ptr == rqeptr->Http2Stream.Http2Ptr)
            {
               WatchReset ();
               rqptr->rqResponse.HttpStatus = 403;
               ErrorGeneral (rqptr, ErrorWatchRabbitHole, FI_LI);
               AdminEnd (rqptr);
               return;
            }

            rqeptr->WatchItem = WatchSetWatch (NULL, WATCH_NEW_ITEM);
            rqeptr->WatchItem |= WATCH_ITEM_ONE_SHOT_FLAG;
            WatchSetWatch (rqeptr, rqeptr->WatchItem);
            if (rqeptr->DclTaskPtr)
               rqeptr->DclTaskPtr->WatchItem = rqeptr->WatchItem;
            if (rqeptr->DECnetTaskPtr)
               rqeptr->DECnetTaskPtr->WatchItem = rqeptr->WatchItem;
            if (rqeptr->ProxyTaskPtr)
               rqeptr->ProxyTaskPtr->WatchItem = rqeptr->WatchItem;
            if (rqeptr->Http2Stream.Http2Ptr)
               rqeptr->Http2Stream.Http2Ptr->WatchItem = rqeptr->WatchItem;
         }
         else
         {
            h2ptr->WatchItem = WatchSetWatch (NULL, WATCH_NEW_ITEM);
            h2ptr->WatchItem |= WATCH_ITEM_HTTP2_FLAG;
         }
      }
   }
   else
      rqeptr = NULL;

   if (WatchConfig.DoPeek)
   {
      if (!rqeptr && !h2ptr)
      {
         WatchReset ();
         rqptr->rqResponse.HttpStatus = 400;
         ErrorGeneral (rqptr, ErrorWatchCannotPeek, FI_LI);
         AdminEnd (rqptr);
         return;
      }
   }

   if (WatchRabbitHole (&WatchConfig, rqeptr))
   {
      WatchReset ();
      rqptr->rqResponse.HttpStatus = 403;
      ErrorGeneral (rqptr, ErrorWatchRabbitHole, FI_LI);
      AdminEnd (rqptr);
      return;
   }

   WatchConfig.FilterSet =
      (WatchConfig.HttpFilter09 || WatchConfig.HttpFilter10 ||
       WatchConfig.HttpFilter11 || WatchConfig.HttpFilter2 ||
       WatchConfig.RealmFilter[0] || WatchConfig.UserFilter[0] ||
       WatchConfig.ClientFilter[0] || WatchConfig.PathFilter[0] ||
       WatchConfig.RequestFilter[0] || WatchConfig.ServiceFilter[0] ||
       WatchConfig.StatusFilter >= 0);

   /***********************/
   /* build report header */
   /***********************/

   if (WatchConfig.Category == WATCH_ONE_SHOT_CAT)
      strcpy (CategoryList, "ALL");
   else
   {
      if (WatchConfig.CliEnabled) eolcnt = 80; else eolcnt = 255;
      zptr = (sptr = CategoryList) + eolcnt;
      /* first the categories */
      for (ucnt = 1; ucnt; ucnt = ucnt << 1)
      {
         cptr = WatchWhatCategory (WatchConfig.Category & ucnt);
         if (cptr)
         {
            if (sptr > CategoryList)
            {
               *sptr++ = ',';
               if (sptr > zptr)
               {
                  zptr = sptr + eolcnt;
                  *sptr++ = '\n';
               }
               else
                  *sptr++ = ' ';
            }
            while (*cptr) *sptr++ = TOLO(*cptr++);
         }
      }
      /* then any modules */
      for (ucnt = 1; ucnt; ucnt = ucnt << 1)
      {
#if WATCH_MOD
         cptr = WatchWhatModule (WatchConfig.Module & ucnt);
#endif
         if (cptr)
         {
            if (sptr > CategoryList)
            {
               *sptr++ = ',';
               if (sptr > zptr)
               {
                  zptr = sptr + eolcnt;
                  *sptr++ = '\n';
               }
               else
                  *sptr++ = ' ';
            }
            while (*cptr) *sptr++ = TOLO(*cptr++);
         }
      }
      *sptr = '\0';
   }

   vecptr = FaoVector;
   *vecptr++ = 0;
   *vecptr++ = ServerHostPort;
   *vecptr++ = 36 + strlen(ServerHostPort);
   *vecptr++ = HttpdProcess.ImageInfo;
   *vecptr++ = BuildDateTime;
   *vecptr++ = TcpIpAgentInfo;
   *vecptr++ = SesolaVersion(true);
   *vecptr++ = strchr(__VMS_VERSION, ' ') - __VMS_VERSION;
   *vecptr++ = __VMS_VERSION;
   *vecptr++ = __DECC_VER;
   *vecptr++ = WatchFuncCc;
   *vecptr++ = SysInfo.HwName;
   *vecptr++ = SysInfo.AvailCpuCnt;
   *vecptr++ = SysInfo.MemoryMBGB;
   *vecptr++ = SysInfo.Version;

#ifdef ODS_EXTENDED
   if (OdsExtended)
      *vecptr++ = "ODS-5 enabled";
   else
   if (SysInfo.VersionInteger >= 720)
      *vecptr++ = "ODS-5 disabled";
   else
      *vecptr++ = "ODS-5 unavailable";
#else /* ODS_EXTENDED */
   *vecptr++ = "ODS-5 unavailable";
#endif /* ODS_EXTENDED */

   *vecptr++ = ENAMEL_NAML_USED;
   *vecptr++ = ENAMEL_FIB_USED;
#if ODS_DIRECT
   *vecptr++ = OdsDirect ? "enabled" : "disabled";
#else
   *vecptr++ = "not compiled";
#endif /* ODS_DIRECT */

   if (Config.cfMisc.GzipResponseCompLevel)
   {
      if (VMSok(GzipFindImageStatus))
      {
         *vecptr++ = "!AZ V!AZ";
         *vecptr++ = GzipZlibNamePtr;
         *vecptr++ = GzipZlibVersionPtr;
      }
      else
      {
         *vecptr++ = "ZLIB !&S";
         *vecptr++ = GzipFindImageStatus;
      }
   }
   else
      *vecptr++ = "ZLIB disabled";

   *vecptr++ = Config.cfMisc.RegexSyntax ? "enabled" : "disabled";

   *vecptr++ = SysInfo.LockValueBlockSize;
   if (OperateWithSysPrv)
      *vecptr++ = ", SYSPRV";
   else
      *vecptr++ = "";
   *vecptr++ = CommandLine;
   *vecptr++ = WatchServerQuotas (0);

   if (DclScriptDetachProcess)
   {
      *vecptr++ = "DCL Scripting: detached, !&@PERSONA!AZ !AZ\n";
      if (HttpdScriptAsUserName[0])
      {
         if (CliScriptAs[0])
            *vecptr++ = "/script=as=!AZ, ";
         else
            *vecptr++ = "as !AZ, ";
         *vecptr++ = HttpdScriptAsUserName;
      }
      else
         *vecptr++ = "";
      if (PersonaMacro)
         *vecptr++ = "_MACRO";
      else
         *vecptr++ = "";
      if (DclPersonaServicesAvailable)
         *vecptr++ = "enabled";
      else
         *vecptr++ = "disabled";
   }
   else
   {
      *vecptr++ =
"DCL Scripting: subprocess\n\
BYTLM-available:!UL BYTLM-per-subproc:!&@ (approx !&@ subprocesses) \
BYTLM-net-accept:!UL BYTLM-net-listen:!UL\n";
      *vecptr++ = HttpdProcess.BytLmAvailable;
      if (DclMailboxBytLmRequired)
      {
         *vecptr++ = "!UL";
         *vecptr++ = DclMailboxBytLmRequired;
         *vecptr++ = "!UL";
         *vecptr++ = (HttpdProcess.BytLmAvailable -
                       (NetAcceptBytLmRequired * Config.cfServer.ConnectMax)) /
                     DclMailboxBytLmRequired;
      }
      else
      {
         *vecptr++ = "?";
         *vecptr++ = "?";
      }
      *vecptr++ = NetAcceptBytLmRequired;
      *vecptr++ = NetListenBytLmRequired;
   }

   *vecptr++ = HttpdProcess.PrcNam;
   *vecptr++ = HttpdProcess.ModeName;
   *vecptr++ = HttpdProcess.SysInput;
   *vecptr++ = HttpdProcess.SysOutput;

   InstanceNodePtr = InstanceClusterPtr = NULL;
   if (InstanceNodeCurrent > 1)
   {
      InstanceLockList (INSTANCE_NODE, ", ", &InstanceNodePtr);
      if (InstanceNodePtr)
      {
         *vecptr++ = "Node: !AZ\n";
         *vecptr++ = InstanceNodePtr;
      }
      else
         *vecptr++ = "";
   }
   else
      *vecptr++ = "";

   InstanceLockList (INSTANCE_CLUSTER, ", ", &InstanceClusterPtr);
   if (InstanceClusterPtr)
   {
      *vecptr++ = "Instances: !AZ\n";
      *vecptr++ = InstanceClusterPtr;
   }
   else
      *vecptr++ = "";

   if (WatchConfig.DoWatch && !WatchConfig.DoPeek)
   {
      *vecptr++ = "Watching: !AZ (!SL!&@) via !AZ\n!&@";
      *vecptr++ = CategoryList;
      *vecptr++ = WatchConfig.Category;
      if (WatchConfig.Module)
      {
         *vecptr++ = ",!SL";
         *vecptr++ = WatchConfig.Module;
      }
      else
         *vecptr++ = "";

      if (HTTP2_REQUEST(rqptr))
         *vecptr++ = "HTTP/2";
      else
      if (rqptr->rqHeader.HttpVersion == HTTP_VERSION_1_1)
         *vecptr++ = "HTTP/1.1";
      else
      if (rqptr->rqHeader.HttpVersion == HTTP_VERSION_1_0)
         *vecptr++ = "HTTP/1.0";
      else
         *vecptr++ = "HTTP/0.9";

      if (WatchConfig.FilterSet)
      {
         *vecptr++ =
"Filter Protocol:!AZ!AZ!AZ!AZ!AZ \
Client:!AZ:\"!AZ\" Service:!AZ:\"!AZ\" Request:!AZ:\"!AZ\" \
URI:!AZ:\"!AZ\" Realm:!AZ:\"!AZ\" User:!AZ:\"!AZ\" Status:IN:\"!&@\"\n";
         *vecptr++ = WatchConfig.FilterOutHttp ? "OUT" : "IN";
         *vecptr++ = WatchConfig.HttpFilter2 ? ":2" : "";
         *vecptr++ = WatchConfig.HttpFilter11 ? ":1.1" : "";
         *vecptr++ = WatchConfig.HttpFilter10 ? ":1.0" : "";
         *vecptr++ = WatchConfig.HttpFilter09 ? ":0.9" : "";
         *vecptr++ = WatchConfig.FilterOutClient ? "OUT" : "IN";
         *vecptr++ = WatchConfig.ClientFilter;
         *vecptr++ = WatchConfig.FilterOutService ? "OUT" : "IN";
         *vecptr++ = WatchConfig.ServiceFilter;
         *vecptr++ = WatchConfig.FilterOutRequest ? "OUT" : "IN";
         *vecptr++ = WatchConfig.RequestFilter;
         *vecptr++ = WatchConfig.FilterOutURI ? "OUT" : "IN";
         *vecptr++ = WatchConfig.PathFilter;
         *vecptr++ = WatchConfig.FilterOutRealm ? "OUT" : "IN";
         *vecptr++ = WatchConfig.RealmFilter;
         *vecptr++ = WatchConfig.FilterOutUser ? "OUT" : "IN";
         *vecptr++ = WatchConfig.UserFilter;
         if (WatchConfig.StatusFilter >= 0)
         {
            *vecptr++ = "!UL";
            *vecptr++ = WatchConfig.StatusFilter;
         }
         else
            *vecptr++ = "";
      }
      else
         *vecptr++ = "Filter: NONE\n";
   }
   else
      *vecptr++ = "";

   FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
   status = FaolToBuffer (Buffer, sizeof(Buffer), &Length,
                          ResponseFao, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
      ErrorNoticed (rqptr, status, NULL, FI_LI);

   /*******************/
   /* enable WATCHing */
   /*******************/

   /* detect a client stopping WATCHing */
   WatchBreakDetect (rqptr);

   if (InstanceNodePtr) VmFree (InstanceNodePtr, FI_LI);
   if (InstanceClusterPtr) VmFree (InstanceClusterPtr, FI_LI);

   /* make sure we get the duration we asked for! */
   HttpdTimerSet (rqptr, TIMER_TERMINATE, WatchConfig.DurationSeconds);

   /* allow browser WATCH to piggyback on CLI WATCH */
   if (!Watch.CliEnabled)
   {
      /* so that WatchNone() "restores" the WATCH items  */
      WatchConfig.Category2 = WatchConfig.Category;
      WatchConfig.Module2 = WatchConfig.Module;
      /* copy the configuration WATCH structure onto the operating WATCH */
      memcpy (&Watch, &WatchConfig, sizeof(Watch));
   }

   rqptr->rqResponse.NoGzip = true;
   rqptr->rqResponse.PreExpired = PRE_EXPIRE_ADMIN;
   ResponseHeader200 (rqptr, "text/plain", NULL);

   NetWrite (rqptr, NULL, Buffer, Length);

   /* the request now just "hangs", reading WATCH plain-text output! */
   Watch.RequestPtr = rqptr;

   /*****************************/
   /* now we're WatchWrite()ing */
   /*****************************/

   if (Watch.DoPeek)
   {
      if (rqeptr)
         WatchPeek (rqptr, rqeptr);
      else
      if (h2ptr)
         WatchPeekHttp2 (rqptr, h2ptr, "|HTTP/2_connection...|");

      if (!Watch.DoWatch)
      {
         /* no more WatchReset() use WatchEnd() to finish  */
         WatchEnd ();
         return;
      }
   }

#else /* WATCH_CAT */

   rqptr->rqResponse.HttpStatus = 403;
   ErrorGeneral (rqptr, ErrorWatchNoCategory, FI_LI);
   AdminEnd (rqptr);

#endif /* WATCH_CAT */
}

/*****************************************************************************/
/*
Set WATCH item indicator to be the supplied value.

If |rqptr| is NULL then it's intended to return an item number for the original
(NetAccept()) network I/O structure, or for an HTTP/2 connection (see below).

When |rqptr| non-NULL then needs to be set for the request across the WATCH
items in various structures.

An HTTP/2 connection can be set for WATCHing via Http2Report().  This will set
the item in the associated NETIO structure and the (usually) associated TLS/SSL
I/O structure.  So when setting the request's WATCH item first check to see if
the associated I/O structures have an item set and DO NOT (RE)SET if not the
same as the current request number to be set.

Requests over HTTP/2 have the original HTTP/2 WATCH item (if any) in the least
significant digits and the stream ID in the most.
*/ 

int WatchSetWatch
(
REQUEST_STRUCT *rqptr,
int item
)
{
#if WATCH_CAT

   static char  divider [] = "****************************************";

   int  number;
   HTTP2_STRUCT  *h2ptr;

   /*********/
   /* begin */
   /*********/

   if (DBUG && Watch.CliEnabled)
      fprintf (stdout, "WatchSetWatch() %d %d\n", rqptr, item);

   if (!Watch.CliEnabled && !Watch.RequestPtr) return (0);

   if (item == WATCH_NEW_ITEM)
   {
      WatchItemSize (rqptr);
      if (rqptr)
      {
         if (h2ptr = rqptr->Http2Stream.Http2Ptr)
         {
            if (h2ptr->WatchItem)
            {
               number = h2ptr->WatchItem & WATCH_ITEM_NUMBER_MASK;
               number = number % Watch.ItemPower2;
            }
            else
               number = ++Watch.ItemCount % Watch.ItemPower2;
            number += rqptr->Http2Stream.Ident * Watch.ItemPower2;
         }
         else
            number = ++Watch.ItemCount;
      }
      else
         number = ++Watch.ItemCount;
   }
   else
      number = item;

   if (rqptr)
   {
      if (Watch.CliEnabled)
         fprintf (stdout, "%s\nWatchSetWatch() %u->%u\n%s\n",
                  divider, rqptr->WatchItem, number, divider);

      if (h2ptr = rqptr->Http2Stream.Http2Ptr)
      {
         /* if not WATCHing the HTTP/2 connection */
         if (!(h2ptr->WatchItem & WATCH_ITEM_HTTP2_FLAG))
            Http2SetWatch (h2ptr, number);
      }
      else
      if (rqptr->NetIoPtr->SesolaPtr)
         SesolaSetWatch (rqptr->NetIoPtr->SesolaPtr, number);
      else
         rqptr->NetIoPtr->WatchItem = number;

      /* after I/O WATCH item set/reset request item */
      rqptr->WatchItem = number; 
   }
   else
   if (Watch.CliEnabled)
      fprintf (stdout, "%s\nWatchSetWatch() %u\n%s\n",
               divider, number, divider);

   return (number);

#endif /* WATCH_CAT */
}

/*****************************************************************************/
/*
WATCH item width starts at 6 digits (3 HTTP/2 ident plus 3 connection) and if
either overflows increments by 2 each time.
*/ 

void WatchItemSize (REQUEST_STRUCT *rqptr)

{
#if WATCH_CAT

   /*********/
   /* begin */
   /*********/

   if (Watch.CliEnabled) fprintf (stdout, "WatchItemSize()\n");

   if (!Watch.ItemWidth)
      Watch.ItemWidth = 6;
   else
   if (Watch.ItemCount+1 >= Watch.ItemPower2 ||
       (rqptr && rqptr->Http2Stream.Ident >= Watch.ItemPower2))
      Watch.ItemWidth += 2;

   if (Watch.ItemWidth != Watch.ItemDigits)
      Watch.ItemPower2 = ipow (10, Watch.ItemWidth / 2);

#endif /* WATCH_CAT */
}

/*****************************************************************************/
/*
Return true if an HTTP/2 rabbit hole (see prologue).
*/ 

BOOL WatchRabbitHole
(
WATCH_STRUCT *WatchPtr,
REQUEST_STRUCT *rqptr
)
{
#if WATCH_CAT

   /*********/
   /* begin */
   /*********/

   if (Watch.CliEnabled)
#if WATCH_MOD
      return (false);
#else
      fprintf (stdout, "WatchRabbitHole() %d\n", rqptr);
#endif

   if (rqptr &&
       rqptr->Http2Stream.Http2Ptr &&
       WatchPtr->RequestPtr &&
       rqptr->Http2Stream.Http2Ptr ==
          WatchPtr->RequestPtr->Http2Stream.Http2Ptr)
   {
      if (WatchPtr->DoPeek ||
#if WATCH_MOD
          WatchPtr->Module ||
#endif
          (WatchPtr->Category & WATCH_HTTP2) ||
          (WatchPtr->Category & WATCH_SESOLA) ||
          (WatchPtr->Category & WATCH_NETWORK) ||
          (WatchPtr->Category & WATCH_NETWORK_OCTETS))
         return (true);
   }

   return (false);

#endif /* WATCH_CAT */
}

/*****************************************************************************/
/*
Check and report if the WATCH facility is already being used (locally or via
another instance).  If has been observed, particularly with HTTP/2 and it's low
inter-request latency, that moving from actively WATCHing back to the WATCH
report menu can occur before the WATCHing request has a chance to run-down and
release the WATCH report.  This results in the user getting a "watch in use". 
To workaround this the code checks for that same client in what is probably
this scenario and allows the access.  It will be blocked once the client clicks
[WATCH] anyway.
*/ 

#if WATCH_CAT

BOOL WatchInUse
(
REQUEST_STRUCT *rqptr,
BOOL ReserveWatch
)
{
   BOOL  InstanceWatchInUse,
         LocalWatchInUse,
         SameClient;
   int  status;
   ushort  Length;
   ulong  *vecptr;
   ulong  FaoVector [8];
   char  *uac1ptr, *uac2ptr;
   char  Buffer [256];

   /*********/
   /* begin */
   /*********/

   if (DBUG && Watch.CliEnabled)
      fprintf (stdout, "WatchInUse()\n");

   if (Watch.CliEnabled) return (false);

   if (!rqptr)
   {
      /* release WATCH */
      if (VMSnok (status = InstanceUnLock (INSTANCE_NODE_WATCH)))
         ErrorExitVmsStatus (status, "InstanceUnLock()", FI_LI);
      return (false);
   }

   LocalWatchInUse = InstanceWatchInUse = SameClient = false;

   /* attempt to obtain the WATCH lock */
   status = InstanceLockNoWait (INSTANCE_NODE_WATCH);
   if (status == SS$_NOTQUEUED)
   {
      /* the lock is already in use (WATCH is in use elsewhere) */
      if (Watch.RequestPtr || Watch.Category || Watch.Module)
         LocalWatchInUse = true;
      else
         InstanceWatchInUse = true;
   }
   else
   {
      /* allows for CLI WATCH */
      if (LocalWatchInUse = Watch.Category || Watch.Module)
         if (VMSnok (status = InstanceUnLock (INSTANCE_NODE_WATCH)))
            ErrorExitVmsStatus (status, "InstanceUnLock()", FI_LI);
   }

   /* if not actually engaging WATCH report and are the same client */
   if ((LocalWatchInUse || InstanceWatchInUse) && !ReserveWatch)
   {
      /* bit clumsy but minimised required coding */
      uac1ptr = UserAtClient (rqptr);
      uac2ptr = UserAtClient (Watch.RequestPtr);
      if (!strcmp (uac1ptr, uac2ptr)) SameClient = true;
   }

   if (!(LocalWatchInUse || InstanceWatchInUse) || SameClient)
   {
      if (ReserveWatch)
         Watch.RequestPtr = rqptr;
      else
      if (!SameClient)
         if (VMSnok (status = InstanceUnLock (INSTANCE_NODE_WATCH)))
            ErrorExitVmsStatus (status, "InstanceUnLock()", FI_LI);
      return (false);
   }

   /* allow browser WATCH to piggyback on CLI WATCH */
   if (Watch.CliEnabled)
   {
      if (ReserveWatch) Watch.RequestPtr = rqptr;
      return (false);
   }

   vecptr = FaoVector;
   if (InstanceWatchInUse)
      *vecptr++ = "via another instance.";
   else
   if (Watch.RequestPtr)
   {
      *vecptr++ = "by !AZ";
      *vecptr++ = UserAtClient(Watch.RequestPtr);
   }
   else
      *vecptr++ = "via /WATCH";

   status = FaolToBuffer (Buffer, sizeof(Buffer), &Length,
                          "WATCH is currently in use !&@", &FaoVector);
   if (VMSnok (status)) ErrorNoticed (rqptr, status, NULL, FI_LI);

   Buffer[Length] = '\0';
   rqptr->rqResponse.HttpStatus = 403;
   ErrorGeneral (rqptr, Buffer, FI_LI);
   return (true);
}                                   

#endif /* WATCH_CAT */

/*****************************************************************************/
/*
Request using the WATCH facility drops the connection.  Release WATCH.
*/ 

void WatchEnd ()

{
#if WATCH_CAT

   static char  BufferFao [] = "|!%T end|\n\0";

   ushort  slen;
   char  Buffer [32];

   /*********/
   /* begin */
   /*********/

   if (Watch.CliEnabled) fprintf (stdout, "WatchEnd()\n");

   if (!Watch.RequestPtr) return;

   WatchNone (true);
   FaoToBuffer (Buffer, sizeof(Buffer), &slen, BufferFao, 0);
   WatchWrite (Buffer, slen-1);
   WatchWrite (NULL, 0);
   Watch.EndWatch = true;
   WatchNone (false);

#endif /* WATCH_CAT */
}                                   

/*****************************************************************************/
/*
Reset the WATCH structure.
*/ 

void WatchReset ()

{
#if WATCH_CAT

   /*********/
   /* begin */
   /*********/

   if (Watch.CliEnabled) fprintf (stdout, "WatchReset()\n");

   if (!Watch.RequestPtr) return;

   if (Watch.CliEnabled)
      Watch.RequestPtr = NULL;
   else
   {
      /* reset WATCH environment */
      WatchSetWatch (NULL, 0);
      memset (&Watch, 0, sizeof(WATCH_STRUCT));
      WatchInUse (NULL, false);
   }

#endif /* WATCH_CAT */
}                                   

/*****************************************************************************/
/*
The WATCH client concluding the watching can only be detected via a break in
connection which in a quiescent system (no requests being processed) can in
turn only be detected by a broken network read I/O or a TLS/SSL shutdown
exchange initiated.
*/ 

void WatchBreakDetect (REQUEST_STRUCT *rqptr)

{
#if WATCH_CAT

   static uchar  buf [32];

   /*********/
   /* begin */
   /*********/

   if (Watch.CliEnabled)
      fprintf (stdout, "WatchBreakDetect() 0x%08.08X 0x%08.08X 0x%08.08X\n",
               rqptr, rqptr->NetIoPtr->ReadPtr, buf);

   if (rqptr->NetIoPtr->ReadPtr == buf)
      WatchEnd ();
   else
      NetRead (rqptr, &WatchBreakDetect, buf, sizeof(buf));

#endif /* WATCH_CAT */
}

/*****************************************************************************/
/*
Write WATCH report output to <stdout> and network client as appropriate.
To reduce network latency of the often highly granular WATCH data use two
dynamic string buffers, filling one while the other is being written to the
client.
*/

void WatchWrite
(
void *DataPtr,
uint DataLength
)
{
#if WATCH_CAT

#define WATCH_STRDSC_SIZE 16384

   int  length;
   STR_DSC_AUTO (DataDsc);
   REQUEST_STRUCT  *rqptr;

   /*********/
   /* begin */
   /*********/

   if (0 && Watch.CliEnabled)
      fprintf (stdout, "WatchWrite() %d %d\n", DataPtr, DataLength);

   if (DataPtr)
   {
      if (DataLength < 0) DataLength = strlen(DataPtr);
      if (!DataLength) return;
      if (Watch.CliEnabled || Watch.StdoutToo || Watch.StdoutOnly)
         fwrite (DataPtr, DataLength, 1, stdout);
   }

   if (!Watch.RequestPtr && !Watch.StdoutOnly) return;

   /******************/
   /* network client */
   /******************/

   WatchNone (true);

   rqptr = Watch.RequestPtr;

   /* do not continue adding to the buffer if finishing up */
   if (!Watch.EndWatch)
   {
      if (DataPtr)
      {
         if (!STR_DSC_SANITY(&Watch.BufferDsc))
            StrDscBegin (rqptr, &Watch.BufferDsc, WATCH_STRDSC_SIZE);
         if (!STR_DSC_SANITY(&rqptr->NetWriteBufferDsc))
            StrDscBegin (rqptr, &rqptr->NetWriteBufferDsc, 0);

         StrDscThis (NULL, &DataDsc, DataPtr, DataLength);
         StrDscBuild (&Watch.BufferDsc, &DataDsc, NULL);
      }
   }

   if (!Watch.AstInUse && STR_DSC_SANITY(&Watch.BufferDsc))
   {
      length = StrDscLength (&Watch.BufferDsc);
      if ((!DataPtr && length) || (DataPtr && length > WATCH_STRDSC_SIZE))
      {
         StrDscSwap (&Watch.BufferDsc, &rqptr->NetWriteBufferDsc);
         StrDscNoContent (&Watch.BufferDsc);
         NetWriteStrDsc (rqptr, Watch.AstInUse = WatchWriteAst);
      }
   }

   WatchNone (false);

#endif /* WATCH_CAT */
}

/*****************************************************************************/
/*
If the the WATCH request pointer has been NULLed indicating the ending of the
WATCH report then reset the WATCH configuration ending the request.
*/

void WatchWriteAst (REQUEST_STRUCT *rqptr)

{
   /*********/
   /* begin */
   /*********/

#if WATCH_CAT

   if (0 && Watch.CliEnabled)
      fprintf (stdout, "WatchWriteAst()\n");

   Watch.AstInUse = NULL;

   if (VMSok (rqptr->NetIoPtr->WriteStatus))
   {
      if (!Watch.EndWatch) return;

      if (STR_DSC_SANITY(&Watch.BufferDsc) &&
          StrDscLength (&Watch.BufferDsc))
      {
         /* buffer has remaining content */
         WatchWrite (NULL, 0);
         return;
      }
   }

   WatchNone (true);
   WatchReset ();
   AdminEnd (rqptr);
   WatchNone (false);

#endif /* WATCH_CAT */
}

/*****************************************************************************/
/*
Temporarily suppress category and module WATCHing while using routines that
provide WATCH points - or all hell breaks loose :-D   Note that WatchBegin()
actually puts the WATCH items into .Category2 and .Module2 while WatchNone() is
in effect and these are "restored" to the active flags.
*/ 

void WatchNone (BOOL none)

{
   static int  NoneDepth = 0;

   /*********/
   /* begin */
   /*********/

#if WATCH_CAT

   if (none)
   {
      if (NoneDepth++ == 0)
      {
         Watch.Category2 = Watch.Category;
         Watch.Module2 = Watch.Module;
         Watch.Category = Watch.Module = 0;
      }
   }
   else
   {
      if (NoneDepth == 0)
         ErrorExitVmsStatus (SS$_BUGCHECK, ErrorSanityCheck, FI_LI);
      if (--NoneDepth == 0)
      {
         Watch.Category = Watch.Category2;
         Watch.Module = Watch.Module2;
         Watch.Category2 = Watch.Module2 = 0;
      }
   }

#endif /* WATCH_CAT */
}                                   

/*****************************************************************************/
/*
Filter on the HTTP protocol.
*/ 

void WatchFilterHttpProtocol (REQUEST_STRUCT *rqptr)

{
   BOOL  hit;
   char  *aptr;

   /*********/
   /* begin */
   /*********/

#if WATCH_CAT

   /* can occur if ASTs are delivered after WATCH use is discontinued */
   if (!Watch.Category && !Watch.Module) return;

   if (Watch.Category == WATCH_ONE_SHOT_CAT) return;

   if (!Watch.FilterSet) return;

   if (HTTP2_REQUEST(rqptr))
   {
      hit = Watch.HttpFilter2;
      aptr = "HTTP/2";
   }
   else
   if (rqptr->rqResponse.HttpVersion == HTTP_VERSION_1_1)
   {
      hit = Watch.HttpFilter11;
      aptr = "HTTP/1.1";
   }
   else
   if (rqptr->rqResponse.HttpVersion == HTTP_VERSION_1_0)
   {
      hit = Watch.HttpFilter10;
      aptr = "HTTP/1.0";
   }
   else
   if (rqptr->rqResponse.HttpVersion == HTTP_VERSION_0_9)
   {
      hit = Watch.HttpFilter09;
      aptr = "HTTP/0.9";
   }
   else
   {
      hit = false;
      aptr = "*BUGCHECK*";
   }

   if (Watch.FilterOutHttp)
   {
      /* if matches filter out */
      if (hit && rqptr->WatchItem)
         WatchFilterDrop (rqptr, aptr);
      else
      /* if doesn't match filter in */
      if (!hit && !rqptr->WatchItem)
         WatchFilterAdd (rqptr, aptr);
   }
   else
   /* if matches filter in */
   if (hit)
      WatchFilterAdd (rqptr, aptr);

#endif /* WATCH_CAT */
}                                   

/*****************************************************************************/
/*
Filter first on the client host name or address, then second on the service
(virtual host) name.  If the filter begins with a scheme (i.e. "http:" or
"https:") then filter on that as well.
*/ 

void WatchFilterClientService (REQUEST_STRUCT *rqptr)

{
   BOOL  match;
   int  WatchItem;
   char  *aptr, *cptr, *sptr;

   /*********/
   /* begin */
   /*********/

#if WATCH_CAT

   /* can occur if ASTs are delivered after WATCH use is discontinued */
   if (!Watch.Category && !Watch.Module) return;

   if (Watch.Category == WATCH_ONE_SHOT_CAT) return;

   if (!Watch.FilterSet)
   {
      /* WATCH is enabled but no filters have been specified */
      if (!WATCHING (rqptr, WATCH_CONNECT)) return;
      if (rqptr != Watch.RequestPtr)
      {
         WatchItem = rqptr->WatchItem;
         WatchSetWatch (rqptr, WATCH_NEW_ITEM);
         if (HTTP2_REQUEST(rqptr))
         {
            WatchThis (WATCHITM(rqptr), WATCH_CONNECT,
                       "HTTP/2 begin !UL with !AZ,!UL on !AZ//!AZ,!UL (!&I)",
                       rqptr->Http2Stream.Ident,
                       rqptr->ClientPtr->Lookup.HostName,
                       rqptr->ClientPtr->IpPort, 
                       rqptr->ServicePtr->RequestSchemeNamePtr,
                       rqptr->ServicePtr->ServerHostName,
                       rqptr->ServicePtr->ServerPort,
                       &rqptr->ServicePtr->ServerIpAddress);
            if (WatchRabbitHole (&Watch, rqptr))
            {
               WatchThis (WATCHITM(rqptr), WATCH_CONNECT, "HTTP/2 rabbit hole");
               WatchSetWatch (rqptr, 0);
            }
         }
         else
         if (rqptr->rqNet.PersistentCount)
            WatchThis (WATCHITM(rqptr), WATCH_CONNECT,
                       "PERSISTENT (!#ZL) with !AZ,!UL on !AZ//!AZ,!UL (!&I)",
                       Watch.ItemWidth, WatchItem,
                       rqptr->ClientPtr->Lookup.HostName,
                       rqptr->ClientPtr->IpPort, 
                       rqptr->ServicePtr->RequestSchemeNamePtr,
                       rqptr->ServicePtr->ServerHostName,
                       rqptr->ServicePtr->ServerPort,
                       &rqptr->ServicePtr->ServerIpAddress);
      }
      else
         WatchSetWatch (rqptr, 0);
      return;
   }

   if (!Watch.ClientFilter[0] && !Watch.ServiceFilter[0]) return;

   if (Watch.ClientFilter[0])
   {
      aptr = "CLIENT";
      sptr = Watch.ClientFilter;
      if (isdigit(*sptr))
         cptr = rqptr->ClientPtr->IpAddressString;
      else
         cptr = rqptr->ClientPtr->Lookup.HostName;

      WatchNone (true);
      match = StringMatchRegex (rqptr, cptr, sptr);
      WatchNone (false);
      if (match)
      {
         if (Watch.FilterOutClient)
         {
            WatchFilterDrop (rqptr, aptr);
            return;
         }
      }
      else
      if (!Watch.FilterOutClient)
         return;
   }

   if (Watch.ServiceFilter[0])
   {
      if (Watch.ClientFilter[0])
         aptr = "CLIENT+SERVICE";
      else
         aptr = "SERVICE";
      sptr = Watch.ServiceFilter;
      /* filter on service */
      if (MATCH5 (sptr, "http:"))
      {
         if (rqptr->ServicePtr->RequestScheme == SCHEME_HTTP)
            if (Watch.FilterOutService)
            {
               WatchFilterDrop (rqptr, aptr);
               return;
            }
         sptr += 5;
      }
      else
      if (MATCH6 (sptr, "https:"))
      {
         if (rqptr->ServicePtr->RequestScheme == SCHEME_HTTPS)
            if (Watch.FilterOutService)
            {
               WatchFilterDrop (rqptr, aptr);
               return;
            }
         sptr += 6;
      }
      while (*sptr == '/') sptr++;
      cptr = rqptr->ServicePtr->ServerHostPort;
      WatchNone (true);
      match = StringMatchRegex (rqptr, cptr, sptr);
      WatchNone (false);
      if (match)
      {
         if (Watch.FilterOutService)
         {
            WatchFilterDrop (rqptr, aptr);
            return;
         }
      }
      else
      if (!Watch.FilterOutService)
         return;
   }

   if (rqptr->WatchItem) return;

   WatchFilterAdd (rqptr, aptr);

#endif /* WATCH_CAT */
}                                   

/*****************************************************************************/
/*
Filter on the request's path or URI if the path does not begin with a slash
(e.g. if a proxy request).  If the filter begins with a dollar and track IDs
are being generated consider a track has been specified.
*/ 

void WatchFilterPathTrack (REQUEST_STRUCT *rqptr)

{
   BOOL  match;
   char  *aptr, *cptr, *sptr;

   /*********/
   /* begin */
   /*********/

#if WATCH_CAT

   /* can occur if ASTs are delivered after WATCH use is discontinued */
   if (!Watch.Category && !Watch.Module) return;

   if (!Watch.FilterSet) return;
   if (!Watch.PathFilter[0]) return;
   /* if filtering-in and it's already being WATChed */
   if (!Watch.FilterOutURI && rqptr->WatchItem) return;

   sptr = Watch.PathFilter;
   cptr = NULL;
   aptr = "URI";
   cptr = rqptr->rqHeader.RequestUriPtr;
   if (!cptr)
   {
      if (Watch.FilterOutURI)
      {
         WatchFilterDrop (rqptr, aptr);
         return;
      }
   }

   WatchNone (true);
   match = StringMatchRegex (rqptr, cptr, sptr);
   WatchNone (false);
   if (match)
   {
      if (Watch.FilterOutURI)
      {
         WatchFilterDrop (rqptr, aptr);
         return;
      }
   }
   else
   if (!Watch.FilterOutURI)
      return;

   if (rqptr->WatchItem) return;

   WatchFilterAdd (rqptr, aptr);

   /* if wanting request header report then satisfy at this late stage */
   if (WATCHING(rqptr,WATCH_REQUEST_HEADER))
   {
      WatchThis (WATCHITM(rqptr), WATCH_REQUEST_HEADER, "DATA");
      DictWatchEntry (NULL);
      DictWatch (rqptr->rqDictPtr, DICT_TYPE_INTERNAL, "request_line");
      DictWatch (rqptr->rqDictPtr, DICT_TYPE_REQUEST, "*");
   }

#endif /* WATCH_CAT */
}                                   

/*****************************************************************************/
/*
Filter first on the *entire* request header.
*/ 

void WatchFilterRequestHeader (REQUEST_STRUCT *rqptr)

{
   BOOL  match;
   char  *aptr, *cptr, *sptr;
   DICT_ENTRY_STRUCT  *denptr;

   /*********/
   /* begin */
   /*********/

#if WATCH_CAT

   /* can occur if ASTs are delivered after WATCH use is discontinued */
   if (!Watch.Category && !Watch.Module) return;

   if (Watch.Category == WATCH_ONE_SHOT_CAT) return;

   if (!Watch.FilterSet) return;
   if (!Watch.RequestFilter[0]) return;
   /* if filtering-in and it's already being WATChed */
   if (!Watch.FilterOutRequest && rqptr->WatchItem) return;

   if (!(cptr = rqptr->rqHeader.RequestHeaderPtr))
   {
      if ((denptr = RequestDictHeader (rqptr)) == NULL) return;
      cptr = DICT_GET_VALUE(denptr);
   }

   aptr = "REQUEST";
   sptr = Watch.RequestFilter;
   WatchNone (true);
   match = StringMatchRegex (rqptr, cptr, sptr);
   WatchNone (false);
   if (match)
   {
      if (Watch.FilterOutRequest)
      {
         WatchFilterDrop (rqptr, aptr);
         return;
      }
   }
   else
   if (!Watch.FilterOutRequest)
      return;

   if (rqptr->WatchItem) return;

   WatchFilterAdd (rqptr, aptr);

   /* if wanting request header report then satisfy at this late stage */
   if (WATCH_CATEGORY(WATCH_REQUEST_HEADER))
   {
      WatchThis (WATCHITM(rqptr), WATCH_REQUEST_HEADER, "DATA");
      DictWatchEntry (NULL);
      DictWatch (rqptr->rqDictPtr, DICT_TYPE_INTERNAL, "request_line");
      DictWatch (rqptr->rqDictPtr, DICT_TYPE_REQUEST, "*");
   }

#endif /* WATCH_CAT */
}                                   

/*****************************************************************************/
/*
Filter on the HTTP status value (late in the request I know).
*/ 

void WatchFilterHttpStatus (REQUEST_STRUCT *rqptr)

{
   char  *aptr; 

   /*********/
   /* begin */
   /*********/

#if WATCH_CAT

   /* can occur if ASTs are delivered after WATCH use is discontinued */
   if (!Watch.Category && !Watch.Module) return;

   if (Watch.Category == WATCH_ONE_SHOT_CAT) return;

   if (!Watch.FilterSet) return;
   if (Watch.StatusFilter < 0) return;
   /* if it's already being WATChed */
   if (rqptr->WatchItem) return;

   aptr = "STATUS";
   if ((Watch.StatusFilter && Watch.StatusFilter <= 5 &&
        rqptr->rqResponse.HttpStatus / 100 == Watch.StatusFilter) ||
       rqptr->rqResponse.HttpStatus == Watch.StatusFilter)
   {
      if (Watch.FilterOutRequest)
      {
         WatchFilterDrop (rqptr, aptr);
         return;
      }
   }
   else
   if (!Watch.FilterOutRequest)
      return;

   if (rqptr->WatchItem) return;

   WatchFilterAdd (rqptr, aptr);

   /* if wanting request header report then satisfy at this late stage */
   if (WATCH_CATEGORY(WATCH_REQUEST_HEADER))
   {
      WatchThis (WATCHITM(rqptr), WATCH_REQUEST_HEADER, "DATA");
      DictWatchEntry (NULL);
      DictWatch (rqptr->rqDictPtr, DICT_TYPE_INTERNAL, "request_line");
      DictWatch (rqptr->rqDictPtr, DICT_TYPE_REQUEST, "*");
   }

   /* same for authorisation data */
   if (WATCH_CATEGORY(WATCH_AUTH))
      if (rqptr->RemoteUser[0])
         WatchThis (WATCHITM(rqptr), WATCH_AUTH,
"user:\'!AZ\' details:\'!AZ\' can:!AZ remote:\'!AZ\' realm:\'!AZ\'",
                    rqptr->RemoteUser,
                    rqptr->rqAuth.UserDetailsPtr,
                    AuthCanString (rqptr->rqAuth.RequestCan,
                                   AUTH_CAN_FORMAT_LONG),
                    rqptr->rqAuth.RemoteUser,
                    rqptr->rqAuth.RealmPtr);

#endif /* WATCH_CAT */
}                                   

/*****************************************************************************/
/*
Filter first on authentication realm (if applicable) then on authenticated
(remote) user (if applicable). 
*/ 

void WatchFilterRealmUser (REQUEST_STRUCT *rqptr)

{
   BOOL  match;
   char  *aptr, *cptr, *sptr;

   /*********/
   /* begin */
   /*********/

#if WATCH_CAT

   /* can occur if ASTs are delivered after WATCH use is discontinued */
   if (!Watch.Category && !Watch.Module) return;

   if (Watch.Category == WATCH_ONE_SHOT_CAT) return;

   if (!Watch.FilterSet) return;
   if (!Watch.RealmFilter[0] && !Watch.UserFilter[0]) return;
   /* if filtering-in and it's already being WATChed */
   if (!Watch.FilterOutRealm &&
       !Watch.FilterOutUser &&
       rqptr->WatchItem) return;

   if (Watch.RealmFilter[0])
   {
      aptr = "REALM";
      sptr = Watch.RealmFilter;
      cptr = rqptr->rqAuth.RealmPtr;
      WatchNone (true);
      match = StringMatchRegex (rqptr, cptr, sptr);
      WatchNone (false);
      if (match)
      {
         if (Watch.FilterOutRealm)
         {
            WatchFilterDrop (rqptr, aptr);
            return;
         }
      }
      else
      if (!Watch.FilterOutRealm)
         return;
   }

   if (Watch.UserFilter[0])
   {
      if (Watch.RealmFilter[0])
         aptr = "REALM+USER";
      else
         aptr = "USER";
      sptr = Watch.UserFilter;
      cptr = rqptr->RemoteUser;
      WatchNone (true);
      match = StringMatchRegex (rqptr, cptr, sptr);
      WatchNone (false);
      if (match)
      {
         if (Watch.FilterOutUser)
         {
            WatchFilterDrop (rqptr, aptr);
            return;
         }
      }
      else
      if (!Watch.FilterOutUser)
         return;
   }

   if (rqptr->WatchItem) return;

   WatchFilterAdd (rqptr, aptr);

   /* if wanting request header report then satisfy at this late stage */
   if (WATCH_CATEGORY(WATCH_REQUEST_HEADER))
   {
      WatchThis (WATCHITM(rqptr), WATCH_REQUEST_HEADER, "DATA");
      DictWatchEntry (NULL);
      DictWatch (rqptr->rqDictPtr, DICT_TYPE_INTERNAL, "request_line");
      DictWatch (rqptr->rqDictPtr, DICT_TYPE_REQUEST, "*");
   }

#endif /* WATCH_CAT */
}                                   

/*****************************************************************************/
/*
If the request is not already being WATCHED then allocate a WATCH item number
and report it's addition.
*/ 

void WatchFilterAdd
(
REQUEST_STRUCT *rqptr,
char *AddingThis
)
{
   /*********/
   /* begin */
   /*********/

#if WATCH_CAT

   if (rqptr != Watch.RequestPtr)
   {
      WatchSetWatch (rqptr, WATCH_NEW_ITEM);
      WatchThis (WATCHITM(rqptr), WATCH_FILTER,
                 "!AZ adding !AZ,!UL on !AZ//!AZ,!UL (!&I)",
                 AddingThis,
                 rqptr->ClientPtr->Lookup.HostName,
                 rqptr->ClientPtr->IpPort, 
                 rqptr->ServicePtr->RequestSchemeNamePtr,
                 rqptr->ServicePtr->ServerHostName,
                 rqptr->ServicePtr->ServerPort,
                 &rqptr->ServicePtr->ServerIpAddress);
      if (WatchRabbitHole (&Watch, rqptr))
      {
         WatchThis (WATCHITM(rqptr), WATCH_FILTER, "HTTP/2 rabbit hole");
         WatchSetWatch (rqptr, 0);
      }
   }

#endif /* WATCH_CAT */
}                                   

/*****************************************************************************/
/*
If the request is currently being WATCHED then report it's removal and reset
the WATCH item number.
*/ 

void WatchFilterDrop
(
REQUEST_STRUCT *rqptr,
char *DroppingThis
)
{
   /*********/
   /* begin */
   /*********/

#if WATCH_CAT

   if (rqptr->WatchItem)
      WatchThis (WATCHITM(rqptr), WATCH_FILTER,
                 "!AZ dropping from WATCH", DroppingThis);
   rqptr->WatchItem = 0;

#endif /* WATCH_CAT */
}                                   

/*****************************************************************************/
/*
Provide a formatted WATCH entry.  |ReportFormat| parameter must be in a
sys$fao() acceptable format and sufficient variable number parameters be
supplied to satisfy any FAO directives in that format string.  The |WatchItem|,
|SourceModuleName| and |SourceLineNumber| are passed by the macros |WATCHITM|
and |WATCHALL|.  These macros provide compile time flexibility in the various
data structures (e.g. request, HTTP/2, network IO) that can be used to initiate
WATCH points.  All the |WATCHITM| structures need is a |->WatchItem| field. 
The |WATCHALL| just uses the item number zero.
*/ 

void WatchThis
(
int WatchItem,
char *SourceModuleName,
int SourceLineNumber,
int Category,
char *ReportFormat,
...
)
{
#if WATCH_CAT

   static char  BufferFao [] = "!&@!AZ|!%T !8AZ !4ZL !#ZL !10AZ !&@|\n";

   int  argcnt, status;
   ushort  slen;
   ulong  *vecptr;
   ulong  FaoVector [128];
   char  *cptr;
   char  Buffer [16384];
   va_list  argptr;
   WATCH_STRUCT  WatchBuffer;

   /*********/
   /* begin */
   /*********/

   if (DBUG && Watch.CliEnabled)
      fprintf (stdout, "WatchThis() %d |%s|\n", argcnt, ReportFormat);

   /* this can occur if ASTs are delivered after WATCH use is discontinued */
   if (!Watch.Category && !Watch.Module) return;

   WatchNone (true);

   /* fudge for SESOLANET and SESOLANETIO within 8 chars */
   if (MATCH8 (SourceModuleName+3, "OLANETIO")) SourceModuleName += 3;

   vecptr = FaoVector;

   if (!Watch.ItemWidth ||
       Watch.ItemWidth != Watch.ItemDigits)
   {
      WatchItemSize (NULL);
      Watch.ItemDigits = Watch.ItemWidth;
      *vecptr++ = WatchItemHeader;
      *vecptr++ = Watch.ItemWidth - 4;
   }
   else
      *vecptr++ = "";

   if (Category & WATCH_INTERNAL)
      *vecptr++ = WatchServerQuotas (0);
   else
      *vecptr++ = "";

   *vecptr++ = 0;
   *vecptr++ = SourceModuleName;
   *vecptr++ = SourceLineNumber;
   *vecptr++ = Watch.ItemWidth; 
   *vecptr++ = WatchItem & WATCH_ITEM_NUMBER_MASK;
#if WATCH_MOD
   if (Category & WATCH_MODULE_FLAG)
      cptr = WatchWhatModule (Category);
   else
#endif /* WATCH_MOD */
      cptr = WatchWhatCategory (Category);
   if (!cptr) cptr = "????????";
   *vecptr++ = cptr;

   /* append the report format string and it's parameters */
   *vecptr++ = ReportFormat;
   va_count (argcnt);
   va_start (argptr, ReportFormat);
   for (argcnt -= 5; argcnt; argcnt--)
      *vecptr++ = va_arg (argptr, unsigned long);
   va_end (argptr);

   if (Category & WATCH_INTERNAL)
      *vecptr++ = WatchServerQuotas (0);
   else
      *vecptr++ = "";

   FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
   status = FaolToBuffer (Buffer, sizeof(Buffer), &slen,
                          BufferFao, &FaoVector);

   if (VMSnok (status) || status == SS$_BUFFEROVF)
   {
      HttpdStackTrace ("WatchThis()", FI_LI);
      fprintf (stdout, "%%HTTPD-W-NOTICED2, %s:%d FaolToBuffer() %%X%08.08X\n",
               FI_LI, status);
   }

   WatchWrite (Buffer, slen);

   WatchNone (false);

#endif /* WATCH_CAT */
}

/*****************************************************************************/
/*
Function to provide a formatted data WATCH entry, with trailing information
from the caller.  'DataFormat' parameter must be in a sys$fao() acceptable
format and sufficient variable number parameters be supplied to satisfy any FAO
directives in that format string.  Should include appropriate carriage-control.
*/ 

void WatchDataFormatted
(
char *DataFormat,
...
)
{
#if WATCH_CAT

   int  status,
        argcnt;
   ushort  slen;
   ulong  *vecptr;
   ulong  FaoVector [64];
   char  Buffer [65535];
   va_list  argptr;

   /*********/
   /* begin */
   /*********/

   va_count (argcnt);

   if (DBUG && Watch.CliEnabled)
      fprintf (stdout, "WatchDataFormatted() %d\n", argcnt);

   /* this can occur if ASTs are delivered after WATCH use is discontinued */
   if (!Watch.Category && !Watch.Module) return;

   vecptr = FaoVector;
   va_start (argptr, DataFormat);
   for (argcnt -= 1; argcnt; argcnt--)
      *vecptr++ = va_arg (argptr, ulong);
   va_end (argptr);

   WatchNone (true);

   status = FaolToBuffer (Buffer, sizeof(Buffer), &slen,
                          DataFormat, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
      ErrorNoticed (NULL, status, NULL, FI_LI);
   Buffer[slen] = '\0';

   WatchNone (false);

   WatchWrite (Buffer, slen);

#endif /* WATCH_CAT */
}

/*****************************************************************************/
/*
Output the supplied, non-formatted data in the WATCH report.  Allows any
printable output to be included as a block in the WATCH output.
*/ 

void WatchData
(
char *DataPtr,
int DataLength
)
{
#if WATCH_CAT

   /* see comment against StrDscThis() */
   char  newline = '\n';

   /*********/
   /* begin */
   /*********/

   if (DBUG && Watch.CliEnabled)
      fprintf (stdout, "WatchData() %d\n", DataLength);

   /* this can occur if ASTs are delivered after WATCH use is discontinued */
   if (!Watch.Category && !Watch.Module) return;

   if (!DataPtr) return;

   if (DataLength == -1) DataLength = strlen(DataPtr);

   if (DataLength < 0 || DataLength > 65535)
   {
      HttpdStackTrace ("WatchData()", FI_LI);
      ErrorNoticed (NULL, SS$_BUGCHECK, NULL, FI_LI);
      return;
   }

   WatchWrite (DataPtr, DataLength);

   if (DataLength && DataPtr[DataLength-1] != '\n')
      WatchWrite (&newline, 1);

#endif /* WATCH_CAT */
}

/*****************************************************************************/
/*
Output the supplied data using WATCH as a hex and printable character dump.
If the data length is negative dump to <stdout>.
*/ 

void WatchDataDump
(
char *DataPtr,
int DataLength
)
{
#if WATCH_CAT

#define MAX_LINES 128
#define BYTES_PER_LINE 32
#define HEX_PER_LINE (BYTES_PER_LINE * 2)
#define BYTES_PER_GROUP 4
#define GROUPS_PER_LINE (BYTES_PER_LINE / BYTES_PER_GROUP)
#define CHARS_PER_LINE ((HEX_PER_LINE + GROUPS_PER_LINE + BYTES_PER_LINE) + 1)

   static char  HexDigits [] = "0123456789ABCDEF";

   BOOL  ToStdout;
   int  ByteCount,
        CurrentDataCount,
        DataCount,
        LinesSnipped;
   char  *cptr, *sptr, *zptr,
         *CurrentDataPtr,
         *PrevLinePtr,
         *ThisLinePtr;
   char  LineBuffer [CHARS_PER_LINE+1],
         DumpBuffer [(CHARS_PER_LINE * MAX_LINES) + 1];

   /*********/
   /* begin */
   /*********/

   if (DBUG && Watch.CliEnabled)
      fprintf (stdout, "WatchDataDump() %d\n", DataLength);

   if (ToStdout = DataLength < 0) DataLength *= -1;

   if (DataLength > 65535)
   {
      HttpdStackTrace ("WatchDataDump()", FI_LI);
      ErrorNoticed (NULL, SS$_BUGCHECK, NULL, FI_LI);
      return;
   }

   /* this can occur if ASTs are delivered after WATCH use is discontinued */
   if (!Watch.Category && !Watch.Module && !ToStdout) return;

   if (!DataPtr) return;

   /* end of buffer (zptr) allows plenty for "overflow" */
   zptr = (sptr = DumpBuffer) + sizeof(DumpBuffer) - (CHARS_PER_LINE * 2);
   cptr = DataPtr;
   PrevLinePtr = "";
   LinesSnipped = 0;
   DataCount = DataLength;

   while (DataCount)
   {
      CurrentDataPtr = cptr;
      CurrentDataCount = DataCount;

      ThisLinePtr = sptr;
      ByteCount = BYTES_PER_LINE;

      /* hex chars */
      while (ByteCount && DataCount)
      {
         *sptr++ = HexDigits[*(uchar*)cptr >> 4];
         *sptr++ = HexDigits[*(uchar*)cptr & 0xf];
         cptr++;
         DataCount--;
         ByteCount--;
         if (!(ByteCount % BYTES_PER_GROUP)) *sptr++ = ' ';
      }

      /* space to literal chars */
      while (ByteCount)
      {
         *sptr++ = ' ';
         *sptr++ = ' ';
         ByteCount--;
         if (!(ByteCount % BYTES_PER_GROUP)) *sptr++ = ' ';
      }

      cptr = CurrentDataPtr;
      DataCount = CurrentDataCount;

      /* literal chars */
      ByteCount = BYTES_PER_LINE;
      while (ByteCount && DataCount)
      {
         if (*cptr >= 32 && *cptr <= 126)
            *sptr++ = *cptr++;
         else
         {
            *sptr++ = '.';
            cptr++;
         }
         DataCount--;
         ByteCount--;
      }
      *sptr++ = '\n';

      if (!memcmp (PrevLinePtr, ThisLinePtr, sptr - ThisLinePtr))
      {
         /* this line is exactly the same as the previous */
         sptr = ThisLinePtr;
         LinesSnipped++;
      }
      else
      if (LinesSnipped)
      {
         *sptr = '\0';
         strcpy (LineBuffer, sptr = ThisLinePtr);
         sptr += sprintf (sptr, "8< %d lines %d bytes 8<\n",
                          LinesSnipped, LinesSnipped * BYTES_PER_LINE); 
         PrevLinePtr = sptr;
         sptr += sprintf (sptr, "%s", LineBuffer);
         LinesSnipped = 0;
      }
      else
         PrevLinePtr = ThisLinePtr;

      if (sptr >= zptr)
      {
         /* flush the buffer */
         *sptr = '\0';
         if (LinesSnipped)
         {
            *sptr = '\0';
            strcpy (LineBuffer, sptr = ThisLinePtr);
            sptr += sprintf (sptr, "8< %d line(s) %d byte(s) 8<\n",
                             LinesSnipped, LinesSnipped * BYTES_PER_LINE); 
            PrevLinePtr = "";
            sptr += sprintf (sptr, "%s", LineBuffer);
            LinesSnipped = 0;
         }
         if (ToStdout)
            fputs (DumpBuffer, stdout);
         else
            WatchData (DumpBuffer, sptr - DumpBuffer);
         /* end of buffer (zptr) allows plenty for "overflow" */
         zptr = (sptr = DumpBuffer) + sizeof(DumpBuffer) - (CHARS_PER_LINE * 2);
      }

      if (!DataCount)
      {
         /* WATCH data has been exhausted */
         if (LinesSnipped)
            sptr += sprintf (sptr, "8< %d line(s) %d byte(s) 8<\n",
                             LinesSnipped, LinesSnipped * BYTES_PER_LINE); 
         *sptr = '\0';
         if (ToStdout)
            fputs (DumpBuffer, stdout);
         else
            WatchData (DumpBuffer, sptr - DumpBuffer);
      }
   }

   if (ToStdout) fflush (stdout);

#endif /* WATCH_CAT */
}

/*****************************************************************************/
/*
If /percent/ is 50% or less then if any quota is less than that percenage of
original return a pointer to a string containing the quotas is returned,
otherwise a NULL.  If /percent/ is 0 then unconditionally return a pointer to a
string containing the quotas.
*/ 

char* WatchServerQuotas (int percent)

{
   static $DESCRIPTOR (QuotasFaoDsc,
"!AZAST:!UL/!UL BIO:!UL/!UL BYT:!UL/!UL DIO:!UL/!UL ENQ:!UL/!UL \
FIL:!UL/!UL PGFL:!UL/!UL PRC:!UL/!UL TQ:!UL/!UL\n\0");
   static char  Buffer [256];

   static int  JpiAstCnt,
               JpiBioCnt,
               JpiBytCnt,
               JpiDioCnt,
               JpiEnqCnt,
               JpiFilCnt,
               JpiPagFilCnt,
               JpiPrcCnt,
               JpiTqCnt;

   static struct {
      ushort  BufferLength;
      ushort  ItemCode;
      ulong  BufferAddress;
      ulong  ReturnLengthAddress;
   }
      JpiItem [] =
   { { sizeof(JpiAstCnt), JPI$_ASTCNT, &JpiAstCnt, 0 },
     { sizeof(JpiBioCnt), JPI$_BIOCNT, &JpiBioCnt, 0 },
     { sizeof(JpiBytCnt), JPI$_BYTCNT, &JpiBytCnt, 0 },
     { sizeof(JpiDioCnt), JPI$_DIOCNT, &JpiDioCnt, 0 },
     { sizeof(JpiEnqCnt), JPI$_ENQCNT, &JpiEnqCnt, 0 },
     { sizeof(JpiFilCnt), JPI$_FILCNT, &JpiFilCnt, 0 },
     { sizeof(JpiPagFilCnt), JPI$_PAGFILCNT, &JpiPagFilCnt, 0 },
     { sizeof(JpiPrcCnt), JPI$_PRCCNT, &JpiPrcCnt, 0 },
     { sizeof(JpiTqCnt), JPI$_TQCNT, &JpiTqCnt, 0 },
     { 0,0,0,0 }
   };

   int  status;
   ulong  *vecptr;
   ulong  FaoVector [32];
   char  alert [64],
         buf [64];
   struct dsc$descriptor_s  *faoptr;
   $DESCRIPTOR (BufferDsc, Buffer);
   IO_SB  IOsb;

   /*********/
   /* begin */
   /*********/

   status = sys$getjpiw (EfnWait, 0, 0, &JpiItem, &IOsb, 0, 0);
   if (VMSok (status)) status = IOsb.Status;
   if (VMSnok (status))
   {
      fprintf (stdout, "%%HTTPD-W-NOTICED2, %s:%d sys$getjpiw() %%X%08.08X\n",
               FI_LI, status);
      return ("sys$getjpiw() failed!");
   }

   if (percent > 0)
   {
      buf[0] = '\0';
      if (JpiAstCnt <= HttpdProcess.AstLm * percent / 100)
         strcat (buf, ",AST");
      if (JpiBioCnt <= HttpdProcess.BioLm * percent / 100)
         strcat (buf, ",BIO");
      if (JpiBytCnt <= HttpdProcess.BytLm * percent / 100)
         strcat (buf, ",BYT");
      if (JpiDioCnt <= HttpdProcess.DioLm * percent / 100)
         strcat (buf, ",DIO");
      if (JpiEnqCnt <= HttpdProcess.EnqLm * percent / 100)
         strcat (buf, ",ENQ");
      if (JpiFilCnt <= HttpdProcess.FilLm * percent / 100)
         strcat (buf, ",FILL");
      if (JpiPagFilCnt <= HttpdProcess.PgFlQuo * percent / 100)
         strcat (buf, ",PGFL");
//      if (JpiPrcCnt <= HttpdProcess.PrcLm * percent / 100)
//         strcat (buf, ",PRC");
      if (JpiTqCnt <= HttpdProcess.TqLm * percent / 100)
         strcat (buf, ",TQ");
      if (!buf[0]) return (NULL);
      sprintf (alert, "<=%d%%:%s; ", percent, buf+1);
   }

   vecptr = &FaoVector;

   if (percent && buf[0])
      *vecptr++ = alert;
   else
      *vecptr++ = "";

   *vecptr++ = JpiAstCnt;
   *vecptr++ = HttpdProcess.AstLm;
   *vecptr++ = JpiBioCnt;
   *vecptr++ = HttpdProcess.BioLm;
   *vecptr++ = JpiBytCnt;
   *vecptr++ = HttpdProcess.BytLm;
   *vecptr++ = JpiDioCnt;
   *vecptr++ = HttpdProcess.DioLm;
   *vecptr++ = JpiEnqCnt;
   *vecptr++ = HttpdProcess.EnqLm;
   *vecptr++ = JpiFilCnt;
   *vecptr++ = HttpdProcess.FilLm;
   *vecptr++ = JpiPagFilCnt;
   *vecptr++ = HttpdProcess.PgFlQuo;
   *vecptr++ = JpiPrcCnt;
   *vecptr++ = HttpdProcess.PrcLm;
   *vecptr++ = JpiTqCnt;
   *vecptr++ = HttpdProcess.TqLm;

   status = sys$faol (&QuotasFaoDsc, NULL, &BufferDsc, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
      fprintf (stdout, "%%HTTPD-W-NOTICED2, %s:%d sys$faol() %%X%08.08X\n",
               FI_LI, status);

   return (Buffer);
}

/*****************************************************************************/
/*
Keep an eye on remaining process quotas.  If any quota drops to 30% provide an
alert every minute.  If it drops to 10% then every second.  Though for ASTs
that's probably too late.  Provide an OPCOM meessage, and in-server-log stamp
of the event, and an alert shown on the Server Admin menu.
*/ 

void WatchServerAlertQuotas ()

{
   static int  PrevMin,
               PrevSec;

   int  quota;
   char  *cptr, *sptr;

   /*********/
   /* begin */
   /*********/

   quota = 30;
#if WATCH_MOD
   if (cptr = SysTrnLnm (WASD_ALERT_QUOTAS)) quota = atoi(cptr);
#endif
   if (cptr = WatchServerQuotas (quota))
   {
      if (sptr = WatchServerQuotas (20))
      {
         quota = 20;
         cptr = sptr;
         if (sptr = WatchServerQuotas (10))
         {
            quota = 10;
            cptr = sptr;
         }
      }
   }
   if (!cptr) return;

   if (quota > 10 && HttpdTime7[4] != PrevMin)
      PrevMin = HttpdTime7[4];
   else
   if (HttpdTime7[5] != PrevSec)
      PrevSec = HttpdTime7[5];
   else
      return;

   for (sptr = cptr; *sptr && *sptr != '\n'; sptr++);
   *sptr = '\0';
   FaoToOpcom ("QUOTAS !UL% !AZ", quota, cptr);
   ErrorNoticed (NULL, SS$_REMINDER, cptr, FI_LI);

   for (sptr = cptr; *sptr && *sptr != ';'; sptr++);
   *sptr = '\0';
   FaoToBuffer (WatchQuotasAlert, sizeof(WatchQuotasAlert), NULL,
                "!6%D !5%T !AZ", 0, 0, cptr);
   fflush (stdout);
}

/*****************************************************************************/
/*
*/

void WatchDuration (int64 *dura64ptr, char *module, int line)

{
   int64  delta64;

   /*********/
   /* begin */
   /*********/

   if (module)
   {
      sys$gettim (&delta64);
      delta64 = *dura64ptr - delta64;
      FaoToStdout ("%WATCH-I-DURATION, !AZ:!UL !%T\n",
                   module, line, &delta64);
   }
   else
      sys$gettim (dura64ptr);
}

/*****************************************************************************/
/*
Return a string corresponding to the function name of the address passed in
'FunctionPtr'.  The '#include watchfunc.h" below provides a static array
containing function address and name details that during module WATCHing can be
used by the FAO.C ('!&F') '!&A' directive to provide function names rather than
just address information.  Returns NULL if the address is unknown.  The
'watchfunc.h' file is generated by the BUILD_WATCHFUNC.COM procedure.
*/ 

char* WatchFunction (void *FunctionPtr)

{
   int  idx;

   /*********/
   /* begin */
   /*********/

   if (!FunctionPtr) return (NULL);
   for (idx = 0; WatchFunc[idx].Address; idx++)
      if (WatchFunc[idx].Address == FunctionPtr) break;
   return (WatchFunc[idx].Name);
}

/*****************************************************************************/
/*
Return a string corresponding to the bit set in the parameter.
*/ 

#if WATCH_CAT

char* WatchWhatCategory (uint number)

{
   /*********/
   /* begin */
   /*********/

   switch (number)
   {
      case WATCH_AUTH             : return ("AUTHORIZE");
      case WATCH_CONNECT          : return ("CONNECT");
      case WATCH_CGI              : return ("CGI");
      case WATCH_DCL              : return ("DCL");
      case WATCH_DECNET           : return ("DECNET");
      case WATCH_ERROR            : return ("ERROR");
      case WATCH_FILTER           : return ("FILTER");
      case WATCH_HTTP2            : return ("HTTP/2");
      case WATCH_INTERNAL         : return ("INTERNAL");
      case WATCH_LOG              : return ("LOG");
      case WATCH_MAPPING          : return ("MAPPING");
      case WATCH_MATCH            : return ("MATCH");
      case WATCH_NETWORK          : return ("NETWORK");
      case WATCH_NETWORK_OCTETS   : return ("NET-OCTETS");
      case WATCH_PROXY            : return ("PROXY");
      case WATCH_PROXY_REQU_HDR   : return ("PRO-REQ-HEADER");
      case WATCH_PROXY_REQU_BDY   : return ("PRO-REQ-BODY");
      case WATCH_PROXY_RESP_HDR   : return ("PRO-RES-HEADER");
      case WATCH_PROXY_RESP_BDY   : return ("PRO-RES-BODY");
      case WATCH_PROXY_REWORK     : return ("PROXY-REWORK");
      case WATCH_REQUEST          : return ("REQUEST");
      case WATCH_REQUEST_BODY     : return ("REQ-BODY");
      case WATCH_REQUEST_HEADER   : return ("REQ-HEADER");
      case WATCH_RESPONSE         : return ("RESPONSE");
      case WATCH_RESPONSE_BODY    : return ("RES-BODY");
      case WATCH_RESPONSE_HEADER  : return ("RES-HEADER");
      case WATCH_SCRIPT           : return ("SCRIPT");
      case WATCH_SESOLA           : return ("SSL");
      case WATCH_WEBDAV           : return ("WEBDAV");
   }

   return (NULL);
}

#endif /* WATCH_CAT */

/*****************************************************************************/
/*
Return a string corresponding to the bit set in the parameter.
*/ 

#if WATCH_MOD

char* WatchWhatModule (uint number)

{
   /*********/
   /* begin */
   /*********/

   switch (number)
   {
      case WATCH_MOD_AUTH         : return ("_AUTH..");
      case WATCH_MOD_BODY         : return ("_BODY");
      case WATCH_MOD_CACHE        : return ("_CACHE");
      case WATCH_MOD_CGI          : return ("_CGI");
      case WATCH_MOD_CONFIG       : return ("_CONFIG");
      case WATCH_MOD_DCL          : return ("_DCL");
      case WATCH_MOD_DECNET       : return ("_DECNET");
      case WATCH_MOD_DIR          : return ("_DIR");
      case WATCH_MOD_FAO          : return ("_FAO");
      case WATCH_MOD_FILE         : return ("_FILE");
      case WATCH_MOD_HTADMIN      : return ("_HTADMIN");
      case WATCH_MOD_HTTP2        : return ("_HTTP2..");
      case WATCH_MOD_INSTANCE     : return ("_INSTANCE");
      case WATCH_MOD_MAPURL       : return ("_MAPURL");
      case WATCH_MOD_METACON      : return ("_METACON");
      case WATCH_MOD_MSG          : return ("_MSG");
      case WATCH_MOD_NET          : return ("_NET");
      case WATCH_MOD_REQUEST      : return ("_REQUEST");
      case WATCH_MOD_ODS          : return ("_ODS");
      case WATCH_MOD_PUT          : return ("_PUT");
      case WATCH_MOD_PROXY        : return ("_PROXY..");
      case WATCH_MOD_RESPONSE     : return ("_RESPONSE");
      case WATCH_MOD_SERVICE      : return ("_SERVICE");
      case WATCH_MOD_SESOLA       : return ("_SESOLA..");
      case WATCH_MOD_SSI          : return ("_SSI");
      case WATCH_MOD_THROTTLE     : return ("_THROTTLE");
      case WATCH_MOD_UPD          : return ("_UPD");
      case WATCH_MOD_VM           : return ("_VM");
      case WATCH_MOD_WEBDAV       : return ("_WEBDAV");
      /* special cases (no pun intended) */
      case WATCH_MOD__DETAIL      : return ("_detail");
      case WATCH_MOD__OTHER       : return ("_other");
   }

   return (NULL);
}

#endif /* WATCH_MOD */

/*****************************************************************************/
/*
Parse the /WATCH= qualifier string for command-line startup control. General
format is "/WATCH=[NOSTARTUP,]items[,module][,client][,service][,URI/track]". 
The first mandatory parameter, 'items', may be preceded by an optional
NOSTARTUP keyword.  This suppresses all WATCH output until the server is ready
to accept requests (reducing the some WATCH item output considerably).  The
'items' parameter can be one or two numbers representing the items to be
displayed (these may be found in the WATCH report output) or more conveniently
can be a parenthesized, comma-separated list of item names.  For example,
"/WATCH=ITEM=(MAPPING,REQUEST,RESPONSE)" and/or module names,
"/WATCH=ITEM=(REQUEST,RESPONSE,_AUTH..,_MAPURL,_METACON)".  The item names can
be any found in WatchWhat() immediately above and must be supplied exactly as
the strings appear in the switch() statement above (i.e. note some have
trailing "..").
*/ 

BOOL WatchCliParse (char *String)

{
#if WATCH_CAT

   BOOL  EndItemList,
         Include_Fao,
         Include_Instance,
         Include_Other,
         NoItem;
   ulong  ucnt;
   char  *cptr, *sptr, *zptr;

   /*********/
   /* begin */
   /*********/

   if (strsame (String, "/NOWATCH", 6))
   {
      Watch.Disabled = -1;
      return (true);
   }
   if (Watch.Disabled < 0) return (true);
   Watch.CliEnabled = true;
   Watch.StatusFilter = -1;
   Include_Fao = Include_Instance = Include_Other = false;

   cptr = String;
   while (*cptr && *cptr != '=') cptr++;
   while (*cptr == '=' || *cptr == '\"') cptr++;
   if (!*cptr) return (true);
   if (*cptr == '(') cptr++;

   if (strsame (cptr, "LIST", -1))
   {
      char  CategoryList [WATCH_CATEGORY_LIST_SIZE];
      sptr = CategoryList;
      for (ucnt = 1; ucnt; ucnt = ucnt << 1)
      {
         cptr = WatchWhatCategory (ucnt);
         if (cptr)
         {
            if (sptr > CategoryList) { *sptr++ = ','; *sptr++ = ' '; }
            while (*cptr) *sptr++ = TOLO(*cptr++);
         }
      }
#if WATCH_MOD
      /* then any modules */
      for (ucnt = 1; ucnt; ucnt = ucnt << 1)
      {
         cptr = WatchWhatModule (ucnt);
         if (cptr)
         {
            if (sptr > CategoryList) { *sptr++ = ','; *sptr++ = ' '; }
            while (*cptr) *sptr++ = TOLO(*cptr++);
         }
      }
#endif /* WATCH_MOD */
      *sptr = '\0';
      FaoToStdout ("%HTTPD-I-WATCH, !AZ\n", CategoryList);
      exit (SS$_NORMAL);
   }

   if (strsame (cptr, "NOSTARTUP", 7))
   {
      Watch.CliNoStartup = true;
      while (isalpha(*cptr)) cptr++;
      if (*cptr == ',' || *cptr == '=') cptr++;
   }

   if (strsame (cptr, "ITEM=(", 6) ||
       strsame (cptr, "ITEMS=(", 7))
   {
      cptr += 6;
      if (*cptr == '(') cptr++;
      Watch.Category = Watch.Module = 0;
      EndItemList = false;
      while (*cptr && *cptr != ')' && !EndItemList)
      {
         sptr = cptr;
         while (*cptr && *cptr != ',' && *cptr != ')') cptr++;
         if (*cptr == ')') EndItemList = true;
         if (*cptr) *cptr++ = '\0';
         if (strsame (sptr, "NO", 2) && !strsame (sptr, "NOTICED", -1))
         {
            NoItem = true;
            sptr += 2;
         }
         else
            NoItem = false;
         for (ucnt = 1; ucnt; ucnt = ucnt << 1)
         {
            zptr = WatchWhatCategory (ucnt);
            if (zptr && strsame (sptr, zptr, -1))
            {
               if (NoItem)
                  Watch.Category &= ~ucnt;
               else
                  Watch.Category |= ucnt;
               break;
            }
#if WATCH_MOD
            zptr = WatchWhatModule (ucnt);
            if (zptr && strsame (sptr, zptr, -1))
            {
               if (NoItem)
                  Watch.Module &= ~ucnt;
               else
                  Watch.Module |= ucnt;
               break;
            }
#endif /* WATCH_MOD */
         }
         if (!ucnt)
         {
            if (strsame (sptr, "ALLCAT", -1))
               Watch.Category |= (ucnt = 0x7fffffff);
            else
            if (strsame (sptr, "ALLMOD", -1))
               Watch.Module |= (ucnt = 0x7fffffff);
#if WATCH_MOD
            /* unless specifically included these are always excluded */
            else
            if (strsame (sptr, "_FAO", -1))
               Include_Fao = true;
            else
            if (strsame (sptr, "_INSTANCE", -1))
               Include_Instance = true;
            else
            if (strsame (sptr, "_OTHER", -1))
               Include_Other = true;
#endif /* WATCH_MOD */
         }
         if (!ucnt)
         {
            FaoToStdout ("%HTTPD-E-WATCH, unknown item\n \\!AZ\\\n", sptr);
            return (false);
         }
         if (*cptr == ',') cptr++;
      }
   }
   else
   {
      if (!(Watch.Category = atoi(cptr)))
      {
         FaoToStdout ("%HTTPD-E-WATCH, invalid category number");
         return (false);
      }
      while (*cptr && (*cptr == '-' || isdigit(*cptr))) cptr++;
      if (*cptr == ',') cptr++;
      if (*cptr == '-' || isdigit(*cptr))
      {
         if (!(Watch.Module = atoi(cptr)))
         {
            FaoToStdout ("%HTTPD-E-WATCH, invalid module number");
            return (false);
         }
         while (*cptr && (*cptr == '-' || isdigit(*cptr))) cptr++;
         if (*cptr == ',') cptr++;
      }
   }

   Watch.Category = Watch.Category & ~WATCH_reserved1;
   Watch.Category = Watch.Category & ~WATCH_reserved2;

#if WATCH_MOD
   /* unless specifically included these are always excluded */
   if (!Include_Fao) Watch.Module = Watch.Module & ~WATCH_MOD_FAO;
//   if (!Include_Instance) Watch.Module = Watch.Module & ~WATCH_MOD_INSTANCE;
//   if (!Include_Other) Watch.Module = Watch.Module & ~WATCH_MOD__OTHER;
   Watch.Module |= WATCH_MODULE_FLAG;
#endif /* WATCH_MOD */

   if (*cptr == ')') return (true);
   zptr = (sptr = Watch.ClientFilter) + sizeof(Watch.ClientFilter);
   while (*cptr && *cptr != ',' && *cptr != '\"' && sptr < zptr)
      *sptr++ = *cptr++;
   if (sptr >= zptr)
   {
      FaoToStdout ("%HTTPD-E-WATCH, invalid client filter");
      return (false);
   }
   *sptr = '\0';
   if (*cptr == ',') cptr++;

   if (*cptr == ')') return (true);
   zptr = (sptr = Watch.ServiceFilter) + sizeof(Watch.ServiceFilter);
   while (*cptr && *cptr != ',' && *cptr != '\"' && sptr < zptr)
      *sptr++ = *cptr++;
   if (sptr >= zptr)
   {
      FaoToStdout ("%HTTPD-E-WATCH, invalid service filter");
      return (false);
   }
   *sptr = '\0';
   if (*cptr == ',') cptr++;

   if (*cptr == ')') return (true);
   zptr = (sptr = Watch.PathFilter) + sizeof(Watch.PathFilter);
   while (*cptr && *cptr != ',' && *cptr != '\"' && sptr < zptr)
      *sptr++ = *cptr++;
   if (sptr >= zptr)
   {
      FaoToStdout ("%HTTPD-E-WATCH, invalid URI/track filter");
      return (false);
   }
   *sptr = '\0';

   if (!Watch.ClientFilter[0]) strcpy (Watch.ClientFilter, "*");
   if (!Watch.PathFilter[0]) strcpy (Watch.PathFilter, "*");
   if (!Watch.ServiceFilter[0]) strcpy (Watch.ServiceFilter, "*");

   return (true);

#else /* WATCH_CAT */

   FaoToStdout ("%HTTPD-E-WATCH, is not a compiled option");
   return (false);

#endif /* WATCH_CAT */
}

/*****************************************************************************/
/*
*/ 

void WatchCliSettings (BOOL StartUpComplete)

{
#if WATCH_CAT

   static int  WatchCategory,
               WatchModule;

   ulong  ucnt;
   char  *cptr, *sptr;
   char  CategoryList [WATCH_CATEGORY_LIST_SIZE];

   /*********/
   /* begin */
   /*********/

   if (!StartUpComplete)
   {
      WatchCategory = Watch.Category;
      WatchModule = Watch.Module;
      if (Watch.CliNoStartup) Watch.Category = Watch.Module = 0;
      return;
   }
   Watch.Category = WatchCategory;
   Watch.Module = WatchModule;

   if (Watch.Disabled)
   {
      FaoToStdout ("%HTTPD-I-WATCH, disabled\n");
      return;
   }

   if (!Watch.Category && !Watch.Module) return;

   sptr = CategoryList;
   /* first any categories */
   for (ucnt = 1; ucnt; ucnt = ucnt << 1)
   {
      cptr = WatchWhatCategory (Watch.Category & ucnt);
      if (cptr)
      {
         if (sptr > CategoryList) { *sptr++ = ','; *sptr++ = ' '; }
         while (*cptr) *sptr++ = TOLO(*cptr++);
      }
   }
#if WATCH_MOD
   /* then any modules */
   for (ucnt = 1; ucnt; ucnt = ucnt << 1)
   {
      cptr = WatchWhatModule (Watch.Module & ucnt);
      if (cptr)
      {
         if (sptr > CategoryList) { *sptr++ = ','; *sptr++ = ' '; }
         while (*cptr) *sptr++ = TOLO(*cptr++);
      }
   }
#endif /* WATCH_MOD */
   *sptr = '\0';

   FaoToStdout (
"%HTTPD-I-WATCH, !&?NOSTARTUP \r\r(!SL,!SL) !AZ\n\
-WATCH-I-CLIENT, client filter \"!AZ\"\n\
-WATCH-I-SERVICE, service filter \"!AZ\"\n\
-WATCH-I-PATH, URI/track filter \"!AZ\"\n",
            Watch.CliNoStartup,
            Watch.Category, Watch.Module, CategoryList,
            Watch.ClientFilter,
            Watch.ServiceFilter,
            Watch.PathFilter);

#endif /* WATCH_CAT */
}

/*****************************************************************************/
/*
Generate a report page listing all of the processes belonging to the server
process.
*/

/* seems a lot but I recall some site having a HUGE number of IDs */
#define JPI_PROCESS_RIGHTS_MAX 1024

#define PSCAN$_GETJPI_BUFFER_SIZE 24

WatchProcessReport (REQUEST_STRUCT *rqptr)

{
   static char  BeginPage [] =
"<p><table class=\"lftlft\">\n\
<tr><th></th>\
<th>PID</th>\
<th>User</u></th>\
<th>Process Name</th>\
<th>Image</th>\
<th>Mode</th>\
<th>State</th>\
<th>Priority</th>\
</tr>\n";

   static char  ProcessFao [] =
"<tr!AZ>\
<td><a href=\"!AZ?pid=!8XL&puser=!AZ\">!3ZL</a></td>\
<td>!8XL</td>\
<td>!AZ</td>\
<td>!AZ</td>\
<td>!AZ</td>\
<td>!AZ</td>\
<td>!AZ</td>\
<td>!UL&nbsp;/&nbsp;!UL</td>\
</tr>\n";

   static char  EndPageFao [] =
"</table>\n\
!AZ\
</body>\n\
</html>\n";

   static char  *StateNameArray [] = {
                "1234","COLPG","MWAIT","CEF","PFW","LEF","LEFO",
                "HIB","HIBO","SUSP","SUSPO","FPG","COM","COMO","CUR" };

   static ulong  GetJpiControlFlags = JPI$M_IGNORE_TARGET_STATUS;

   static ulong  JpiMode,
                 JpiPid,
                 JpiPri,
                 JpiPrib,
                 JpiRightsSize,
                 JpiState;
   static char  JpiImagName [256],
                JpiNodeName [32],
                JpiPrcNam [16],
                JpiUserName [13];

   static struct
   {
      ushort  buf_len;
      ushort  item;
      uchar   *buf_addr;
      ushort  *short_ret_len;
   }
      JpiItems [] =
   {
      { sizeof(GetJpiControlFlags), JPI$_GETJPI_CONTROL_FLAGS,
        &GetJpiControlFlags, 0 },
      { sizeof(JpiPid), JPI$_PID, &JpiPid, 0 },
      { sizeof(JpiPri), JPI$_PRI, &JpiPri, 0 },
      { sizeof(JpiPrib), JPI$_PRIB, &JpiPrib, 0 },
      { sizeof(JpiMode), JPI$_MODE, &JpiMode, 0 },
      { sizeof(JpiImagName), JPI$_IMAGNAME, &JpiImagName, 0 },
      { sizeof(JpiPrcNam), JPI$_PRCNAM, &JpiPrcNam, 0 },
      { sizeof(JpiUserName), JPI$_USERNAME, &JpiUserName, 0 },
      { sizeof(JpiState), JPI$_STATE, &JpiState, 0 },
      { sizeof(JpiRightsSize), JPI$_RIGHTS_SIZE, &JpiRightsSize, 0 },
#define JPI_PROCESS_RIGHTS_ITEM 10
      { 0, JPI$_PROCESS_RIGHTS, 0, 0 },
      { 0,0,0,0 }
   },
      ScanItems [] =
   {
      { 0, PSCAN$_GETJPI_BUFFER_SIZE, 2048, 0},
      { 0,0,0,0 }
   };

   int  idx, status,
        IdentCount,
        ProcessCount,
        SetPrvStatus;
   ulong  *vecptr;
   ulong  ProcessContext;
   ulong  FaoVector [32];
   char  *cptr, *sptr;
   ulong  JpiProcessRights [JPI_PROCESS_RIGHTS_MAX*2];
   IO_SB  IOsb;

   /*********/
   /* begin */
   /*********/

   if (WATCH_MODULE(WATCH_MOD__OTHER))
      WatchThis (WATCHALL, WATCH_MOD__OTHER, "WatchProcessReport()");

   JpiItems[JPI_PROCESS_RIGHTS_ITEM].buf_len = sizeof(JpiProcessRights);
   JpiItems[JPI_PROCESS_RIGHTS_ITEM].buf_addr = &JpiProcessRights;

   ProcessContext = 0;
   status = sys$process_scan (&ProcessContext, &ScanItems);
   if (VMSnok (status))
   {
      rqptr->rqResponse.ErrorTextPtr = "sys$process_scan()";
      ErrorVmsStatus (rqptr, status, FI_LI);
      AdminEnd (rqptr);
      return;
   }

   AdminPageTitle (rqptr, "Process Report", BeginPage);

   /* detached scripts (possibly executing as a non-server username) */
   if (DclScriptDetachProcess)
      if (VMSnok (SetPrvStatus = sys$setprv (1, &MailboxMask, 0, 0)))
         ErrorExitVmsStatus (SetPrvStatus, "sys$setprv()", FI_LI);

   ProcessCount = 0;

   for (;;)
   {
      status = sys$getjpiw (EfnWait, &ProcessContext, 0,
                            &JpiItems, &IOsb, 0, 0);
      if (VMSok (status)) status = IOsb.Status;
      if (VMSnok (status)) break;

      JpiPrcNam[15] = '\0';
      for (cptr = JpiPrcNam; *cptr && *cptr != ' '; cptr++);
      *cptr = '\0';

      JpiUserName[12] = '\0';
      for (cptr = JpiUserName; *cptr && *cptr != ' '; cptr++);
      *cptr = '\0';

      if (WATCH_MODULE(WATCH_MOD__OTHER))
         WatchThis (WATCHALL, WATCH_MOD__OTHER, "!8XL !&Z !&Z !UL",
                    JpiPid, JpiUserName, JpiPrcNam, JpiRightsSize);

      if (DclScriptDetachProcess &&
          JpiPid != HttpdProcess.Pid)
      {
         if (JpiRightsSize > sizeof(JpiProcessRights))
         {
            char  Buffer [32];
            sprintf (Buffer, "sys$getjpiw() %08.08X", JpiPid);
            ErrorNoticed (rqptr, SS$_BUFFEROVF, Buffer, FI_LI);
         }

         /* look through each of the identifiers in the list */
         idx = 0;
         for (IdentCount = JpiRightsSize / 8;
              IdentCount && JpiProcessRights[idx] != ProcessRightsIdent[0];
              IdentCount--) idx += 2;

         /* if we didn't find the identifier then continue */
         if (!IdentCount) continue;
      }

      ProcessCount++;

      for (cptr = JpiImagName; *cptr && *cptr != ';'; cptr++);
      if (*cptr == ';') *cptr-- = '\0';
      while (cptr > JpiImagName && *cptr != ']') cptr--;
      if (*cptr == ']') cptr++;

      if (JpiState > 0 && JpiState <= 14)
         sptr = StateNameArray[JpiState];
      else
         sprintf (sptr = StateNameArray[0], "%04.04X", JpiState);

      vecptr = FaoVector;
      if (ProcessCount % 2)
         *vecptr++ = "";
      else
         *vecptr++ = " class=\"hlght\"";
      *vecptr++ = ADMIN_REPORT_SHOW_PROCESS;
      *vecptr++ = JpiPid;
      *vecptr++ = JpiUserName;
      *vecptr++ = ProcessCount;
      *vecptr++ = JpiPid;
      *vecptr++ = JpiUserName;
      *vecptr++ = JpiPrcNam;
      if (*cptr)
         *vecptr++ = cptr;
      else
         *vecptr++ = "[<font size=\"-1\">DCL</font>]";
      switch (JpiMode)
      {
         case JPI$K_BATCH : *vecptr++ = "BAT"; break;
         case JPI$K_INTERACTIVE : *vecptr++ = "INT"; break;
         case JPI$K_NETWORK : *vecptr++ = "NET"; break;
         case JPI$K_OTHER : *vecptr++ = "OTH"; break;
         default : *vecptr++ = "?";
      }
      *vecptr++ = sptr;
      *vecptr++ = JpiPri;
      *vecptr++ = JpiPrib;

      status = FaolToNet (rqptr, ProcessFao, &FaoVector);
      if (VMSnok (status)) ErrorNoticed (rqptr, status, NULL, FI_LI);
   }

   if (DclScriptDetachProcess)
      if (VMSnok (SetPrvStatus = sys$setprv (0, &MailboxMask, 0, 0)))
         ErrorExitVmsStatus (SetPrvStatus, "sys$setprv()", FI_LI);

   if (status != SS$_NOMOREPROC)
   {
      rqptr->rqResponse.ErrorTextPtr = "sys$getjpiw()";
      ErrorVmsStatus (rqptr, status, FI_LI);
   }

   vecptr = FaoVector;
   *vecptr++ = AdminRefresh();

   status = FaolToNet (rqptr, EndPageFao, &FaoVector);
   if (VMSnok (status)) ErrorNoticed (rqptr, status, NULL, FI_LI);

   rqptr->rqResponse.PreExpired = PRE_EXPIRE_ADMIN;
   ResponseHeader200 (rqptr, "text/html", &rqptr->NetWriteBufferDsc);

   AdminEnd (rqptr);
}

/*****************************************************************************/
/*
Using a scripting script process do a SHOW PROCESS /ALL on the specified
process.  Used from the DclReport() but actually could be used on any process
the server has access to, including the server!
*/

void WatchShowProcess
(
REQUEST_STRUCT *rqptr,
char *ProcessIdString,
char *ProcessIdUserName
)
{
   static char  DclCommand [512];
   static ulong  JpiServerPid;
   static $DESCRIPTOR (DclCommandDsc, DclCommand);
   static $DESCRIPTOR (DclCommandFaoDsc,
"SHOW PROCESS /ALL /IDENT=!AZ\n\
SV=$SEVERITY\n\
IF SV THEN MO=F$GETJPI(\"!AZ\",\"MODE\")\n\
JT=\"\"\n\
IF SV THEN IF F$GETJPI(\"!AZ\",\"PID\").NES.F$GETJPI(\"!AZ\",\"MASTER_PID\") \
THEN JT=\" (subprocess)\"\n\
IF SV THEN IF JT.EQS.\"\".AND.F$GETJPI(\"!AZ\",\"JOBTYPE\").EQ.0 \
THEN JT=\" (detached)\"\n\
IF SV THEN IM=F$GETJPI(\"!AZ\",\"IMAGNAME\")\n\
IF SV THEN IF IM.EQS.\"\" THEN IM=\"[DCL]\"\n\
LF[0,8]=10\n\
IF SV THEN WRITE SYS$OUTPUT LF+\"Mode: \"+MO+JT+LF+LF+\"Image: \"+IM\n\
\0");

   static char  BeginPage [] =
"<p><table class=\"ctgry\">\n\
<tr><td>\n\
<table class=\"lftlft\">\n\
<tr><td><pre>";

   int  status;
   ulong  *vecptr;
   ulong  ProcessId;
   ulong  FaoVector [32];
   char  *cptr, *sptr;
   REQUEST_AST EndPageFunction;

   /*********/
   /* begin */
   /*********/

   if (ProcessIdUserName[0])
   {
      if (strsame (ProcessIdUserName, HttpdScriptAsUserName, -1))
         rqptr->rqPathSet.ScriptAsPtr = HttpdScriptAsUserName;
      else
      if (strsame (ProcessIdUserName, HttpdProcess.UserName, -1))
         rqptr->rqPathSet.ScriptAsPtr = HttpdProcess.UserName;
      else
      {
         if (!DclPersonaServicesAvailable)
         {
            rqptr->rqResponse.HttpStatus = 403;
            ErrorGeneral (rqptr, ErrorWatchPersonaNeeded, FI_LI);
            AdminEnd (rqptr);
            return;
         }
         rqptr->rqPathSet.ScriptAsPtr = cptr =
            VmGetHeap (rqptr, strlen(ProcessIdUserName)+1);
         strcpy (cptr, ProcessIdUserName);
      }
   }

   ProcessId = strtol (ProcessIdString, NULL, 16);

   /* suppress the [delete] button for the main server process!! */
   if (ProcessId == HttpdProcess.Pid)
      EndPageFunction = &WatchShowEnd;
   else
      EndPageFunction = &WatchShowProcessDeleteEnd;

   vecptr = FaoVector;
   *vecptr++ = ProcessIdString;
   *vecptr++ = ProcessIdString;
   *vecptr++ = ProcessIdString;
   *vecptr++ = ProcessIdString;
   *vecptr++ = ProcessIdString;
   *vecptr++ = ProcessIdString;

   status = sys$faol (&DclCommandFaoDsc, 0, &DclCommandDsc, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
   {
      rqptr->rqResponse.ErrorTextPtr = "sys$faol()";
      ErrorVmsStatus (rqptr, status, FI_LI);
      AdminEnd (rqptr);
      return;
   }

   rqptr->rqResponse.PreExpired = PRE_EXPIRE_ADMIN;
   ResponseHeader200 (rqptr, "text/html", NULL);
   AdminPageTitle (rqptr, "Show Process", BeginPage);

   rqptr->rqCgi.BufferRecords = rqptr->NetWriteEscapeHtml = true;

   DclBegin (rqptr, EndPageFunction, DclCommand,
             NULL, NULL, NULL, NULL, NULL);
}

/*****************************************************************************/
/*
Called when the scripting script process is complete.  Output the last portion
of the report page and AST to wherever was the buffered end-of-report function.
*/

void WatchShowProcessDeleteEnd (REQUEST_STRUCT *rqptr)

{
   static char  EndPageFao [] =
"</pre></td></tr>\n\
</table>\n\
</td></tr>\n\
</table>\n\
<p><form method=\"GET\" action=\"!AZ\">\n\
<input type=\"hidden\" name=\"pid\" value=\"!AZ\">\n\
<input type=\"submit\" value=\" Force Delete \">\n\
</form>\n\
</body>\n\
</html>\n";

   int  status;
   ulong  *vecptr;
   ulong  FaoVector [8];
   char  ProcessIdString [32];

   /*********/
   /* begin */
   /*********/

   rqptr->NetWriteEscapeHtml = false;

   if (!rqptr->rqHeader.QueryStringLength ||
       !strsame (rqptr->rqHeader.QueryStringPtr, "pid=", 4))
   {
      WatchShowEnd (rqptr);
      return;
   }
   strzcpy (ProcessIdString,
            rqptr->rqHeader.QueryStringPtr+4,
            sizeof(ProcessIdString));

   vecptr = FaoVector;
   *vecptr++ = ADMIN_CONTROL_DELETE_PROCESS;
   *vecptr++ = ProcessIdString;

   FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
   status = FaolToNet (rqptr, EndPageFao, &FaoVector);
   if (VMSnok (status)) ErrorNoticed (rqptr, status, NULL, FI_LI);

   AdminEnd (rqptr);
}

/*****************************************************************************/
/*
Using a scripting script process to display relevant cluster details.
*/

void WatchShowCluster (REQUEST_STRUCT *rqptr)

{
   static $DESCRIPTOR (DclFaoDsc,
"HAR=F$SEARCH(\"CGI-BIN:[000000]HTTPD_ADMIN_REPORT_CLUSTER.COM\")\n\
IF HAR.NES.\"\" THEN @\'HAR\'\n\
SAY=\"WRITE SYS$OUTPUT\"\n\
NL=\"\'\'SAY\' \"\"\"\"\"\n\
H80=\"\'\'SAY\' F$FAO(\"\"!!/!80*-!!/\"\")\"\n\
SYS=\"SHOW SYSTEM/FULL/CLUSTER\"\n\
SYS\n\
H80\n\
SAY F$FAO(\"!!/Server Process(es):!!/!!/\")\n\
SYS/OWNER=!AZ\n\
SAY F$FAO(\"!!/(Default) Scripting Process(es):!!/!!/\")\n\
SYS/OWNER=!AZ\n\
H80\n\
NL\n\
SHOW USER/CLUSTER/INT/NET/BAT/SUB\n\
NL\n\
SHOW USER/CLUSTER/INT/NET/BAT/SUB/FULL/NOHEAD\n\
NL");

   static char  BeginPage [] =
"<p><table class=\"ctgry\">\n\
<tr><td>\n\
<table class=\"lftlft\">\n\
<tr><td><pre>";

   int  status;
   char  DclBuffer [1024];
   $DESCRIPTOR (DclBufferDsc, DclBuffer);

   /*********/
   /* begin */
   /*********/

   rqptr->rqResponse.PreExpired = PRE_EXPIRE_ADMIN;
   ResponseHeader200 (rqptr, "text/html", NULL);
   AdminPageTitle (rqptr, "Cluster Report", BeginPage);

   /* filter-null required, V7.3 (at least) SHOW CPU/FULL contains them!! */
   rqptr->rqCgi.BufferRecords = 
      rqptr->rqCgi.FilterStream =
      rqptr->NetWriteEscapeHtml = true;

   sys$fao (&DclFaoDsc, NULL, &DclBufferDsc,
            HttpdProcess.UserName,
            HttpdScriptAsUserName);

   DclBegin (rqptr, &WatchShowEnd, DclBuffer,
             NULL, NULL, NULL, NULL, NULL);
}

/*****************************************************************************/
/*
Using a scripting script process to display relevant system details.
*/

void WatchShowSystem (REQUEST_STRUCT *rqptr)

{
   static $DESCRIPTOR (DclFaoDsc,
"HAR=F$SEARCH(\"CGI-BIN:[000000]HTTPD_ADMIN_REPORT_SYSTEM.COM\")\n\
IF HAR.NES.\"\" THEN @\'HAR\'\n\
SAY=\"WRITE SYS$OUTPUT\"\n\
NL=\"\'\'SAY\' \"\"\"\"\"\n\
H80=\"\'\'SAY\' F$FAO(\"\"!!/!!80*-!!/\"\")\"\n\
SYI=F$FAO(\"!!AS, a !!AS with !!UL CPU and !!ULMB running VMS !!AS\",\
F$GETSYI(\"NODENAME\"),F$EDIT(F$GETSYI(\"HW_NAME\"),\"COMPRESS,TRIM\"),\
F$GETSYI(\"AVAILCPU_CNT\"),\
(F$GETSYI(\"MEMSIZE\")*(F$GETSYI(\"PAGE_SIZE\")/512)/2048),\
F$EDIT(F$GETSYI(\"VERSION\"),\"COLLAPSE\"))\n\
HDR=F$FAO(\"  Pid    Process Name    State  Pri      I/O\
       CPU       Page flts  Pages!!/\")\n\
SAY SYI\n\
SAY F$FAO(\"!!#*-!!/!!/!!AS\",F$LENGTH(SYI),HDR)\n\
SYS=\"SHOW SYSTEM/FULL/NOHEAD\"\n\
SYS\n\
H80\n\
SAY F$FAO(\"!!/Server Process(es):!!/!!/\")\n\
SYS/OWNER=!AZ\n\
SAY F$FAO(\"!!/(Default) Scripting Process(es):!!/!!/\")\n\
SYS/OWNER=!AZ\n\
H80\n\
NL\n\
SHOW USER/NODE/INT/NET/BAT/SUB\n\
NL\n\
SHOW USER/NODE/INT/NET/BAT/SUB/FULL/NOHEAD\n\
H80\n\
NL\n\
SHOW MEMORY/FULL\n\
H80\n\
SHOW CPU/FULL\n\
H80\n\
SHOW DEVICE/BRIEF\n\
DEFINE/USER SYS$ERROR NL:\n\
DEFINE/USER SYS$OUTPUT NL:\n\
SHOW ERROR\n\
OK=F$INTEGER(F$EXTRACT(3,7,$STATUS)).EQ.1\n\
IF OK THEN NL\n\
IF OK THEN SHOW ERROR\n\
H80\n\
SHOW NET\n\
SHOW NET/FULL\n");

   static char  BeginPage [] =
"<p><table class=\"ctgry\">\n\
<tr><td>\n\
<table class=\"lftlft\">\n\
<tr><td><pre>";

   int  status;
   ushort  slen;
   char  DclBuffer [2048],
         SystemBuffer [256];
   $DESCRIPTOR (DclBufferDsc, DclBuffer);
   $DESCRIPTOR (SystemBufferDsc, SystemBuffer);

   /*********/
   /* begin */
   /*********/

   rqptr->rqResponse.PreExpired = PRE_EXPIRE_ADMIN;
   ResponseHeader200 (rqptr, "text/html", NULL);
   AdminPageTitle (rqptr, "System Report", BeginPage);

   /* filter-null required, V7.3 (at least) SHOW CPU/FULL contains them!! */
   rqptr->rqCgi.BufferRecords = 
      rqptr->rqCgi.FilterStream =
      rqptr->NetWriteEscapeHtml = true;

   status = sys$fao (&DclFaoDsc, NULL, &DclBufferDsc,
                     HttpdProcess.UserName,
                     HttpdScriptAsUserName);
   if (VMSnok (status)) ErrorNoticed (rqptr, status, NULL, FI_LI);

   DclBegin (rqptr, &WatchShowEnd, DclBuffer,
             NULL, NULL, NULL, NULL, NULL);
}

/*****************************************************************************/
/*
Called when the scripting script process is complete.  Output the last portion
of the report page and AST to wherever was the buffered end-of-report function.
*/

void WatchShowEnd (REQUEST_STRUCT *rqptr)

{
   static char  EndPageFao [] =
"</pre></td></tr>\n\
</table>\n\
</td></tr>\n\
</table>\n\
</div>\n\
</body>\n\
</html>\n";

   int  status;

   /*********/
   /* begin */
   /*********/

   rqptr->NetWriteEscapeHtml = false;

   if (rqptr->rqResponse.HttpStatus != 200) sysPlusReport (rqptr);

   status = FaolToNet (rqptr, EndPageFao, NULL);
   if (VMSnok (status)) ErrorNoticed (rqptr, status, NULL, FI_LI);

   AdminEnd (rqptr);
}

/*****************************************************************************/
/*
Just delete the process specified by 'ProcessIdString'.
*/

void WatchDeleteProcess (REQUEST_STRUCT *rqptr)

{
   int  status,
        SetPrvStatus;
   ulong  ProcessId;

   /*********/
   /* begin */
   /*********/

   if (rqptr->rqHeader.QueryStringLength &&
       strsame (rqptr->rqHeader.QueryStringPtr, "pid=", 4))
      ProcessId = strtol (rqptr->rqHeader.QueryStringPtr+4, NULL, 16);
   else
      ProcessId  = 0;

   if (ProcessId)
   {
      if (DclScriptDetachProcess)
      {
         /* detached scripts, possibly executing as a non-server username */
         if (VMSnok (SetPrvStatus = sys$setprv (1, &WorldMask, 0, 0)))
            ErrorExitVmsStatus (SetPrvStatus, "sys$setprv()", FI_LI);
         status = sys$delprc (&ProcessId, 0);
         if (VMSnok (SetPrvStatus = sys$setprv (0, &WorldMask, 0, 0)))
            ErrorExitVmsStatus (SetPrvStatus, "sys$setprv()", FI_LI);
      }
      else
         status = sys$delprc (&ProcessId, 0);
   }
   else
      status = SS$_BUGCHECK;

   if (VMSnok (status))
   {
      rqptr->rqResponse.HttpStatus = 409;
      rqptr->rqResponse.ErrorTextPtr = "when deleting";
      ErrorVmsStatus (rqptr, status, FI_LI);
      AdminEnd (rqptr);
      return;
   }

   rqptr->rqResponse.PreExpired = PRE_EXPIRE_ADMIN;
   ReportSuccess (rqptr, "Server !AZ deleted process !8XL.",
                  ServerHostPort, ProcessId);

   AdminEnd (rqptr);
}

/*****************************************************************************/
/*
This is a development tool.

OpenVMS System Services Reference Manual (V8.4): $RPCC_64:

"On Alpha and I64 systems, returns a 64-bit long version of the current process
cycle counter.  On Alpha systems, this service must be called at least once
within each wrap period of the least significant 32 bits of the counter.  For
more information, see the RPCC() C-language built-in documentation and the RPCC
instruction in the Alpha Architecture Handbook."

The Alpha Architecture Book (1992):

"The low-order 32 bits of the process cycle counter is an unsigned 32-bit
integer that increments once per N CPU cycles, where N is an implementation-
specific integer in the range 1..16.  The cycle counter frequency is the number
of times the process cycle counter gets incremented per second, rounded to a
64-bit integer.  The integer count wraps to 0 from a count of FFFF FFFF16?  The
counter wraps no more frequently than 1.5 times the implementation's interval
clock interrupt period (which is two thirds of the interval clock interrupt
frequency).  The high-order 32 bits of the process cycle counter are an offset
that when added to the low-order 32 bits gives the cycle count for this
process.  The process cycle counter is suitable for timing intervals on the
order of nanoseconds and may be used for detailed performance characterization.
It is required on all implementations.  PCC is required for every processor,
and each processor in a multiprocessor system has its own private, independent
PCC."

Calls to this function need to be embedded into code between points measuring
CPU clock counts.  Up to eight such measurements may concurrently be performed. 
The |index| parameter is used to specify 1..8.  This calculates a delta with
the previous value (from reset or previous call), reports that and the
percentage of total counts.  The same |index| value but negative resets that
count and reports the same.  If |index| is zero all elements are reinitialised
to the current CPU count.

Not quite convinced this is as useful as originally hoped for but as it was a
bit of a tease to get working, and does not bloat code in a production
environment, will leave in place for possible future use.
*/

#if WATCH_MOD

uint64 WatchRPCC
(
NETIO_STRUCT *ioptr,
int index,
char *module,
int line
)
{
#define INDEX_MAX 8

   static int  watching;
   static uint64  ctx64, init64;
   static uint64  delta64 [INDEX_MAX+1],
                            prev64 [INDEX_MAX+1];

   int  bsize, cnt, idx;
   ushort  slen;
   uint64  drpcc64, rpcc64;
   double  fpercent;
   char  *bptr;
   char  buf [256],
         pbuf [32];

   /*********/
   /* begin */
   /*********/

   /* apparently the context is unnecessary but innocuous from Alpha V8.4 */
   rpcc64 = sys$rpcc_64 (&ctx64);

   if (index == 0 || !init64)
   {
      /* initialise */
      init64 = rpcc64;
      for (idx = 0; idx < INDEX_MAX+1; idx++) prev64[idx] = rpcc64;
      /* enable RPCC WATCHing is logical name exists */
      bptr = SysTrnLnm (WASD_WATCH_RPCC);
      watching = 0;
      if (bptr) watching = atoi(bptr);
      if (index == 0) return (0);
   }

   if (index > INDEX_MAX || -index > INDEX_MAX)
      ErrorExitVmsStatus (SS$_BUGCHECK, ErrorSanityCheck, FI_LI);

   /* then reset this array element to the current count */
   if (index < 0) prev64[-index] = rpcc64;

   if (watching)
   {
      cnt = 0;
      drpcc64 = rpcc64 - init64;
      for (idx = 0; idx < INDEX_MAX+1; idx++)
      {
         if (prev64[idx] == init64)
            delta64[idx] = 0;
         else
         {
            delta64[idx] = rpcc64 - prev64[idx];
            cnt++;
         }
      }
      bptr = buf;
      bsize = sizeof(buf)-2;
      FaoToBuffer (bptr, bsize, &slen, "RPCC !SL !&,@SQ", index, &drpcc64);
      bptr += slen;
      bsize -= slen;
      for (idx = 0; idx < cnt; idx++)
      {
         if (idx > 0)
            fpercent = ((double)delta64[idx] * 100.0) / (double)delta64[0];
         else
            fpercent = ((double)delta64[0] * 100.0) / (double)drpcc64;
         sprintf (pbuf, "(%.1f%%)", fpercent);
         FaoToBuffer (bptr, bsize, &slen, " [!UL]!&,@SQ!AZ",
                      idx, &delta64[idx], pbuf);
         bptr += slen;
         bsize -= slen;
      }

      if (ioptr)
         if (WATCHING (ioptr, WATCH_REQUEST))
            WatchThis (ioptr->WatchItem, module, line, WATCH_REQUEST,
                       "!AZ", buf);

      if (watching > 0)
         FaoToStdout ("|!%T !8AZ !4ZL|!AZ\n", 0, module, line, buf);
   }

   prev64[index] = prev64[0] = rpcc64;

   return (rpcc64);
}

#endif /* WATCH_MOD */

/*****************************************************************************/
/*
Called from WatchBegin().  Provide a plain-text dump displaying some of the
essential fields from various data structures in an executing request. 
Intended as a diagnosis and development tool.  If 'rqptr' is NULL then the
information is written to SYS$OUTPUT (and in this case leaks a little memory).
*/

void WatchPeek
(
REQUEST_STRUCT *rqptr,
REQUEST_STRUCT *rqeptr
)
{
#define WATCH_NULL_STRING "(null)"
#define WATCH_NULL(string) (!string ? WATCH_NULL_STRING : string)

   static char  VmZoneFao [] =
"|\n\
!33<HttpdTickSecond!> !UL\n\
!33<ConnectNumber!> !UL\n\
!33<VmHeapZoneId!> !8XL\n\
\n";

   static char  ServiceFao [] =
"|\n\
!33<ServicePtr!> !&X\n\
!33<->ServerChannel!> !UL (!AZ)\n\
!33<->ServerHostPort!> !&Z\n\
!33<->ServerIpAddressString!> !&Z\n\
!33<->RequestSchemeNamePtr!> !&Z\n\
!33<->ProxyTunnel!> !UL\n\
!33<->RawSocket!> !UL\n\
!33<->SSLserverPtr!> !&X\n\
!33<->SSLclientPtr!> !&X\n\
|\n\
!33<RequestState!> !UL !AZ\n\
!33<NotePadPtr!> !&Z\n\
!33<ProxyReverseLocationPtr!> !&Z\n\
|\n\
!33<Http2Stream.Depend!> !UL\n\
!33<Http2Stream.Http2Ptr!> !&X\n\
!33<Http2Stream.RequestPtr!> !&X\n\
!33<Http2Stream.ContinPtr!> !&X\n\
!33<Http2Stream.ContinSize!> !UL\n\
!33<Http2Stream.FlowControl!> !UL\n\
!33<Http2Stream.HeaderSent!> !&B\n\
!33<Http2Stream.Ident!> !UL\n\
!33<Http2Stream.Priority!> !UL\n\
!33<Http2Stream.DataReadPtr!> !&X\n\
!33<Http2Stream.DataReadSize!> !UL\n\
!33<Http2Stream.DataReadLength!> !UL\n\
!33<Http2Stream.ReadWindowSize!> !UL\n\
!33<Http2Stream.RequestEnd!> !&B\n\
!33<Http2Stream.State!> !UL\n\
!33<Http2Stream.Weight!> !UL\n\
!33<Http2Stream.WriteWindowSize!> !UL\n\
!33<Http2Stream.QueuedWriteCount!> !UL\n\
|\n\
!33<rqNet.ReadErrorCount!> !UL\n\
!33<rqNet.ReadErrorStatus!> !&S\n\
!33<rqNet.WriteErrorCount!> !UL\n\
!33<rqNet.WriteErrorStatus!> !&S\n\
!33<rqNet.GzipDataLength!> !UL\n\
!33<rqNet.GzipAstFunction!> !&A\n\
!33<rqNet.PipelineBufferPtr!> !&X\n\
!33<rqNet.PipelineBufferCount!> !UL\n\
!33<rqNet.PipelineBufferSize!> !UL\n\
!33<rqNet.PipelineRequestCount!> !UL\n\
!33<rqNet.PersistentCount!> !UL\n";

   static char  TimerFao [] =
"|\n\
!33<BytesRx64!> !@SQ\n\
!33<BytesTx64!> !@SQ\n\
!33<BytesRawRx64!> !@SQ\n\
!33<BytesRawTx64!> !@SQ\n\
!33<PersistentRequest!> !&B\n\
!33<PersistentResponse!> !&B\n\
!33<rqTmr.InputSecond!> !UL\n\
!33<rqTmr.PersistentSecond!> !UL\n\
!33<rqTmr.ListIndex!> !UL!&@\n\
!33<rqTmr.NoProgressBytesTx!> !UL\n\
!33<rqTmr.NoProgressSecond!> !UL\n\
!33<rqTmr.NoProgressPeriod!> !UL\n\
!33<rqTmr.OutputSecond!> !UL\n\
!33<rqTmr.TimeoutCount!> !UL !AZ\n\
!33<rqTmr.ThrottleSecond!> !UL\n\
!33<rqPathSet.ThrottleSet!> !&B\n\
!33<rqPathSet.ThrottleFrom!> !UL/!UL!AZ\n\
!33<rqPathSet.ThrottleTo!> !UL\n\
!33<rqPathSet.ThrottleResume!> !UL\n\
!33<rqPathSet.ThrottleBusy!> !UL\n\
!33<rqPathSet.ThrottleIndex!> !UL!&@\n\
!33<throttlePerUser!> !&B\n\
|\n\
!33<rqTime.BeginTime64!> !%D (!AZ ago)\n\
!33<rqTime.GmDateTime!> !&Z\n";

   static char  HeaderFao [] =
"!33<rqHeader.RequestHeaderPtr!> {!UL}|!-!#AZ|\n\
!33<rqHeader.RequestBodyPtr!> {!UL}|!-!#AZ|\n\
!33<rqHeader.MethodName!> !&Z\n\
!33<rqHeader.RequestUriPtr!> {!UL}!&P\n\
!33<rqHeader.HttpVersion!> !UL.!UL\n\
!33<rqHeader.AcceptPtr!> !&Z\n\
!33<rqHeader.AcceptCharsetPtr!> !&Z\n\
!33<rqHeader.AcceptEncodingPtr!> !&Z\n\
!33<rqHeader.AcceptLangPtr!> !&Z\n\
!33<rqHeader.AuthorizationPtr!> !&Z\n\
!33<rqHeader.CacheControl!> no-cache:!&B no-store:!&B max-age=0:!&B\n\
!33<rqHeader.ContentLength64!> !@SQ\n\
!33<rqHeader.ContentTypePtr!> !&Z\n\
!33<rqHeader.CookiePtr!> !&Z\n\
!33<rqHeader.ForwardedPtr!> !&Z\n\
!33<rqHeader.HostPtr!> !&Z\n\
!33<rqHeader.IfMatchPtr!> !&Z\n\
!33<rqHeader.IfNoneMatchPtr!> !&Z\n\
!33<rqHeader.OriginPtr!> !&Z\n\
!33<rqHeader.ProxyAuthorizationPtr!> !&Z\n\
!33<rqHeader.RefererPtr!> !&Z\n\
!33<rqHeader.UserAgentPtr!> !&Z\n\
!33<rqHeader.XForwardedForPtr!> !&Z\n";

   static char  BodyFao [] =
"!33<rqBody.UnEncodeStream!> !&B\n\
!33<rqBody.ChunkState!> !UL\n\
!33<rqBody.ChunkCount!> !UL\n\
!33<rqBody.ChunkSize!> !UL\n\
!33<rqBody.ChunkSizeString!> !&Z\n\
!33<rqBody.ChunkedTrailerBufferCount!> !UL\n\
!33<rqBody.ChunkedTrailerBufferSize!> !UL\n\
!33<rqBody.ChunkedTrailerBufferPtr!> !&X\n\
!33<rqBody.ChunkedTrailerNewLineCount!> !UL\n\
!33<rqBody.ContentLength64!> !@SQ\n\
!33<rqBody.ContentCount64!> !@SQ\n\
!33<rqBody.DataVBN!> !UL\n\
!33<rqBody.DataPtr!> 0x!XL\n\
!33<rqBody.DataCount!> !UL\n\
!33<rqBody.DataSize!> !UL\n\
!33<rqBody.DataStatus!> !&S\n\
!33<rqBody.DiscardReadCount!> !UL\n\
!33<rqBody.AstFunction!> !&A\n\
!33<rqBody.ProcessFunction!> !&A\n\
!33<rqBody.ProcessPtr!> !&X\n\
|\n";

   static char  PathInfoFao [] =
"!33<rqHeader.PathInfoPtr!> !&Z\n\
!33<rqHeader.QueryStringPtr!> !&Z\n\
!33<Md5HashPath!> |!16&H|\n\
!33<MappedPathPtr!> !&Z\n\
!33<RequestMappedFile!> !&Z\n\
!33<ParseOds.ExpFileName!> !&Z\n\
!33<ScriptName!> !&Z\n\
!33<RequestMappedScript!> !&Z\n\
!33<RequestMappedRunTime!> !&Z\n\
!33<IsCgiPlusScript!> !&B\n\
!33<rqPathSet.PathOds!> !UL !AZ\n\
!33<PathOds!> !UL !AZ\n\
!33<PathOdsExtended!> !&B\n\
|\n\
!33<rqResponse.HeaderGenerated!> !&B\n\
!33<rqResponse.HeaderSent!> !&B\n\
!33<rqResponse.ErrorReportPtr!> !&Z\n\
!33<rqResponse.LocationPtr!> !&Z\n\
!33<rqResponse.ContentEncodeAsGzip!> !&B\n\
!33<rqResponse.ContentIsEncodedGzip!> !&B\n\
!33<rqResponse.ChunkedBufferPtr!> !&X\n\
!33<rqResponse.ChunkedBufferSize!> !UL\n\
!33<rqResponse.TransferEncodingChunke!> !&B\n\
|\n\
!33<rqWebSocket.ScriptProcessPid!> !8XL\n\
!33<rqWebSocket.InputSize!> !UL\n\
!33<rqWebSocket.InputChannel!> !UL (!AZ)\n\
!33<rqWebSocket.InputIOsb!> !&S !UL\n\
!33<rqWebSocket.QueuedInput!> !UL\n\
!33<rqWebSocket.QueuedNetRead!> !UL\n\
!33<rqWebSocket.OutputSize!> !UL\n\
!33<rqWebSocket.OutputChannel!> !UL (!AZ)\n\
!33<rqWebSocket.OutputIOsb!> !&S !UL\n\
!33<rqWebSocket.QueuedOutput!> !UL\n\
!33<rqWebSocket.QueuedNetWrite!> !UL\n\
|\n";

   static char  AuthFao [] =
"!33<RemoteUser!> !&Z\n\
!33<RemoteUserPassword!> |!#**|\n\
!33<ResolvedRemoteUser!> !&B\n\
!33<rqAuth.FinalStatus!> !&S\n\
!33<rqAuth.RequestCan!> 0x!4XL (!AZ)\n\
!33<rqAuth.UserCan!> 0x!4XL (!AZ)\n\
!33<rqAuth.GroupCan!> 0x!4XL (!AZ)\n\
!33<rqAuth.WorldCan!> 0x!4XL (!AZ)\n\
!33<rqAuth.Type!> !&Z\n\
!33<rqAuth.UserDetailsPtr!> !&Z\n\
!33<rqAuth.HttpsOnly!> !&B\n\
!33<rqAuth.SkelKeyAuthenticated!> !&B\n\
!33<rqAuth.SysUafAuthenticated!> !&B\n\
!33<rqAuth.VmsIdentifiersCount!> !UL\n\
!33<rqAuth.VmsIdentifiersPtr!> 0x!XL\n\
!33<rqAuth.VmsUserProfile!> !&B\n\
!33<rqAuth.VmsUserProfileLength!> !UL\n\
!33<rqAuth.VmsUserProfilePtr!> 0x!XL\n\
!33<rqAuth.VmsUserScriptAs!> !&B\n\
!33<rqAuth.DirectoryPtr!> !&Z\n\
!33<rqAuth.RealmPtr!> !&Z (!AZ)\n\
!33<rqAuth.RealmDescrPtr!> !&Z\n\
!33<rqAuth.PathParameterPtr!> !&Z\n\
!33<rqAuth.GroupWritePtr!> !&Z (!AZ)\n\
!33<rqAuth.GroupReadPtr!> !&Z (!AZ)\n\
!33<rqAuth.GroupRestrictListPtr!> !&Z\n\
!33<rqAuth.WorldRestrictListPtr!> !&Z\n\
!33<rqAuth.ProxyStringPtr!> !&Z\n\
!33<rqAuth.RemoteUser!> !&Z\n\
|\n";

   static char  CgiFao [] =
"!33<rqCgi.BufferLength!> !UL\n\
!33<rqCgi.BufferRemaining!> !UL\n\
!33<rqCgi.BufferPtr!> 0x!XL\n\
!33<rqCgi.BufferCurrentPtr!> 0x!XL\n\
!33<rqCgi.CalloutInProgress!> !&B\n\
!33<rqCgi.CalloutOutputCount!> !UL\n\
!33<rqCgi.CalloutOutputPtr!> 0x!XL !&Z\n\
!33<rqCgi.ContentEncodingGzip!> !UL\n\
!33<rqCgi.ContentTypeText!> !&B\n\
!33<rqCgi.EofStr!> !&Z\n\
!33<rqCgi.EotStr!> !&Z\n\
!33<rqCgi.EscStr!> !&Z\n\
!33<rqCgi.Header100Continue!> !&B\n\
!33<rqCgi.Header100ContinueDone!> !&B\n\
!33<rqCgi.HeaderLineCount!> !UL\n\
!33<rqCgi.IsCliDcl!> !&B\n\
!33<rqCgi.OutputMode!> !UL (!AZ)\n\
!33<rqCgi.ProcessingBody!> !&B\n\
!33<rqCgi.RecordCount!> !UL\n\
!33<rqCgi.ScriptRetryCount!> !UL\n\
!33<rqCgi.TransferEncoding!> !&B\n\
!33<rqCgi.TransferEncodingChunked!> !UL\n\
!33<rqCgi.XVMSRecordMode!> !&B\n\
";

   static char  CacheFao [] =
"|\n\
!33<rqCache.EntryPtr!> 0x!XL\n\
|\n\
!33<AgentRequestPtr!> !&Z\n\
!33<AgentResponsePtr!> !&Z\n\
!33<AgentAstParam!> !&X\n\
|\n\
!33<DclTaskPtr->!> 0x!XL\n";

   static char  DECnetFao [] = "!33<DECnetTaskPtr!> !&X\n";

   static char  DECnetTaskFao [] =
"!33<DECnetChannel!> !UL\n\
!33<DECnetConnectIOsb!> !&S !UL\n\
!33<DECnetReadIOsb!> !&S !UL\n\
!33<DECnetWriteIOsb!> !&S !UL\n\
!33<QueuedDECnetIO!> !UL\n\
!33<ScriptResponded!> !&B\n\
!33<BuildRecords!> !&B\n\
!33<BuildCount!> !UL\n\
!33<CgiDialogState!> !UL\n\
!33<OsuDialogState!> !UL\n\
!33<OsuDnetCgi!> !&B\n\
|\n";

   static char  DescrFao [] =
"!33<DescrTaskPtr!> !&X\n\
!33<DirTaskPtr!> !&X\n\
!33<FileTaskPtr!> !&X\n\
!33<HTAdminTaskPtr!> !&X\n\
|\n\
!33<ProxyTaskPtr!> !&X\n";

   static char  ProxyTaskFao [] =
"!33<NetIoPtr->Channel!> !UL (!AZ)\n\
!33<NetIoPtr->QioMaxSeg!> !UL\n\
!33<NetIoPtr->ReadIOsb!> !&S !UL\n\
!33<NetIoPtr->ReadStatus!> !&S\n\
!33<NetIoPtr->ReadCount!> !UL\n\
!33<NetIoPtr->ReadAstFunction!> !&A\n\
!33<NetIoPtr->ReadPtr!> !&X\n\
!33<NetIoPtr->ReadSize!> !UL\n\
!33<NetIoPtr->WriteIOsb!> !&S !UL\n\
!33<NetIoPtr->WriteStatus!> !&S\n\
!33<NetIoPtr->WriteCount!> !UL\n\
!33<NetIoPtr->WriteAstFunction!> !&A\n\
!33<NetIoPtr->WritePtr!> !&X\n\
!33<NetIoPtr->WriteLength!> !UL\n\
!33<NetIoPtr->BytesRawRx64!> !@SQ\n\
!33<NetIoPtr->BytesRawTx64!> !@SQ\n\
!33<ConnectIpAddress!> !&I\n\
!33<RequestHostIpAddress!> !&I\n\
!33<RequestHostPort!> !&Z\n\
!33<RequestSchemeName!> !&Z\n\
!33<ProxyTunnel!> !UL\n\
!33<ProxyLookupRetryCount!> !UL\n\
!33<ProxyConnectIOsb!> !&S !UL\n\
!33<VerifyRecordPtr!> !&Z\n\
!33<RebuiltRequestLength!> !UL\n\
!33<RebuiltRequestPtr!> !&Z\n\
!33<ResponseBodyLength!> !UL\n\
!33<ResponseBufferCount!> !UL\n\
!33<ResponseBufferPtr!> !&Z\n\
!33<ResponseBufferCurrentPtr!> !&X\n\
!33<ResponseBufferRemaining!> !UL\n\
!33<ResponseBufferNetCount!> !UL\n\
!33<ResponseBufferNetPtr!> !&X\n\
!33<ResponseCacheControlMaxAge!> !UL\n\
!33<ResponseCacheControlMaxAgeZero!> !&B\n\
!33<ResponseCacheControlMustReval!> !&B\n\
!33<ResponseCacheControlNoCache!> !&B\n\
!33<ResponseCacheControlNoStore!> !&B\n\
!33<ResponseCacheControlNoTransform!> !&B\n\
!33<ResponseCacheControlPrivate!> !&B\n\
!33<ResponseCacheControlProxyReval!> !&B\n\
!33<ResponseCacheControlPublic!> !&B\n\
!33<ResponseCacheControlSMaxAge!> !UL\n\
!33<ResponseChunkedCount!> !UL\n\
!33<ResponseChunkedEnd!> !&B\n\
!33<ResponseChunkedEol!> !&B\n\
!33<ResponseChunkedEot!> !&B\n\
!33<ResponseChunkedInit!> !&B\n\
!33<ResponseChunkedSize!> !UL\n\
!33<ResponseChunkedString!> !&Z\n\
!33<ResponseChunkedNewlineCount!> !UL\n\
!33<ResponseConsecutiveNewLineCount!> !UL\n\
!33<ResponseContentEncodingGzip!> !&B\n\
!33<ResponseContentEncodingUnknown!> !&B\n\
!33<ResponseContentLength!> !SL\n\
!33<ResponseExpires!> !&Z (!%D)\n\
!33<ResponseHeaderLength!> !UL\n\
!33<ResponseHeaderPtr!> |!#AZ|\n\
!33<ResponseLastModified!> !&Z (!%D)\n\
!33<ResponseTransferEncodingChunked!> !&B\n\
!33<ResponseUpgradeHttp2onTLS!> !&B\n\
!33<ResponseUpgradeHttp2toTLS!> !&B\n\
!33<ResponseUpgradeWebSocket!> !&B\n";

   static char  PutFao [] =
"!33<PutTaskPtr!> !&X\n\
!33<SsiTaskPtr!> !&X\n\
!33<UpdTaskPtr!> !&X\n\
|\n";

   int  status;
   int64  Time64,
          Duration64,
          ResultTime64;
   ushort  Length;
   ulong  Remainder,
          Seconds,
          SubSeconds;
   ulong  FaoVector [128];
   ulong  *vecptr;
   char  *cptr;
   char  Buffer [8192],
         ProxyDevName [64],
         ServerDevName [64];
   MAP_RULE_META  *mrptr;

   /*********/
   /* begin */
   /*********/

   WatchNone (true);

   NetGetBgDevice (rqeptr->ServicePtr->ServerChannel,
                   ServerDevName, sizeof(ServerDevName));

   sys$gettim (&Time64);
   Duration64 = rqeptr->rqTime.BeginTime64 - Time64;

   vecptr = FaoVector;

   *vecptr++ = HttpdTickSecond;
   *vecptr++ = rqeptr->ConnectNumber;
   *vecptr++ = rqeptr->VmHeapZoneId;

   status = FaolToBuffer (Buffer, sizeof(Buffer), &Length,
                          VmZoneFao, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
      ErrorNoticed (rqptr, status, NULL, FI_LI);

   WatchWrite (Buffer, Length);

   WatchVmZone (rqptr, rqeptr->VmHeapZoneId);

   vecptr = FaoVector;

   *vecptr++ = rqeptr->ServicePtr;
   *vecptr++ = rqeptr->ServicePtr->ServerChannel;
   *vecptr++ = ServerDevName+1;
   *vecptr++ = rqeptr->ServicePtr->ServerHostPort;
   *vecptr++ = rqeptr->ServicePtr->ServerIpAddressString;
   *vecptr++ = rqeptr->ServicePtr->RequestSchemeNamePtr;
   *vecptr++ = rqeptr->ServicePtr->ProxyTunnel;
   *vecptr++ = rqeptr->ServicePtr->RawSocket;
   *vecptr++ = rqeptr->ServicePtr->SSLserverPtr;
   *vecptr++ = rqeptr->ServicePtr->SSLclientPtr;

   *vecptr++ = rqeptr->RequestState;
   *vecptr++ = RequestState (rqeptr->RequestState);
   *vecptr++ = rqeptr->NotePadPtr;
   *vecptr++ = rqeptr->ProxyReverseLocationPtr;

   *vecptr++ = rqeptr->Http2Stream.Depend;
   *vecptr++ = rqeptr->Http2Stream.Http2Ptr;
   *vecptr++ = rqeptr->Http2Stream.RequestPtr;
   *vecptr++ = rqeptr->Http2Stream.ContinPtr;
   *vecptr++ = rqeptr->Http2Stream.ContinSize;
   *vecptr++ = rqeptr->Http2Stream.FlowControl;
   *vecptr++ = rqeptr->Http2Stream.HeaderSent;
   *vecptr++ = rqeptr->Http2Stream.Ident;
   *vecptr++ = rqeptr->Http2Stream.Priority;
   *vecptr++ = rqeptr->Http2Stream.DataReadPtr;
   *vecptr++ = rqeptr->Http2Stream.DataReadSize;
   *vecptr++ = rqeptr->Http2Stream.DataReadLength;
   *vecptr++ = rqeptr->Http2Stream.ReadWindowSize;
   *vecptr++ = rqeptr->Http2Stream.RequestEnd;
   *vecptr++ = rqeptr->Http2Stream.State;
   *vecptr++ = rqeptr->Http2Stream.Weight;
   *vecptr++ = rqeptr->Http2Stream.WriteWindowSize;
   *vecptr++ = rqeptr->Http2Stream.QueuedWriteCount;

   *vecptr++ = rqeptr->rqNet.ReadErrorCount;
   *vecptr++ = rqeptr->rqNet.ReadErrorStatus;
   *vecptr++ = rqeptr->rqNet.WriteErrorCount;
   *vecptr++ = rqeptr->rqNet.WriteErrorStatus;
   *vecptr++ = rqeptr->rqNet.GzipDataLength;
   *vecptr++ = rqeptr->rqNet.GzipAstFunction;
   *vecptr++ = rqeptr->rqNet.PipelineBufferPtr;
   *vecptr++ = rqeptr->rqNet.PipelineBufferCount;
   *vecptr++ = rqeptr->rqNet.PipelineBufferSize;
   *vecptr++ = rqeptr->rqNet.PipelineRequestCount;
   *vecptr++ = rqeptr->rqNet.PersistentCount;

   FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
   status = FaolToBuffer (Buffer, sizeof(Buffer), &Length,
                          ServiceFao, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
      ErrorNoticed (rqptr, status, NULL, FI_LI);

   WatchWrite (Buffer, Length);

   WatchPeekNetIo (rqptr, rqeptr->NetIoPtr,  "rqNet.NetIoPtr->");

   if (rqeptr->Http2Stream.Http2Ptr)
      WatchPeekHttp2 (rqptr, rqeptr->Http2Stream.Http2Ptr,
                      "|\nHttp2Stream.Http2Ptr->"); 

   vecptr = FaoVector;

   *vecptr++ = &rqeptr->BytesRx64;
   *vecptr++ = &rqeptr->BytesTx64;
   *vecptr++ = &rqeptr->NetIoPtr->BytesRawRx64;
   *vecptr++ = &rqeptr->NetIoPtr->BytesRawTx64;
   *vecptr++ = rqeptr->PersistentRequest;
   *vecptr++ = rqeptr->PersistentResponse;
   *vecptr++ = rqeptr->rqTmr.InputSecond;
   *vecptr++ = rqeptr->rqTmr.PersistentSecond;
   *vecptr++ = rqeptr->rqTmr.ListIndex;
   if (rqeptr->rqTmr.ListIndex)
   {
      *vecptr++ = " (!UL seconds)";
      *vecptr++ = SupervisorListArray[rqeptr->rqTmr.ListIndex].ChunkSeconds;
   }
   else
      *vecptr++ = "";
   *vecptr++ = rqeptr->rqTmr.NoProgressBytesTx;
   *vecptr++ = rqeptr->rqTmr.NoProgressSecond;
   *vecptr++ = rqeptr->rqTmr.NoProgressPeriod;
   *vecptr++ = rqeptr->rqTmr.OutputSecond;
   *vecptr++ = rqeptr->rqTmr.TimeoutCount;
   *vecptr++ = HttpdTimeoutType(rqeptr->rqTmr.TimeoutType);
   *vecptr++ = rqeptr->rqTmr.ThrottleSecond;

   *vecptr++ = rqeptr->rqPathSet.ThrottleSet;
   *vecptr++ = rqeptr->rqPathSet.ThrottleFrom;
   *vecptr++ = rqeptr->rqPathSet.ThrottlePerUser;
   if (rqeptr->rqPathSet.ThrottleFrom)
   {
      if (!rqeptr->ThrottleListEntry.DataPtr)
         *vecptr++ = " (QUEUED)";
      else
         *vecptr++ = " (PROCESSING)";
   }
   else
      *vecptr++ = "";
   *vecptr++ = rqeptr->rqPathSet.ThrottleTo;
   *vecptr++ = rqeptr->rqPathSet.ThrottleResume;
   *vecptr++ = rqeptr->rqPathSet.ThrottleBusy;
   *vecptr++ = rqeptr->rqPathSet.ThrottleIndex;
   /* if throttled get the path rule using the index number */
   if (rqeptr->rqPathSet.ThrottleIndex)
      mrptr = MapUrl_ThrottleRule (rqeptr->rqPathSet.ThrottleIndex);
   else
      mrptr = NULL;
   if (mrptr)
   {
      *vecptr++ = " (!AZ throttle=!UL,!UL,!UL,!UL,!AZ,!AZ)";
      *vecptr++ = mrptr->TemplatePtr;
      *vecptr++ = mrptr->mpPathSet.ThrottleFrom;
      *vecptr++ = mrptr->mpPathSet.ThrottleTo;
      *vecptr++ = mrptr->mpPathSet.ThrottleResume;
      *vecptr++ = mrptr->mpPathSet.ThrottleBusy;
      *vecptr++ = MetaConShowSeconds (rqptr, mrptr->mpPathSet.ThrottleTimeoutQueue);
      *vecptr++ = MetaConShowSeconds (rqptr, mrptr->mpPathSet.ThrottleTimeoutBusy);
   }
   else
      *vecptr++ = "";
   *vecptr++ = rqeptr->ThrottlePerUser;

   *vecptr++ = &rqeptr->rqTime.BeginTime64;
   *vecptr++ = DurationString (rqptr, &Duration64);
   *vecptr++ = rqeptr->rqTime.GmDateTime;

   FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
   status = FaolToBuffer (Buffer, sizeof(Buffer), &Length,
                          TimerFao, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
      ErrorNoticed (rqptr, status, NULL, FI_LI);

   WatchWrite (Buffer, Length);

   vecptr = FaoVector;

   if (rqeptr->rqHeader.RequestHeaderPtrInvalid)
   {
      *vecptr++ = sizeof("(invalid)")-1;
      *vecptr++ = "(invalid)";
   }
   else
   {
      *vecptr++ = rqeptr->rqHeader.RequestHeaderLength;
      *vecptr++ = WATCH_NULL(rqeptr->rqHeader.RequestHeaderPtr);
   }
   *vecptr++ = rqeptr->rqHeader.RequestBodyCount;
   *vecptr++ = WATCH_NULL(rqeptr->rqHeader.RequestBodyPtr);
   *vecptr++ = rqeptr->rqHeader.MethodName;
   if (rqeptr->rqHeader.RequestUriPtr)
      *vecptr++ = strlen(rqeptr->rqHeader.RequestUriPtr);
   else
      *vecptr++ = 0;
   *vecptr++ = rqeptr->rqHeader.RequestUriPtr;
   *vecptr++ = rqeptr->rqHeader.HttpVersion / 10;
   *vecptr++ = rqeptr->rqHeader.HttpVersion % 10;
   *vecptr++ = rqeptr->rqHeader.AcceptPtr;
   *vecptr++ = rqeptr->rqHeader.AcceptCharsetPtr;
   *vecptr++ = rqeptr->rqHeader.AcceptEncodingPtr;
   *vecptr++ = rqeptr->rqHeader.AcceptLangPtr;
   *vecptr++ = rqeptr->rqHeader.AuthorizationPtr;
   *vecptr++ = rqeptr->rqHeader.CacheControlNoCache;
   *vecptr++ = rqeptr->rqHeader.CacheControlNoStore;
   *vecptr++ = rqeptr->rqHeader.CacheControlMaxAgeZero;
   *vecptr++ = &rqeptr->rqHeader.ContentLength64;
   *vecptr++ = rqeptr->rqHeader.ContentTypePtr;
   *vecptr++ = rqeptr->rqHeader.CookiePtr;
   *vecptr++ = rqeptr->rqHeader.ForwardedPtr;
   *vecptr++ = rqeptr->rqHeader.HostPtr;
   *vecptr++ = rqeptr->rqHeader.IfMatchPtr;
   *vecptr++ = rqeptr->rqHeader.IfNoneMatchPtr;
   *vecptr++ = rqeptr->rqHeader.OriginPtr;
   *vecptr++ = rqeptr->rqHeader.ProxyAuthorizationPtr;
   *vecptr++ = rqeptr->rqHeader.RefererPtr;
   *vecptr++ = rqeptr->rqHeader.UserAgentPtr;
   *vecptr++ = rqeptr->rqHeader.XForwardedForPtr;

   FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
   status = FaolToBuffer (Buffer, sizeof(Buffer), &Length,
                          HeaderFao, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
      ErrorNoticed (rqptr, status, NULL, FI_LI);

   WatchWrite (Buffer, Length);

   vecptr = FaoVector;

   *vecptr++ = rqeptr->rqBody.UnEncodeStream;
   *vecptr++ = rqeptr->rqBody.ChunkState;
   *vecptr++ = rqeptr->rqBody.ChunkCount;
   *vecptr++ = rqeptr->rqBody.ChunkSize;
   *vecptr++ = rqeptr->rqBody.ChunkSizeString;
   *vecptr++ = rqeptr->rqBody.ChunkedTrailerBufferCount;
   *vecptr++ = rqeptr->rqBody.ChunkedTrailerBufferSize;
   *vecptr++ = rqeptr->rqBody.ChunkedTrailerBufferPtr;
   *vecptr++ = rqeptr->rqBody.ChunkedTrailerNewLineCount;
   *vecptr++ = &rqeptr->rqBody.ContentLength64;
   *vecptr++ = &rqeptr->rqBody.ContentCount64;
   *vecptr++ = rqeptr->rqBody.DataVBN;
   *vecptr++ = rqeptr->rqBody.DataPtr;
   *vecptr++ = rqeptr->rqBody.DataCount;
   *vecptr++ = rqeptr->rqBody.DataSize;
   *vecptr++ = rqeptr->rqBody.DataStatus;
   *vecptr++ = rqeptr->rqBody.DiscardReadCount;
   *vecptr++ = rqeptr->rqBody.AstFunction;
   *vecptr++ = rqeptr->rqBody.ProcessFunction;
   *vecptr++ = rqeptr->rqBody.ProcessPtr;

   FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
   status = FaolToBuffer (Buffer, sizeof(Buffer), &Length,
                          BodyFao, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
      ErrorNoticed (rqptr, status, NULL, FI_LI);

   WatchWrite (Buffer, Length);

   vecptr = FaoVector;

   *vecptr++ = rqeptr->rqHeader.PathInfoPtr;
   *vecptr++ = rqeptr->rqHeader.QueryStringPtr;
   *vecptr++ = &rqeptr->Md5HashPath;
   *vecptr++ = rqeptr->MappedPathPtr;
   *vecptr++ = rqeptr->RequestMappedFile;
   *vecptr++ = rqeptr->ParseOds.ExpFileName;
   *vecptr++ = rqeptr->ScriptName;
   *vecptr++ = rqeptr->RequestMappedScript;
   *vecptr++ = rqeptr->RequestMappedRunTime;
   *vecptr++ = rqeptr->IsCgiPlusScript;
   *vecptr++ = rqeptr->rqPathSet.PathOds;
   switch (rqeptr->rqPathSet.PathOds)
   {
      case MAPURL_PATH_ODS_2 : *vecptr++ = "ODS-2"; break;
      case MAPURL_PATH_ODS_5 : *vecptr++ = "ODS-5"; break;
      case MAPURL_PATH_ODS_ADS : *vecptr++ = "ADS"; break;
      case MAPURL_PATH_ODS_PWK : *vecptr++ = "PWK"; break;
      case MAPURL_PATH_ODS_SMB : *vecptr++ = "SMB"; break;
      case MAPURL_PATH_ODS_SRI : *vecptr++ = "SRI"; break;
      default : *vecptr++ = "ods-2";
   }
   *vecptr++ = rqeptr->PathOds;
   switch (rqeptr->PathOds)
   {
      case MAPURL_PATH_ODS_2 : *vecptr++ = "ODS-2"; break;
      case MAPURL_PATH_ODS_5 : *vecptr++ = "ODS-5"; break;
      case MAPURL_PATH_ODS_ADS : *vecptr++ = "ADS"; break;
      case MAPURL_PATH_ODS_PWK : *vecptr++ = "PWK"; break;
      case MAPURL_PATH_ODS_SMB : *vecptr++ = "SMB"; break;
      case MAPURL_PATH_ODS_SRI : *vecptr++ = "SRI"; break;
      default : *vecptr++ = "ods-2";
   }
   *vecptr++ = rqeptr->PathOdsExtended;

   *vecptr++ = rqeptr->rqResponse.HeaderGenerated;
   *vecptr++ = rqeptr->rqResponse.HeaderSent;
   *vecptr++ = rqeptr->rqResponse.ErrorReportPtr;
   *vecptr++ = rqeptr->rqResponse.LocationPtr;
   *vecptr++ = rqeptr->rqResponse.ContentEncodeAsGzip;
   *vecptr++ = rqeptr->rqResponse.ContentIsEncodedGzip;
   *vecptr++ = rqeptr->rqResponse.ChunkedBufferPtr;
   *vecptr++ = rqeptr->rqResponse.ChunkedBufferSize;
   *vecptr++ = rqeptr->rqResponse.TransferEncodingChunked;

   *vecptr++ = rqeptr->rqWebSocket.ScriptProcessPid;
   *vecptr++ = rqeptr->rqWebSocket.InputSize;
   *vecptr++ = rqeptr->rqWebSocket.InputChannel;
   *vecptr++ = rqeptr->rqWebSocket.InputDevName;
   *vecptr++ = rqeptr->rqWebSocket.InputIOsb.Status;
   *vecptr++ = rqeptr->rqWebSocket.InputIOsb.Count;
   *vecptr++ = rqeptr->rqWebSocket.QueuedInput;
   *vecptr++ = rqeptr->rqWebSocket.QueuedNetRead;
   *vecptr++ = rqeptr->rqWebSocket.OutputSize;
   *vecptr++ = rqeptr->rqWebSocket.OutputChannel;
   *vecptr++ = rqeptr->rqWebSocket.OutputDevName;
   *vecptr++ = rqeptr->rqWebSocket.OutputIOsb.Status;
   *vecptr++ = rqeptr->rqWebSocket.OutputIOsb.Count;
   *vecptr++ = rqeptr->rqWebSocket.QueuedOutput;
   *vecptr++ = rqeptr->rqWebSocket.QueuedNetWrite;

   FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
   status = FaolToBuffer (Buffer, sizeof(Buffer), &Length,
                          PathInfoFao, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
      ErrorNoticed (rqptr, status, NULL, FI_LI);

   WatchWrite (Buffer, Length);

   vecptr = FaoVector;

   *vecptr++ = rqeptr->RemoteUser;
   *vecptr++ = strlen(rqeptr->RemoteUserPassword);
   *vecptr++ = rqeptr->rqAuth.ResolvedRemoteUser;
   *vecptr++ = rqeptr->rqAuth.FinalStatus;
   *vecptr++ = rqeptr->rqAuth.RequestCan;
   *vecptr++ = AuthCanString (rqeptr->rqAuth.RequestCan, AUTH_CAN_FORMAT_LONG);
   *vecptr++ = rqeptr->rqAuth.UserCan;
   *vecptr++ = AuthCanString (rqeptr->rqAuth.UserCan, AUTH_CAN_FORMAT_LONG);
   *vecptr++ = rqeptr->rqAuth.GroupCan;
   *vecptr++ = AuthCanString (rqeptr->rqAuth.GroupCan, AUTH_CAN_FORMAT_LONG);
   *vecptr++ = rqeptr->rqAuth.WorldCan;
   *vecptr++ = AuthCanString (rqeptr->rqAuth.WorldCan, AUTH_CAN_FORMAT_LONG);
   *vecptr++ = rqeptr->rqAuth.Type;
   *vecptr++ = rqeptr->rqAuth.UserDetailsPtr;
   *vecptr++ = rqeptr->rqAuth.HttpsOnly;
   *vecptr++ = rqeptr->rqAuth.SkelKeyAuthenticated;
   *vecptr++ = rqeptr->rqAuth.SysUafAuthenticated;
   *vecptr++ = rqeptr->rqAuth.VmsIdentifiersCount;
   *vecptr++ = rqeptr->rqAuth.VmsIdentifiersPtr;
   *vecptr++ = rqeptr->rqAuth.VmsUserProfile;
   *vecptr++ = rqeptr->rqAuth.VmsUserProfileLength;
   *vecptr++ = rqeptr->rqAuth.VmsUserProfilePtr;
   *vecptr++ = rqeptr->rqAuth.VmsUserScriptAs;
   *vecptr++ = rqeptr->rqAuth.DirectoryPtr;
   *vecptr++ = rqeptr->rqAuth.RealmPtr;
   *vecptr++ = AuthSourceString (rqeptr->rqAuth.RealmPtr,
                                 rqeptr->rqAuth.SourceRealm);
   *vecptr++ = rqeptr->rqAuth.RealmDescrPtr;
   *vecptr++ = rqeptr->rqAuth.PathParameterPtr;
   *vecptr++ = rqeptr->rqAuth.GroupWritePtr;
   *vecptr++ = AuthSourceString (rqeptr->rqAuth.GroupWritePtr,
                                 rqeptr->rqAuth.SourceGroupWrite);
   *vecptr++ = rqeptr->rqAuth.GroupReadPtr;
   *vecptr++ = AuthSourceString (rqeptr->rqAuth.GroupReadPtr,
                                 rqeptr->rqAuth.SourceGroupRead);
   *vecptr++ = rqeptr->rqAuth.GroupRestrictListPtr;
   *vecptr++ = rqeptr->rqAuth.WorldRestrictListPtr;
   *vecptr++ = rqeptr->rqAuth.ProxyStringPtr;
   *vecptr++ = rqeptr->rqAuth.RemoteUser;

   FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
   status = FaolToBuffer (Buffer, sizeof(Buffer), &Length,
                          AuthFao, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
      ErrorNoticed (rqptr, status, NULL, FI_LI);

   WatchWrite (Buffer, Length);

   vecptr = FaoVector;

   *vecptr++ = rqeptr->rqCgi.BufferLength;
   *vecptr++ = rqeptr->rqCgi.BufferRemaining;
   *vecptr++ = rqeptr->rqCgi.BufferPtr;
   *vecptr++ = rqeptr->rqCgi.BufferCurrentPtr;
   *vecptr++ = rqeptr->rqCgi.CalloutInProgress;
   *vecptr++ = rqeptr->rqCgi.CalloutOutputCount;
   *vecptr++ = rqeptr->rqCgi.CalloutOutputPtr;
   *vecptr++ = rqeptr->rqCgi.CalloutOutputPtr;
   *vecptr++ = rqeptr->rqCgi.ContentEncodingGzip;
   *vecptr++ = rqeptr->rqCgi.ContentTypeText;
   *vecptr++ = rqeptr->rqCgi.EofStr;
   *vecptr++ = rqeptr->rqCgi.EotStr;
   *vecptr++ = rqeptr->rqCgi.EscStr;
   *vecptr++ = rqeptr->rqCgi.Header100Continue;
   *vecptr++ = rqeptr->rqCgi.Header100ContinueDone;
   *vecptr++ = rqeptr->rqCgi.HeaderLineCount;
   *vecptr++ = rqeptr->rqCgi.IsCliDcl;
   *vecptr++ = rqeptr->rqCgi.OutputMode;
   switch (rqeptr->rqCgi.OutputMode)
   {
      case CGI_OUTPUT_MODE_STREAM : *vecptr++ = "STREAM"; break;
      case CGI_OUTPUT_MODE_RECORD : *vecptr++ = "RECORD"; break;
      case CGI_OUTPUT_MODE_CRLF : *vecptr++ = "CRLF"; break;
      default : *vecptr++ = "?";
   }
   *vecptr++ = rqeptr->rqCgi.ProcessingBody;
   *vecptr++ = rqeptr->rqCgi.RecordCount;
   *vecptr++ = rqeptr->rqCgi.ScriptRetryCount;
   *vecptr++ = rqeptr->rqCgi.TransferEncoding;
   *vecptr++ = rqeptr->rqCgi.TransferEncodingChunked;
   *vecptr++ = rqeptr->rqCgi.XVMSRecordMode;

   FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
   status = FaolToBuffer (Buffer, sizeof(Buffer), &Length,
                          CgiFao, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
      ErrorNoticed (rqptr, status, NULL, FI_LI);

   WatchWrite (Buffer, Length);

   if ((cptr = rqeptr->rqCgi.BufferPtr))
   {
      /*****************/
      /* CGI variables */
      /*****************/

      for (;;)
      {
         if (!(Length = *(USHORTPTR)cptr)) break;
         status = FaoToBuffer (Buffer, sizeof(Buffer), &Length, "!&Z\n",
                               cptr + sizeof(short));
         if (VMSnok (status) || status == SS$_BUFFEROVF)
            ErrorNoticed (rqptr, status, NULL, FI_LI);

         WatchWrite (Buffer, Length);

         cptr += *(USHORTPTR)cptr + sizeof(short);
      }
   }

   vecptr = FaoVector;
   *vecptr++ = rqeptr->rqCache.EntryPtr;
   *vecptr++ = rqeptr->AgentRequestPtr;
   *vecptr++ = rqeptr->AgentResponsePtr;
   *vecptr++ = rqeptr->AgentAstParam;
   *vecptr++ = rqeptr->DclTaskPtr;

   FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
   status = FaolToBuffer (Buffer, sizeof(Buffer), &Length,
                          CacheFao, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
      ErrorNoticed (rqptr, status, NULL, FI_LI);

   WatchWrite (Buffer, Length);

   if (rqeptr->DclTaskPtr) WatchPeekDcl (rqptr, rqeptr->DclTaskPtr);

   vecptr = FaoVector;
   *vecptr++ = rqeptr->DECnetTaskPtr;

   FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
   status = FaolToBuffer (Buffer, sizeof(Buffer), &Length,
                          DECnetFao, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
      ErrorNoticed (rqptr, status, NULL, FI_LI);

   WatchWrite (Buffer, Length);

   if (rqeptr->DECnetTaskPtr)
   {
      /***************/
      /* DECnet task */
      /***************/

      vecptr = FaoVector;
      *vecptr++ = rqeptr->DECnetTaskPtr->DECnetChannel;
      *vecptr++ = rqeptr->DECnetTaskPtr->DECnetConnectIOsb.Status;
      *vecptr++ = rqeptr->DECnetTaskPtr->DECnetConnectIOsb.Count;
      *vecptr++ = rqeptr->DECnetTaskPtr->DECnetReadIOsb.Status;
      *vecptr++ = rqeptr->DECnetTaskPtr->DECnetReadIOsb.Count;
      *vecptr++ = rqeptr->DECnetTaskPtr->DECnetWriteIOsb.Status;
      *vecptr++ = rqeptr->DECnetTaskPtr->DECnetWriteIOsb.Count;
      *vecptr++ = rqeptr->DECnetTaskPtr->QueuedDECnetIO;
      *vecptr++ = rqeptr->DECnetTaskPtr->ScriptResponded;
      *vecptr++ = rqeptr->DECnetTaskPtr->BuildRecords;
      *vecptr++ = rqeptr->DECnetTaskPtr->BuildCount;
      *vecptr++ = rqeptr->DECnetTaskPtr->CgiDialogState;
      *vecptr++ = rqeptr->DECnetTaskPtr->OsuDialogState;
      *vecptr++ = rqeptr->DECnetTaskPtr->OsuDnetCgi;

      FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
      status = FaolToBuffer (Buffer, sizeof(Buffer), &Length,
                             DECnetTaskFao, &FaoVector);
      if (VMSnok (status) || status == SS$_BUFFEROVF)
         ErrorNoticed (rqptr, status, NULL, FI_LI);

      WatchWrite (Buffer, Length);
   }

   vecptr = FaoVector;
   *vecptr++ = rqeptr->DescrTaskPtr;
   *vecptr++ = rqeptr->DirTaskPtr;
   *vecptr++ = rqeptr->FileTaskPtr;
   *vecptr++ = rqeptr->HTAdminTaskPtr;
   *vecptr++ = rqeptr->ProxyTaskPtr;

   FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
   status = FaolToBuffer (Buffer, sizeof(Buffer), &Length,
                          DescrFao, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
      ErrorNoticed (rqptr, status, NULL, FI_LI);

   WatchWrite (Buffer, Length);

   if (rqeptr->ProxyTaskPtr)
   {
      /**************/
      /* proxy task */
      /**************/

      NetGetBgDevice (rqeptr->ProxyTaskPtr->NetIoPtr->Channel,
                      ProxyDevName, sizeof(ProxyDevName));

      vecptr = FaoVector;
      *vecptr++ = rqeptr->ProxyTaskPtr->NetIoPtr->Channel;
      *vecptr++ = ProxyDevName+1;
      *vecptr++ = rqeptr->ProxyTaskPtr->NetIoPtr->QioMaxSeg;
      *vecptr++ = rqeptr->ProxyTaskPtr->NetIoPtr->ReadIOsb.Status;
      *vecptr++ = rqeptr->ProxyTaskPtr->NetIoPtr->ReadIOsb.Count;
      *vecptr++ = rqeptr->ProxyTaskPtr->NetIoPtr->ReadStatus;
      *vecptr++ = rqeptr->ProxyTaskPtr->NetIoPtr->ReadCount;
      *vecptr++ = rqeptr->ProxyTaskPtr->NetIoPtr->ReadAstFunction;
      *vecptr++ = rqeptr->ProxyTaskPtr->NetIoPtr->ReadPtr;
      *vecptr++ = rqeptr->ProxyTaskPtr->NetIoPtr->ReadSize;
      *vecptr++ = rqeptr->ProxyTaskPtr->NetIoPtr->WriteIOsb.Status;
      *vecptr++ = rqeptr->ProxyTaskPtr->NetIoPtr->WriteIOsb.Count;
      *vecptr++ = rqeptr->ProxyTaskPtr->NetIoPtr->WriteStatus;
      *vecptr++ = rqeptr->ProxyTaskPtr->NetIoPtr->WriteCount;
      *vecptr++ = rqeptr->ProxyTaskPtr->NetIoPtr->WriteAstFunction;
      *vecptr++ = rqeptr->ProxyTaskPtr->NetIoPtr->WritePtr;
      *vecptr++ = rqeptr->ProxyTaskPtr->NetIoPtr->WriteLength;
      *vecptr++ = &rqeptr->ProxyTaskPtr->NetIoPtr->BytesRawRx64;
      *vecptr++ = &rqeptr->ProxyTaskPtr->NetIoPtr->BytesRawTx64;
      *vecptr++ = &rqeptr->ProxyTaskPtr->ConnectIpAddress;
      *vecptr++ = &rqeptr->ProxyTaskPtr->RequestHostIpAddress;
      *vecptr++ = rqeptr->ProxyTaskPtr->RequestHostPort;
      *vecptr++ = rqeptr->ProxyTaskPtr->RequestSchemeName;
      *vecptr++ = rqeptr->ProxyTaskPtr->ProxyTunnel;
      *vecptr++ = rqeptr->ProxyTaskPtr->ProxyLookupRetryCount;
      *vecptr++ = rqeptr->ProxyTaskPtr->ProxyConnectIOsb.Status;
      *vecptr++ = rqeptr->ProxyTaskPtr->ProxyConnectIOsb.Count;
      *vecptr++ = rqeptr->ProxyTaskPtr->VerifyRecordPtr;
      *vecptr++ = rqeptr->ProxyTaskPtr->RebuiltRequestLength;
      *vecptr++ = rqeptr->ProxyTaskPtr->RebuiltRequestPtr;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseBodyLength;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseBufferNetCount;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseBufferNetPtr;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseBufferCurrentPtr;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseBufferRemaining;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseBufferCount;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseBufferPtr;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseCacheControlMaxAge;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseCacheControlMaxAgeZero;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseCacheControlMustReval;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseCacheControlNoCache;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseCacheControlNoStore;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseCacheControlNoTransform;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseCacheControlPrivate;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseCacheControlProxyReval;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseCacheControlPublic;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseCacheControlSMaxAge;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseChunkedCount;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseChunkedEnd;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseChunkedEol;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseChunkedEot;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseChunkedInit;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseChunkedSize;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseChunkedString;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseChunkedNewlineCount;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseConsecutiveNewLineCount;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseContentEncodingGzip;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseContentEncodingUnknown;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseContentLength;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseExpires;
      *vecptr++ = &rqeptr->ProxyTaskPtr->ResponseExpiresTime64;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseHeaderLength;
      if (!rqeptr->ProxyTaskPtr->ResponseHeaderPtr)
      {
         *vecptr++ = sizeof(WATCH_NULL_STRING)-1;
         *vecptr++ = WATCH_NULL_STRING;
      }
      else
      if (rqeptr->ProxyTaskPtr->ResponseConsecutiveNewLineCount < 2)
      {
         *vecptr++ = rqeptr->ProxyTaskPtr->ResponseHeaderLength;
         *vecptr++ = WATCH_NULL(rqeptr->ProxyTaskPtr->ResponseHeaderPtr);
      }
      else
      {
         *vecptr++ = sizeof(WATCH_NULL_STRING)-1;
         *vecptr++ = WATCH_NULL_STRING;
      }
      *vecptr++ = rqeptr->ProxyTaskPtr->RebuiltHeaderLength;
      *vecptr++ = rqeptr->ProxyTaskPtr->RebuiltHeaderPtr;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseLastModified;
      *vecptr++ = &rqeptr->ProxyTaskPtr->ResponseLastModifiedTime64;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseTransferEncodingChunked;
      *vecptr++ = rqeptr->ProxyTaskPtr->ResponseUpgradeWebSocket;

      FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
      status = FaolToBuffer (Buffer, sizeof(Buffer), &Length,
                             ProxyTaskFao, &FaoVector);
      if (VMSnok (status) || status == SS$_BUFFEROVF)
         ErrorNoticed (rqptr, status, NULL, FI_LI);

      WatchWrite (Buffer, Length);
   }

   vecptr = FaoVector;
   *vecptr++ = rqeptr->PutTaskPtr;
   *vecptr++ = rqeptr->SsiTaskPtr;
   *vecptr++ = rqeptr->UpdTaskPtr;

   FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
   status = FaolToBuffer (Buffer, sizeof(Buffer), &Length, PutFao, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
      ErrorNoticed (rqptr, status, NULL, FI_LI);

   WatchWrite (Buffer, Length);

   WatchNone (false);
}

/*****************************************************************************/
/*
Peek at the supplied DCL structure.
*/

void WatchPeekDcl
(
REQUEST_STRUCT *rqptr,
DCL_TASK *tkptr
)
{
   static char  DclTaskFao [] =
"!33<RequestPtr!> !&X\n\
!33<TaskType!> !UL (!AZ)\n\
!33<LifeTimeSecond!> !&@\n\
!33<CrePrcTermMbxChannel!> !UL (!AZ)\n\
!33<CrePrcDetachProcess!> !UL\n\
!33<CrePrcDetachStarting!> !UL\n\
!33<CrePrcUserName!> !&Z\n\
!33<CgiPlusVarStruct!> !UL\n\
!33<CgiPlusInChannel!> !UL (!AZ)\n\
!33<CgiPlusInIOsb!> !&S !UL\n\
!33<QueuedCgiPlusIn!> !UL\n\
!33<HttpInputChannel!> !UL (!AZ)\n\
!33<HttpInputIOsb!> !&S !UL\n\
!33<QueuedHttpInput!> !UL\n\
!33<ClientReadBufferSize!> !UL\n\
!33<ClientReadStripCrLf!> !UL\n\
!33<QueuedClientRead!> !UL\n\
!33<SysCommandChannel!> !UL (!AZ)\n\
!33<SysCommandIOsb!> !&S !UL\n\
!33<QueuedSysCommand!> !UL\n\
!33<QueuedSysCommandAllowed!> !UL\n\
!33<SysOutputSize!> !UL\n\
!33<SysOutputChannel!> !UL (!AZ)\n\
!33<SysOutputIOsb!> !&S !UL\n\
!33<QueuedSysOutput!> !UL\n\
!33<QueuedClientOutput!> !UL\n\
!33<BuildRecords!> !&B\n\
!33<SysOutputBuildCount!> !UL\n\
!33<ClientWriteErrorCount!> !UL\n\
!33<ScriptProcessPid!> !8XL\n\
!33<CrePrcTermRecord.acc$l_finalsts!> !&S\n\
!33<ScriptProcessActivated!> !&B\n\
!33<ScriptProcessResponded!> !&B\n\
!33<TaskRunDown!> !UL\n\
!33<DeleteProcess!> !&B\n\
!33<ForceImageExit!> !&B\n\
!33<ForceImageExitGetJpi!> !&B\n\
!33<ForceImageExitIssued!> !&B\n\
!33<ForceImageExitSecond!> !UL\n\
!33<JpiImagNameIOsb.Status!> !&S\n\
!33<JpiImagName!> |!#AZ|\n\
!33<ScriptCpuMax!> !UL\n\
!33<ScriptCpuTimGetJpi!> !UL\n\
!33<JpiCpuTimIOsb.Status!> !&S\n\
!33<JpiCpuTim!> !UL\n\
!33<ScriptCpuTimMax!> !UL\n\
!33<CalloutFunction!> !&A\n\
!33<DclCommandPtr!> !&Z\n\
!33<DclCommandSize!> !UL\n\
!33<DclCommandLength!> !UL\n\
!33<ScriptName!> !&Z\n\
!33<ScriptFileName!> !&Z\n\
!33<MemBufCount64!> !@SQ\n\
!33<MemBufInProgress!> !&B\n\
!33<MemBufGblSecName!> !&Z\n\
!33<MemBufGblSecPtr!> !8XL\n\
!33<MemBufSize!> !UL\n\
|\n";

   int  status;
   ushort  slen;
   ulong  FaoVector [96];
   ulong  *vecptr;
   char  Buffer [4096];

   if (!tkptr) return;

   vecptr = FaoVector;
   *vecptr++ = tkptr->RequestPtr;
   *vecptr++ = tkptr->TaskType;
   switch (tkptr->TaskType)
   {
      case DCL_TASK_TYPE_NONE : *vecptr++ = "none"; break;
      case DCL_TASK_TYPE_CLI : *vecptr++ = "CLI"; break;
      case DCL_TASK_TYPE_CGI_SCRIPT : *vecptr++ = "CGI"; break;
      case DCL_TASK_TYPE_CGIPLUS_SCRIPT : *vecptr++ = "CGIplus"; break;
      case DCL_TASK_TYPE_RTE_SCRIPT : *vecptr++ = "RTE"; break;
      default : *vecptr++ = "?";
   }
   if (tkptr->LifeTimeSecond == DCL_DO_NOT_DISTURB)
      *vecptr++ = "DO-NOT-DISTURB";
   else
   {
      *vecptr++ = "!UL";
      *vecptr++ = tkptr->LifeTimeSecond;
   }
   *vecptr++ = tkptr->CrePrcTermMbxChannel;
   *vecptr++ = tkptr->CrePrcTermMbxDevName+1;
   *vecptr++ = tkptr->CrePrcDetachProcess;
   *vecptr++ = tkptr->CrePrcDetachStarting;
   *vecptr++ = tkptr->CrePrcUserName;
   *vecptr++ = tkptr->CgiPlusVarStruct;
   *vecptr++ = tkptr->CgiPlusInChannel;
   *vecptr++ = tkptr->CgiPlusInDevName+1;
   *vecptr++ = tkptr->CgiPlusInIOsb.Status;
   *vecptr++ = tkptr->CgiPlusInIOsb.Count;
   *vecptr++ = tkptr->QueuedCgiPlusIn;
   *vecptr++ = tkptr->HttpInputChannel;
   *vecptr++ = tkptr->HttpInputDevName+1;
   *vecptr++ = tkptr->HttpInputIOsb.Status;
   *vecptr++ = tkptr->HttpInputIOsb.Count;
   *vecptr++ = tkptr->QueuedHttpInput;
   *vecptr++ = tkptr->ClientReadBufferSize;
   *vecptr++ = tkptr->ClientReadStripCrLf;
   *vecptr++ = tkptr->QueuedClientRead;
   *vecptr++ = tkptr->SysCommandChannel;
   *vecptr++ = tkptr->SysCommandDevName+1;
   *vecptr++ = tkptr->SysCommandIOsb.Status;
   *vecptr++ = tkptr->SysCommandIOsb.Count;
   *vecptr++ = tkptr->QueuedSysCommand;
   *vecptr++ = tkptr->QueuedSysCommandAllowed;
   *vecptr++ = tkptr->SysOutputSize;
   *vecptr++ = tkptr->SysOutputChannel;
   *vecptr++ = tkptr->SysOutputDevName+1;
   *vecptr++ = tkptr->SysOutputIOsb.Status;
   *vecptr++ = tkptr->SysOutputIOsb.Count;
   *vecptr++ = tkptr->QueuedSysOutput;
   *vecptr++ = tkptr->QueuedClientOutput;
   *vecptr++ = tkptr->BuildRecords;
   *vecptr++ = tkptr->SysOutputBuildCount;
   *vecptr++ = tkptr->ClientWriteErrorCount;
   *vecptr++ = tkptr->ScriptProcessPid;
   *vecptr++ = tkptr->CrePrcTermRecord.acc$l_finalsts;
   *vecptr++ = tkptr->ScriptProcessActivated;
   *vecptr++ = tkptr->ScriptProcessResponded;
   *vecptr++ = tkptr->TaskRunDown;
   *vecptr++ = tkptr->DeleteProcess;
   *vecptr++ = tkptr->ForceImageExit;
   *vecptr++ = tkptr->ForceImageExitGetJpi;
   *vecptr++ = tkptr->ForceImageExitIssued;
   *vecptr++ = tkptr->ForceImageExitSecond;
   *vecptr++ = tkptr->JpiImagNameIOsb.Status;
   *vecptr++ = tkptr->JpiImagNameLength;
   *vecptr++ = tkptr->JpiImagName;
   *vecptr++ = tkptr->ScriptCpuMax;
   *vecptr++ = tkptr->ScriptCpuTimGetJpi;
   *vecptr++ = tkptr->JpiCpuTimIOsb.Status;
   *vecptr++ = tkptr->JpiCpuTim;
   *vecptr++ = tkptr->ScriptCpuTimMax;
   *vecptr++ = tkptr->CalloutFunction;
   *vecptr++ = tkptr->DclCommandPtr;
   *vecptr++ = tkptr->DclCommandSize;
   *vecptr++ = tkptr->DclCommandLength;
   *vecptr++ = tkptr->ScriptName;
   *vecptr++ = tkptr->ScriptFileName;
   *vecptr++ = &tkptr->MemBufCount64;
   *vecptr++ = tkptr->MemBufInProgress;
   *vecptr++ = tkptr->MemBufGblSecName;
   *vecptr++ = tkptr->MemBufGblSecPtr;
   *vecptr++ = tkptr->MemBufSize;

   FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
   status = FaolToBuffer (Buffer, sizeof(Buffer), &slen,
                          DclTaskFao, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
      ErrorNoticed (rqptr, status, NULL, FI_LI);

   WatchWrite (Buffer, slen);
}

/*****************************************************************************/
/*
Peek at the supplied HTTP/2 structure.
*/

void WatchPeekHttp2
(
REQUEST_STRUCT *rqptr,
HTTP2_STRUCT *h2ptr,
char *Title
)
{
   static char  NetIoFao [] =
"!AZ\n\
!33<BytesRawRx64!> !@SQ\n\
!33<BytesRawTx64!> !@SQ\n\
!33<ClientInitialWindowSize!> !UL\n\
!33<ClientMaxConcStreams!> !UL\n\
!33<ClientMaxFrameSize!> !UL\n\
!33<ClientMaxHeaderListSize!> !UL\n\
!33<ClientMaxHeaderTableSize!> !UL\n\
!33<ClientPushPromise!> !UL\n\
!33<ConnectNumber!> !UL\n\
!33<ConnectTime64!> !%D (!AZ ago)\n\
!33<FlowControlCount!> !UL\n\
!33<FlowControlCurrent!> !UL\n\
!33<FrameCountRx!> !UL\n\
!33<FrameCountTx!> !UL\n\
!33<FrameRequestCountRx!> !UL\n\
!33<FrameRequestCountTx!> !UL\n\
!33<GoAwayIdent!> !UL\n\
!33<GoAwayLastStreamIdent!> !UL\n\
!33<GoAwaySecond!> !UL\n\
!33<IdleSecond!> !UL (!SL seconds)\n\
!33<LastStreamIdent!> !UL\n\
!33<PingTime64!> !%D!&@\n\
!33<PingMicroSeconds!> !UL\n\
!33<PingBackTickSecond!> !UL (!SL seconds)\n\
!33<PingSendTickSecond!> !UL (!SL seconds)\n\
!33<QueuedWriteList[0].Count!> !UL\n\
!33<QueuedWriteList[1].Count!> !UL\n\
!33<QueuedWriteList[2].Count!> !UL\n\
!33<QueuedWriteList[3].Count!> !UL\n\
!33<QueuedWritePeak!> !UL\n\
!33<ReadBufferCount!> !UL\n\
!33<ReadBufferPtr!> !&X\n\
!33<ReadBufferSize!> !UL\n\
!33<ReadWindowSize!> !UL\n\
!33<RequestCount!> !UL\n\
!33<RequestCurrent!> !UL\n\
!33<RequestPeak!> !UL\n\
!33<ServerHeaderTableSize!> !UL\n\
!33<ServerInitialWindowSize!> !UL\n\
!33<ServerMaxConcStreams!> !UL\n\
!33<ServerMaxFrameSize!> !UL\n\
!33<ServerMaxHeaderTableSize!> !UL\n\
!33<ServerMaxHeaderListSize!> !UL\n\
!33<ServerPushPromise!> !UL\n\
!33<ServicePtr!> !&X\n\
!33<->ServerChannel!> !UL (!AZ)\n\
!33<->ServerHostPort!> !&Z\n\
!33<->ServerIpAddressString!> !&Z\n\
!33<StreamList.Count!> !UL\n\
!33<WriteInUseCount!> !SL\n\
!33<WriteWindowSize!> !SL\n\
!33<NETIO_IN_PROGRESS!> !&B\n";

   int  status;
   int64  Time64,
          ConnectDuration64,
          PingDuration64;
   ushort  Length;
   ulong  FaoVector [96];
   ulong  *vecptr;
   char  Buffer [4096],
         ServerDevName [64];

   /*********/
   /* begin */
   /*********/

   WatchNone (true);

   NetGetBgDevice (h2ptr->ServicePtr->ServerChannel,
                   ServerDevName, sizeof(ServerDevName));

   sys$gettim (&Time64);
   ConnectDuration64 = h2ptr->ConnectTime64 - Time64;
   PingDuration64 = h2ptr->PingTime64 - Time64;

   vecptr = FaoVector;

   *vecptr++ = Title ? Title : "";

   *vecptr++ = &h2ptr->BytesRawRx64;
   *vecptr++ = &h2ptr->BytesRawTx64;
   *vecptr++ = h2ptr->ClientInitialWindowSize;

   *vecptr++ = h2ptr->ClientMaxConcStreams;
   *vecptr++ = h2ptr->ClientMaxFrameSize;
   *vecptr++ = h2ptr->ClientMaxHeaderListSize;
   *vecptr++ = h2ptr->ClientMaxHeaderTableSize;
   *vecptr++ = h2ptr->ClientPushPromise;

   *vecptr++ = h2ptr->ConnectNumber;
   *vecptr++ = &h2ptr->ConnectTime64;
   *vecptr++ = DurationString (rqptr, &ConnectDuration64);

   *vecptr++ = h2ptr->FlowControlCount;
   *vecptr++ = h2ptr->FlowControlCurrent;

   *vecptr++ = h2ptr->FrameCountRx;
   *vecptr++ = h2ptr->FrameCountTx;
   *vecptr++ = h2ptr->FrameRequestCountRx;
   *vecptr++ = h2ptr->FrameRequestCountTx;

   *vecptr++ = h2ptr->GoAwayIdent;
   *vecptr++ = h2ptr->GoAwayLastStreamIdent;
   *vecptr++ = h2ptr->GoAwaySecond;
   *vecptr++ = h2ptr->IdleSecond;
   *vecptr++ = h2ptr->IdleSecond - HttpdTickSecond;
   *vecptr++ = h2ptr->LastStreamIdent;
   *vecptr++ = &h2ptr->PingTime64;
   if (!h2ptr->PingTime64)
      *vecptr++ = "";
   else
   {
      *vecptr++ = " (!AZ ago)";
      *vecptr++ = DurationString (rqptr, &PingDuration64);
   }
   *vecptr++ = h2ptr->PingMicroSeconds;
   *vecptr++ = h2ptr->PingBackTickSecond;
   *vecptr++ = h2ptr->PingBackTickSecond ?
               h2ptr->PingBackTickSecond - HttpdTickSecond : 0;
   *vecptr++ = h2ptr->PingSendTickSecond;
   *vecptr++ = h2ptr->PingSendTickSecond ?
               h2ptr->PingSendTickSecond - HttpdTickSecond : 0;

   *vecptr++ = LIST_GET_COUNT(&h2ptr->QueuedWriteList[0]);
   *vecptr++ = LIST_GET_COUNT(&h2ptr->QueuedWriteList[1]);
   *vecptr++ = LIST_GET_COUNT(&h2ptr->QueuedWriteList[2]);
   *vecptr++ = LIST_GET_COUNT(&h2ptr->QueuedWriteList[3]);
   *vecptr++ = h2ptr->QueuedWritePeak;

   *vecptr++ = h2ptr->ReadBufferCount;
   *vecptr++ = h2ptr->ReadBufferPtr;
   *vecptr++ = h2ptr->ReadBufferSize;
   *vecptr++ = h2ptr->ReadWindowSize;

   *vecptr++ = h2ptr->RequestCount;
   *vecptr++ = h2ptr->RequestCurrent;
   *vecptr++ = h2ptr->RequestPeak;

   *vecptr++ = h2ptr->ServerHeaderTableSize;
   *vecptr++ = h2ptr->ServerInitialWindowSize;
   *vecptr++ = h2ptr->ServerMaxConcStreams;
   *vecptr++ = h2ptr->ServerMaxFrameSize;
   *vecptr++ = h2ptr->ServerMaxHeaderTableSize;
   *vecptr++ = h2ptr->ServerMaxHeaderListSize;
   *vecptr++ = h2ptr->ServerPushPromise;

   *vecptr++ = h2ptr->ServicePtr;
   *vecptr++ = h2ptr->ServicePtr->ServerChannel;
   *vecptr++ = ServerDevName+1;
   *vecptr++ = h2ptr->ServicePtr->ServerHostPort;
   *vecptr++ = h2ptr->ServicePtr->ServerIpAddressString;

   *vecptr++ = LIST_GET_COUNT(&h2ptr->StreamList);

   *vecptr++ = h2ptr->WriteInUseCount;
   *vecptr++ = h2ptr->WriteWindowSize;
   *vecptr++ = NETIO_IN_PROGRESS (h2ptr->NetIoPtr);

   FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
   status = FaolToBuffer (Buffer, sizeof(Buffer), &Length,
                          NetIoFao, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
      ErrorNoticed (rqptr, status, NULL, FI_LI);

   WatchWrite (Buffer, Length);

   WatchPeekNetIo (rqptr, h2ptr->NetIoPtr, "Http2Ptr->NetIoPtr->");

   WatchNone (false);
}

/*****************************************************************************/
/*
Peek at the supplied NETIO structure.
*/

void WatchPeekNetIo
(
REQUEST_STRUCT *rqptr,
NETIO_STRUCT *ioptr,
char *Title
)
{
   static char  NetIoFao [] =
"|\n\
!33<!AZ!> !&X\n\
!33<Channel!> !UL (!AZ)\n\
!33<QioMaxSeg!> !UL\n\
!33<BlocksRawRx64!> !@SQ\n\
!33<BytesRawRx64!> !@SQ\n\
!33<BlocksRawTx64!> !@SQ\n\
!33<BytesRawTx64!> !@SQ\n\
!33<ReadAstFunction!> !&A\n\
!33<ReadAstParam!> !&X\n\
!33<ReadCount!> !UL\n\
!33<ReadErrorCount!> !UL\n\
!33<ReadErrorStatus!> !&S\n\
!33<ReadPtr!> !&X\n\
!33<ReadSize!> !UL\n\
!33<ReadIOsb!> !&S !UL\n\
!33<VmsStatus!> !&S\n\
!33<SSHversionDigit!> 0x!2XL\n\
!33<WriteAstFunction!> !&A\n\
!33<WriteAstParam!> !&X\n\
!33<WriteCount!> !UL\n\
!33<WriteErrorCount!> !UL\n\
!33<WriteErrorStatus!> !&S\n\
!33<WriteLength!> !UL\n\
!33<WritePtr!> !&X\n\
!33<WriteLength!> !UL\n\
!33<WriteIOsb!> !&S !UL\n\
!33<ClientPtr->Lookup.HostName!> !&Z\n\
!33<ClientPtr->IpAddress!> !&I\n\
!33<ClientPtr->IpPort!> !UL\n\
!33<ClientPtr->MultiHomeIpAddress!> !&I\n";

   static char  SesolaPtrNull [] =
"|\nSesolaPtr->                       0x00000000\n";

   int  status;
   ushort  Length;
   ulong  FaoVector [48];
   ulong  *vecptr;
   char  Buffer [2048],
         DevName [64];

   /*********/
   /* begin */
   /*********/

   WatchNone (true);

   NetGetBgDevice (ioptr->Channel, DevName, sizeof(DevName));

   vecptr = FaoVector;

   *vecptr++ = Title ? Title : "ioptr->";
   *vecptr++ = ioptr;
   *vecptr++ = ioptr->Channel;
   *vecptr++ = DevName+1;
   *vecptr++ = ioptr->QioMaxSeg;
   *vecptr++ = &ioptr->BlocksRawRx64;
   *vecptr++ = &ioptr->BytesRawRx64;
   *vecptr++ = &ioptr->BlocksRawTx64;
   *vecptr++ = &ioptr->BytesRawTx64;

   *vecptr++ = ioptr->ReadAstFunction;
   *vecptr++ = ioptr->ReadAstParam;
   *vecptr++ = ioptr->ReadCount;
   *vecptr++ = ioptr->ReadErrorCount;
   *vecptr++ = ioptr->ReadErrorStatus;
   *vecptr++ = ioptr->ReadPtr;
   *vecptr++ = ioptr->ReadSize;
   *vecptr++ = ioptr->ReadIOsb.Status;
   *vecptr++ = ioptr->ReadIOsb.Count;
   *vecptr++ = ioptr->VmsStatus;
   *vecptr++ = ioptr->SSHversionDigit;

   *vecptr++ = ioptr->WriteAstFunction;
   *vecptr++ = ioptr->WriteAstParam;
   *vecptr++ = ioptr->WriteCount;
   *vecptr++ = ioptr->WriteErrorCount;
   *vecptr++ = ioptr->WriteErrorStatus;
   *vecptr++ = ioptr->WriteLength;
   *vecptr++ = ioptr->WritePtr;
   *vecptr++ = ioptr->WriteLength;
   *vecptr++ = ioptr->WriteIOsb.Status;
   *vecptr++ = ioptr->WriteIOsb.Count;

   *vecptr++ = ioptr->ClientPtr->Lookup.HostName;
   *vecptr++ = &ioptr->ClientPtr->IpAddress;
   *vecptr++ = ioptr->ClientPtr->IpPort;
   *vecptr++ = &ioptr->ClientPtr->MultiHomeIpAddress;

   FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
   status = FaolToBuffer (Buffer, sizeof(Buffer), &Length,
                          NetIoFao, &FaoVector);
   if (VMSnok (status) || status == SS$_BUFFEROVF)
      ErrorNoticed (rqptr, status, NULL, FI_LI);

   WatchWrite (Buffer, Length);

   if (ioptr->SesolaPtr == NULL)
      WatchWrite (SesolaPtrNull, sizeof(SesolaPtrNull)-1);
   else
      SesolaWatchPeek (rqptr, ioptr->SesolaPtr);

   WatchNone (false);
}

/*****************************************************************************/
/*
Return a report on processes' virtual memory usage.  This function blocks while
executing.
*/ 

void WatchVmZone
(
REQUEST_STRUCT *rqptr,
ulong ZoneId
)
{
   static ulong  ShowVmZoneDetail = 3;

   int  status;
   ushort  slen;
   char  buf [256];

   /*********/
   /* begin */
   /*********/

   status = lib$show_vm_zone (&ZoneId, &ShowVmZoneDetail, &WatchVmWrite, rqptr);
   if (VMSnok (status))
   {
      FaoToBuffer (buf, sizeof(buf), &slen, "LIB$SHOW_VM_ZONE !&S\n", status);
      WatchWrite (buf, slen);
   }
}

/*****************************************************************************/
/*
Action routine for lib$show_vm*() routines.
Munge the peek link from the zone name.
*/ 

int WatchVmWrite
(
struct dsc$descriptor *DscPtr,
REQUEST_STRUCT *rqptr
)
{
   int  status;
   char  *cptr, *czptr, *sptr, *zptr;
   char  buf [256];

   /*********/
   /* begin */
   /*********/

   zptr = (sptr = buf) + sizeof(buf)-2;
   czptr = (cptr = DscPtr->dsc$a_pointer) + DscPtr->dsc$w_length;
   while (cptr < czptr && sptr < zptr) *sptr++ = *cptr++;
   *sptr = '\0';
   if (sptr = strstr (buf, "WASD Request Heap "))
   {
      sptr += 18;
      if (cptr = strstr (sptr, "at="))
      {
         for (cptr += 3; isdigit(*cptr); *sptr++ = *cptr++);
         *sptr++ = '\"';
         *sptr = '\0';  
      }
   }
   for (sptr = buf; *sptr; sptr++);
   *sptr++ = '\n';
   *sptr = '\0';  
   WatchWrite (buf, sptr - buf);

   return (SS$_NORMAL);
}

/*****************************************************************************/
/*
Display the size of selected data structures.
*/ 

void WatchReportStruct (REQUEST_STRUCT *rqptr)

{
#if WATCH_MOD

   static char  ResponseFao [] =
"!25<AccountingStruct!> !6UL  (bytes)\n\
!25<ActivityGblSecStruct!> !6UL\n\
!25<AuthCacheRecordStruct!> !6UL\n\
!25<AuthConfigStruct!> !6UL\n\
!25<AuthGblSecStruct!> !6UL\n\
!25<AuthHtaRecordStruct!> !6UL\n\
!25<AuthPathRecordStruct!> !6UL\n\
!25<AuthRealmRecordStruct!> !6UL\n\
!25<BodyProcessStruct!> !6UL\n\
!25<CacheStruct!> !6UL\n\
!25<DclTaskStruct!> !6UL\n\
!25<DclScriptNameCacheStruct!> !6UL\n\
!25<DirTaskStruct!> !6UL\n\
!25<DECnetConnectStruct!> !6UL\n\
!25<DECnetTaskStruct!> !6UL\n\
!25<Http2Struct!> !6UL\n\
!25<Http2StreamStruct!> !6UL\n\
!25<Http2WriteStruct!> !6UL\n\
!25<HttpdGblSecStruct!> !6UL\n\
!25<MonRequestStruct!> !6UL\n\
!25<NetIoStruct!> !6UL\n\
!25<OdsStruct!> !6UL\n\
!25<ProxyTaskStruct!> !6UL\n\
!25<ProxyAccountingStruct!> !6UL\n\
!25<ProxyVerifyGblSecStruct!> !6UL\n\
!25<PutTaskStruct!> !6UL\n\
!25<RequestStruct!> !6UL\n\
!25<ServiceStruct!> !6UL\n\
!25<SesolaGblSecStruct!> !6UL\n\
!25<SsiStruct!> !6UL\n\
!25<StrDscStruct!> !6UL\n\
!25<UpdTaskStruct!> !6UL\n\
!25<VmStruct!> !6UL\n\
!25<WebDavTaskStruct!> !6UL\n";

   int  status;
   ulong  FaoVector [64];
   ulong  *vecptr;

   /*********/
   /* begin */
   /*********/

   if (!rqptr->RemoteUser[0])
   {
      rqptr->rqResponse.HttpStatus = 403;
      ErrorGeneral (rqptr, ErrorWatchAuthNeeded, FI_LI);
      AdminEnd (rqptr);
      return;
   }

   vecptr = FaoVector;
   *vecptr++ = sizeof(struct AccountingStruct);
   *vecptr++ = sizeof(struct ActivityGblSecStruct);
   *vecptr++ = sizeof(struct AuthCacheRecordStruct);
   *vecptr++ = sizeof(struct AuthConfigStruct);
   *vecptr++ = sizeof(struct AuthGblSecStruct);
   *vecptr++ = sizeof(struct AuthHtaRecordStruct);
   *vecptr++ = sizeof(struct AuthPathRecordStruct);
   *vecptr++ = sizeof(struct AuthRealmRecordStruct);
   *vecptr++ = sizeof(struct BodyProcessStruct);
   *vecptr++ = sizeof(struct CacheStruct);
   *vecptr++ = sizeof(struct DclTaskStruct);
   *vecptr++ = sizeof(struct DclScriptNameCacheStruct);
   *vecptr++ = sizeof(struct DirTaskStruct);
   *vecptr++ = sizeof(struct DECnetConnectStruct);
   *vecptr++ = sizeof(struct DECnetTaskStruct);
   *vecptr++ = sizeof(struct Http2Struct);
   *vecptr++ = sizeof(struct Http2StreamStruct);
   *vecptr++ = sizeof(struct Http2WriteStruct);
   *vecptr++ = sizeof(HTTPD_GBLSEC);
   *vecptr++ = sizeof(struct MonRequestStruct);
   *vecptr++ = sizeof(struct NetIoStruct);
   *vecptr++ = sizeof(struct OdsStruct);
   *vecptr++ = sizeof(struct ProxyTaskStruct);
   *vecptr++ = sizeof(PROXY_ACCOUNTING_STRUCT);
   *vecptr++ = sizeof(struct ProxyVerifyGblSecStruct);
   *vecptr++ = sizeof(struct PutTaskStruct);
   *vecptr++ = sizeof(struct RequestStruct);
   *vecptr++ = sizeof(struct ServiceStruct);
   *vecptr++ = SesolaGblSecStructSize;
   *vecptr++ = sizeof(struct SsiTaskStruct);
   *vecptr++ = sizeof(struct StrDscStruct);
   *vecptr++ = sizeof(struct UpdTaskStruct);
   *vecptr++ = sizeof(struct VmStruct);
   *vecptr++ = sizeof(struct WebDavTaskStruct);

   FaoCheck (sizeof(FaoVector), &FaoVector, vecptr, FI_LI);
   status = FaolToNet (rqptr, ResponseFao, &FaoVector);
   if (VMSnok (status)) ErrorNoticed (rqptr, status, NULL, FI_LI);

   ResponseHeader200 (rqptr, "text/plain", &rqptr->NetWriteBufferDsc);

   AdminEnd (rqptr);

#else /* WATCH_MOD */

   rqptr->rqResponse.HttpStatus = 403;
   ErrorGeneral (rqptr, ErrorWatchNoModule, FI_LI);
   AdminEnd (rqptr);

#endif /* WATCH_MOD */
}

/****************************************************************************/