Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pcap-Net
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Pcap-Net
Commits
19eb654f
Commit
19eb654f
authored
Mar 18, 2012
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Warnings, Code Analysis and Documentation. 48 warnings left.
parent
d4f798e6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
2 deletions
+55
-2
DnsOptionLongLivedQuery.cs
...otNet.Packets/Dns/ResourceData/DnsOptionLongLivedQuery.cs
+31
-1
DnsResourceDataIpSecKey.cs
...otNet.Packets/Dns/ResourceData/DnsResourceDataIpSecKey.cs
+24
-1
No files found.
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsOptionLongLivedQuery.cs
View file @
19eb654f
...
@@ -35,8 +35,16 @@ namespace PcapDotNet.Packets.Dns
...
@@ -35,8 +35,16 @@ namespace PcapDotNet.Packets.Dns
public
const
int
LeaseLife
=
Id
+
sizeof
(
ulong
);
public
const
int
LeaseLife
=
Id
+
sizeof
(
ulong
);
}
}
p
ublic
const
int
ConstDataLength
=
Offset
.
LeaseLife
+
sizeof
(
uint
);
p
rivate
const
int
ConstDataLength
=
Offset
.
LeaseLife
+
sizeof
(
uint
);
/// <summary>
/// Constructs an instance out of the version, opcode, error code, id and lease life fields.
/// </summary>
/// <param name="version">Version of LLQ protocol implemented.</param>
/// <param name="opCode">Identifies LLQ operation.</param>
/// <param name="errorCode">Identifies LLQ errors.</param>
/// <param name="id">Identifier for an LLQ.</param>
/// <param name="leaseLife">Requested or granted life of LLQ, in seconds.</param>
public
DnsOptionLongLivedQuery
(
ushort
version
,
DnsLongLivedQueryOpCode
opCode
,
DnsLongLivedQueryErrorCode
errorCode
,
ulong
id
,
uint
leaseLife
)
public
DnsOptionLongLivedQuery
(
ushort
version
,
DnsLongLivedQueryOpCode
opCode
,
DnsLongLivedQueryErrorCode
errorCode
,
ulong
id
,
uint
leaseLife
)
:
base
(
DnsOptionCode
.
LongLivedQuery
)
:
base
(
DnsOptionCode
.
LongLivedQuery
)
{
{
...
@@ -47,12 +55,34 @@ namespace PcapDotNet.Packets.Dns
...
@@ -47,12 +55,34 @@ namespace PcapDotNet.Packets.Dns
LeaseLife
=
leaseLife
;
LeaseLife
=
leaseLife
;
}
}
/// <summary>
/// Version of LLQ protocol implemented.
/// </summary>
public
ushort
Version
{
get
;
private
set
;
}
public
ushort
Version
{
get
;
private
set
;
}
/// <summary>
/// Identifies LLQ operation.
/// </summary>
public
DnsLongLivedQueryOpCode
OpCode
{
get
;
private
set
;
}
public
DnsLongLivedQueryOpCode
OpCode
{
get
;
private
set
;
}
/// <summary>
/// Identifies LLQ errors.
/// </summary>
public
DnsLongLivedQueryErrorCode
ErrorCode
{
get
;
private
set
;
}
public
DnsLongLivedQueryErrorCode
ErrorCode
{
get
;
private
set
;
}
/// <summary>
/// Identifier for an LLQ.
/// </summary>
public
ulong
Id
{
get
;
private
set
;
}
public
ulong
Id
{
get
;
private
set
;
}
/// <summary>
/// Requested or granted life of LLQ, in seconds.
/// </summary>
public
uint
LeaseLife
{
get
;
private
set
;
}
public
uint
LeaseLife
{
get
;
private
set
;
}
/// <summary>
/// The number of bytes the option data takes.
/// </summary>
public
override
int
DataLength
public
override
int
DataLength
{
{
get
{
return
ConstDataLength
;
}
get
{
return
ConstDataLength
;
}
...
...
PcapDotNet/src/PcapDotNet.Packets/Dns/ResourceData/DnsResourceDataIpSecKey.cs
View file @
19eb654f
...
@@ -34,8 +34,22 @@ namespace PcapDotNet.Packets.Dns
...
@@ -34,8 +34,22 @@ namespace PcapDotNet.Packets.Dns
public
const
int
Gateway
=
Algorithm
+
sizeof
(
byte
);
public
const
int
Gateway
=
Algorithm
+
sizeof
(
byte
);
}
}
p
ublic
const
int
ConstPartLength
=
Offset
.
Gateway
;
p
rivate
const
int
ConstPartLength
=
Offset
.
Gateway
;
/// <summary>
/// Constructs an instance out of the precedence, gateway, algorithm and public key fields.
/// </summary>
/// <param name="precedence">
/// Precedence for this record.
/// Gateways listed in IPSECKEY records with lower precedence are to be attempted first.
/// Where there is a tie in precedence, the order should be non-deterministic.
/// </param>
/// <param name="gateway">
/// Indicates a gateway to which an IPsec tunnel may be created in order to reach the entity named by this
/// resource record.
/// </param>
/// <param name="algorithm">Identifies the public key's cryptographic algorithm and determines the format of the public key field.</param>
/// <param name="publicKey">Contains the algorithm-specific portion of the KEY RR RDATA.</param>
public
DnsResourceDataIpSecKey
(
byte
precedence
,
DnsGateway
gateway
,
DnsPublicKeyAlgorithm
algorithm
,
DataSegment
publicKey
)
public
DnsResourceDataIpSecKey
(
byte
precedence
,
DnsGateway
gateway
,
DnsPublicKeyAlgorithm
algorithm
,
DataSegment
publicKey
)
{
{
Precedence
=
precedence
;
Precedence
=
precedence
;
...
@@ -71,6 +85,9 @@ namespace PcapDotNet.Packets.Dns
...
@@ -71,6 +85,9 @@ namespace PcapDotNet.Packets.Dns
/// </summary>
/// </summary>
public
DataSegment
PublicKey
{
get
;
private
set
;
}
public
DataSegment
PublicKey
{
get
;
private
set
;
}
/// <summary>
/// Two DnsResourceDataIpSecKey are equal iff their precedence, gateway, algorithm and public key fields are equal.
/// </summary>
public
bool
Equals
(
DnsResourceDataIpSecKey
other
)
public
bool
Equals
(
DnsResourceDataIpSecKey
other
)
{
{
return
other
!=
null
&&
return
other
!=
null
&&
...
@@ -80,11 +97,17 @@ namespace PcapDotNet.Packets.Dns
...
@@ -80,11 +97,17 @@ namespace PcapDotNet.Packets.Dns
PublicKey
.
Equals
(
other
.
PublicKey
);
PublicKey
.
Equals
(
other
.
PublicKey
);
}
}
/// <summary>
/// Two DnsResourceDataIpSecKey are equal iff their precedence, gateway, algorithm and public key fields are equal.
/// </summary>
public
override
bool
Equals
(
object
obj
)
public
override
bool
Equals
(
object
obj
)
{
{
return
Equals
(
obj
as
DnsResourceDataIpSecKey
);
return
Equals
(
obj
as
DnsResourceDataIpSecKey
);
}
}
/// <summary>
/// A hash code of the combination of the precedence, gateway, algorithm and public key fields.
/// </summary>
public
override
int
GetHashCode
()
public
override
int
GetHashCode
()
{
{
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
(
Precedence
,
(
byte
)
Algorithm
),
Gateway
,
PublicKey
);
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
(
Precedence
,
(
byte
)
Algorithm
),
Gateway
,
PublicKey
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment