Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
常顺宇
OpenXG-RAN
Commits
0b7d2420
Commit
0b7d2420
authored
Jun 05, 2016
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enb.c stays alive if tracee dies
enb.c will then try to reconnect.
parent
88c44ef9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
common/utils/T/tracer/config.c
common/utils/T/tracer/config.c
+7
-0
common/utils/T/tracer/config.h
common/utils/T/tracer/config.h
+1
-0
common/utils/T/tracer/enb.c
common/utils/T/tracer/enb.c
+11
-2
No files found.
common/utils/T/tracer/config.c
View file @
0b7d2420
...
...
@@ -17,6 +17,13 @@ static char *PUT(char *to, int tosize, char c)
return
to
;
}
void
clear_remote_config
(
void
)
{
free
(
remote
);
remote
=
NULL
;
remote_size
=
0
;
}
void
append_received_config_chunk
(
char
*
buf
,
int
length
)
{
int
buflen
=
*
(
int
*
)
buf
;
...
...
common/utils/T/tracer/config.h
View file @
0b7d2420
#ifndef _CONFIG_H_
#define _CONFIG_H_
void
clear_remote_config
(
void
);
void
append_received_config_chunk
(
char
*
buf
,
int
length
);
void
load_config_file
(
char
*
filename
);
void
verify_config
(
void
);
...
...
common/utils/T/tracer/enb.c
View file @
0b7d2420
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
#include <signal.h>
#include "database.h"
...
...
@@ -43,10 +44,16 @@ void is_on_changed(void *_d)
if
(
socket_send
(
d
->
socket
,
&
t
,
1
)
==
-
1
||
socket_send
(
d
->
socket
,
&
d
->
nevents
,
sizeof
(
int
))
==
-
1
||
socket_send
(
d
->
socket
,
d
->
is_on
,
d
->
nevents
*
sizeof
(
int
))
==
-
1
)
abort
()
;
goto
connection_dies
;
no_connection:
if
(
pthread_mutex_unlock
(
&
d
->
lock
))
abort
();
return
;
connection_dies:
close
(
d
->
socket
);
d
->
socket
=
-
1
;
if
(
pthread_mutex_unlock
(
&
d
->
lock
))
abort
();
}
void
usage
(
void
)
...
...
@@ -380,6 +387,8 @@ int main(int n, char **v)
if
(
pthread_mutex_init
(
&
enb_data
.
lock
,
NULL
))
abort
();
setup_event_selector
(
g
,
database
,
is_on
,
is_on_changed
,
&
enb_data
);
restart:
clear_remote_config
();
enb_data
.
socket
=
connect_to
(
ip
,
port
);
/* send the first message - activate selected traces */
...
...
@@ -390,7 +399,7 @@ int main(int n, char **v)
char
v
[
T_BUFFER_MAX
];
event
e
;
e
=
get_event
(
enb_data
.
socket
,
v
,
database
);
if
(
e
.
type
==
-
1
)
abort
()
;
if
(
e
.
type
==
-
1
)
goto
restart
;
handle_event
(
h
,
e
);
}
...
...
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