Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
rude
rude
Commits
61a479e5
Commit
61a479e5
authored
Jan 13, 2015
by
yorn
Browse files
Use fixed-length types for shared structs
This should allow for compatibility between 32-bit and 64-bit hosts.
parent
81bb34b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/rude.h
View file @
61a479e5
...
...
@@ -26,6 +26,7 @@
#include <netinet/in.h>
/* for struct sockaddr_in */
#include <sys/time.h>
/* for struct timeval */
#include <stdint.h>
#define DNMAXLEN 128
#define TMAXLEN 32
...
...
@@ -34,7 +35,7 @@
#define PMAXSIZE 32768
/* Maximum accepted UDP-data field/packet size */
#define MINDURAT 0.001
/* Minimum allowed flow duration in seconds (float) */
#define VERSION "0.8"
#define VERSION "0.8
.3
"
/*
* Enumeration definition for different (known) flow types
...
...
@@ -85,8 +86,8 @@ struct flow_cfg {
int
send_sock
;
/* Socket to be used by this flow */
long
in
t
flow_id
;
/* Flow IDENTIFICATION number */
u
nsigned
short
flow_sport
;
/* Flow SOURCE PORT number */
uint32_
t
flow_id
;
/* Flow IDENTIFICATION number */
u
int16_t
flow_sport
;
/* Flow SOURCE PORT number */
struct
timeval
flow_start
;
/* Absolute flow cmd START TIME */
struct
timeval
flow_stop
;
/* Absolute flow cmd END TIME */
struct
timeval
next_tx
;
/* Absolute next packet TX TIME */
...
...
@@ -112,10 +113,10 @@ struct flow_cfg {
* Wrapper structure that helps filling the "header" to the buffer
*/
struct
udp_data
{
u
nsigned
long
sequence_number
;
u
nsigned
long
tx_time_seconds
;
u
nsigned
long
tx_time_useconds
;
u
nsigned
long
flow_id
;
u
int32_t
sequence_number
;
u
int32_t
tx_time_seconds
;
u
int32_t
tx_time_useconds
;
u
int32_t
flow_id
;
struct
sockaddr_storage
dest_addr
;
}
__attribute__
((
packed
));
...
...
@@ -124,13 +125,13 @@ struct udp_data{
* Structure used by the CRUDE
*/
struct
crude_struct
{
u
nsigned
long
rx_time_seconds
;
u
nsigned
long
rx_time_useconds
;
u
int32_t
rx_time_seconds
;
u
int32_t
rx_time_useconds
;
//struct in6_addr src_addr;
long
pkt_size
;
uint32_t
pkt_size
;
struct
sockaddr_storage
src
;
//unsigned short src_port;
u
nsigned
shor
t
dest_port
;
u
int16_
t
dest_port
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment