summaryrefslogtreecommitdiffstats
path: root/src/vnet/unix
AgeCommit message (Expand)AuthorFilesLines
2018-05-25Add interface rx pcap tracingDave Barach1-15/+13
2018-05-17Packet generator: preserve pcap file timestampsDave Barach2-0/+10
2018-04-13Revert "MTU: Setting of MTU on software interface (instead of hardware interf...Damjan Marion1-3/+2
2018-04-13MTU: Setting of MTU on software interface (instead of hardware interface)Ole Troan1-2/+3
2018-02-23Convert a pcap file to a set of C initializersDave Barach2-1/+140
2018-01-23VPPAPIGEN: vppapigen replacement in Python PLY.Ole Troan1-1/+1
2018-01-11api: remove transport specific code from handlersFlorin Coras1-21/+21
2018-01-09api: refactor vlibmemoryFlorin Coras1-7/+6
2017-12-11VPP-273 Coding standards cleanup - vnet/vnet/unixsharath reddy8-794/+947
2017-12-04tapcli: change interface nameDamjan Marion1-1/+1
2017-10-19VPP-1024: rewrite buffer trajectory tracerDave Barach1-0/+13
2017-10-09vppapigen: support per-file (major,minor,patch) version stampsDave Barach1-0/+2
2017-10-06tuntap: Introduce per thread structure to suport multi-threadsSteven2-65/+99
2017-09-28tun/tap: Bad packets sent to kernel via tun/tap interfaceSteven2-22/+29
2017-09-09move unix_file_* code to vppinfraDamjan Marion2-16/+13
2017-08-18Use correct msg ID in the sw-interface-event from TAP and VHOSTNeale Ranns1-1/+1
2017-08-11Dedicated SW Interface EventNeale Ranns1-3/+3
2017-08-11the automatic addition of IP address to the magic TAP interface should only h...Neale Ranns1-0/+21
2017-08-02Fix tcp tx buffer allocationFlorin Coras1-1/+44
2017-05-17VPP-846: tcp perf / scale / hardeningDave Barach1-1/+11
2017-04-25"autoreply" flag: autogenerate standard xxx_reply_t messagesDave Barach1-11/+1
2017-04-06Use thread local storage for thread indexDamjan Marion2-3/+3
2017-03-10VPP-659 TCP improvementsFlorin Coras1-1/+2
2017-03-06features: take device-input buffer advance value directlyDamjan Marion2-3/+2
2017-02-22VPP-635: CLI Memory leak with invalid parameterBilly McFall1-17/+40
2017-01-20Fix coverity warning, VPP-608Dave Barach1-0/+3
2017-01-18Fix coverity warnings, VPP-608Dave Barach1-2/+3
2017-01-14Provision linux stack ip4 and ip6 addresses for tap interfacesDave Barach4-89/+269
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion10-0/+3620
uot;ip4_pfx", default=def_ip4_pfx) parser.add_argument('--ip6-prefix', action="store", dest="ip6_pfx", default=def_ip6_pfx) parser.add_argument('--ip6-src', action="store", dest="ip6_src", default=def_ip6_src) parser.add_argument('--psid-len', action="store", dest="psid_len", default=def_psid_len) parser.add_argument('--psid-offset', action="store", dest="psid_offset", default=def_psid_offset) parser.add_argument('--ea-bits-len', action="store", dest="ea_bits_len", default=def_ea_bits_len) args = parser.parse_args() # # Print domain # def domain_print(i, ip4_pfx, ip6_pfx, ip6_src, eabits_len, psid_offset, psid_len): if format == 'vpp': print("map add domain ip4-pfx " + ip4_pfx + " ip6-pfx", ip6_pfx, "ip6-src " + ip6_src + " ea-bits-len", eabits_len, "psid-offset", psid_offset, "psid-len", psid_len) if format == 'confd': print("vpp softwire softwire-instances softwire-instance", i, "br-ipv6 " + ip6_src + " ipv6-prefix " + ip6_pfx + " ipv4-prefix " + ip4_pfx + " ea-bits-len", eabits_len, "psid-offset", psid_offset, "psid-len", psid_len) if format == 'xml': print("<softwire-instance>") print("<id>", i, "</id>"); print(" <br-ipv6>" + ip6_src + "</br-ipv6>") print(" <ipv6-prefix>" + ip6_pfx + "</ipv6-prefix>") print(" <ipv4-prefix>" + ip4_pfx + "</ipv4-prefix>") print(" <ea-len>", eabits_len, "</ea-len>") print(" <psid-len>", psid_len, "</psid-len>") print(" <psid-offset>", psid_offset, "</psid-offset>") def domain_print_end(): if format == 'xml': print("</softwire-instance>") def rule_print(i, psid, dst): if format == 'vpp': print("map add rule index", i, "psid", psid, "ip6-dst", dst) if format == 'confd': print("binding", psid, "ipv6-addr", dst) if format == 'xml': print(" <binding>") print(" <psid>", psid, "</psid>") print(" <ipv6-addr>", dst, "</ipv6-addr>") print(" </binding>") # # Algorithmic mapping Shared IPv4 address # def algo(ip4_pfx_str, ip6_pfx_str, ip6_src_str, ea_bits_len, psid_offset, psid_len, ip6_src_ecmp = False): domain_print(0, ip4_pfx_str, ip6_pfx_str, ip6_src_str, ea_bits_len, psid_offset, psid_len) domain_print_end() # # 1:1 Full IPv4 address # def lw46(ip4_pfx_str, ip6_pfx_str, ip6_src_str, ea_bits_len, psid_offset, psid_len, ip6_src_ecmp = False): ip4_pfx = ipaddress.ip_network(ip4_pfx_str) ip6_src = ipaddress.ip_address(ip6_src_str) ip6_dst = ipaddress.ip_network(ip6_pfx_str) psid_len = 0 mod = ip4_pfx.num_addresses / 1024 for i in range(ip4_pfx.num_addresses): domain_print(i, str(ip4_pfx[i]) + "/32", str(ip6_dst[i]) + "/128", str(ip6_src), 0, 0, 0) domain_print_end() if ip6_src_ecmp and not i % mod: ip6_src = ip6_src + 1 # # 1:1 Shared IPv4 address, shared BR (16) VPP CLI # def lw46_shared(ip4_pfx_str, ip6_pfx_str, ip6_src_str, ea_bits_len, psid_offset, psid_len, ip6_src_ecmp = False): ip4_pfx = ipaddress.ip_network(ip4_pfx_str) ip6_src = ipaddress.ip_address(ip6_src_str) ip6_dst = ipaddress.ip_network(ip6_pfx_str) mod = ip4_pfx.num_addresses / 1024 for i in range(ip4_pfx.num_addresses): domain_print(i, str(ip4_pfx[i]) + "/32", "::/0", str(ip6_src), 0, 0, psid_len) for psid in range(0x1 << int(psid_len)): rule_print(i, psid, str(ip6_dst[(i * (0x1<<int(psid_len))) + psid])) domain_print_end() if ip6_src_ecmp and not i % mod: ip6_src = ip6_src + 1 # # 1:1 Shared IPv4 address, shared BR # def lw46_shared_b(ip4_pfx_str, ip6_pfx_str, ip6_src_str, ea_bits_len, psid_offset, psid_len, ip6_src_ecmp = False): ip4_pfx = ipaddress.ip_network(ip4_pfx_str) ip6_src = ipaddress.ip_address(ip6_src_str) ip6_dst = list(ipaddress.ip_network(ip6_pfx_str).subnets(new_prefix=56)) mod = ip4_pfx.num_addresses / 1024 for i in range(ip4_pfx.num_addresses): domain_print(i, str(ip4_pfx[i]) + "/32", "::/0", str(ip6_src), 0, 0, psid_len) for psid in range(0x1 << psid_len): enduserprefix = list(ip6_dst.pop(0).subnets(new_prefix=64))[255-1] rule_print(i, psid, enduserprefix[(i * (0x1<<psid_len)) + psid]) domain_print_end() if ip6_src_ecmp and not i % mod: ip6_src = ip6_src + 1 def xml_header_print(): print(''' <?xml version="1.0" encoding="UTF-8"?> <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <capabilities> <capability>urn:ietf:params:netconf:base:1.0</capability> </capabilities> </hello> ]]>]]> <?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <edit-config> <target> <candidate/> </target> <config> <vpp xmlns="http://www.cisco.com/yang/cisco-vpp"> <softwire> <softwire-instances> ''') def xml_footer_print(): print(''' </softwire-instances> </softwire> </vpp> </config> </edit-config> </rpc> ]]>]]> <?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2"> <close-session/> </rpc> ]]>]]> ''') format = args.format if format == 'xml': xml_header_print() globals()[args.mapmode](args.ip4_pfx, args.ip6_pfx, args.ip6_src, args.ea_bits_len, args.psid_offset, args.psid_len) if format == 'xml': xml_footer_print()