Hello. In article <[EMAIL PROTECTED]> (at Sat, 17 Nov 2007 02:34:50 +0900), [EMAIL PROTECTED] says:
> + *cp++ = '\0'; > + count = sscanf(cp, > + NIP6_FMT "-" NIP6_FMT, > + &min[0], &min[1], &min[2], &min[3], > + &min[4], &min[5], &min[6], &min[7], > + &max[0], &max[1], &max[2], &max[3], > + &max[4], &max[5], &max[6], &max[7]); > + I think you can use in6_pton() here. > + count = sscanf(cp, > + NIPQUAD_FMT "-" NIPQUAD_FMT, > + &min[0], &min[1], > + &min[2], &min[3], > + &max[0], &max[1], > + &max[2], &max[3]); > + in4_pton(). > + > +/** > + * tmy_print_ipv6 - print ipv6 address > + * @buffer: pointer to buffer to save the result. > + * @buffer_len: sizeof @buffer . > + * @ip: pointer to an IPv6 address in network byte order. > + * > + * Returns @buffer . > + */ > +char *tmy_print_ipv6(char *buffer, const int buffer_len, const u16 *ip) > +{ > + memset(buffer, 0, buffer_len); > + snprintf(buffer, buffer_len - 1, NIP6_FMT, > + ntohs(ip[0]), ntohs(ip[1]), ntohs(ip[2]), ntohs(ip[3]), > + ntohs(ip[4]), ntohs(ip[5]), ntohs(ip[6]), ntohs(ip[7])); > + return buffer; > +} > + snprintf(buffer, buffer_len - 1, NIP6_FMT, NIP6(*(struct in6_addr *)ip)); > + count = sscanf(cp2, > + NIP6_FMT "-" NIP6_FMT, > + &min[0], &min[1], &min[2], &min[3], > + &min[4], &min[5], &min[6], &min[7], > + &max[0], &max[1], &max[2], &max[3], > + &max[4], &max[5], &max[6], &max[7]); > + again, in6_pton(). > + count = sscanf(cp2, > + NIPQUAD_FMT "-" NIPQUAD_FMT, > + &min[0], &min[1], &min[2], &min[3], > + &max[0], &max[1], &max[2], &max[3]); > + in4_pton(). --yoshfuji - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/