Changeset bb5b4048 in rtems


Ignore:
Timestamp:
Oct 25, 2004, 1:50:39 PM (16 years ago)
Author:
Eric Norum <WENorum@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
4db99d8a
Parents:
c4b0c2c1
Message:

Install working version of ether_sprintf().

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/ChangeLog

    rc4b0c2c1 rbb5b4048  
     12004-10-25      Eric Norum <norume@aps.anl.gov>
     2
     3        * libchip/network/i82586.c: ether_sprintf() is part of networking library.
     4
    152004-10-22      Ralf Corsepius <ralf_corsepius@rtems.org>
    26
  • c/src/libchip/network/i82586.c

    rc4b0c2c1 rbb5b4048  
    261261
    262262  *b = '\0';
    263   return buf;
    264 }
    265 
    266 char *ether_sprintf(unsigned char *addr)
    267 {
    268   static char buf[32];
    269   char *b = buf;
    270   int i;
    271 
    272   for (i = 0; i < ETHER_ADDR_LEN; i++)
    273   {
    274     sprintf(b, "%02x:", *addr++);
    275     b += 3;
    276   }
    277   b--;
    278   b = "\0";
    279263  return buf;
    280264}
  • cpukit/ChangeLog

    rc4b0c2c1 rbb5b4048  
     12004-10-25      Eric Norum <norume@aps.anl.gov>
     2
     3        * libnetworking/net/if_ethersubr.c: Working version of ether_sprintf().
     4
    152004-10-22      Ralf Corsepius <ralf_corsepius@rtems.org>
    26
  • cpukit/libnetworking/net/if_ethersubr.c

    rc4b0c2c1 rbb5b4048  
    513513/*
    514514 * Convert Ethernet address to printable (loggable) representation.
    515  * This routine is for compatibility; it's better to just use
    516  *
    517  *      printf("%6D", <pointer to address>, ":");
    518  *
    519  * since there's no static buffer involved.
     515 * The static buffer isn't a really huge problem since this code
     516 * is protected by the RTEMS network mutex.
    520517 */
    521518char *
    522 ether_sprintf(const u_char *ap)
    523 {
    524         static char etherbuf[18];
    525         snprintf(etherbuf, sizeof (etherbuf), "%6D", ap, ":");
    526         return (etherbuf);
     519ether_sprintf(const u_int8_t *addr)
     520{
     521        static char buf[32];
     522        char *b = buf;
     523        int i;
     524
     525        for (i = 0; i < ETHER_ADDR_LEN; i++, b+=3)
     526                sprintf(b, "%02x:", *addr++);
     527        *--b = '\0';
     528        return buf;
    527529}
    528530
Note: See TracChangeset for help on using the changeset viewer.