-
-
Notifications
You must be signed in to change notification settings - Fork 131
/
AfsDbRecord.cs
83 lines (73 loc) · 2.88 KB
/
AfsDbRecord.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
using System;
namespace DnsClient.Protocol
{
/* https://tools.ietf.org/html/rfc1183#section-1, https://tools.ietf.org/html/rfc5864
1. AFS Data Base location
This section defines an extension of the DNS to locate servers both
for AFS (AFS is a registered trademark of Transarc Corporation) and
for the Open Software Foundation's (OSF) Distributed Computing
Environment (DCE) authenticated naming system using HP/Apollo's NCA,
both to be components of the OSF DCE. The discussion assumes that
the reader is familiar with AFS [5] and NCA [6].
The AFS (originally the Andrew File System) system uses the DNS to
map from a domain name to the name of an AFS cell database server.
The DCE Naming service uses the DNS for a similar function: mapping
from the domain name of a cell to authenticated name servers for that
cell. The method uses a new RR type with mnemonic AFSDB and type
code of 18 (decimal).
AFSDB has the following format:
<owner> <ttl> <class> AFSDB <subtype> <hostname>
*/
/// <summary>
/// A <see cref="DnsResourceRecord"/> representing an AFS database location.
/// </summary>
/// <seealso href="https://tools.ietf.org/html/rfc1183#section-1">RFC 1183</seealso>
/// <seealso href="https://tools.ietf.org/html/rfc5864">RFC 5864</seealso>
public class AfsDbRecord : DnsResourceRecord
{
/// <summary>
/// Gets the <see cref="AfsType"/>.
/// </summary>
/// <value>
/// The sub type.
/// </value>
public AfsType SubType { get; }
/// <summary>
/// Gets the hostname.
/// </summary>
/// <value>
/// The hostname.
/// </value>
public DnsString Hostname { get; }
/// <summary>
/// Initializes a new instance of the <see cref="AfsDbRecord"/> class.
/// </summary>
/// <param name="info">The information.</param>
/// <param name="type">The type.</param>
/// <param name="name">The name.</param>
/// <exception cref="ArgumentNullException">If <paramref name="info"/> or <paramref name="name"/> is null.</exception>
public AfsDbRecord(ResourceRecordInfo info, AfsType type, DnsString name) : base(info)
{
SubType = type;
Hostname = name ?? throw new ArgumentNullException(nameof(name));
}
private protected override string RecordToString()
{
return $"{(int)SubType} {Hostname}";
}
}
/// <summary>
/// Type used by <see cref="AfsDbRecord"/>.
/// </summary>
public enum AfsType
{
/// <summary>
/// AFS is a registered trademark of Transarc Corporation
/// </summary>
Afs = 1,
/// <summary>
/// The Distributed Computing Environment
/// </summary>
Dce = 2
}
}