本文整理汇总了C#中ISegment.GetData方法的典型用法代码示例。如果您正苦于以下问题:C# ISegment.GetData方法的具体用法?C# ISegment.GetData怎么用?C# ISegment.GetData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISegment
的用法示例。
在下文中一共展示了ISegment.GetData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PackMessage
internal static Sequence PackMessage(VersionCode version, ISegment header, ISegment parameters, ISnmpData scopeBytes, IPrivacyProvider privacy)
{
if (scopeBytes == null)
{
throw new ArgumentNullException("scopeBytes");
}
if (parameters == null)
{
throw new ArgumentNullException("parameters");
}
if (header == null)
{
throw new ArgumentNullException("header");
}
if (privacy == null)
{
throw new ArgumentNullException("privacy");
}
ISnmpData[] collection = new ISnmpData[4]
{
new Integer32((int)version),
header.GetData(version),
parameters.GetData(version),
scopeBytes,
};
return new Sequence(collection);
}
示例2: ComputeHash
/// <summary>
/// Computes the hash.
/// </summary>
/// <param name="provider">The authentication provider.</param>
/// <param name="version">The version.</param>
/// <param name="header">The header.</param>
/// <param name="parameters">The parameters.</param>
/// <param name="scope">The scope.</param>
/// <param name="privacy">The privacy provider.</param>
public static void ComputeHash(this IAuthenticationProvider provider, VersionCode version, Header header, SecurityParameters parameters, ISegment scope, IPrivacyProvider privacy)
{
if (provider == null)
{
throw new ArgumentNullException("provider");
}
if (header == null)
{
throw new ArgumentNullException("header");
}
if (parameters == null)
{
throw new ArgumentNullException("parameters");
}
if (scope == null)
{
throw new ArgumentNullException("scope");
}
if (privacy == null)
{
throw new ArgumentNullException("privacy");
}
if (provider is DefaultAuthenticationProvider)
{
return;
}
if (0 == (header.SecurityLevel & Levels.Authentication))
{
return;
}
var scopeData = privacy.GetScopeData(header, parameters, scope.GetData(version));
parameters.AuthenticationParameters = provider.ComputeHash(version, header, parameters, scopeData, privacy, null); // replace the hash.
}
示例3: PackMessage
internal static Sequence PackMessage(byte[] length, VersionCode version, ISegment header, ISegment parameters, ISnmpData data)
{
if (header == null)
{
throw new ArgumentNullException("header");
}
if (parameters == null)
{
throw new ArgumentNullException("parameters");
}
if (data == null)
{
throw new ArgumentNullException("data");
}
var items = new[]
{
new Integer32((int)version),
header.GetData(version),
parameters.GetData(version),
data
};
return new Sequence(length, items);
}