summaryrefslogtreecommitdiff
path: root/ucspi-tcp-0.88/socket_getifname.c
blob: 77edff94fbd60d033705215aa6141d969ed69eeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include "socket.h"

static char ifname[IFNAMSIZ];

const char* socket_getifname(uint32 interface) {
  char *tmp=if_indextoname(interface,ifname);
  if (tmp)
    return tmp;
  else
    return "[unknown]";
}