Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
1b5f187c
Commit
1b5f187c
authored
Mar 28, 2006
by
Jonathon Duerig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some logging to help with debugging. This logs the packet-buffer details.
parent
69b90e79
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
27 deletions
+48
-27
pelab/monitor/ip-mapping.txt
pelab/monitor/ip-mapping.txt
+1
-2
pelab/reset.sh
pelab/reset.sh
+6
-6
pelab/stub/log.c
pelab/stub/log.c
+4
-0
pelab/stub/log.h
pelab/stub/log.h
+15
-12
pelab/stub/stubd.c
pelab/stub/stubd.c
+22
-7
No files found.
pelab/monitor/ip-mapping.txt
View file @
1b5f187c
10.0.0.1 10.1.0.1 elabc-elab0
10.0.0.2 10.1.0.2 elabc-elab1
10.0.0.3 10.1.0.3 elabc-elab2
10.0.0.2 10.4.0.1 elabc-elab1
pelab/reset.sh
View file @
1b5f187c
...
...
@@ -4,9 +4,9 @@
/usr/testbed/bin/tevc
-e
tbres/pelab now elabc-elab1 modify
dest
=
10.0.0.1
bandwidth
=
100000
/usr/testbed/bin/tevc
-e
tbres/pelab now elabc-elab0 modify
dest
=
10.0.0.2
lpr
=
0.0
/usr/testbed/bin/tevc
-e
tbres/pelab now elabc-elab1 modify
dest
=
10.0.0.1
lpr
=
0.0
/usr/testbed/bin/tevc
-e
tbres/pelab now planetc-planet0 modify
dest
=
10.1.0.2
delay
=
5
/usr/testbed/bin/tevc
-e
tbres/pelab now planetc-planet1 modify
dest
=
10.1.0.1
delay
=
5
/usr/testbed/bin/tevc
-e
tbres/pelab now planetc-planet0 modify
dest
=
10.1.0.2
bandwidth
=
10000
/usr/testbed/bin/tevc
-e
tbres/pelab now planetc-planet1 modify
dest
=
10.1.0.1
bandwidth
=
10000
/usr/testbed/bin/tevc
-e
tbres/pelab now planetc-planet0 modify
dest
=
10.1.0.2
lpr
=
0.0
/usr/testbed/bin/tevc
-e
tbres/pelab now planetc-planet1 modify
dest
=
10.1.0.1
lpr
=
0.0
#
/usr/testbed/bin/tevc -e tbres/pelab now planetc-planet0 modify dest=10.1.0.2 delay=5
#
/usr/testbed/bin/tevc -e tbres/pelab now planetc-planet1 modify dest=10.1.0.1 delay=5
#
/usr/testbed/bin/tevc -e tbres/pelab now planetc-planet0 modify dest=10.1.0.2 bandwidth=10000
#
/usr/testbed/bin/tevc -e tbres/pelab now planetc-planet1 modify dest=10.1.0.1 bandwidth=10000
#
/usr/testbed/bin/tevc -e tbres/pelab now planetc-planet0 modify dest=10.1.0.2 lpr=0.0
#
/usr/testbed/bin/tevc -e tbres/pelab now planetc-planet1 modify dest=10.1.0.1 lpr=0.0
pelab/stub/log.c
View file @
1b5f187c
...
...
@@ -74,6 +74,10 @@ static void logPrefix(int flags, struct timeval const * timestamp)
{
fprintf
(
logFile
,
"DELAY_DETAIL "
);
}
if
(
flags
&
PACKET_BUFFER_DETAIL
)
{
fprintf
(
logFile
,
"PACKET_BUFFER_DETAIL "
);
}
if
(
logTimestamp
)
{
struct
timeval
now
;
...
...
pelab/stub/log.h
View file @
1b5f187c
...
...
@@ -49,31 +49,34 @@ void logWrite(int flags, struct timeval const * timestamp,
enum
LOG_TYPE
{
// Information about control messages being sent to the monitor
CONTROL_SEND
=
0x1
,
CONTROL_SEND
=
0x1
,
// Information about control messages being received from the monitor
CONTROL_RECEIVE
=
0x2
,
CONTROL_RECEIVE
=
0x2
,
// Information about sent control messages in a format used in
// tcptrace graphs.
TCPTRACE_SEND
=
0x4
,
TCPTRACE_SEND
=
0x4
,
// Information about received control messages in a format used in
// tcptrace graphs.
TCPTRACE_RECEIVE
=
0x8
,
TCPTRACE_RECEIVE
=
0x8
,
// Information about sent packets which were sniffed by stub-pcap.
SNIFF_SEND
=
0x10
,
SNIFF_SEND
=
0x10
,
// Information about received packets which were sniffed by stub-pcap.
SNIFF_RECEIVE
=
0x20
,
SNIFF_RECEIVE
=
0x20
,
// Information about writing to peers.
PEER_WRITE
=
0x40
,
PEER_WRITE
=
0x40
,
// Information about reading from peers.
PEER_READ
=
0x80
,
PEER_READ
=
0x80
,
// Which stages are being run in the main loop.
MAIN_LOOP
=
0x100
,
MAIN_LOOP
=
0x100
,
// Database storage and reterieval
LOOKUP_DB
=
0x200
,
DELAY_DETAIL
=
0x400
,
LOOKUP_DB
=
0x200
,
// Print fine grained delay data in the log file.
DELAY_DETAIL
=
0x400
,
// Print fine grained packet-buffer control data.
PACKET_BUFFER_DETAIL
=
0x800
,
// Shortcuts for common cases.
LOG_NOTHING
=
0x00
,
LOG_EVERYTHING
=
0x
7
ff
LOG_EVERYTHING
=
0x
f
ff
};
#ifdef __cplusplus
...
...
pelab/stub/stubd.c
View file @
1b5f187c
...
...
@@ -45,6 +45,13 @@ char random_buffer[MAX_PAYLOAD_SIZE];
int
total_size
=
0
;
char
*
ipToString
(
unsigned
long
ip
)
{
struct
in_addr
address
;
address
.
s_addr
=
ip
;
return
inet_ntoa
(
address
);
}
typedef
struct
packet_buffer_node_tag
{
struct
packet_buffer_node_tag
*
next
;
...
...
@@ -116,6 +123,8 @@ void packet_buffer_add(char * buffer, int size)
packet_info
packet_buffer_front
(
void
)
{
packet_info
result
;
static
char
*
lastAddress
=
NULL
;
char
*
thisAddress
=
packet_buffer_head
->
buffer
+
packet_buffer_index
;
if
(
packet_buffer_head
==
NULL
)
{
printf
(
"packet_buffer_head == NULL in front
\n
"
);
...
...
@@ -154,6 +163,15 @@ packet_info packet_buffer_front(void)
result
.
type
=
ntohs
(
result
.
type
);
base
+=
sizeof
(
result
.
type
);
}
if
(
thisAddress
!=
lastAddress
)
{
logWrite
(
PACKET_BUFFER_DETAIL
,
NULL
,
"Looking at packet: type(%hu) value(%lu) delta(%lu) "
"source_port(%hu) dest_port(%hu) ip(%s)"
,
result
.
type
,
result
.
value
,
result
.
delta
,
result
.
source_port
,
result
.
dest_port
,
ipToString
(
result
.
ip
));
}
lastAddress
=
thisAddress
;
return
result
;
}
...
...
@@ -181,13 +199,6 @@ void packet_buffer_advance(void)
}
}
char
*
ipToString
(
unsigned
long
ip
)
{
struct
in_addr
address
;
address
.
s_addr
=
ip
;
return
inet_ntoa
(
address
);
}
void
init_random_buffer
(
void
)
{
int
i
=
0
;
...
...
@@ -1010,6 +1021,10 @@ int main(int argc, char *argv[]) {
{
logflags
=
logflags
|
DELAY_DETAIL
;
}
else
if
(
strcmp
(
optarg
,
"packet-buffer-detail"
)
==
0
)
{
logflags
=
logflags
|
PACKET_BUFFER_DETAIL
;
}
else
{
fprintf
(
stderr
,
"Unknown logging option %s
\n
"
,
optarg
);
...
...
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