File: //lib/python2.7/site-packages/azurelinuxagent/common/utils/networkutil.pyc
�
d�bc @ s� d d l m Z d d l m Z d d l m Z d e f d � � YZ d d
d � � YZ d e f d � � YZ d
e f d � � YZ
d S( i����( t ustr( t shellutil( t CommandErrort
RouteEntryc B s\ e Z d Z d � Z e d � � Z d � Z d � Z d � Z d � Z d � Z
d � Z RS( s�
Represents a single route. The destination, gateway, and mask members are hex representations of the IPv4 address in
network byte order.
c C sI | | _ | | _ | | _ | | _ t | d � | _ t | � | _ d S( Ni ( t interfacet destinationt gatewayt maskt intt flagst metric( t selfR R R R R R
( ( sL /usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/networkutil.pyt __init__ s c C sx t | � d k r! t d � � n g } xA t d d d � D]- } | j t t | | | d !d � � � q: Wd j | � S( Ni s5 String to dotted quad conversion must be 8 charactersi i����i i t .( t lent Exceptiont ranget appendt strR t join( t valuet octetst idx( ( sL /usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/networkutil.pyt _net_hex_to_dotted_quad% s +c C s | j | j � S( N( R R ( R ( ( sL /usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/networkutil.pyt destination_quad. s c C s | j | j � S( N( R R ( R ( ( sL /usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/networkutil.pyt gateway_quad1 s c C s | j | j � S( N( R R ( R ( ( sL /usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/networkutil.pyt mask_quad4 s c C s= d } | j | j | j � | j � | j � | j | j � S( Nso {{"Iface": "{0}", "Destination": "{1}", "Gateway": "{2}", "Mask": "{3}", "Flags": "{4:#06x}", "Metric": "{5}"}}( t formatR R R R R R
( R t f( ( sL /usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/networkutil.pyt to_json7 s 'c C s= d } | j | j | j � | j � | j � | j | j � S( NsN Iface: {0} Destination: {1} Gateway: {2} Mask: {3} Flags: {4:#06x} Metric: {5}( R R R R R R R
( R R ( ( sL /usr/lib/python2.7/site-packages/azurelinuxagent/common/utils/networkutil.pyt __str__<