mirror of
https://github.com/nmap/nmap.git
synced 2026-01-01 12:29:03 +00:00
Merge 30432:30436 from /nmap-exp/david/ipv6-ranges.
This is simple IPv6 unicast ranges. For example, nmap -6 en.wikipedia.org/120 -sn The other, more complicated part of this overall change is automatic multicast scanning of large local subnets. That part isn't done yet.
This commit is contained in:
@@ -93,6 +93,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include "nbase.h"
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
@@ -164,6 +165,18 @@ int Snprintf(char *s, size_t n, const char *fmt, ...)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Make a new allocated null-terminated string from the bytes [start, end). */
|
||||
char *mkstr(const char *start, const char *end) {
|
||||
char *s;
|
||||
|
||||
assert(end >= start);
|
||||
s = (char *) safe_malloc(end - start + 1);
|
||||
memcpy(s, start, end - start);
|
||||
s[end - start] = '\0';
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
/* vsprintf into a dynamically allocated buffer, similar to asprintf in
|
||||
Glibc. Return the length of the buffer or -1 on error. */
|
||||
int alloc_vsprintf(char **strp, const char *fmt, va_list va) {
|
||||
|
||||
Reference in New Issue
Block a user