projects
/
l2tpns.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Session group update rate calculation
[l2tpns.git]
/
util.c
diff --git
a/util.c
b/util.c
index
7237c08
..
65f8dc3
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-1,7
+1,5
@@
/* Misc util functions */
/* Misc util functions */
-char const *cvs_id_util = "$Id: util.c,v 1.14 2006-04-05 01:45:57 bodea Exp $";
-
#include <unistd.h>
#include <errno.h>
#include <sched.h>
#include <unistd.h>
#include <errno.h>
#include <sched.h>
@@
-10,6
+8,7
@@
char const *cvs_id_util = "$Id: util.c,v 1.14 2006-04-05 01:45:57 bodea Exp $";
#include <arpa/inet.h>
#include <string.h>
#include <sys/mman.h>
#include <arpa/inet.h>
#include <string.h>
#include <sys/mman.h>
+#include <linux/rtnetlink.h>
#include "l2tpns.h"
#ifdef BGP
#include "l2tpns.h"
#ifdef BGP
@@
-30,6
+29,17
@@
char *fmtaddr(in_addr_t addr, int n)
return strcpy(addrs[n], inet_ntoa(in));
}
return strcpy(addrs[n], inet_ntoa(in));
}
+char *fmtMacAddr(uint8_t *pMacAddr)
+{
+ static char strMAC[2*ETH_ALEN];
+
+ sprintf(strMAC, "%02X:%02X:%02X:%02X:%02X:%02X",
+ pMacAddr[0], pMacAddr[1], pMacAddr[2],
+ pMacAddr[3], pMacAddr[4], pMacAddr[5]);
+
+ return strMAC;
+}
+
void *shared_malloc(unsigned int size)
{
void * p;
void *shared_malloc(unsigned int size)
{
void * p;
@@
-81,8
+91,6
@@
pid_t fork_and_close()
if (controlfd != -1) close(controlfd);
if (daefd != -1) close(daefd);
if (snoopfd != -1) close(snoopfd);
if (controlfd != -1) close(controlfd);
if (daefd != -1) close(daefd);
if (snoopfd != -1) close(snoopfd);
- if (ifrfd != -1) close(ifrfd);
- if (ifr6fd != -1) close(ifr6fd);
if (rand_fd != -1) close(rand_fd);
if (epollfd != -1) close(epollfd);
if (rand_fd != -1) close(rand_fd);
if (epollfd != -1) close(epollfd);