MAC vendor lookup: Difference between revisions
Content added Content deleted
(Added C implementation.) |
|||
Line 82: | Line 82: | ||
sprintf(str,"http://api.macvendors.com/%s",argV[1]); |
sprintf(str,"http://api.macvendors.com/%s",argV[1]); |
||
curl_easy_setopt(curl, CURLOPT_URL, str); |
curl_easy_setopt(curl, CURLOPT_URL, str); |
||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback); |
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback); |
||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk); |
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk); |
||
Line 91: | Line 91: | ||
if (res == CURLE_OK) { |
if (res == CURLE_OK) { |
||
checkResponse(chunk.memory); |
|||
return EXIT_SUCCESS; |
return EXIT_SUCCESS; |
||
} |
} |
||
Line 108: | Line 108: | ||
C:\rosettaCode>macLookUp 10-11-22-33-44-55-66 |
C:\rosettaCode>macLookUp 10-11-22-33-44-55-66 |
||
N/A |
N/A |
||
</pre> |
</pre> |
||
=={{header|C sharp|C#}}== |
=={{header|C sharp|C#}}== |
||