Advertisement
sanpai

Strtok

Jul 30th, 2013
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3.  
  4. const char *OIDStr[] = {"2.", "4.", "9.", "11.", "23.", "35.", "36.", "42.", "63.", "77.", "94.", "99.", "186.", "207.", "224.", "232.", "255.", "311.", "318.", "334.", "343.", "351.", "353.", "412.", "476.", "534.", "674.", "710.", "726.", "789.", "795.", "1123.", "1302.", "1570.", "1869.", "1916.", "1991.", "2021.", "2252.", "2467.", "2591.", "2620.", "2636.", "2793.", "2947.", "3076.", "3183.", "3309.", "3317.", "3375.", "3417.", "3530.", "3582.", "3607.", "3727.", "3955.", "4289.", "4355.", "4413.", "5491.", "5528.", "5678.", "6876.", "7185.", "7505.", "8072.", "8673.", "8741.", "9600.", "11898.", "12394.", "14748.", "17471.", "\0"};
  5. const wchar_t *VendorStr[] = {L"IBM", L"UNIX", L"CISCO", L"HP", L"Novell", L"Nortel", L"DEC", L"SUN Microsystems", L"Apple", L"LAN Manager", L"Nokia", L"SNMP Research", L"Toshiba", L"Allied Telesync", L"LAN Optics", L"Compaq", L"Compatible", L"Microsoft", L"APC", L"Lotus", L"Intel", L"Stratacom", L"Atm Forum", L"DMTF", L"EMERSON", L"Powerware", L"Dell .Inc", L"Breezecom", L"Castelle", L"Netapp", L"Adaptec", L"Symbios", L"Veritas Software", L"Cisco Telesend", L"Synchronous", L"Extreme Networks", L"Foundry", L"Ucdavis", L"Wheelgroup", L"Arrowpoint", L"Radyne", L"Checkpoint", L"Juniper", L"Interintelli", L"BestPower", L"Altigaroot", L"Wiredformgmt", L"Nomadix", L"Gnome.", L"F5", L"Bluecoat", L"RIM", L"AMI", L"Cerent", L"Westren Multiplex", L"Linksys", L"Vbrick", L"Raphidstream", L"Broadcom", L"UPS-Man", L"NetBoltz", L"StalkerMIB", L"VMware", L"Lattitude comm", L"Calista", L"Netsnmp", L"Borderware", L"Sonicwall", L"Wtcs", L"Agere", L"Alvarion", L"Computer Support Systems", L"Actona", L"\0"};
  6.  
  7. int main()
  8. {
  9. char str[]=".iso.org.dod.internet.private.enterprise.9.4.1.";
  10.  
  11. char *ptr;
  12. char str1[10];
  13. memset(str1,0,10);
  14.  
  15. int i=0;
  16. ptr=strtok(str,".");
  17.  
  18. while(ptr!=NULL)
  19. {
  20.  
  21. ptr=strtok(NULL,".");
  22. ++i;
  23. if(i==6){
  24. strcpy_s(str1,ptr);
  25. strcat_s(str1,".");
  26.  
  27. break;
  28. }
  29. }
  30.  
  31. i=0;
  32. while((_stricmp(OIDStr[i],(char *)"\0")!=0)){
  33.  
  34. if(_stricmp(str1,OIDStr[i])==0)
  35. {
  36. wprintf(L"%ls",VendorStr[i]);
  37. break;
  38. }
  39.  
  40. i++;
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement