/* Dirty test prog for %pI6 formatting */ /* Compile with: cc -o test test.c lib/vsprintf.o lib/ctype.o */ #include extern int printf(const char *fmt, ...); extern int sprintf(char * buf, const char *fmt, ...); const char hex_asc[] = "0123456789abcdef"; sprint_symbol(void) { return 0; } kallsyms_lookup(void) { return 0; } warn_slowpath_null(void) { return 0;} void dotest(void *addr) { char res[500], res2[500]; inet_ntop(AF_INET6, addr, res2, 500); sprintf(res, "%pi6 %pI6", addr, addr); printf("%s %s\n", res, res2); } main() { unsigned int addr[8]; int i; for(i=0;i<8;i++) addr[i]=0; dotest(addr); addr[3]=htonl(0x100); dotest(addr); addr[3]=htonl(0x10000); dotest(addr); addr[0]=htonl(0x20010db8); addr[1]=htonl(0x234); dotest(addr); addr[0]=htonl(0x20010000); dotest(addr); addr[3]=htonl(0xa); dotest(addr); }