Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NetworkManager-l2tp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
CeRiAl
NetworkManager-l2tp
Commits
eeb5396a
Commit
eeb5396a
authored
Jan 26, 2012
by
Сергей Прохоров
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some options to nm-l2tp-service (for debugging purposes)
parent
ff997946
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
8 deletions
+49
-8
AUTHORS
AUTHORS
+1
-0
nm-l2tp-service.c
src/nm-l2tp-service.c
+48
-8
No files found.
AUTHORS
View file @
eeb5396a
Alexey Torkhov <atorkhov@gmail.com>
Sergey Prokhorov <me@seriyps.ru>
Based on NetworkManager-pptp by:
Antony Mee <eemynotna@gmail.com>
...
...
src/nm-l2tp-service.c
View file @
eeb5396a
...
...
@@ -22,7 +22,12 @@
* (C) Copyright 2008 - 2009 Red Hat, Inc.
* (C) Copyright 2011 Alexey Torkhov <atorkhov@gmail.com>
* (C) Copyright 2011 Geo Carncross <geocar@gmail.com>
* (C) Copyright 2012 Sergey Prokhorov <me@seriyps.ru>
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <string.h>
...
...
@@ -52,6 +57,12 @@
#include "nm-l2tp-service.h"
#include "nm-ppp-status.h"
#if !defined(DIST_VERSION)
# define DIST_VERSION VERSION
#endif
static
gboolean
debug
=
FALSE
;
/********************************************************/
/* ppp plugin <-> l2tp-service object */
/********************************************************/
...
...
@@ -949,11 +960,12 @@ nm_l2tp_stop_ipsec(void)
NULL
,
NULL
,
NULL
,
NULL
))
{
free_args
(
whack_argv
);
return
FALSE
;
return
;
}
g_message
(
"ipsec shut down"
);
}
static
gboolean
nm_l2tp_start_ipsec
(
NML2tpPlugin
*
plugin
,
NMSettingVPN
*
s_vpn
,
...
...
@@ -1213,14 +1225,14 @@ nm_l2tp_config_write (NML2tpPlugin *plugin,
if
(
service_priv
&&
strlen
(
service_priv
->
username
))
{
write_config_option
(
conf_fd
,
"name = %s
\n
"
,
service_priv
->
username
);
}
write_config_option
(
conf_fd
,
"ppp debug = yes
\n
"
);
if
(
debug
)
write_config_option
(
conf_fd
,
"ppp debug = yes
\n
"
);
write_config_option
(
conf_fd
,
"pppoptfile = /var/run/nm-ppp-options.xl2tpd.%d
\n
"
,
pid
);
write_config_option
(
conf_fd
,
"require pap = no
\n
"
);
write_config_option
(
conf_fd
,
"autodial = yes
\n
"
);
/* PPP options */
//if (getenv ("NM_PPP_DEBUG")
)
if
(
debug
)
write_config_option
(
pppopt_fd
,
"debug
\n
"
);
write_config_option
(
pppopt_fd
,
"ipparam nm-l2tp-service-%d
\n
"
,
pid
);
...
...
@@ -1383,6 +1395,9 @@ real_connect (NMVPNPlugin *plugin,
g_signal_connect
(
G_OBJECT
(
priv
->
service
),
"ppp-state"
,
G_CALLBACK
(
service_ppp_state_cb
),
plugin
);
g_signal_connect
(
G_OBJECT
(
priv
->
service
),
"ip4-config"
,
G_CALLBACK
(
service_ip4_config_cb
),
plugin
);
if
(
getenv
(
"NM_PPP_DUMP_CONNECTION"
)
||
debug
)
nm_connection_dump
(
connection
);
/* Cache the username and password so we can relay the secrets to the pppd
* plugin when it asks for them.
*/
...
...
@@ -1548,19 +1563,44 @@ main (int argc, char *argv[])
{
NML2tpPlugin
*
plugin
;
GMainLoop
*
main_loop
;
char
*
filename
;
gboolean
persist
=
FALSE
;
GOptionContext
*
opt_ctx
=
NULL
;
GOptionEntry
options
[]
=
{
{
"persist"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
persist
,
N_
(
"Don't quit when VPN connection terminates"
),
NULL
},
{
"debug"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
debug
,
N_
(
"Enable verbose debug logging (may expose passwords)"
),
NULL
},
{
NULL
}
};
g_type_init
();
/* Parse options */
opt_ctx
=
g_option_context_new
(
""
);
g_option_context_set_translation_domain
(
opt_ctx
,
"UTF-8"
);
g_option_context_set_ignore_unknown_options
(
opt_ctx
,
FALSE
);
g_option_context_set_help_enabled
(
opt_ctx
,
TRUE
);
g_option_context_add_main_entries
(
opt_ctx
,
options
,
NULL
);
g_option_context_set_summary
(
opt_ctx
,
_
(
"nm-pptp-service provides L2TP VPN capability with optional IPSec support to NetworkManager."
));
g_option_context_parse
(
opt_ctx
,
&
argc
,
&
argv
,
NULL
);
g_option_context_free
(
opt_ctx
);
if
(
getenv
(
"NM_PPP_DEBUG"
))
debug
=
TRUE
;
if
(
debug
)
g_message
(
"nm-pptp-service (version "
DIST_VERSION
") starting..."
);
plugin
=
nm_l2tp_plugin_new
();
if
(
!
plugin
)
exit
(
EXIT_FAILURE
);
main_loop
=
g_main_loop_new
(
NULL
,
FALSE
);
g_signal_connect
(
plugin
,
"quit"
,
G_CALLBACK
(
quit_mainloop
),
main_loop
);
if
(
!
persist
)
g_signal_connect
(
plugin
,
"quit"
,
G_CALLBACK
(
quit_mainloop
),
main_loop
);
g_main_loop_run
(
main_loop
);
...
...
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