def test_construct_nlri(self):
     raw_hex = '\x0f\x05\x01\x50\x11\x1f\x90\x11\x1f\x91\x11\x1f\x92\x91\x1f\x93'
     nlri_dict = {bgp_cons.BGPNLRI_FSPEC_DST_PORT: '=80|=8080|=8081|=8082|=8083'}
     self.assertEqual(raw_hex, IPv4FlowSpec.construct_nlri(nlri_dict))
     nlri_bin = b'\x0a\x01\x18\xc0\x55\x02\x02\x18\xc0\x55\x01'
     nlri_list = {1: '192.85.2.0/24', 2: '192.85.1.0/24'}
     self.assertEqual(nlri_bin, IPv4FlowSpec.construct_nlri(nlri_list))
Exemple #2
0
 def test_construct_nlri(self):
     nlri_bin = b'\x0a\x01\x18\xc0\x55\x02\x02\x18\xc0\x55\x01'
     nlri_list = {1: '192.85.2.0/24', 2: '192.85.1.0/24'}
     self.assertEqual(nlri_bin, IPv4FlowSpec.construct_nlri(nlri_list))
Exemple #3
0
 def test_construct_nlri(self):
     nlri_bin = b'\x0a\x01\x18\xc0\x55\x02\x02\x18\xc0\x55\x01'
     nlri_list = [{1: '192.85.2.0/24'}, {2: '192.85.1.0/24'}]
     self.assertEqual(nlri_bin, IPv4FlowSpec.construct_nlri(nlri_list))