
	BEGIN { FS="";ORS=""; d=1}
	
{
#Extract time information

if ($1$2$3$4 ~/TIME/)
	{

	if (s==0)
		{
		t = "20"$13$14" "$7$8" "$10$11" "$16$17" "$19$20" "$22$23
		ref_time = mktime(t)
		s=1
		time_diff= ref_time-ref_time
		}
	else
	{
		dt = "20"$13$14" "$7$8" "$10$11" "$16$17" "$19$20" "$22$23
		now_time=mktime(dt)
		time_diff = now_time-ref_time
	}
		#print time_diff
	}

# Extract source address 

		if ($1$2$3$4$5 ~/FROM:/)
		{
			
			
			i = 6;
			while ($i !~/A/)
			{
				if ($i !~/ /)
				a[i]= $i;
				
				else
				a[i] = ""
				
				i++
			

			}

#Verify all other data is cleared out

			for (j=i;j<50;j++)
			{
				a[j]= ""
			}

		}

#Extract destination address 

		if ($1$2$3 ~/TO:/)
		{
			d=1
			m=5;
			while ($m !~/A/)
			{
				if ($m !~/ /)1
				b[m]=$m;
				m++
			}

		}
#Define new line variable 

		c= "\n"

#Extract protocol message type

		if ($1$2$3$4 ~/TYPE/)
		{
			g = $7$8$9
		}

		if ($1$2$3$4$5$6 ~/ASPATH/)
		{
			d=21
			u=10
			while ($u !~/ /)
			{
				if ($u !~/ /)1
				f[u] = $u;
				u++
			}	
	}

# Extract protocol type

			if ($11 ~/P/)
		{
				p= $9$10$11
		}

#Print all information i.e Time, Source, Destination, Protocol, Length of packet

		if (d !=1)
		{
		print time_diff" "
			for (i=6;i<50;i++)
			{
				if (a[i] !~/""/)
				print a[i]
				
			}
#Print Source address
			for (i=6;i<50;i++)
			{
				a[i] = ""
			}
			print " "
#Print destination address

			for (m=5;m<40;m++)
			{
				if ($m$(m+1) ~/::/)
				{
					if ($m$(m+1)$(m+2) ~/::[0-z]/)
					print "::"
					else
					print "0::0"
				}
				else if ($(m-1)$m !~/::/)
				{
					if (b[i] !~/""/ && b[i] !~/ /)
					print b[m]
					else
					l=0
				}
			}
			for (m=5;m<40;m++)
			{
				b[m] = ""
			}
#Print Message type
			print g,""
#Print length of packet

			for (u=10;u<20;u++)
			{
				if (f[u] !~/""/)
				print f[u]
			}
			for (u=10;u<20;u++)
			{
			b[u] = ""
			}
			print c
			d=1
			}

}


		
		
