Ë vñþûxM•ãóL—ddlZddlZddlZddlZddlmZddlmZddlm Z m Z m Z ddl m Z ddlmZmZddlmZddlmZdd lmZmZmZmZmZmZmZmZmZmZm Z dd l!m"Z"m#Z#m$Z$dd l%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;mZ>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZSdd lTmUZUdd lVmWZWddlXmYZYddlZm[Z[ddl\m]Z]m^Z^m_Z_ddl`maZaddlbmcZcddldmeZeddlfmgZgddlhmiZiddljmkZlddljmmZmddlnmoZompZpddlqmrZrmsZsmtZtddlumvZvmwZwddlxmyZyddlzm{Z{m|Z|ddl}m~Z~mZddl€m�Z�m‚Z‚dd lƒm„Z„d!Z…e�j e‡«Zˆd"„Z‰d#„ZŠGd$„d%«Z‹Gd&„d'e‹e^«ZŒGd(„d)ee‹e_«Z�Gd*„d+e‹eg«ZŽGd,„d-e‹e]«Z�y).éN)Úpartial)Úchain)ÚAF_INETÚAF_INET6Ú AF_UNSPEC)Úconfig)ÚAF_MPLSÚ basestring)Ú AF_BRIDGE)ÚLAB_API) Ú NLM_F_ACKÚ NLM_F_APPENDÚ NLM_F_ATOMICÚ NLM_F_CREATEÚ NLM_F_DUMPÚ NLM_F_ECHOÚ NLM_F_EXCLÚ NLM_F_REPLACEÚ NLM_F_REQUESTÚ NLM_F_ROOTÚ NLMSG_ERROR)ÚNetlinkDumpInterruptedÚ NetlinkErrorÚ SkipInode).Ú RTM_DELADDRÚ RTM_DELLINKÚRTM_DELLINKPROPÚ RTM_DELNEIGHÚ RTM_DELQDISCÚ RTM_DELROUTEÚ RTM_DELRULEÚ RTM_DELTCLASSÚRTM_DELTFILTERÚ RTM_GETADDRÚ RTM_GETLINKÚ RTM_GETNEIGHÚRTM_GETNEIGHTBLÚ RTM_GETNSIDÚ RTM_GETQDISCÚ RTM_GETROUTEÚ RTM_GETRULEÚ RTM_GETSTATSÚ RTM_GETTCLASSÚRTM_GETTFILTERÚ RTM_NEWADDRÚ RTM_NEWLINKÚRTM_NEWLINKPROPÚ RTM_NEWNEIGHÚ RTM_NEWNETNSÚ RTM_NEWNSIDÚ RTM_NEWQDISCÚ RTM_NEWROUTEÚ RTM_NEWRULEÚ RTM_NEWTCLASSÚRTM_NEWTFILTERÚ RTM_SETLINKÚRTMGRP_IPV4_IFADDRÚRTMGRP_IPV4_ROUTEÚRTMGRP_IPV4_RULEÚRTMGRP_IPV6_IFADDRÚRTMGRP_IPV6_ROUTEÚRTMGRP_IPV6_RULEÚ RTMGRP_LINKÚRTMGRP_MPLS_ROUTEÚ RTMGRP_NEIGHÚ TC_H_ROOTÚndmsgÚrt_protoÚrt_scopeÚrt_type)Úfibmsg)Ú ifaddrmsg)Úifinfmsg)Ú ifstatsmsg)ÚChaoticIPRSocketÚ IPBatchSocketÚ IPRSocket)Úndtmsg)Únsidmsg)Únsinfmsg)Ú RawIPRSocket)Úrtmsg)Úplugins)Útcmsg)ÚAddressFieldFilterÚAddressIPRouteFilter)ÚBridgeFieldFilterÚBridgeIPRouteFilterÚBridgePortFieldFilter)ÚLinkFieldFilterÚLinkIPRouteFilter)ÚRequestProcessor)ÚNeighbourFieldFilterÚNeighbourIPRouteFilter)ÚRouteFieldFilterÚRouteIPRouteFilter)ÚRuleFieldFilterÚRuleIPRouteFilteré)Údefault_routeséþcól—d|vr|jd«|fSi}d|vr|jd«|d<||fS)NÚmatchÚfamily)Úpop)ÚkwargÚ new_kwargs ú;/usr/lib/python3.12/site-packages/pyroute2/iproute/linux.pyÚget_dump_filterrousI€Ø�%ÑØ�y‰y˜Ó! 5Ð(Ð(àˆ Ø �uÑ Ø"'§)¡)¨HÓ"5ˆI�hÑ Ø�iÐÐócó —t|t«r8|jd«D�cgc]}t|r|ndd«‘Œc}\}}|dz|z}|Scc}w)NÚ:Ú0é)Ú isinstancer ÚsplitÚint)ÚhandleÚxÚmajorÚminors rnÚtransform_handler|sS€Ü�&œ*Ô%Ø.filter_messages´sø€Ü˜^˜TŸ^™^¨TÐ;°UÑ;Ó<Ðz,RTNL_API.make_request_type..¼sø€˜q ™t T×%<Ñ%<¸Q¸q¹TÓ%BÑCrpÚcreatez,allowed command types: int, str, list, tuple)rur rwrŽÚlistrƒÚ TypeError)r†ÚcommandÚ command_maps` rnÚmake_request_typezRTNL_API.make_request_typeºscø€Ü �gœzÔ *ÜCؘGÑ$óð ô˜¤Ô %ؘD×3Ñ3°HÓ=Ð=Ð =Ü ˜¤$¬ Ô /؈NäÐJÓKÐ Krpcó*—ttzttzttzdœ}|dtztz|d<|dtzt z|d<|dt z|d<|dtz|d<|||jdr |dvrtzSd zS) N)ÚdumpÚgetÚreqr™r�ÚappendÚchangeÚreplaceÚnlm_echo)r˜r—r) rrr rrrrrr)r†ÚmodeÚflagss rnrŽzRTNL_API.make_request_flagsÆs®€ä!¤JÑ.Ü ¤9Ñ,Ü ¤9Ñ,ñ ˆð   ™,¬Ñ5¼ ÑBˆˆh‰Ø ™,¬Ñ5¼ ÑDˆˆh‰Ø ™,¬Ñ6ˆˆh‰Ø  ™?¬\Ñ9ˆˆiÑà�T‰{à— ‘ ˜JÒ'¨D¸Ñ,Gô ñ ð ðñ ð rpc#ó”K—|D]¿}t|d«r||«sŒ|–—Œt|t«sŒ.g}|D]{}t|t«r|f}nt|t«r|}nŒ+|j |Ž}|�)t ||«r|j|||««Œe|j|||k(«Œ}t|«sŒ¼|–—ŒÁy­w)aš Filter messages using `dump_filter`. The filter might be a callable, then it will be called for every message in the list. Or it might be a dict, where keys are used to get values from messages, and dict values are used to match the message. The method might be called directly. It is also used by calls like `ipr.link('dump', ....)`, where keyword arguments work as `dump_filter` for `ipr.filter_messages()`. A callable `dump_filter` must return True or False: .. code-block:: python # get all links with names starting with eth: # ipr.filter_messages( lambda x: x.get_attr('IFLA_IFNAME').startswith('eth'), ipr.link('dump') ) A dict `dump_filter` can have callables as values: .. code-block:: python # get all links with names starting with eth, and # MAC address in a database: # ipr.filter_messages( { 'ifname': lambda x: x.startswith('eth'), 'address': lambda x: x in database, }, ipr.link('dump') ) ... or constants to compare with: .. code-block:: python # get all links in state up: # ipr.filter_message({'state': 'up'}, ipr.link('dump')) Ú__call__N) ÚhasattrruÚdictÚstrrƒÚ get_nestedÚcallableršÚall)r†Ú dump_filterÚmsgsÚmsgÚmatchesÚkeyÚnkeyÚvalues rnr‡zRTNL_API.filter_messages×sÅèø€ó\ˆCÜ�{ JÔ/Ù˜sÕ#Ø“IܘK¬Õ.Ø�Û&�Cä! #¤sÔ+Ø #˜v™Ü# C¬Ô/Ø"™à Ø*˜CŸN™N¨DÐ1�EØÐ(¬X°kÀ#Ñ6FÔ-GØŸ™Ð'7 {°3Ñ'7¸Ó'>Õ?àŸ™ {°3Ñ'7¸5Ñ'@ÕAð'ô�w•<Ø“Iñ)ùs‚C�C³B CÃCNc#óbK—|jddk(r2d|j|j|j|jgi}�n$t |j|j t|jd«gtt|jt¬«gtt|jt¬«gt|jgtt|jt¬«gtt|jt¬«gt t|jt"¬«gt$t|j&t¬«gt(t|j&t¬«gi }|j+«D]0\}}||�|n |j,zsŒ|D]}|«D]}|–—ŒŒŒ2y­w)a; Dump network objects. On OpenBSD: * get_links() * get_addr() * get_neighbours() * get_routes() On Linux: * get_links() * get_addr() * get_neighbours() * get_vlans() * dump FDB * IPv4 and IPv6 rules rÚOpenBSDrer—)rjN)ÚunameÚ get_linksÚget_addrÚget_neighboursÚ get_routesrAÚ get_vlansrÚfdbr;rr>rrCr<r?rBr r=Ú get_rulesr@ÚitemsÚgroups)r†rºÚ groups_mapÚgroupÚmethodsÚmethodrªs rnr—z RTNL_API.dumpsNèø€ð6 �:‰:�a‰=˜IÒ %àØ—N‘NØ—M‘MØ×'Ñ'Ø—O‘Oð ðŠJôØ—N‘NØ—N‘NܘDŸH™H fÓ-ðô #¤W¨T¯]©]Ä7Ô%KÐ$LÜ"¤W¨T¯]©]Ä8Ô%LÐ$Mܘt×2Ñ2Ð3Ü!¤G¨D¯O©OÄGÔ$LÐ#MÜ!¤G¨D¯O©OÄHÔ$MÐ#NÜ!¤G¨D¯O©OÄGÔ$LÐ#MÜ ¤7¨4¯>©>Ä'Ô#JÐ"KÜ ¤7¨4¯>©>Ä(Ô#KÐ"LðˆJð)×.Ñ.Ö0‰NˆE�7Ø &Ð"4™¸$¿+¹+ÓFÛ%�FÙ%žx˜Ø!› ñ (ñ&ñ1ùs ‚FF/ÆF/c ó —tj«}t«}||ztj«kDr> ||fi|¤Ž}|r|Stj|«||ztj«kDrŒ>t «‚#t$rYŒ0wxYw)a Run `method` with a positional argument `command` and keyword arguments `**spec` every `interval` seconds, but not more than `timeout`, until it returns a result which doesn't evaluate to `False`. Example: .. code-block:: python # create a bridge interface and wait for it: # spec = { 'ifname': 'br0', 'kind': 'bridge', 'state': 'up', 'br_stp_state': 1, } ipr.link('add', **spec) ret = ipr.poll(ipr.link, 'dump', **spec) assert ret[0].get('ifname') == 'br0' assert ret[0].get('state') == 'up' assert ret[0].get(('linkinfo', 'data', 'br_stp_state')) == 1 )ÚtimerƒÚsleeprÚ TimeoutError)r†r¾r“ÚtimeoutÚintervalÚspecÚctimeÚrets rnÚpollz RTNL_API.pollWs‚€ô4— ‘ “ ˆÜ‹gˆØ�g‰o¤§ ¡ £ Ò+ð Ù˜WÑ-¨Ñ-�ÙØ�JÜ— ‘ ˜8Ô$ð �g‰o¤§ ¡ £ Ó+ô‹nÐøô*ò Ùð úsº BÁB B  B cóª—t«}t|d<|j|t«}|€ t |«S|D�cgc] }|d|k(sŒ |‘Œc}Scc}w)z\ Get all queue disciplines for all interfaces or for specified one. rjÚindex)rVrÚ nlm_requestr)rƒ)r†rÊrªrÇrys rnÚ get_qdiscszRTNL_API.get_qdiscs�sX€ô ‹gˆÜ!ˆˆH‰ Ø×јs¤LÓ1ˆØ ˆ=ܘ“:Ð á"Ó:™s˜! a¨¡j°EÓ&9’A˜sÑ:Ð :ùÒ:s » AÁ Acó¨—t«}t|d<||d<t|«|d<t|«|d<t|j |t ««S)zI Get filters for specified interface, handle and parent. rjrÊrxÚparent)rVrr|rƒrËr.)r†rÊrxrÎrªs rnÚ get_filterszRTNL_API.get_filtersŽsQ€ô‹gˆÜ!ˆˆH‰ ؈ˆG‰ Ü(¨Ó0ˆˆH‰ Ü(¨Ó0ˆˆH‰ Ü�T×%Ñ% c¬>Ó:Ó;Ð;rpcóp—t«}t|d<||d<t|j|t««S)z6 Get classes for specified interface. rjrÊ)rVrrƒrËr-)r†rÊrªs rnÚ get_classeszRTNL_API.get_classes™s5€ô‹gˆÜ!ˆˆH‰ ؈ˆG‰ Ü�T×%Ñ% c¬=Ó9Ó:Ð:rpc óP—t|«\}}|jdtd|¬«S)z: Dump available vlan info on bridge ports r—é)rjÚext_maskri)roÚlinkr )r†rlr¨s rnr¶zRTNL_API.get_vlans¢s2€ô-¨UÓ3ш �UØ�y‰yØ œ9¨q¸ ðó ð rpcó®—g}|xsdg}|ddk(rdg}|ddk(rd}nd}|D].}|dkDr||d<|j|j|fi|¤Ž«Œ0|S)aY Get network interfaces. By default returns all interfaces. Arguments vector can contain interface indices or a special keyword 'all':: ip.get_links() ip.get_links('all') ip.get_links(1, 2, 3) interfaces = [1, 2, 3] ip.get_links(*interfaces) rr§r—r˜rÊ)ÚextendrÕ)r†r…rlÚresultÚlinksÚcmdrÊs rnr²zRTNL_API.get_linksµsy€ðˆØ’ ˜˜ˆØ �‰8�uÒ Ø�CˆEà �‰8�qŠ=؉CàˆCãˆEØ�qŠyØ!&��g‘Ø �M‰M˜)˜$Ÿ)™) CÑ1¨5Ñ1Õ 2ððˆ rpc ó2—|jd||xs|¬«S)aë Dump ARP cache records. The `family` keyword sets the family for the request: e.g. `AF_INET` or `AF_INET6` for arp cache, `AF_BRIDGE` for fdb. If other keyword arguments not empty, they are used as filter. Also, one can explicitly set filter as a function with the `match` parameter. Examples:: # get neighbours on the 3rd link: ip.get_neighbours(ifindex=3) # get a particular record by dst: ip.get_neighbours(dst='172.16.0.1') # get fdb records: ip.get_neighbours(AF_BRIDGE) # and filter them by a function: ip.get_neighbours(AF_BRIDGE, match=lambda x: x['state'] == 2) r—©rjri)Úneigh©r†rjrirls rnr´zRTNL_API.get_neighboursÔs€ð4�z‰z˜&¨°u²~ÀˆzÓFÐFrpcó^—t«}||d<t|j|t««S)z& Get neighbour tables rj)rPrƒrËr')r†rjrªs rnÚ get_ntableszRTNL_API.get_ntablesðs,€ô‹hˆØˆˆH‰ Ü�T×%Ñ% c¬?Ó;Ó<ÐÀE�:ÓJÐ Jrpcó�—tj|tj«}tj|«j}||fS)z3Open a file (read only) and return its (fd, inode).)ÚosÚopenÚO_RDONLYÚfstatÚst_ino)ÚpathÚfdÚinodes rnÚ open_filezRTNL_API.open_fileAs5€ô�W‰W�Tœ2Ÿ;™;Ó 'ˆÜ—‘˜“ ×#Ñ#ˆØ�Eˆ{Ðrpcó.—tj|«y)z9Close a file that was previously opened with open_file().N)réÚclose)rïs rnÚ close_filezRTNL_API.close_fileHs€ô �‰�� rpcó*—tj«S)z&Return the PID of the current process.)réÚgetpid©rprnÚget_pidzRTNL_API.get_pidMs€ô�y‰y‹{ÐrpcóD—tjj|||«Sr‚)rKÚifinfoÚregister_link_kind)r†rîÚpkgÚmodules rnrûzRTNL_API.register_link_kindRs€Ü�‰×1Ñ1°$¸¸VÓDÐDrpcó@—tjj|«Sr‚)rKrúÚunregister_link_kind)r†Úkinds rnrÿzRTNL_API.unregister_link_kindUs€Ü�‰×3Ñ3°DÓ9Ð9rpcó>—tjj«Sr‚)rKrúÚlist_link_kind)r†s rnrzRTNL_API.list_link_kindXs€Ü�‰×-Ñ-Ó/Ð/rpcór—t«}d|d<d}t«}t«} |j|«\}}||d<|d|vr t«‚|j |d«d|fg|d< |j |t t«D]}|jd«|d<nd|fg|d< |dkDr|j|« t|d d <|j|d d <d |d <|S#t$rYŒPwxYw#t$r}t|j«‚d}~wwxYw#|dkDr|j|«wwxYw)NìÿÿÚnetnsidrrðÚ NETNSA_FDÚattrsÚ NETNSA_NSIDÚ NSINFO_PATHÚheaderÚtypeÚtargetr3Úevent)rRrQrñrÚaddrËr(rÚget_attrÚ ExceptionÚOSErrorÚerrnorôr3r ) r†rîÚregistryÚitemÚnsfdÚinforªrðÚes rnÚ _dump_one_nszRTNL_API._dump_one_ns^sY€Ü‹zˆØ$ˆˆY‰ØˆÜ‹yˆÜ‹iˆð &Ø ŸN™N¨4Ó0‰MˆT�5Ø!ˆD�‰Mð�G‰} Ñ(Ü“kÐ!Ø �L‰L˜˜g™Ô 'ð )¨$Ð/Ð0ˆC�‰Lð Ø ×,Ñ,¨S´+¼}ÖM�Dð'+§m¡m°MÓ&B�D˜‘OÙð Nð,¨TÐ2Ð3ˆD�ŠMð�aŠxØ—‘ Õ%Ü!-ˆˆX‰�vÑØ#'§;¡;ˆˆX‰�xÑ Ø&ˆˆW‰ ؈ øôò Ùð ûôò %ܘAŸG™GÓ$Ð $ûð %ûð�aŠxØ—‘ Õ%ðúsH§AC7Á.5C(Â#C7Ã( C4Ã1C7Ã3C4Ã4C7Ã7 DÄDÄDÄDÄD6c#ó´K—tj|«D]-}|›tj›|›�} |j||«–—Œ/y#t$rYŒØ �‰L× Ñ  ¨bÐ 1Ô 2à Ð "Ø �‰L× Ñ Ð!5°{Ð CÔ Dà×#Ñ# C¬´mÓDˆÛˆAàŸ ™  =Ó1Ø !§ ¡ Ð+@Ó Añò ðð rpc#ó$K—t«}i}|j«D]B}|jd«}|€Œ||vrg||<||j|jd««ŒDg}|jD]#}|j|j ||««Œ%|r |j|j |««|D]A} |D]9} | d=|j| dg«D]}| djd|f«Œ| –—Œ;ŒCy#t$rYŒPwxYw­w)zÉ A prototype method to list available netns and associated interfaces. A bit weird to have it here and not under `pyroute2.netns`, but it uses RTNL to get all the info. ÚIFLA_LINK_NETNSIDNÚ IFLA_IFNAMEr®rrÚ NSINFO_PEER) Úsetr²rršr€rr!r˜r) r†Ú list_procrÚpeersÚpeerrÚviewsrîÚviewrs rnÚget_netns_infozRTNL_API.get_netns_info·sèø€ô“5ˆðˆØ—N‘NÖ$ˆDØ—m‘mÐ$7Ó8ˆGØÑ"Ø %Ñ'Ø%'�E˜'‘NØ�g‘×%Ñ% d§m¡m°MÓ&BÕCð %ðˆØ—O”OˆDØ �L‰L˜Ÿ™¨¨hÓ7Õ 8ð$á Ø �L‰L˜Ÿ™¨Ó2Ô 3óˆDð Û �Dð˜W˜ ð!&§ ¡ ¨$¨y©/¸2Ö >˜Ø˜W™ ×,Ñ,¨m¸TÐ-BÕCð!?à“Jñ!ñøôò Ùð üs/‚3D¶B DÃ>DÃ>DÄ D Ä DÄ D Ä Dcó—t«}|�|dkr|djd«n|djd|f«|�|djd|f«|�|djd|f«|j|ttt z«S)z³Assigns an id to a peer netns using RTM_NEWNSID query. The kernel chooses an unique id if nsid is omitted. This corresponds to the "ip netns set" command. rr)rrrr#r)rQršrËr4rr )r†r&r(rïrªs rnÚ set_netnsidzRTNL_API.set_netnsidés’€ô ‹iˆà ˆ<˜4 !š8à �‰L× Ñ Ð ;Õ <à �‰L× Ñ  °Ð 5Ô 6à ˆ?Ø �‰L× Ñ  ¨sÐ 3Ô 4à ˆ>Ø �‰L× Ñ  ¨bÐ 1Ô 2à×Ñ ¤[´-Ä)Ñ2KÓLÐLrpcó —t«}||d<|j|tttzt ¬«}|€|S|j d|i|«S)z$ Get default routes rj)Úmsg_typeÚ msg_flagsÚparserÚtable)rTrËr*rrrfr‡)r†rjr>rªÚroutess rnÚget_default_routeszRTNL_API.get_default_routess^€ô‹gˆØˆˆH‰ à×!Ñ!Ø Ü!Ü ¤=Ñ0Ü!ð "ó ˆð ˆ=؈Mà×'Ñ'¨°%Ð(8¸&ÓAÐ Arpc óà—|r0t|«hd£kr |jdi|¤ŽD] }|dgcSy|j|xs|¬«D�cgc]}|d‘Œ c}S#t$rgcYSwxYwcc}w)aA Lookup interface index (indeces) by first level NLA value. Example:: ip.link_lookup(address="52:54:00:9d:4e:3d") ip.link_lookup(ifname="lo") ip.link_lookup(operstate="UP") Please note, that link_lookup() returns list, not one value. >rÊÚifnameÚaltnamerÊ)riN)r˜)r1rÕrr²)r†rirlrÕs rnÚ link_lookupzRTNL_API.link_lookupsˆ€ñ ”S˜“ZÒ"@Ò@ð Ø%˜DŸI™IÑ5¨uÔ5�DØ  ™M˜?Ò*ñ6ð+/¯.©.¸uº~Ȩ.Ô*NóÙ*N $��W“ Ð*Nñð øô  ò Ø’ ð üòs”A±AÁ A+Á A(Á'A(có’—g}|j|i|¤ŽD]/}|j|tt¬«|j |«Œ1|S)zâ Flush routes -- purge route records from a table. Arguments are the same as for `get_routes()` routine. Actually, this routine implements a pipe from `get_routes()` to `nlm_request()`. ©r;r<)rµÚputr rrš)r†r…rlrÇrçs rnÚ flush_routeszRTNL_API.flush_routes8sH€ðˆØ$�T—_‘_ dÐ4¨eÔ4ˆEØ �H‰H�U¤\¼]ˆHÔ KØ �J‰J�uÕ ð5ðˆ rpcó¤—ttz}g}|j|i|¤ŽD]+}|j|t|¬«|j |«Œ-|S)a Flush IP addresses. Examples:: # flush all addresses on the interface with index 2: ipr.flush_addr(index=2) # flush all addresses with IFA_LABEL='eth0': ipr.flush_addr(label='eth0') rF)rrr³rGrrš)r†r…rlrŸrÇrâs rnÚ flush_addrzRTNL_API.flush_addrEsR€ôœ}Ñ,ˆØˆØ!�D—M‘M 4Ð1¨5Ô1ˆDØ �H‰H�T¤K¸5ˆHÔ AØ �J‰J�tÕ ð2ðˆ rpcó¤—ttz}g}|j|i|¤ŽD]+}|j|t|¬«|j |«Œ-|S)a Flush rules. Please keep in mind, that by default the function operates on **all** rules of **all** families. To work only on IPv4 rules, one should explicitly specify `family=AF_INET`. Examples:: # flush all IPv4 rule with priorities above 5 and below 32000 ipr.flush_rules(family=AF_INET, priority=lambda x: 5 < x < 32000) # flush all IPv6 rules that point to table 250: ipr.flush_rules(family=socket.AF_INET6, table=250) rF)rrr¸rGr!rš)r†r…rlrŸrÇräs rnÚ flush_ruleszRTNL_API.flush_rulesXsR€ôœ}Ñ,ˆØˆØ"�D—N‘N DÐ2¨EÔ2ˆDØ �H‰H�T¤K¸5ˆHÔ AØ �J‰J�tÕ ð3ðˆ rpc ó®—|dk(rFt«}|jdd«|d<d|d<|D] }||||<Œ |j|fi|¤ŽS|dvrd|vr|}n|jdd«}td ftd fdœ}|j ||«\}}t «}|j dd«|d<t|d <t||¬ «jt|««j«} |d jd d | d idf«|j|||¬«} |�|j|| «} |jr|t zt k(s t#| «} | S)aO Set bridge port parameters. Example:: idx = ip.link_lookup(ifname='eth0') ip.brport("set", index=idx, unicast_flood=0, cost=200) ip.brport("show", index=idx) Possible keywords are NLA names for the `protinfo_bridge` class, without the prefix and in lower letters. r1rÊrÚ bridge_slaver©r—ÚshowriNr—rj©ÚcontextÚprimerÚ IFLA_PROTINFOi€rF)r£rkrÕr%r•rKr˜r r^Ú apply_filterr[ÚfinalizeršrËr‡rŠrrƒ) r†r“rlÚ linkkwargr¬rir”r<rªÚprotinforÇs rnÚbrportzRTNL_API.brportss|€ð �eÒ Ü›ˆIØ!&§¡¨7°AÓ!6ˆI�gÑ Ø .ˆI�fÑ Û�Ø!& s¡� ˜#’ðà�4—9‘9˜WÑ2¨ Ñ2Ð 2Ø Ð'Ñ '¨g¸UÑ.B؉Eà—I‘I˜g tÓ,ˆEô! &Ð)Ü  &Ð)ñ ˆ ð $×5Ñ5°g¸{ÓKш�)ä‹jˆØ—y‘y ¨!Ó,ˆˆG‰ Ü!ˆˆH‰ ä  U°%Ô 8ß ‰\Ô/°Ó8Ó 9ß ‰X‹Zð ð ˆG‰ ×ÑØ ˜w¨°Ñ(9Ð:¸FÐ Cô ð×јs¨WÀ ÐÓJˆØ Ð Ø×&Ñ& u¨cÓ2ˆCà × Ò  i´*Ñ&<Ä Ò&Jܘ“*ˆCàˆ rpc óÌ—tdftdfdœ}t|d<t«t |«g|d<|j ||«\}}t |j||ffi|¤Ž«S)a' Vlan filters is another approach to support vlans in Linux. Before vlan filters were introduced, there was only one way to bridge vlans: one had to create vlan interfaces and then add them as ports:: +------+ +----------+ net --> | eth0 | <--> | eth0.500 | <---+ +------+ +----------+ | v +------+ +-----+ net --> | eth1 | | br0 | +------+ +-----+ ^ +------+ +----------+ | net --> | eth2 | <--> | eth2.500 | <---+ +------+ +----------+ It means that one has to create as many bridges, as there were vlans. Vlan filters allow to bridge together underlying interfaces and create vlans already on the bridge:: # v500 label shows which interfaces have vlan filter +------+ v500 net --> | eth0 | <-------+ +------+ | v +------+ +-----+ +---------+ net --> | eth1 | <--> | br0 |<-->| br0v500 | +------+ +-----+ +---------+ ^ +------+ v500 | net --> | eth2 | <-------+ +------+ In this example vlan 500 will be allowed only on ports `eth0` and `eth2`, though all three eth nics are bridged. Some example code:: # create bridge ip.link("add", ifname="br0", kind="bridge") # attach a port ip.link("set", index=ip.link_lookup(ifname="eth0")[0], master=ip.link_lookup(ifname="br0")[0]) # set vlan filter ip.vlan_filter("add", index=ip.link_lookup(ifname="eth0")[0], vlan_info={"vid": 500}) # create vlan interface on the bridge ip.link("add", ifname="br0v500", kind="vlan", link=ip.link_lookup(ifname="br0")[0], vlan_id=500) # set all UP ip.link("set", index=ip.link_lookup(ifname="br0")[0], state="up") ip.link("set", index=ip.link_lookup(ifname="br0v500")[0], state="up") ip.link("set", index=ip.link_lookup(ifname="eth0")[0], state="up") # set IP address ip.addr("add", index=ip.link_lookup(ifname="br0v500")[0], address="172.16.5.2", mask=24) Now all the traffic to the network 172.16.5.2/24 will go to vlan 500 only via ports that have such vlan filter. Required arguments for `vlan_filter()`: `index` and `vlan_info`. Vlan info dict:: ip.vlan_filter('add', index=, vlan_info = {'vid': , 'pvid': , 'flags': int or list} More details: * kernel:Documentation/networking/switchdev.txt * pyroute2.netlink.rtnl.ifinfmsg:... vlan_info Setting PVID or specifying a range will specify the approprate flags. One can specify `flags` as int or as a list of flag names: * `master` == 0x1 * `pvid` == 0x2 * `untagged` == 0x4 * `range_begin` == 0x8 * `range_end` == 0x10 * `brentry` == 0x20 E.g.:: {'vid': 20, 'pvid': true } # is equal to {'vid': 20, 'flags': ['pvid', 'untagged']} # is equal to {'vid': 20, 'flags': 6} # range {'vid': '100-199'} Required arguments for `vlan_filter()`: `index` and `vlan_tunnel_info`. Vlan tunnel info dict:: ip.vlan_filter('add', index=, vlan_tunnel_info = {'vid': , 'id': } vlan_tunnel_info appears to only use the 'range_begin' and 'range_end' flags from vlan_info. Specifying a range will automatically send the needed flags. Example:: {'vid': 20, 'id: 20} {'vid': '200-299', 'id': '200-299'} The above directives can be combined as in the example:: ip.vlan_filter('add', index=7, vlan_info={'vid': 600}, vlan_tunnel_info={'vid': 600, 'id': 600}) Commands: **add** Add vlan filter to a bridge port. Example:: ip.vlan_filter("add", index=2, vlan_info={"vid": 200}) **del** Remove vlan filter from a bridge port. Example:: ip.vlan_filter("del", index=2, vlan_info={"vid": 200}) r™)rÚdelrjÚ kwarg_filter)r:rr rYrZr•rƒrÕ)r†r“rlr”rŸs rnÚ vlan_filterzRTNL_API.vlan_filter¤sz€ôH  Ð'Ü Ð'ñ ˆ ô $ˆˆh‰ä Ó Ü  Ó (ð! ˆˆnÑð  ×1Ñ1°'¸;ÓGш�%Ü�Y�T—Y‘Y ¨Ð/Ñ9°5Ñ9Ó:Ð:rpc óÀ—d}|dk(rt|«\}}t|d<d|vr|jd«|d<|dv�r |jdd«tj dzsä|jdd«tj dz|d<|jdd«tj d tj d zzs|dxxtj d zcc<|jd d«tj d tj d zzs)|jd d«tj d z|d <|�||d<|j|fi|¤ŽS)a Bridge forwarding database management. More details: * kernel:Documentation/networking/switchdev.txt * pyroute2.netlink.rtnl.ndmsg **add** Add a new FDB record. Works in the same way as ARP cache management, but some additional NLAs can be used:: # simple FDB record # ip.fdb('add', ifindex=ip.link_lookup(ifname='br0')[0], lladdr='00:11:22:33:44:55', dst='10.0.0.1') # specify vlan # NB: vlan should exist on the device, use # `vlan_filter()` # ip.fdb('add', ifindex=ip.link_lookup(ifname='br0')[0], lladdr='00:11:22:33:44:55', dst='10.0.0.1', vlan=200) # specify vxlan id and port # NB: works only for vxlan devices, use # `link("add", kind="vxlan", ...)` # # if port is not specified, the default one is used # by the kernel. # # if vni (vxlan id) is equal to the device vni, # the kernel doesn't report it back # ip.fdb('add', ifindex=ip.link_lookup(ifname='vx500')[0] lladdr='00:11:22:33:44:55', dst='10.0.0.1', port=5678, vni=600) # or specify src_vni for a vlan-aware vxlan device ip.fdb('add', ifindex=ip.link_lookup(ifname='vx500')[0] lladdr='00:11:22:33:44:55', dst='10.0.0.1', port=5678, src_vni=600) **append** Append a new FDB record. The same syntax as for **add**. **del** Remove an existing FDB record. The same syntax as for **add**. **dump** Dump all the FDB records. If any `**kwarg` is provided, results will be filtered:: # dump all the records ip.fdb('dump') # show only specific lladdr, dst, vlan etc. ip.fdb('dump', lladdr='00:11:22:33:44:55') ip.fdb('dump', dst='10.0.0.1') ip.fdb('dump', vlan=200) Nr—rjÚnudÚstate)rr[ršrÚnoarpÚ permanentÚ reachablerŸr†Úmasterri)ror rkr˜rEÚstatesrŸrÝ)r†r“rlr¨s rnr·z RTNL_API.fdbUsH€ðZˆ Ø �fÒ Ü!0°Ó!7Ñ ˆK˜ä#ˆˆh‰à �E‰>Ø"ŸY™Y uÓ-ˆE�'‰NØ Ð/Ò /Ø �I‰I�g˜qÓ !¤E§L¡L°Ñ$9Ò 9ð#ŸY™Y w°Ó2´U·\±\À'Ñ5JÑJˆE�'‰Nà—9‘9˜W aÓ(Ü— ‘ ˜[Ñ)¬E¯L©L¸Ñ,EÑEòð�g“¤%§,¡,¨{Ñ";Ñ;“Ø—9‘9˜W aÓ(Ü— ‘ ˜FÑ#¤e§k¡k°(Ñ&;Ñ;òð"'§¡¨7°AÓ!6¼¿¹ÀVÑ9LÑ!L��g‘à Ð "Ø(ˆE�'‰N؈t�z‰z˜'Ñ+ UÑ+Ð+rpc ó —tdftdftdftdftdftdftdftdftdftdfdœ }d }tj«}|dk(rt |«\}}t ||¬ «j t««j t|««j«}|j||«\}}|jD]7} |dk(r|jr | d d k(rŒ|j| d d «|| d <Œ9|j«D]O\} } tjj| «} |j!| «sŒ7| €Œ:|d j#| | g«ŒQ|j%|||¬«} |dk(r|r|j'|| «} |j(r|t*zt*k(s t-| «} | S)a= Neighbours operations, same as `ip neigh` or `bridge fdb` **add** Add a neighbour record, e.g.:: from pyroute2 import IPRoute from pyroute2.netlink.rtnl import ndmsg # add a permanent record on veth0 idx = ip.link_lookup(ifname='veth0')[0] ip.neigh('add', dst='172.16.45.1', lladdr='00:11:22:33:44:55', ifindex=idx, state=ndmsg.states['permanent']) **set** Set an existing record or create a new one, if it doesn't exist. The same as above, but the command is "set":: ip.neigh('set', dst='172.16.45.1', lladdr='00:11:22:33:44:55', ifindex=idx, state=ndmsg.states['permanent']) **change** Change an existing record. If the record doesn't exist, fail. **del** Delete an existing record. **dump** Dump all the records in the NDB:: ip.neigh('dump') **get** Get specific record (dst and ifindex are mandatory). Available only on recent kernel:: ip.neigh('get', dst='172.16.45.1', ifindex=idx) r�rœr›r™r—r˜rš) rr1rœr›r[ÚremoveÚdeleter—r˜ršNrQrÚifindexrrF)r2rr&rEror^rUr_r`rVr•ÚfieldsÚ strict_checkrkr¹Úname2nlaÚ valid_nlaršrËr‡rŠrrƒ)r†r“rlr”r¨rªÚrequestr;r<Úfieldr¬r®ÚnlarÇs rnrÝzRTNL_API.neighÃsË€ôn! (Ð+Ü  )Ð,Ü$ iÐ0Ü# XÐ.Ü  %Ð(Ü# UÐ+Ü# UÐ+Ü! 6Ð*Ü  %Ð(Ü# XÐ.ñ  ˆ ðˆ Ü�k‰k‹mˆØ �fÒ Ü!0°Ó!7Ñ ˆK˜ô  U°%Ô 8ß ‰\Ô.Ó0Ó 1ß ‰\Ô0°Ó9Ó :ß ‰X‹Zð ð #×4Ñ4°W¸kÓJш�)ð—Z”ZˆEà˜6Ò!Ø×%Ò%ؘ!‘H  Ò)ðØ#ŸK™K¨¨a©°!Ó4ˆC��a‘ŠMð ð"Ÿ-™-ž/‰JˆC�Ü—+‘+×&Ñ& sÓ+ˆCØ�}‰}˜SÕ! eÑ&7Ø�G‘ ×#Ñ# S¨% LÕ1ð*ð ×јs¨XÀÐÓKˆà �fÒ ¡Ø×&Ñ& {°CÓ8ˆCà × Ò  i´*Ñ&<Ä Ò&Jܘ“*ˆCàˆ rpc ó8—tdftdftdftdftdftdftdftdft dft dfdœ }d}i}t «}|dk(rt|«\}}|ra|jd«r|d}nt«t|«g}t||¬ «}|D]}|j|«Œ|j«|j||«\} } |jD]} |j!| d d «|| d <Œ|j#«D]J\} } t%|«j'| «}|j)|«sŒ2| €Œ5|d j+|| g«ŒL|j-|| | ¬ «}|dk(rn|�lt/|t0«rJt||¬ «jt««jtd««j«}|j3||«}|j4r| t6zt6k(s t9|«}|S) u-) Link operations. Keywords to set up ifinfmsg fields: * index -- interface index * family -- AF_BRIDGE for bridge operations, otherwise 0 * flags -- device flags * change -- change mask All other keywords will be translated to NLA names, e.g. `mtu -> IFLA_MTU`, `af_spec -> IFLA_AF_SPEC` etc. You can provide a complete NLA structure or let filters do it for you. E.g., these pairs show equal statements:: # set device MTU ip.link("set", index=x, mtu=1000) ip.link("set", index=x, IFLA_MTU=1000) # add vlan device ip.link("add", ifname="test", kind="dummy") ip.link("add", ifname="test", IFLA_LINKINFO={'attrs': [['IFLA_INFO_KIND', 'dummy']]}) Filters are implemented in the `pyroute2.iproute.req` module. You can contribute your own if you miss shortcuts. Commands: **add** To create an interface, one should specify the interface kind:: ip.link("add", ifname="test", kind="dummy") The kind can be any of those supported by kernel. It can be `dummy`, `bridge`, `bond` etc. On modern kernels one can specify even interface index:: ip.link("add", ifname="br-test", kind="bridge", index=2345) Specific type notes: â–º geneve Create GENEVE tunnel:: ip.link("add", ifname="genx", kind="geneve", geneve_id=42, geneve_remote="172.16.0.101") Support for GENEVE over IPv6 is also included; use `geneve_remote6` to configure a remote IPv6 address. â–º gre Create GRE tunnel:: ip.link("add", ifname="grex", kind="gre", gre_local="172.16.0.1", gre_remote="172.16.0.101", gre_ttl=16) The keyed GRE requires explicit iflags/oflags specification:: ip.link("add", ifname="grex", kind="gre", gre_local="172.16.0.1", gre_remote="172.16.0.101", gre_ttl=16, gre_ikey=10, gre_okey=10, gre_iflags=32, gre_oflags=32) Support for GRE over IPv6 is also included; use `kind=ip6gre` and `ip6gre_` as the prefix for its values. â–º ipip Create ipip tunnel:: ip.link("add", ifname="tun1", kind="ipip", ipip_local="172.16.0.1", ipip_remote="172.16.0.101", ipip_ttl=16) Support for sit and ip6tnl is also included; use `kind=sit` and `sit_` as prefix for sit tunnels, and `kind=ip6tnl` and `ip6tnl_` prefix for ip6tnl tunnels. â–º macvlan Macvlan interfaces act like VLANs within OS. The macvlan driver provides an ability to add several MAC addresses on one interface, where every MAC address is reflected with a virtual interface in the system. In some setups macvlan interfaces can replace bridge interfaces, providing more simple and at the same time high-performance solution:: ip.link("add", ifname="mvlan0", kind="macvlan", link=ip.link_lookup(ifname="em1")[0], macvlan_mode="private").commit() Several macvlan modes are available: "private", "vepa", "bridge", "passthru". Ususally the default is "vepa". â–º macvtap Almost the same as macvlan, but creates also a character tap device:: ip.link("add", ifname="mvtap0", kind="macvtap", link=ip.link_lookup(ifname="em1")[0], macvtap_mode="vepa").commit() Will create a device file `"/dev/tap%s" % index` â–º tuntap Possible `tuntap` keywords: * `mode` — "tun" or "tap" * `uid` — integer * `gid` — integer * `ifr` — dict of tuntap flags (see ifinfmsg:... tuntap_data) Create a tap interface:: ip.link("add", ifname="tap0", kind="tuntap", mode="tap") Tun/tap interfaces are created using `ioctl()`, but the library provides a transparent way to manage them using netlink API. â–º veth To properly create `veth` interface, one should specify `peer` also, since `veth` interfaces are created in pairs:: # simple call ip.link("add", ifname="v1p0", kind="veth", peer="v1p1") # set up specific veth peer attributes ip.link("add", ifname="v1p0", kind="veth", peer={"ifname": "v1p1", "net_ns_fd": "test_netns"}) â–º vlan VLAN interfaces require additional parameters, `vlan_id` and `link`, where `link` is a master interface to create VLAN on:: ip.link("add", ifname="v100", kind="vlan", link=ip.link_lookup(ifname="eth0")[0], vlan_id=100) There is a possibility to create also 802.1ad interfaces:: # create external vlan 802.1ad, s-tag ip.link("add", ifname="v100s", kind="vlan", link=ip.link_lookup(ifname="eth0")[0], vlan_id=100, vlan_protocol=0x88a8) # create internal vlan 802.1q, c-tag ip.link("add", ifname="v200c", kind="vlan", link=ip.link_lookup(ifname="v100s")[0], vlan_id=200, vlan_protocol=0x8100) â–º vrf VRF interfaces (see linux/Documentation/networking/vrf.txt):: ip.link("add", ifname="vrf-foo", kind="vrf", vrf_table=42) â–º vxlan VXLAN interfaces are like VLAN ones, but require a bit more parameters:: ip.link("add", ifname="vx101", kind="vxlan", vxlan_link=ip.link_lookup(ifname="eth0")[0], vxlan_id=101, vxlan_group='239.1.1.1', vxlan_ttl=16) All possible vxlan parameters are listed in the module `pyroute2.netlink.rtnl.ifinfmsg:... vxlan_data`. â–º ipoib IPoIB driver provides an ability to create several ip interfaces on one interface. IPoIB interfaces requires the following parameter: `link` : The master interface to create IPoIB on. The following parameters can also be provided: * `pkey`- Inifiniband partition key the ip interface is associated with * `mode`- Underlying infiniband transport mode. One of: ['datagram' ,'connected'] * `umcast`- If set(1), multicast group membership for this interface is handled by user space. Example:: ip.link("add", ifname="ipoib1", kind="ipoib", link=ip.link_lookup(ifname="ib0")[0], pkey=10) **set** Set interface attributes:: # get interface index x = ip.link_lookup(ifname="eth0")[0] # put link down ip.link("set", index=x, state="down") # rename and set MAC addr ip.link("set", index=x, address="00:11:22:33:44:55", name="bala") # set MTU and TX queue length ip.link("set", index=x, mtu=1000, txqlen=2000) # bring link up ip.link("set", index=x, state="up") Seting bridge or tunnel attributes require `kind` to be specified in order to properly encode `IFLA_LINKINFO`:: ip.link("set", index=x, kind="bridge", br_forward_delay=2000) ip.link("set", index=x, kind="gre", gre_local="10.0.0.1", gre_remote="10.1.0.103") Keyword "state" is reserved. State can be "up" or "down", it is a shortcut:: state="up": flags=1, mask=1 state="down": flags=0, mask=0 SR-IOV virtual function setup:: # get PF index x = ip.link_lookup(ifname="eth0")[0] # setup macaddr ip.link("set", index=x, # PF index vf={"vf": 0, # VF index "mac": "00:11:22:33:44:55"}) # address # setup vlan ip.link("set", index=x, # PF index vf={"vf": 0, # VF index "vlan": 100}) # the simplest case # setup QinQ ip.link("set", index=x, # PF index vf={"vf": 0, # VF index "vlan": [{"vlan": 100, # vlan id "proto": 0x88a8}, # 802.1ad {"vlan": 200, # vlan id "proto": 0x8100}]}) # 802.1q **update** Almost the same as `set`, except it uses different flags and message type. Mostly does the same, but in some cases differs. If you're not sure what to use, use `set`. **del** Destroy the interface:: ip.link("del", index=ip.link_lookup(ifname="dummy0")[0]) **dump** Dump info for all interfaces **get** Get specific interface info:: ip.link("get", index=ip.link_lookup(ifname="br0")[0]) Get extended attributes like SR-IOV setup:: ip.link("get", index=3, ext_mask=1) r™r�ršr—r˜) r1Úupdaterr[Ú property_addÚ property_delrgrhr—r˜Nr\rQrrrF)r0r:rr1rr%rKror˜r\r]r^rUrVr•rjrkr¹r rlrmršrËrur£r‡rŠrrƒ)r†r“rlr”r¨rnrªÚfiltersÚrfilterr;r<ror¬r®rprÇs rnrÕz RTNL_API.link,s€ôZ   Ð'Ü" HÐ-Ü Ð*Ü Ð'Ü,¨hÐ7Ü,¨eÐ4Ü" EÐ*Ü" EÐ*Ü  &Ð)Ü Ð'ñ  ˆ ðˆ ØˆÜ‹jˆà �fÒ Ü!0°Ó!7Ñ ˆK˜á Ø�y‰y˜Ô(Ø Ñ/‘ä*Ó,Ô.?ÀÓ.HÐI�Ü&¨u¸EÔBˆGÛ"�Ø×$Ñ$ WÕ-ð#à × Ñ Ô à"×4Ñ4°W¸kÓJш�)à—Z”ZˆEØ#ŸK™K¨¨a©°!Ó4ˆC��a‘ŠMð ð"Ÿ-™-ž/‰JˆC�Ü�s“)×$Ñ$ SÓ)ˆCØ�}‰}˜SÕ! eÑ&7Ø�G‘ ×#Ñ# S¨% LÕ1ð*ð ×јs¨XÀÐÓKˆà �fÒ  Ð!8ܘ+¤tÔ,ä$¨[À ÔLß!‘\¤/Ó"3Ó4ß!‘\Ô"3°FÓ";Ó<ß‘X“Zð ð ×&Ñ& {°CÓ8ˆCà × Ò  i´*Ñ&<Ä Ò&Jܘ“*ˆCàˆ rpcóÜ—|dvrgS|r7tjdt«td|«}|j |«d|vrtjdt«t dft dft dft dft dftd fd œ}d }t«}|d k(rt|«\}}t||¬ «jt««jt|««j«}|j||«\} } |j D]&} | d dk7sŒ |j#| d d «|| d <Œ(|j%«D]E\} } tj&| «}|j)|«sŒ-| €Œ0|dj+|| g«ŒG|j-|| | d„¬«}|d k(r|�|j/||«}|j0r| t2zt2k(s t5|«}|S)a Address operations * command -- add, delete, replace, dump * index -- device index * address -- IPv4 or IPv6 address * mask -- address mask * family -- socket.AF_INET for IPv4 or socket.AF_INET6 for IPv6 * scope -- the address scope, see /etc/iproute2/rt_scopes * kwarg -- dictionary, any ifaddrmsg field or NLA Later the method signature will be changed to:: def addr(self, command, match=None, **kwarg): # the method body So only keyword arguments (except of the command) will be accepted. The reason for this change is an unification of API. Example:: idx = 62 ip.addr('add', index=idx, address='10.0.0.1', mask=24) ip.addr('add', index=idx, address='10.0.0.2', mask=24) With more NLAs:: # explicitly set broadcast address ip.addr('add', index=idx, address='10.0.0.3', broadcast='10.0.0.255', prefixlen=24) # make the secondary address visible to ifconfig: add label ip.addr('add', index=idx, address='10.0.0.4', broadcast='10.0.0.255', prefixlen=24, label='eth0:1') Configure p2p address on an interface:: ip.addr('add', index=idx, address='10.1.1.2', mask=24, local='10.1.1.1') )r˜r1zMpositional arguments for IPRoute.addr() are deprecated, use keyword arguments)rÊÚaddressÚ prefixlenrjÚscoperiÚmaskz2usage of mask is deprecated, use prefixlen insteadr�r™rœr—)rr[rgrhrœr—NrQrrŸrcó —|ddtk(S)Nr r )r)rys rnr�zRTNL_API.addr..s€  (¡ ¨FÑ 3´{Ò Brp)r;r<Ú terminate)ÚwarningsÚwarnÚDeprecationWarningÚziprrr/rr$rJror^rUrWrXrVr•rjrkr¹rlrmršrËr‡rŠrrƒ)r†r“r…rlÚconverted_argvr”r¨rªrnr;r<ror¬r®rprÇs rnrâz RTNL_API.addr±sû€ð` �nÑ $؈Iñ Ü �M‰Mð(ä"ô ô !ØMØóˆNð �L‰L˜Ô (Ø �U‰?Ü �M‰MØDÜ"ô ô   Ð*Ü Ð'Ü" EÐ*Ü" EÐ*Ü# YÐ/Ü  &Ð)ñ  ˆ ðˆ Ü‹kˆØ �fÒ Ü!0°Ó!7Ñ ˆK˜ô  U°%Ô 8ß ‰\Ô,Ó.Ó /ß ‰\Ô.¨wÓ7Ó 8ß ‰X‹Zð ð #×4Ñ4°W¸kÓJш�)à—Z”ZˆEØ�Q‰x˜7Ó"Ø '§ ¡ ¨E°!©H°aÓ 8��E˜!‘H’ ð ð "Ÿ-™-ž/‰JˆC�Ü×$Ñ$ SÓ)ˆCØ�}‰}˜SÕ! eÑ&7Ø�G‘ ×#Ñ# S¨% LÕ1ð*ð ×ÑØ ØØÙBð ó ˆð �fÒ  Ð!8Ø×&Ñ& {°CÓ8ˆCà × Ò  i´*Ñ&<Ä Ò&Jܘ“*ˆCàˆ rpc óð‡—|dk(ry|dk(rtS|dk(r0tj|«}|�t|d«r |jSytdft dft dft dftd ftd ft dftdft d ft d ftdftdftd ftd fd œ}|d k(rc|d k(r)‰j«D�cgc]}|ddk7sŒ |d‘Œ}}t|tttf«rttˆfd„|D«Ž«S‰j!||«\}} t#«} t%|«}dD]} | |vsŒ|| €Œt%|| «|| <Œ || d<|| d<d|vr|d| d<|jdd«} |tvr{t|}|j'dt)|dd ««| d<t|d«r|j+| |«|rK|t tfvr|j-|«} n+|j/|«} n|jdt0«| d<|�| dj3d|g«| �| dj3d| g«t‰j5| || ¬««Scc}w)aÌ "Swiss knife" for traffic control. With the method you can add, delete or modify qdiscs, classes and filters. * command -- add or delete qdisc, class, filter. * kind -- a string identifier -- "sfq", "htb", "u32" and so on. * handle -- integer or string Command can be one of ("add", "del", "add-class", "del-class", "add-filter", "del-filter") (see `commands` dict in the code). Handle notice: traditional iproute2 notation, like "1:0", actually represents two parts in one four-bytes integer:: 1:0 -> 0x10000 1:1 -> 0x10001 ff:0 -> 0xff0000 ffff:1 -> 0xffff0001 Target notice: if your target is a class/qdisc that applies an algorithm that can only apply to upstream traffic profile, but your keys variable explicitly references a match that is only relevant for upstream traffic, the kernel will reject the filter. Unless you're dealing with devices like IMQs For pyroute2 tc() you can use both forms: integer like 0xffff0000 or string like 'ffff:0000'. By default, handle is 0, so you can add simple classless queues w/o need to specify handle. Ingress queue causes handle to be 0xffff0000. So, to set up sfq queue on interface 1, the function call will be like that:: ip = IPRoute() ip.tc("add", "sfq", 1) Instead of string commands ("add", "del"...), you can use also module constants, `RTM_NEWQDISC`, `RTM_DELQDISC` and so on:: ip = IPRoute() flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_CREATE | NLM_F_EXCL ip.tc((RTM_NEWQDISC, flags), "sfq", 1) It should be noted that "change", "change-class" and "change-filter" work like "replace", "replace-class" and "replace-filter", except they will fail if the node doesn't exist (while it would have been created by "replace"). This is not the same behaviour as with "tc" where "change" can be used to modify the value of some options while leaving the others unchanged. However, as not all entities support this operation, we believe the "change" commands as implemented here are more useful. Also available "modules" (returns tc plugins dict) and "help" commands:: help(ip.tc("modules")["htb"]) print(ip.tc("help", "htb")) r1NÚmodulesÚhelpÚ__doc__zNo help availabler�r™r›rœ)rr[rgrhr›rœz add-classz del-classz change-classz replace-classz add-filterz del-filterz change-filterzreplace-filterr[rrÊrec3óD•K—|]}‰jd|¬«–—Œy­w)r[)rÊN)Útc)Ú.0ryr†s €rnÚ zRTNL_API.tc..‚søèø€Ð#KÁUÀ D§G¡G¨E¸ G×$;ÁUùsƒ )rÎr ÚdefaultrxrÚoptsrÎÚfix_msgrÚTCA_KINDÚ TCA_OPTIONSrF)Ú tc_pluginsr˜r¢r†r5rr8r"r9r#r²rur‘rƒr1rr•rVr|rkÚgetattrr�Úget_class_parametersÚget_parametersrDršrË) r†r“rrÊrxrlÚpr”ryrŸrªrrŒs ` rnrˆz RTNL_API.tc"sªø€ðz �eÒ Ø à �iÒ ÜÐ à �fÒ Ü—‘˜tÓ$ˆA؈}¤¨¨IÔ!6Ø—y‘yÐ à*ô! (Ð+Ü  %Ð(Ü# UÐ+Ü# UÐ+Ü# XÐ.Ü$ iÐ0Ü'¨Ð2Ü'¨Ð/Ü*¨HÐ5Ü+¨YÐ7Ü)¨8Ð4Ü)¨5Ð1Ü,¨hÐ7Ü-¨yÐ9ñ ˆ ð �eÒ Ø˜Šzà(,¯©Ô(8óÙ(8 1¸A¸g¹JÈ!»O�A�g“JÐ(8ððô˜%¤$¬¬sÐ!3Ô4ÜœEÓ#KÁUÓ#KÐLÓMÐMØ×/Ñ/°¸ÓE‰ˆ�Ü‹gˆä! &Ó)ˆÛ3ˆDØ�uŠ}  t¡Ñ!8Ü.¨u°T©{Ó;��d’ ð4ðˆˆG‰ ؈ˆH‰ Ø �U‰?Ø ™-ˆC�‰KØ�y‰y˜ Ó&ˆð ”:Ñ Ü˜4Ñ ˆAØ!ŸI™I h´¸¸8ÀQÓ0GÓHˆC�‰MÜ�q˜)Ô$Ø— ‘ ˜#˜uÔ%ÙØœ}¬mÐ<Ñ<Ø×1Ñ1°%Ó8‘Dà×+Ñ+¨EÓ2‘Dà!ŸI™I h´ Ó:ˆC�‰Mà Ð Ø �‰L× Ñ  ¨TÐ 2Ô 3Ø Ð Ø �‰L× Ñ  °Ð 5Ô 6Ü�T×%Ñ% c°GÀuÐ%ÓMÓNÐNùòKs à I3ÃI3c ó„—|dvr2|jdd«xsd|d<|jdd«xsd|d<d|vr|dvr|}n|jdd«}|jd d«}t||¬ «jt ««jt |««j «}|}td ftd ftd ftd ftdftdftdftdftdftdftdfdœ }|j||«\}}t«}|js|jdd«} | dkr| nd|d<|jdt«|d<|jdtd«|d<|jdd«xs|jdd«|d<|jdd«|d<|jdd«|d<|jdd«|d<|jdtd «|d<|jdt d «|d<g|d!<|dt"k(r&t%|«D]} | d"vsŒ|j| «Œ|D]¸} tj&| «} | d#k(r|| sŒ#|| €Œ)|d!j)| || g«|dt*dfvsŒP| d$k(sŒVt-|| «dkDsŒh|| d} | jd!g«} | D]2}|dd%k(sŒ |d&j/d'«dk\rt0nt|d<Œ¸Œº|j3||||¬(«}|rnt5|t6«rLt||¬ «jt d)¬*««jt d««j «}|j9||«}|j:r|t<zt<k(s t%|«}|S)+a� Route operations. Keywords to set up rtmsg fields: * dst_len, src_len -- destination and source mask(see `dst` below) * tos -- type of service * table -- routing table * proto -- `redirect`, `boot`, `static` (see `rt_proto`) * scope -- routing realm * type -- `unicast`, `local`, etc. (see `rt_type`) `pyroute2/netlink/rtnl/rtmsg.py` rtmsg.nla_map: * table -- routing table to use (default: 254) * gateway -- via address * prefsrc -- preferred source IP address * dst -- the same as `prefix` * iif -- incoming traffic interface * oif -- outgoing traffic interface etc. One can specify mask not as `dst_len`, but as a part of `dst`, e.g.: `dst="10.0.0.0/24"`. Commands: **add** Example:: ipr.route("add", dst="10.0.0.0/24", gateway="192.168.0.1") ... More `route()` examples. Blackhole route:: ipr.route( "add", dst="10.0.0.0/24", type="blackhole", ) Create a route with metrics:: ipr.route( "add", dst="172.16.0.0/24", gateway="10.0.0.10", metrics={ "mtu": 1400, "hoplimit": 16, }, ) Multipath route:: ipr.route( "add", dst="10.0.0.0/24", multipath=[ {"gateway": "192.168.0.1", "hops": 2}, {"gateway": "192.168.0.2", "hops": 1}, {"gateway": "192.168.0.3"}, ], ) MPLS lwtunnel on eth0:: ipr.route( "add", dst="10.0.0.0/24", oif=ip.link_lookup(ifname="eth0"), encap={ "type": "mpls", "labels": "200/300", }, ) IPv6 next hop for IPv4 dst:: ipr.route( "add", prefsrc="10.127.30.4", dst="172.16.0.0/24", via={"family": AF_INET6, "addr": "fe80::1337"}, oif=ipr.link_lookup(ifname="eth0"), table=100, ) Create MPLS route: push label:: # $ sudo modprobe mpls_router # $ sudo sysctl net.mpls.platform_labels=1024 ipr.route( "add", family=AF_MPLS, oif=ipr.link_lookup(ifname="eth0"), dst=0x200, newdst=[0x200, 0x300], ) MPLS multipath:: ipr.route( "add", dst="10.0.0.0/24", table=20, multipath=[ { "gateway": "192.168.0.1", "encap": {"type": "mpls", "labels": 200}, }, { "ifindex": ipr.link_lookup(ifname="eth0"), "encap": {"type": "mpls", "labels": 300}, }, ], ) MPLS target can be int, string, dict or list:: "labels": 300 # simple label "labels": "300" # the same "labels": (200, 300) # stacked "labels": "200/300" # the same # explicit label definition "labels": { "bos": 1, "label": 300, "tc": 0, "ttl": 16, } Create SEG6 tunnel encap mode (kernel >= 4.10):: ipr.route( "add", dst="2001:0:0:10::2/128", oif=idx, encap={ "type": "seg6", "mode": "encap", "segs": "2000::5,2000::6", }, ) Create SEG6 tunnel inline mode (kernel >= 4.10):: ipr.route( "add", dst="2001:0:0:10::2/128", oif=idx, encap={ "type": "seg6", "mode": "inline", "segs": ["2000::5", "2000::6"], }, ) Create SEG6 tunnel inline mode with hmac (kernel >= 4.10):: ipr.route( "add", dst="2001:0:0:22::2/128", oif=idx, encap={ "type": "seg6", "mode": "inline", "segs": "2000::5,2000::6,2000::7,2000::8", "hmac": 0xf, }, ) Create SEG6 tunnel with ip4ip6 encapsulation (kernel >= 4.14):: ipr.route( "add", dst="172.16.0.0/24", oif=idx, encap={ "type": "seg6", "mode": "encap", "segs": "2000::5,2000::6", }, ) Create SEG6LOCAL tunnel End.DX4 action (kernel >= 4.14):: ipr.route( "add", dst="2001:0:0:10::2/128", oif=idx, encap={ "type": "seg6local", "action": "End.DX4", "nh4": "172.16.0.10", }, ) Create SEG6LOCAL tunnel End.DT6 action (kernel >= 4.14):: ipr.route( "add", dst="2001:0:0:10::2/128", oif=idx, encap={ "type": "seg6local", "action": "End.DT6", "table": "10", }, ) Create SEG6LOCAL tunnel End.DT4 action (kernel >= 5.11):: # $ sudo modprobe vrf # $ sudo sysctl -w net.vrf.strict_mode=1 ipr.link( "add", ifname="vrf-foo", kind="vrf", vrf_table=10, ) ipr.route( "add", dst="2001:0:0:10::2/128", oif=idx, encap={ "type": "seg6local", "action": "End.DT4", "vrf_table": 10, }, ) Create SEG6LOCAL tunnel End.DT46 action (kernel >= 5.14):: # $ sudo modprobe vrf # $ sudo sysctl -w net.vrf.strict_mode=1 ip.link('add', ifname='vrf-foo', kind='vrf', vrf_table=10) ip.route('add', dst='2001:0:0:10::2/128', oif=idx, encap={'type': 'seg6local', 'action': 'End.DT46', 'vrf_table': 10}) Create SEG6LOCAL tunnel End.B6 action (kernel >= 4.14):: ipr.route( "add", dst="2001:0:0:10::2/128", oif=idx, encap={ "type": "seg6local", "action": "End.B6", "srh": {"segs": "2000::5,2000::6"}, }, ) Create SEG6LOCAL tunnel End.B6 action with hmac (kernel >= 4.14):: ipr.route( "add", dst="2001:0:0:10::2/128", oif=idx, encap={ "type": "seg6local", "action": "End.B6", "srh": { "segs": "2000::5,2000::6", "hmac": 0xf, }, }, ) **change**, **replace**, **append** Commands `change`, `replace` and `append` have the same meanings as in ip-route(8): `change` modifies only existing route, while `replace` creates a new one, if there is no such route yet. `append` allows to create an IPv6 multipath route. **del** Remove the route. The same syntax as for **add**. **get** Get route by spec. **dump** Dump all routes. )rr1rœr›ršÚprotoÚstaticr ÚunicastrirONÚcallbackrQr�rœr›ršr™r˜r—) rr1rœr›ršr[rgrhr˜rPr—r>rgéÿéürjrzÚuniverseÚdst_lenr{rÚsrc_lenÚtosrŸÚunspecr)ræÚnewdstÚviaÚ multipathÚoifÚRTA_DSTr£Ú RTA_GATEWAYrerr)r;r<r™F)Ú add_defaults)r˜rkr^rUrarbrVr6r r*r•rTrkrrGrHrFr rƒrlršrÚlenÚfindrrËrur£r‡rŠr)r†r“rlrir™rnr”rŸrªr>r¬rpÚhoprÚattrrÇs rnrçzRTNL_API.route¥sÇ€ð^ ÐCÑ CØ"ŸY™Y w°Ó9ÒE¸XˆE�'‰NØ!ŸI™I f¨iÓ8ÒE¸IˆE�&‰MØ ˜%Ñ  GÐ/?Ñ$?؉Eà—I‘I˜g tÓ,ˆEØ—9‘9˜Z¨Ó.ˆä  U°%Ô 8ß ‰\Ô*Ó,Ó -ß ‰\Ô,¨WÓ5Ó 6ß ‰X‹Zð ð ˆô! (Ð+Ü  )Ð,Ü$ iÐ0Ü# XÐ.Ü# XÐ.Ü  %Ð(Ü# UÐ+Ü# UÐ+Ü  %Ð(Ü! 6Ð*Ü! 6Ð*ñ  ˆ ð ×1Ñ1°'¸;ÓGш�%Ü‹gˆð × Ò Ø—I‘I˜g sÓ+ˆEØ$)¨S¢L™5°cˆC�‰LØŸ ™  (¬GÓ4ˆˆH‰ Ø—y‘y ¬(°:Ñ*>Ó?ˆˆG‰ ØŸ™ 9¨dÓ3ÒK°u·y±yÀÈÓ7KˆˆI‰ØŸ™ 9¨aÓ0ˆˆI‰Ø—Y‘Y˜u aÓ(ˆˆE‰ Ø—y‘y ¨!Ó,ˆˆG‰ Ø—i‘i ¬°Ñ(9Ó:ˆˆF‰ Ø—y‘y ¬(°8Ñ*<Ó=ˆˆG‰ ؈ˆG‰ à ˆx‰=œGÒ #ܘU–|�ØÐJÒJØ—I‘I˜c•Nð$óˆCÜ—.‘. Ó%ˆCØ�iÒ¨¨cª ØØ�S‰zÑ%Ø�G‘ ×#Ñ# S¨%°©*Ð$5Ô6à�x‘=¤Y°Ð$4Ò4ؘkÓ)¬c°%¸±*«oÀÓ.AØ# C™j¨™m˜Ø #§¡¨°Ó 4˜Û$)˜DØ# A™w¨-Ó7ð(,¨A¡w§|¡|°CÓ'8¸AÒ'=õ%-ä)0ð!$ H¡ ñ !&ñ%*ðð(×ÑØ ˜'¨U¸Xðó ˆñ ܘ%¤Ô&ä$¨U¸%Ô@ß!‘\Ô"2ÀÔ"FÓGß!‘\Ô"4°VÓ"<Ó=ß‘X“Zð ð ×&Ñ& u¨cÓ2ˆCà × Ò  e¬jÑ&8¼JÒ&Fܘ“*ˆCàˆ rpc óæ—|dk(ryd|vr|dk(r|}n|jdd«}t||¬«jt««jt |««j «}t dftdftdftdftdfdœ}|j||«\}}t«}|jd d «}|d kr|nd |d <d D]} |j| d «|| <Œg|d<|D]P} |tk(r|jr| dvrŒtj| «} || €Œ8|dj| || g«ŒR|j|||¬«} |rlt!|t"«rJt||¬«jt««jt d««j «}|j%|| «} |j&r|t(zt(k(s t+| «} | S)u6 Rule operations - command — add, delete - table — 0 < table id < 253 - priority — 0 < rule's priority < 32766 - action — type of rule, default 'FR_ACT_NOP' (see fibmsg.py) - rtscope — routing scope, default RT_SCOPE_UNIVERSE `(RT_SCOPE_UNIVERSE|RT_SCOPE_SITE| RT_SCOPE_LINK|RT_SCOPE_HOST|RT_SCOPE_NOWHERE)` - family — rule's family (socket.AF_INET (default) or socket.AF_INET6) - src — IP source for Source Based (Policy Based) routing's rule - dst — IP for Destination Based (Policy Based) routing's rule - src_len — Mask for Source Based (Policy Based) routing's rule - dst_len — Mask for Destination Based (Policy Based) routing's rule - iifname — Input interface for Interface Based (Policy Based) routing's rule - oifname — Output interface for Interface Based (Policy Based) routing's rule - uid_range — Range of user identifiers, a string like "1000:1234" - dport_range — Range of destination ports, a string like "80-120" - sport_range — Range of source ports, as a string like "80-120" All packets route via table 10:: # 32000: from all lookup 10 # ... ip.rule('add', table=10, priority=32000) Default action:: # 32001: from all lookup 11 unreachable # ... iproute.rule('add', table=11, priority=32001, action='FR_ACT_UNREACHABLE') Use source address to choose a routing table:: # 32004: from 10.64.75.141 lookup 14 # ... iproute.rule('add', table=14, priority=32004, src='10.64.75.141') Use dst address to choose a routing table:: # 32005: from 10.64.75.141/24 lookup 15 # ... iproute.rule('add', table=15, priority=32005, dst='10.64.75.141', dst_len=24) Match fwmark:: # 32006: from 10.64.75.141 fwmark 0xa lookup 15 # ... iproute.rule('add', table=15, priority=32006, dst='10.64.75.141', fwmark=10) r1Nrir—rQr�r™)rr[rgrhr—r>rršr›)rjržr�ÚactionrŸrŸr)riÚpriorityrF)rkr^rUrcrdrVr7r!r+r•rIr˜rkrlršrËrur£r‡rŠrrƒ) r†r“rlrirnr”rŸrªr>r¬rprÇs rnräz RTNL_API.rule0 sé€ðL �eÒ Ø à ˜%Ñ  G¨vÒ$5؉Eà—I‘I˜g tÓ,ˆEä  U°%Ô 8ß ‰\œ/Ó+Ó ,ß ‰\Ô+¨GÓ4Ó 5ß ‰X‹Zð ô  Ð*Ü Ð'Ü" EÐ*Ü" EÐ*Ü  &Ð)ñ  ˆ ð×/Ñ/°¸ÓE‰ˆ�ä‹hˆØ— ‘ ˜G QÓ'ˆØ %¨¢ ‘u°#ˆˆG‰ ÛMˆCØ—{‘{ 3¨Ó*ˆC�ŠHðNàˆˆG‰ ãˆCØœ+Ò%¨$×*;Ò*;ØÐ/Ñ/ØÜ—/‘/ #Ó&ˆCØ�s‰|Ñ'Ø�G‘ ×#Ñ# S¨'°#©,Ð$7Õ8ð ð×јs¨WÀÐÓFˆá ܘ%¤Ô&ä$¨U¸%Ô@ß!‘\¤/Ó"3Ó4ß!‘\Ô"3°FÓ";Ó<ß‘X“Zð ð ×&Ñ& u¨cÓ2ˆCà × Ò  e¬jÑ&8¼JÒ&Fܘ“*ˆCàˆ rpc ó”—|dk(rd|vr|}n|jdd«}tdftdfdœ}|j||«\}}t«}|j dd«|d<|j dd «|d<|j |||¬ «}|�|j ||«}|jr|tztk(s t|«}|S) z" Stats prototype. r—riNr˜)r—r˜Ú filter_maskérirrF) rkr,r•rLr˜rËr‡rŠrrƒ)r†r“rlrir”rŸrªrÇs rnÚstatszRTNL_API.stats­ sÛ€ð �vÒ  G°5Ñ$8؉Eà—I‘I˜g tÓ,ˆEô" 6Ð*Ü  %Ð(ñ ˆ ð×/Ñ/°¸ÓE‰ˆ�ä‹lˆØ"ŸY™Y }°bÓ9ˆˆMÑØŸ™ 9¨aÓ0ˆˆI‰à×јs¨WÀÐÓFˆØ Ð Ø×&Ñ& u¨cÓ2ˆCà × Ò  e¬jÑ&8¼JÒ&Fܘ“*ˆCàˆ rpr‚)é gš™™™™™É?)rrr)r)ršN)NNN)NNNN)F)Nrr)3Ú__name__Ú __module__Ú __qualname__r†r‰r•rŽr‡r—rÈrÌrÏrÑr¶r²rr´ràr³r¸rµÚ staticmethodrñrôrørûrÿrrrr!r,r7r9Ú DEFAULT_TABLEr@rDrHrJrLrYr]r·rÝrÕrârˆrçrär²Ú __classcell__)r‹s@rnr~r~†sNø„ñ#ôJ 3ò Lò ò"BóL8"ót$óT ;ó <ó;ò ò&ð>%.°TóGð8"+ó=ð(¨tóFð: )°ó  óKð:ñóðð ñóððñóðóEò:ò0ò &òPò óó60ódMð6)2¸óBó&òB òò&ò6/òbo;òbh,ò\gòRCòJ oóbAOòFIòV {özrpr~có—eZdZdZy)ÚIPBatcha Netlink requests compiler. Does not send any requests, but instead stores them in the internal binary buffer. The contents of the buffer can be used to send batch requests, to test custom netlink parsers and so on. Uses `RTNL_API` and provides all the same API as normal `IPRoute` objects:: # create the batch compiler ipb = IPBatch() # compile requests into the internal buffer ipb.link("add", index=550, ifname="test", kind="dummy") ipb.link("set", index=550, state="up") ipb.addr("add", index=550, address="10.0.0.2", mask=24) # save the buffer data = ipb.batch # reset the buffer ipb.reset() ... # send the buffer IPRoute().sendto(data, (0, 0)) N©r´rµr¶r†r÷rprnr»r»Ì s „ñð2 rpr»có—eZdZdZy)ÚIPRoutezO Regular ordinary utility class, see RTNL API for the list of methods. Nr¼r÷rprnr¾r¾é ó „ñð rpr¾có—eZdZdZy)Ú RawIPRoutezx The same as `IPRoute`, but does not use the netlink proxy. Thus it can not manage e.g. tun/tap interfaces. Nr¼r÷rprnrÁrÁñ s „ñð  rprÁcó—eZdZdZy)ÚChaoticIPRoutezL IPRoute interface for chaotic tests - raising exceptions randomly. Nr¼r÷rprnrÃrÃú r¿rprÃ)�ÚloggingrérÀr~Ú functoolsrÚ itertoolsrÚsocketrrrÚpyroute2rÚpyroute2.commonr r Úpyroute2.configr Ú pyroute2.labr Úpyroute2.netlinkr rrrrrrrrrrÚpyroute2.netlink.exceptionsrrrÚpyroute2.netlink.rtnlrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHÚpyroute2.netlink.rtnl.fibmsgrIÚpyroute2.netlink.rtnl.ifaddrmsgrJÚpyroute2.netlink.rtnl.ifinfmsgrKÚ pyroute2.netlink.rtnl.ifstatsmsgrLÚpyroute2.netlink.rtnl.iprsocketrMrNrOÚpyroute2.netlink.rtnl.ndtmsgrPÚpyroute2.netlink.rtnl.nsidmsgrQÚpyroute2.netlink.rtnl.nsinfmsgrRÚ pyroute2.netlink.rtnl.riprsocketrSÚpyroute2.netlink.rtnl.rtmsgrTÚpyroute2.netlink.rtnl.tcmsgrUr�rVÚpyroute2.requests.addressrWrXÚpyroute2.requests.bridgerYrZr[Úpyroute2.requests.linkr\r]Úpyroute2.requests.mainr^Úpyroute2.requests.neighbourr_r`Úpyroute2.requests.routerarbÚpyroute2.requests.rulercrdÚparsersrfr¸Ú getLoggerr´Úlogror|r~r»r¾rÁrÃr÷rprnÚräsDðãÛ Û ÛÝÝß/Ñ/åß/Ý%Ý ÷ ÷ ÷ ñ ÷ñ÷ /÷/÷/÷/÷/÷/÷/÷/÷/÷/÷/÷/õ`0Ý5Ý3Ý7÷ñõ 0Ý1Ý3Ý9Ý-Ý=Ý-ßN÷ñ÷ FÝ3÷÷IßEå#à€ Ø€g×Ò˜Ó!€ò ò÷A%ñA%ôLJ ˆh˜ ô ô: ˆg�x ô ô �˜<ô ô �XÐ/õ rp