diff options
author | jardin <jardin> | 2003-12-23 08:56:18 +0000 |
---|---|---|
committer | jardin <jardin> | 2003-12-23 08:56:18 +0000 |
commit | accc3fe2638b3d69e6561171f2dd99f1afd83cf8 (patch) | |
tree | ca748729716d0511cdf96bb3fb48ce02a8b43586 /isisd/isis_misc.c | |
parent | 07ce4061d272721d5b5bb15869150a159d34a7d8 (diff) | |
download | quagga-accc3fe2638b3d69e6561171f2dd99f1afd83cf8.tar.bz2 quagga-accc3fe2638b3d69e6561171f2dd99f1afd83cf8.tar.xz |
Merge isisd into the Quagga's framework:
- add privs support
- use misc quagga's definitions
- make it compile"able"
- fix segfault cases related to hostname()
- add debug isis xxx command
This patch has been approved by Paul Jakma.
Diffstat (limited to 'isisd/isis_misc.c')
-rw-r--r-- | isisd/isis_misc.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/isisd/isis_misc.c b/isisd/isis_misc.c index 763ae243..cf558e83 100644 --- a/isisd/isis_misc.c +++ b/isisd/isis_misc.c @@ -28,12 +28,13 @@ #include <ctype.h> #include <zebra.h> #include <net/ethernet.h> - +#include <sys/utsname.h> #include "stream.h" #include "vty.h" #include "hash.h" #include "if.h" +#include "command.h" #include "isisd/dict.h" #include "isisd/isis_constants.h" @@ -432,7 +433,22 @@ newprefix2inaddr (u_char *prefix_start, u_char prefix_masklen) return new_prefix; } +/* + * Returns host.name if any, otherwise + * it returns the system hostname. + */ +const char * +unix_hostname(void) +{ + static struct utsname names; + const char *hostname; + extern struct host host; + + hostname = host.name; + if (!hostname) { + uname(&names); + hostname = names.nodename; + } - - - + return hostname; +} |