From 258887a0f6a798cc021837c3f686d02ff317d271 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 7 May 2005 20:40:01 +0000 Subject: Add authentication support --- dund/main.c | 11 ++++++++++- pand/main.c | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/dund/main.c b/dund/main.c index 837073f9..2bc4f9b5 100644 --- a/dund/main.c +++ b/dund/main.c @@ -70,6 +70,7 @@ static char *pppd_opts[DUN_MAX_PPP_OPTS] = static int detach = 1; static int persist; static int use_sdp = 1; +static int auth; static int encrypt; static int secure; static int master; @@ -147,6 +148,8 @@ static int do_listen(void) lm = 0; if (master) lm |= RFCOMM_LM_MASTER; + if (auth) + lm |= RFCOMM_LM_AUTH; if (encrypt) lm |= RFCOMM_LM_ENCRYPT; if (secure) @@ -390,6 +393,7 @@ static struct option main_lopts[] = { { "show", 0, 0, 'l' }, { "nodetach", 0, 0, 'n' }, { "persist", 2, 0, 'p' }, + { "auth", 0, 0, 'A' }, { "encrypt", 0, 0, 'E' }, { "secure", 0, 0, 'S' }, { "master", 0, 0, 'M' }, @@ -400,7 +404,7 @@ static struct option main_lopts[] = { { 0, 0, 0, 0 } }; -static char main_sopts[] = "hsc:k:Kr:i:lnp::DQ::ESMP:C::P:X"; +static char main_sopts[] = "hsc:k:Kr:i:lnp::DQ::AESMP:C::P:X"; static char main_help[] = "Bluetooth LAP (LAN Access over PPP) daemon version " VERSION " \n" @@ -417,6 +421,7 @@ static char main_help[] = "\t--channel -P RFCOMM channel\n" "\t--device -i Source bdaddr\n" "\t--nosdp -D Disable SDP\n" + "\t--auth -A Enable authentication\n" "\t--encrypt -E Enable encryption\n" "\t--secure -S Secure connection\n" "\t--master -M Become the master of a piconet\n" @@ -480,6 +485,10 @@ int main(int argc, char **argv) use_sdp = 0; break; + case 'A': + auth = 1; + break; + case 'E': encrypt = 1; break; diff --git a/pand/main.c b/pand/main.c index 959d6057..c128d332 100644 --- a/pand/main.c +++ b/pand/main.c @@ -61,6 +61,7 @@ static int detach = 1; static int persist; static int use_sdp = 1; static int use_cache; +static int auth; static int encrypt; static int secure; static int master; @@ -169,6 +170,8 @@ static int do_listen(void) lm = 0; if (master) lm |= L2CAP_LM_MASTER; + if (auth) + lm |= L2CAP_LM_AUTH; if (encrypt) lm |= L2CAP_LM_ENCRYPT; if (secure) @@ -497,6 +500,7 @@ static struct option main_lopts[] = { { "show", 0, 0, 'l' }, { "nodetach", 0, 0, 'n' }, { "persist", 2, 0, 'p' }, + { "auth", 0, 0, 'A' }, { "encrypt", 0, 0, 'E' }, { "secure", 0, 0, 'S' }, { "master", 0, 0, 'M' }, @@ -506,7 +510,7 @@ static struct option main_lopts[] = { { 0, 0, 0, 0 } }; -static char main_sopts[] = "hsc:k:Kr:e:i:lnp::DQ::ESMC::P:z"; +static char main_sopts[] = "hsc:k:Kr:e:i:lnp::DQ::AESMC::P:z"; static char main_help[] = "Bluetooth PAN daemon version " VERSION " \n" @@ -525,6 +529,7 @@ static char main_help[] = "\t--ethernet -e Network interface name\n" "\t--device -i Source bdaddr\n" "\t--nosdp -D Disable SDP\n" + "\t--auth -A Enable authentication\n" "\t--encrypt -E Enable encryption\n" "\t--secure -S Secure connection\n" "\t--master -M Become the master of a piconet\n" @@ -589,6 +594,10 @@ int main(int argc, char **argv) use_sdp = 0; break; + case 'A': + auth = 1; + break; + case 'E': encrypt = 1; break; -- cgit