Exemplo n.º 1
0
 private static PeerHeaderModel ConvertToModel(PerPeerHeader peerHeader)
 {
     return(new PeerHeaderModel
     {
         // type
         Address = peerHeader.PeerAddress,
         Asn = peerHeader.AS,
         Id = peerHeader.PeerId
     });
 }
Exemplo n.º 2
0
        public void BmpPerPeerHeaderDecodes(string value)
        {
            var data          = Convert.FromBase64String(value);
            var bmpPeerHeader = new PerPeerHeader(data, 0);

            Assert.Equal(bmpPeerHeader.AS, 64515);
            Assert.Equal(bmpPeerHeader.PeerAddress, IPAddress.Parse("169.254.169.254"));
            Assert.Equal(bmpPeerHeader.PeerId, IPAddress.Parse("45.63.33.43"));
            Assert.Equal(bmpPeerHeader.PeerDistinguisher, (ulong)0);
            Assert.False(bmpPeerHeader.IsPostPolicy);
            Assert.Equal(bmpPeerHeader.PeerType, PerPeerHeader.Type.Global);
        }