frag3.c revision 5e1b1363249699753bf8706d5593bbb9ebb189dd
1f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu 2f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liuextern const struct SLInterfaceID_ SL_IID_array[MPH_MAX]; 3f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liuextern const char * const interface_names[MPH_MAX]; 4f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu 5f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liuint main(int argc, char **argv) 6f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu{ 7f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu int i; 8323480423219ecd77329f8326dc5e0e3b50926d4Torne (Richard Coles) for (i = 0; i <= MAX_HASH_VALUE; ++i) { 9323480423219ecd77329f8326dc5e0e3b50926d4Torne (Richard Coles) const char *x = wordlist[i]; 10f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu if (!x) { 11f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu printf(" -1"); 12f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu } else { 13f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu const struct SLInterfaceID_ *xx = SL_IID_array; 14f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu unsigned MPH; 15323480423219ecd77329f8326dc5e0e3b50926d4Torne (Richard Coles) for (MPH = 0; MPH < MPH_MAX; ++MPH, ++xx) { 16f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu if (!memcmp(x, xx, 16)) { 17f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) printf(" MPH_%s", interface_names[MPH]); 18f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu goto out; 19f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu } 20f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu } 21f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu printf(" (-1)"); 22f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liuout: 23f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu ; 24f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu } 25f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu if (i < MAX_HASH_VALUE) 26f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu printf(","); 27f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu printf("\n"); 28f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu } 29f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu return EXIT_SUCCESS; 30f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu} 31323480423219ecd77329f8326dc5e0e3b50926d4Torne (Richard Coles)