<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        color:black;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Cool script.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><a href="mailto:rchien@3ecompany.com"><span style="color:blue">Ryan Chien</span></a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Senior Network Engineer<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><a href="http://www.3ecompany.com/"><span style="color:blue">3E Company</span></a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">T: 760-602-8689<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">F: 760-918-4007<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> arin-tech-discuss-bounces@arin.net [mailto:arin-tech-discuss-bounces@arin.net]
<b>On Behalf Of </b>tarig.shoush@bt.com<br>
<b>Sent:</b> Wednesday, June 18, 2014 1:01 PM<br>
<b>To:</b> ecsd@transpacific.net; arin-tech-discuss@arin.net<br>
<b>Subject:</b> Re: [arin-tech-discuss] This is getting a little irritating ...<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Eric,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I checked with our development, the reason we are getting this is because the zone is not dynamic –not updateable- and the server is not the Master for that
 zone. Ideally we want ‘Notify’ coming only from the Master server and for dynamic zones only. As of 172.17.32.2 seems to be affected, my guess is that you took the log file before that ‘authentication’ was cached for that server/zone.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> In short this too is benign error and shall go away once we update the database.
<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Tarig Shoush<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:windowtext">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:windowtext">
<a href="mailto:arin-tech-discuss-bounces@arin.net">arin-tech-discuss-bounces@arin.net</a> [<a href="mailto:arin-tech-discuss-bounces@arin.net">mailto:arin-tech-discuss-bounces@arin.net</a>]
<b>On Behalf Of </b>Eric Dynamic<br>
<b>Sent:</b> Saturday, January 04, 2014 8:08 PM<br>
<b>To:</b> <a href="mailto:arin-tech-discuss@arin.net">arin-tech-discuss@arin.net</a><br>
<b>Subject:</b> [arin-tech-discuss] This is getting a little irritating ...<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Now after having written a script that worked
<u>marvelously</u> for at least several says, <u>all of a sudden</u> now it is failing.<br>
<br>
Why? Because once again, your service is returning <u>what it feels like</u> versus what I asked for.<br>
<br>
Here is what I got from asking for JSON:<br>
<br>
processing 204.12.8.28<br>
<br>
<tt><span style="font-size:10.0pt"><?xml version='1.0'?><?xml-stylesheet type='text/xsl' href='<a href="http://whois.arin.net/xsl/website.xsl">http://whois.arin.net/xsl/website.xsl</a>' ?><net xmlns=<a href="http://www.arin.net/whoisrws/core/v1">"http://www.arin.net/whoisrws/core/v1"</a>
 xmlns:ns2=<a href="http://www.arin.net/whoisrws/rdns/v1">"http://www.arin.net/whoisrws/rdns/v1"</a> xmlns:ns3="<a href="http://ww">http://ww</a></span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<tt>w.arin.net/whoisrws/netref/v2" termsOfUse=<a href="https://www.arin.net/whois_tou.html">"https://www.arin.net/whois_tou.html"</a>><registrationDate>2011-02-03T11:23:31-05:00</registrationDate><ref><a href="http://whois.arin.net/rest/net/NET-204-12-8-24-1">http://whois.arin.net/rest/net/NET-204-12-8-24-1</a></ref><customerRef
 name="</tt><br>
<tt>Stylelife" handle="C02687103"><a href="http://whois.arin.net/rest/customer/C02687103">http://whois.arin.net/rest/customer/C02687103</a></customerRef><endAddress>204.12.8.31</endAddress><handle>NET-204-12-8-24-1</handle><name>STYLELIFE</name><netBlocks><netBlock><cidrLength>29</ci</tt><br>
<tt>drLength><endAddress>204.12.8.31</endAddress><description>Reassigned</description><type>S</type><startAddress>204.12.8.24</startAddress></netBlock></netBlocks><originASes><originAS>AS20021</originAS></originASes><parentN</tt><br>
<tt>etRef name="HOSTMYSITE" handle="NET-204-12-0-0-1"><a href="http://whois.arin.net/rest/net/NET-204-12-0-0-1">http://whois.arin.net/rest/net/NET-204-12-0-0-1</a></parentNetRef><startAddress>204.12.8.24</startAddress><updateDate>2011-02-03T11:23:31-05:00</updateDate><version>4</versio</tt><br>
<tt>n></net></tt><br>
<tt>204.12.8.28</tt><br>
<tt> no ns4:pft</tt></span><br>
<br>
Now I am getting XML.<br>
<br>
I don't have time to keep figuring out new parsers. I already write the code for the JSON. And it was working, as I said, for several days
<b>just fine.</b><br>
Now for no reason I can see, <b>suddenly</b>, asking for JSON gives me XML. I don't feel like writing something that has to try to
<u>figure out what you actually sent versus what I requested.</u><br>
This time I request that you FIX THIS.<br>
<br>
=================<br>
<br>
<tt><span style="font-size:10.0pt">#!/usr/local/bin/php</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<tt><?php</tt><br>
<tt>// SQL #####################################################################################################################################################################################</tt><br>
<tt>function sqlerr()   //$ER_DUP_Entry=1062;</tt><br>
<tt>{ if(($e = mysql_errno()) == 1062) $h = "Duplicate Key, ignored."; else $h = mysql_error(); $h = str_replace("'","",$h); $m = "DB:$e:$h"; echo "$m\n"; }</tt><br>
<tt>function gqquery($q) { if(mysql_query("$q")) return 0; sqlerr(); return 1; }</tt><br>
<tt>function mqquery($q) { if($qr = mysql_query("$q")) return $qr; sqlerr(); return 0; }</tt><br>
<tt>function sqquery($q) { $r = false; if($qr = mqquery($q)) { $r = mysql_fetch_object($qr); if(!$r) $r = false; mysql_free_result($qr); } return($r); }</tt><br>
<tt>function attach() { global $db; $db = mysql_connect("localhost","*****","*****"); if(!$db) return(0); return(mysql_select_db("sdfilter",$db)); }</tt><br>
<tt>//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@</tt><br>
<tt>// MAIN</tt><br>
<tt>$aTZ = "America/Los_Angeles"; date_default_timezone_set($aTZ);                  // timezone (absurd format)</tt><br>
<tt>global $errno, $fh, $db; $db=0;                                                 // globals</tt><br>
<tt>error_reporting(0x1F);                                                          // complain about anything</tt><br>
<tt>$db = attach(); if(!$db) {echo("open db failed."); return(1);}                  // sordid error handling</tt><br>
<br>
<tt>$buf = "";</tt><br>
<tt>$v = array();</tt><br>
<tt>if(!($C = curl_init())) exit(0);</tt><br>
<tt>curl_setopt($C,CURLOPT_RETURNTRANSFER,true);</tt><br>
<br>
<tt>if(!($fh=fopen("php://stdin","r"))) exit(0);</tt><br>
<tt>for($line = 1;;$line++) {</tt><br>
<tt>    if(!($A = fgets($fh))) break;</tt><br>
<tt>    echo "processing $A\n";</tt><br>
<tt>    if(4 != sscanf($A,"%d.%d.%d.%d",&$n3,&$n2,&$n1,&$n0)) break;</tt><br>
<tt>    $AA = sprintf("%02X%02X%02X%02X",$n3,$n2,$n1,$n0);</tt><br>
<tt>    if($r = sqquery("select afrom,ato,contact from abuse where afrom <= '$AA' and '$AA' <= ato limit 1")) {</tt><br>
<tt>        echo "$A already found in abuse $r->afrom <= $AA <= $r->ato *$r->contact), ignoring request.\n";</tt><br>
<tt>        continue;</tt><br>
<tt>        }</tt><br>
<tt>    curl_setopt($C,CURLOPT_URL,<a href="http://whois.arin.net/rest/ip/$A/pft.json">"http://whois.arin.net/rest/ip/$A/pft.json"</a>);</tt><br>
<tt>    $pft = curl_exec($C);</tt><br>
<tt><b>echo "$pft\n";   // gives the output shown above</b></tt><br>
<tt>    for($rc = 1;;) {</tt><br>
<tt>        if(!$pft) { echo "$A: no pft\n"; break; }</tt><br>
<tt>        $Q = json_decode($pft,true); $Q = $Q["ns4:pft"]; if(!$Q) { echo "$A no ns4:pft\n"; break; }</tt><br>
<tt>        if(!isset($Q["poc"])) { echo "$A: no poc\n"; break; }</tt><br>
<tt>        if(!isset($Q["poc"][0])) { echo "$A: no poc[0]\n"; break; }</tt><br>
<tt>        $F = $Q["net"]["startAddress"]["$"]; if( 4 != sscanf($F,"%d.%d.%d.%d",&$n3,&$n2,&$n1,&$n0) ) break;</tt><br>
<tt>        $afrom = sprintf("%02X%02X%02X%02X",$n3,$n2,$n1,$n0);</tt><br>
<tt>        $T = $Q["net"]["endAddress"]["$"]; if( 4 != sscanf($T,"%d.%d.%d.%d",&$n3,&$n2,&$n1,&$n0) ) break;</tt><br>
<tt>        $ato = sprintf("%02X%02X%02X%02X",$n3,$n2,$n1,$n0);</tt><br>
<tt>        if( $afrom > $ato ) break;</tt><br>
<tt>        $n = count($Q["poc"]); $contact = "";</tt><br>
<tt>        for( $j = 0; $j < $n; $j++ ) {</tt><br>
<tt>            //echo "$A poc $j description " . $Q["poc"][$j]["@relatedDescription"] ."\n";</tt><br>
<tt>            if($Q["poc"][$j]["@relatedDescription"] == "Abuse") {</tt><br>
<tt>                $m = count($Q["poc"][$j]["emails"]["email"]);   // we either get [$] or [0]...[n] in this modern world</tt><br>
<tt>                if($m == 1) {</tt><br>
<tt>                    $contact = $Q["poc"][$j]["emails"]["email"]["$"];</tt><br>
<tt>                    //echo "single records, $contact.\n";</tt><br>
<tt>                    }</tt><br>
<tt>                else {  // save the first contact in any case and if it or a later one contains "abuse", use that.</tt><br>
<tt>                    $contact = strtolower($Q["poc"][$j]["emails"]["email"][0]);</tt><br>
<tt>                    //echo "$A multiple records, default $contact.\n";</tt><br>
<tt>                    if(strstr($contact,"abuse")) break;</tt><br>
<tt>                    else for($k=1, $x = strtolower($Q["poc"][$j]["emails"]["email"][$k]); $k<$m;$k++) if(strstr($x,"abuse")) { $contact = $x; break; }</tt><br>
<tt>                    echo "$A multiple records, using $contact.\n";</tt><br>
<tt>                    }</tt><br>
<tt>                break;</tt><br>
<tt>                }</tt><br>
<tt>            }</tt><br>
<tt>        if(!$contact || $contact == <a href="mailto:abuse@ripe.net">"abuse@ripe.net"</a> || $contact ==
<a href="mailto:abuse@arin.net">"abuse@arin.net"</a> || $contact == <a href="mailto:abuse@apnic.net">
"abuse@apnic.net"</a>) break;   // if <a href="mailto:abuse@ripe.net">abuse@ripe.net</a> e.g. then should ask RIPE.</tt><br>
<tt>        echo "RESULT:: $afrom - $ato\t$contact\n";</tt><br>
<tt>        $afrom = sprintf("%08X",$afrom); $ato = sprintf("%08X",$ato);</tt><br>
<tt>        gqquery("insert into abuse (afrom,ato,contact) values ('$afrom','$ato','$contact')");</tt><br>
<tt>        gqquery("update counts set count = count + 1 where class='database/reqfilled'");</tt><br>
<tt>        $rc = 0;</tt><br>
<tt>        break;</tt><br>
<tt>        }</tt><br>
<tt>    // we no longer insert (a,0) into abuse to remember what we want.</tt><br>
<tt>    }</tt><br>
<br>
<tt>curl_close($C);</tt><br>
<tt>//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@</tt><br>
<tt>?></tt></span><o:p></o:p></p>
</div>

<DIV><P><HR>
The information contained in this electronic mail transmission is intended only for the use of the individual or entity named above and is privileged and confidential, and contains proprietary and confidential information belonging to 3E Company and its affiliates. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Any dissemination, distribution or copying of this communication other than to the person or entity named above is strictly prohibited. If you have received this communication in error, please immediately delete it from your system.
</P></DIV>
</body>
</html>