IPNameCache.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Hal Murray June 19, 1985 8:43:40 pm PDT
John Larson, June 14, 1987 2:33:33 am PDT
DIRECTORY
BasicTime USING [GMT],
Rope USING [ROPE],
IPDefs USING [Address, nullAddress];
IPNameCache: CEDAR DEFINITIONS =
BEGIN
ROPE: TYPE = Rope.ROPE;
ZapWholeCache: PROC;
Name Cache
NameEntry: TYPE = REF NameRecord;
NameRecord: TYPE = RECORD [
loaded: BasicTime.GMT,
referenced: BasicTime.GMT,
expires: BasicTime.GMT,
ttl: INT,
source: IPDefs.Address,
authoritative: BOOL,
rejuvinations: INT ← 0,
nameCacheLoad: INT ← 0,
nameToAddress: INT ← 0,
normalizeName: INT ← 0,
name: ROPENIL,
addresses: LIST OF IPDefs.Address ← NIL ];
GetNames: PROC RETURNS [LIST OF NameEntry];
NameLookup: PROC [ROPE] RETURNS [NameEntry];
UpdateName: PROC [
name: ROPE, source: IPDefs.Address, ttl: INT, authoritative: BOOL]
RETURNS [entry: NameEntry];
AddAddressToName: PROC [entry: NameEntry, address: IPDefs.Address];
Alias Cache
AliasEntry: TYPE = REF AliasRecord;
AliasRecord: TYPE = RECORD [
loaded: BasicTime.GMT,
referenced: BasicTime.GMT,
expires: BasicTime.GMT,
ttl: INT,
source: IPDefs.Address,
authoritative: BOOL,
rejuvinations: INT ← 0,
aliasToName: INT ← 0,
alias: ROPE,
name: ROPE ];
GetAliases: PROC RETURNS [LIST OF AliasEntry];
AliasLookup: PROC [ROPE] RETURNS [AliasEntry];
UpdateAlias: PROC [
alias: ROPE, source: IPDefs.Address, ttl: INT, authoritative: BOOL]
RETURNS [entry: AliasEntry];
AddNameToAlias: PROC [entry: AliasEntry, name: ROPE];
MX Cache (mail forwarding hosts)
MXEntry: TYPE = REF MXRecord;
MXRecord: TYPE = RECORD [
loaded: BasicTime.GMT,
referenced: BasicTime.GMT,
expires: BasicTime.GMT,
ttl: INT,
source: IPDefs.Address,
authoritative: BOOL,
rejuvinations: INT ← 0,
nameToMX: INT ← 0,
name: ROPE,
mxHosts: LIST OF MXHostInfo];
MXHostInfo: TYPE = RECORD [
host: ROPE,
preference: INT ← 0];
GetMXList: PROC RETURNS [LIST OF MXEntry];
MXLookup: PROC [ROPE] RETURNS [MXEntry];
UpdateMX: PROC [
name: ROPE, source: IPDefs.Address, ttl: INT, authoritative: BOOL]
RETURNS [entry: MXEntry];
AddHostToMX: PROC [entry: MXEntry, hostInfo: MXHostInfo];
Bogus Name Cache
BogusNameEntry: TYPE = REF BogusNameRecord;
BogusNameRecord: TYPE = RECORD [
loaded: BasicTime.GMT,
referenced: BasicTime.GMT,
expires: BasicTime.GMT,
ttl: INT,
source: IPDefs.Address,
authoritative: BOOL,
rejuvinations: INT ← 0,
nameToBogus: INT ← 0,
bogus: ROPE ];
GetBogusNames: PROC RETURNS [LIST OF BogusNameEntry];
BogusNameLookup: PROC [ROPE] RETURNS [BogusNameEntry];
UpdateBogusName: PROC [
bogus: ROPE, source: IPDefs.Address, ttl: INT, authoritative: BOOL]
RETURNS [entry: BogusNameEntry];
Down Name Cache
DownNameEntry: TYPE = REF DownNameRecord;
DownNameRecord: TYPE = RECORD [
loaded: BasicTime.GMT,
referenced: BasicTime.GMT,
expires: BasicTime.GMT,
ttl: INT,
nameToDown: INT ← 0,
name: ROPE ];
GetDownNames: PROC RETURNS [LIST OF DownNameEntry];
DownNameLookup: PROC [ROPE] RETURNS [DownNameEntry];
UpdateDownName: PROC [name: ROPE, ttl: INT] RETURNS [DownNameEntry];
Address Cache
AddressEntry: TYPE = REF AddressRecord;
AddressRecord: TYPE = RECORD [
loaded: BasicTime.GMT,
referenced: BasicTime.GMT,
expires: BasicTime.GMT,
ttl: INT,
source: IPDefs.Address,
authoritative: BOOL,
rejuvinations: INT ← 0,
addressCacheLoad: INT ← 0,
addressToName: INT ← 0,
address: IPDefs.Address ← IPDefs.nullAddress,
names: LIST OF ROPENIL ];
GetAddresses: PROC RETURNS [LIST OF AddressEntry];
AddressLookup: PROC [IPDefs.Address] RETURNS [AddressEntry];
UpdateAddress: PROC [
address: IPDefs.Address, source: IPDefs.Address, ttl: INT, authoritative: BOOL]
RETURNS [entry: AddressEntry];
AddNameToAddress: PROC [entry: AddressEntry, name: ROPE];
Bogus Address Cache
BogusAddressEntry: TYPE = REF BogusAddressRecord;
BogusAddressRecord: TYPE = RECORD [
loaded: BasicTime.GMT,
referenced: BasicTime.GMT,
expires: BasicTime.GMT,
ttl: INT,
source: IPDefs.Address,
authoritative: BOOL,
rejuvinations: INT ← 0,
addressToBogus: INT ← 0,
bogus: IPDefs.Address ];
GetBogusAddresses: PROC RETURNS [LIST OF BogusAddressEntry];
BogusAddressLookup: PROC [IPDefs.Address] RETURNS [BogusAddressEntry];
UpdateBogusAddress: PROC [
bogus: IPDefs.Address, source: IPDefs.Address, ttl: INT, authoritative: BOOL]
RETURNS [entry: BogusAddressEntry];
Down Address Cache
DownAddressEntry: TYPE = REF DownAddressRecord;
DownAddressRecord: TYPE = RECORD [
loaded: BasicTime.GMT,
referenced: BasicTime.GMT,
expires: BasicTime.GMT,
ttl: INT,
addressToDown: INT ← 0,
address: IPDefs.Address ];
GetDownAddresses: PROC RETURNS [LIST OF DownAddressEntry];
DownAddressLookup: PROC [IPDefs.Address] RETURNS [DownAddressEntry];
UpdateDownAddress: PROC [address: IPDefs.Address, ttl: INT] RETURNS [DownAddressEntry];
Down Server Cache
DownServerEntry: TYPE = REF DownServerRecord;
DownServerRecord: TYPE = RECORD [
loaded: BasicTime.GMT,
referenced: BasicTime.GMT,
expires: BasicTime.GMT,
ttl: INT,
serverToDown: INT ← 0,
address: IPDefs.Address ];
GetDownServers: PROC RETURNS [LIST OF DownServerEntry];
DownServerLookup: PROC [address: IPDefs.Address] RETURNS [DownServerEntry];
UpdateDownServer: PROC [address: IPDefs.Address, ttl: INT] RETURNS [DownServerEntry];
Zone Cache
ZoneEntry: TYPE = REF ZoneRecord;
ZoneRecord: TYPE = RECORD [
loaded: BasicTime.GMT,
referenced: BasicTime.GMT,
expires: BasicTime.GMT,
ttl: INT,
source: IPDefs.Address,
authoritative: BOOL,
rejuvinations: INT ← 0,
zoneLookup: INT ← 0,
zone: ROPENIL,
servers: LIST OF ROPENIL ];
GetZones: PROC RETURNS [LIST OF ZoneEntry];
GetZone: PROC[name: ROPE] RETURNS [entry: ZoneEntry]; -- Get best zone for name
ZoneLookup: PROC[zone: ROPE] RETURNS [entry: ZoneEntry]; -- Lookup zone in cache
UpdateZone: PROC [
name: ROPE, source: IPDefs.Address, ttl: INT, authoritative: BOOL] RETURNS [entry: ZoneEntry];
AddServer: PROC [entry: ZoneEntry, server: ROPE];
Usage and Response Time Histograms
CacheType: TYPE = {name, alias, mx, bogusName, address, bogusAddress, zone};
ProbeType: TYPE = {name, mx, nameRejuvination, aliasRejuvination, mxRejuvination, bogusNameRejuvination, address, addressRejuvination, bogusAddressRejuvination, newZone, zoneRejuvination, newServer};
histogramSlots: INT = 250;
histogramSlotSize: INT = 100; -- ms/slot
HistogramEntry: TYPE = REF HistogramRecord;
HistogramRecord: TYPE = RECORD [
server: IPDefs.Address,
cacheHits: ARRAY CacheType OF INTALL[0],
probes: ARRAY ProbeType OF INTALL[0],
lost: INT ← 0,
counters: ARRAY [0..histogramSlots) OF INTALL[0] ];
GetHistograms: PROC RETURNS [LIST OF HistogramEntry];
AddToCacheHits: PROC [server: IPDefs.Address, type: CacheType];
AddToProbes: PROC [server: IPDefs.Address, type: ProbeType];
AddToLost: PROC [server: IPDefs.Address];
AddToCounter: PROC [server: IPDefs.Address, ms: INT];
END.