3 #include <netinet/in.h>
7 static __inline__ int do_digit(char *str, u_int32_t addr, u_int32_t scale, size_t *pos, size_t len)
9 u_int32_t tmp = addr >> (scale * 4);
16 *str = tmp + 'A' - 10;
24 static const char *ipx_ntop1(const struct ipx_addr *addr, char *str, size_t len)
32 for(i = 7; i >= 0; i--)
33 if (do_digit(str + pos, ntohl(addr->ipx_net), i, &pos, len))
42 for(i = 0; i < 6; i++) {
43 if (do_digit(str + pos, addr->ipx_node[i], 1, &pos, len))
45 if (do_digit(str + pos, addr->ipx_node[i], 0, &pos, len))
58 const char *ipx_ntop(int af, const void *addr, char *str, size_t len)
63 return ipx_ntop1((struct ipx_addr *)addr, str, len);