~ubuntu-branches/ubuntu/precise/tcpdump/precise-updates

« back to all changes in this revision

Viewing changes to addrtoname.c

  • Committer: Package Import Robot
  • Author(s): Stéphane Graber
  • Date: 2012-01-04 10:33:48 UTC
  • mfrom: (7.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20120104103348-6i4d0riwu9laykex
Tags: 4.2.1-1ubuntu1
* Resynchronise with Debian.  Remaining changes (LP: #892285):
  - Add enforcing AppArmor profile.
* Refreshed manpage patch to apply to new upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
508
508
}
509
509
 
510
510
const char *
 
511
le64addr_string(const u_char *ep)
 
512
{
 
513
        const unsigned int len = 8;
 
514
        register u_int i;
 
515
        register char *cp;
 
516
        register struct enamemem *tp;
 
517
        char buf[BUFSIZE];
 
518
 
 
519
        tp = lookup_bytestring(ep, len);
 
520
        if (tp->e_name)
 
521
                return (tp->e_name);
 
522
 
 
523
        cp = buf;
 
524
        for (i = len; i > 0 ; --i) {
 
525
                *cp++ = hex[*(ep + i - 1) >> 4];
 
526
                *cp++ = hex[*(ep + i - 1) & 0xf];
 
527
                *cp++ = ':';
 
528
        }
 
529
        cp --;
 
530
 
 
531
        *cp = '\0';
 
532
 
 
533
        tp->e_name = strdup(buf);
 
534
 
 
535
        return (tp->e_name);
 
536
}
 
537
 
 
538
const char *
511
539
linkaddr_string(const u_char *ep, const unsigned int type, const unsigned int len)
512
540
{
513
541
        register u_int i;