summaryrefslogtreecommitdiff
path: root/staging/mz.h
diff options
context:
space:
mode:
authorMatteo Croce <mcroce@redhat.com>2018-08-21 16:38:09 +0200
committerTobias Klauser <tklauser@distanz.ch>2018-08-22 10:21:37 +0200
commitc7c176394ad2b87f56b0aed2731eb9dde29750f0 (patch)
tree1c423f98bc7ac52feb134044efeed38ccc6d0507 /staging/mz.h
parent01f339a7bb170310f9dd6a389d9c89b6c62032d0 (diff)
mausezahn: improve random mac address generation
Modify -b option to generate all random MAC addresses. Improve the random generation algorithm, use nrand48() which fills the ethernet address in two calls instead of six calls to rand() and six floating point calculations. Set the locally administered bit of generated MAC addresses. Signed-off-by: Matteo Croce <mcroce@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'staging/mz.h')
-rw-r--r--staging/mz.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/staging/mz.h b/staging/mz.h
index aa2c36f..6d98ad0 100644
--- a/staging/mz.h
+++ b/staging/mz.h
@@ -726,10 +726,10 @@ int get_mpls_params(char *params);
int exists(char* str, char* ch);
-// Applies another random Ethernet source address to a given Ethernet-PTAG.
-// (The calling function should check 'tx.eth_src_rand' whether the SA
+// Applies another random address to a given buffer.
+// (The calling function should check 'tx.eth_(dst|src)_rand' whether the address
// should be randomized.)
-int update_Eth_SA(libnet_t *l, libnet_ptag_t t);
+void rand_addr(u_int8_t *addr);
// Update timestamp and sequence number in the RTP header.