summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/modem.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/ppp/modem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/modem.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/noncore/settings/networksettings/ppp/modem.cpp b/noncore/settings/networksettings/ppp/modem.cpp
index 3bc7d43..79f015b 100644
--- a/noncore/settings/networksettings/ppp/modem.cpp
+++ b/noncore/settings/networksettings/ppp/modem.cpp
@@ -11,97 +11,96 @@
11 * 11 *
12 * This program is free software; you can redistribute it and/or 12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public 13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either 14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version. 15 * version 2 of the License, or (at your option) any later version.
16 * 16 *
17 * This program is distributed in the hope that it will be useful, 17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details. 20 * Library General Public License for more details.
21 * 21 *
22 * You should have received a copy of the GNU Library General Public 22 * You should have received a copy of the GNU Library General Public
23 * License along with this program; if not, write to the Free 23 * License along with this program; if not, write to the Free
24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 */ 25 */
26 26
27/* OPIE */ 27/* OPIE */
28#include <opie2/odebug.h> 28#include <opie2/odebug.h>
29using namespace Opie::Core; 29using namespace Opie::Core;
30 30
31/* STD */ 31/* STD */
32#include <errno.h> 32#include <errno.h>
33#include <stdlib.h> 33#include <stdlib.h>
34#include <unistd.h> 34#include <unistd.h>
35#include <fcntl.h> 35#include <fcntl.h>
36#include <signal.h> 36#include <signal.h>
37#include <sys/ioctl.h> 37#include <sys/ioctl.h>
38#include <sys/types.h> 38#include <sys/types.h>
39#include <sys/stat.h> 39#include <sys/stat.h>
40#include <setjmp.h> 40#include <setjmp.h>
41#include <regex.h> 41#include <regex.h>
42#include <qregexp.h> 42#include <qregexp.h>
43#include <assert.h> 43#include <assert.h>
44#include <string.h> 44#include <string.h>
45 45
46#ifdef HAVE_RESOLV_H 46#ifdef HAVE_RESOLV_H
47# include <arpa/nameser.h> 47# include <arpa/nameser.h>
48# include <resolv.h> 48# include <resolv.h>
49#endif 49#endif
50 50
51#ifndef _PATH_RESCONF 51#ifndef _PATH_RESCONF
52#define _PATH_RESCONF "/etc/resolv.conf" 52#define _PATH_RESCONF "/etc/resolv.conf"
53#endif 53#endif
54 54
55#define strlcpy strcpy 55#define strlcpy strcpy
56#include "auth.h" 56#include "auth.h"
57#include "modem.h" 57#include "modem.h"
58#include "pppdata.h" 58#include "pppdata.h"
59#define qError qDebug
60 59
61 60
62#define MY_ASSERT(x) if (!(x)) { \ 61#define MY_ASSERT(x) if (!(x)) { \
63 ofatal << "ASSERT: \"" << #x << "\" in " << __FILE__ << " (" << __LINE__ << ")\n" << oendl; \ 62 ofatal << "ASSERT: \"" << #x << "\" in " << __FILE__ << " (" << __LINE__ << ")\n" << oendl; \
64 exit(1); } 63 exit(1); }
65 64
66 65
67static sigjmp_buf jmp_buffer; 66static sigjmp_buf jmp_buffer;
68 67
69//Modem *Modem::modem = 0; 68//Modem *Modem::modem = 0;
70 69
71 70
72const char* pppdPath() { 71const char* pppdPath() {
73 // wasting a few bytes 72 // wasting a few bytes
74 static char buffer[sizeof(PPPDSEARCHPATH)+sizeof(PPPDNAME)]; 73 static char buffer[sizeof(PPPDSEARCHPATH)+sizeof(PPPDNAME)];
75 static char *pppdPath = 0L; 74 static char *pppdPath = 0L;
76 char *p; 75 char *p;
77 76
78 if(pppdPath == 0L) { 77 if(pppdPath == 0L) {
79 const char *c = PPPDSEARCHPATH; 78 const char *c = PPPDSEARCHPATH;
80 while(*c != '\0') { 79 while(*c != '\0') {
81 while(*c == ':') 80 while(*c == ':')
82 c++; 81 c++;
83 p = buffer; 82 p = buffer;
84 while(*c != '\0' && *c != ':') 83 while(*c != '\0' && *c != ':')
85 *p++ = *c++; 84 *p++ = *c++;
86 *p = '\0'; 85 *p = '\0';
87 strcat(p, "/"); 86 strcat(p, "/");
88 strcat(p, PPPDNAME); 87 strcat(p, PPPDNAME);
89 if(access(buffer, F_OK) == 0) 88 if(access(buffer, F_OK) == 0)
90 return (pppdPath = buffer); 89 return (pppdPath = buffer);
91 } 90 }
92 } 91 }
93 92
94 return pppdPath; 93 return pppdPath;
95} 94}
96 95
97 96
98Modem::Modem( PPPData* pd ) 97Modem::Modem( PPPData* pd )
99{ 98{
100 _pppdata = pd; 99 _pppdata = pd;
101 modemfd = -1; 100 modemfd = -1;
102 _pppdExitStatus = -1; 101 _pppdExitStatus = -1;
103 pppdPid = -1; 102 pppdPid = -1;
104 sn = m_modemDebug = 0L; 103 sn = m_modemDebug = 0L;
105 data_mode = false; 104 data_mode = false;
106 modem_is_locked = false; 105 modem_is_locked = false;
107 lockfile[0] = '\0'; 106 lockfile[0] = '\0';