
Kc           @   s   d  d k  Z  d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Td d d     YZ	 d S(   iN(   t   *t   streamExtractorc           B   s   e  Z d    Z RS(   c         C   s@  d  | j o t Sg  } g  } d } t |  } d } x| t |  j  o| | } y| t t t i | j o| t t i }	 | t t i	 }
 | t t t i
 } | t t t i } | | j o | i |  n | d } t xt o	| t |  j  o | d } y | | } | t t i } | t t i	 } | t t t i
 } | t t t i } |	 | j o' |
 | j o | | j o | | j p4 |	 | j o8 |
 | j o+ | | j o | | j o | i |  n | d } PWq q Xq W| i |  g  } n | d } Wq9 | d } q9 Xq9 W| S(   Ni   i    i   (   t   Nonet   Falset   rdpcapt   lent   Ethert   IPt   TCPt   flagst   srct   dstt   sportt   dportt   appendt   nextt   True(   t   selft
   inFileNamet   portt   streamst
   packetListt   synFlagt   packetst   indext   packetR
   t   destR   R   t   npackett   nsrct   ndestt   nsportt   ndport(    (    sI   /data/558/contest/contest02/submissions/Serge_Gorbunov/streamExtractor.pyt   extractStreams&   sX     

 

44
	


	(   t   __name__t
   __module__R    (    (    (    sI   /data/558/contest/contest02/submissions/Serge_Gorbunov/streamExtractor.pyR      s   (    (
   t   syst   getoptt   urlparset   stringt   ret   ost   tempfilet   base64t	   scapy.allR   (    (    (    sI   /data/558/contest/contest02/submissions/Serge_Gorbunov/streamExtractor.pyt   <module>   s   0$

