yawmppp: Add version 2.0.2 to the repository.

Obtained from:
https://archive.org/download/tucows_59618_yawmppp/yawmppp-2.0.2.tar.gz
This commit is contained in:
Doug Torrance 2017-08-22 19:44:55 -04:00 committed by Carlos R. Mafra
parent c1f2d4c11b
commit c50ceb41d7
57 changed files with 14286 additions and 0 deletions

89
yawmppp/CHANGELOG Normal file
View file

@ -0,0 +1,89 @@
CHANGELOG for YAWMPPP
$Id: CHANGELOG,v 1.2 2001/04/21 18:29:33 bergo Exp $
2.0.2 (Apr 21 2001)
* fixed minor bug when generating files with the
"don't generate login password pairs" option
turned on (a CONNECT line was not being added)
2.0.1 (Mar 3 2001)
* fixed minor bug: the installation script now creates
the /etc/ppp/peers directory if it is missing.
2.0.0 (Feb 22 2001)
* Revamped the way the GUI manages config files, now pppd
files go under /etc/ppp/peers (and you'll have to
exercise your root password sometimes when configuring
ISP info). Configuration now goes under ~/.yawmppp2
* Changed RX/TX leds for arrows in the Window Maker applet.
* Dropped old named-based DNS support
* Added support for the usepeerdns option in pppd.
1.2.1 (Apr 12 2000)
* Increased Modem Init Strings maximum size from 64 to
256 characters.
1.2.0 (Apr 3 2000)
* Fixed bug regarding user names made up of digits
only.
* Added the yawmppp.thin applet.
* Made the -caution option default.
* Bug fix: now modem init strings may contain spaces.
* Bug fix: the config applet wasn't recognizing the first
init string, it was putting ATZ always. As no one has
complained about it, I'm surprised to know that ATZ is
good for everyone :)
1.1.3 (Mar 24 2000)
* Fixed bug in Help system (memory buffer for man pages was too
small and the Configuration program dumped core). Now the
buffers are initialized with 128K instead of 64K and will grow
on demand. Thanks to Thomas Hood for reporting this one.
* Added the -caution and -paranoid command line options, meant to
help PCMCIA & APM users.
* Minor documentation fixes.
1.1.2 (Mar 20 2000)
* Added the online help (er... man) system.
* Tried to fix a compilation bug that happened with Debian regarding the
double inclusion of linux/socket.h and sys/socket.h. I don't have
a Debian system to test, so I don't know for sure if it will work
right now (Debian only).
* Added the --with-x-include-dirs= option to the configure script. This
should be helpful for FreeBSD users.
* Due to the change below, changed the caption on the
"Post-login conversation" button to "Additional conversation".
* Added the "Don't generate login/password pairs" checkbox to help people
with even stranger ISP conversations. I can't keep it simple if ISPs can't.
* Fixed bug in expect/send pair parsing, now usernames, passwords,
and all expected/sent strings may contain spaces and escaped
quotes (\").
* Fixed stop.* script generation (missing space between
quote and bracket, thanks to Igor Marinovic for reporting
it)
* Fixed W,X,Y,Z characters which were apeearing swapped on the
dock applet display.
1.1.1 (Mar 11 2000)
* Fixed small bug in configure script that would prevent
yawmppp from building in some FreeBSD systems.
1.1.0 (Mar 7 2000)
* Added tooltips to most widgets in the PPP page.
* Added capability for more multiple expect/send pairs in the
entries.
* Added support for PAP/CHAP related options in the pppd
command line (the secrets must still be set manually in
the secret files, read the FAQ for furhter information)
1.0.1 (Feb 29 2000)
* Added "user <username>" to command line of pppd,
which may help PAPers and CHAPers.
* Some of the options shown with yawmppp -h were
bogus. Took them out.
1.0.0 (Feb 14 2000)
* First public release

339
yawmppp/COPYING Normal file
View file

@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

164
yawmppp/FAQ Normal file
View file

@ -0,0 +1,164 @@
YAWMPPP FAQ
$Id: FAQ,v 1.2 2001/04/21 18:29:33 bergo Exp $
1 Generic
1.1 How can I see what is going on with my connection ?
1.2 Nothing happens when I hit the "V" button.
1.3 Yawmppp/pppd complain about not having root privileges.
1.4 Why doesn't it shows with the NeXTSTEP(tm) look
in my system as it does in the screenshots ?
1.X Where can I get more info ?
2 Specific
2.1 How do I setup PAP/CHAP ?
2.2 My modem dials, connects, but hangs up some seconds later.
What is happening ?
---------------------------------------------------------------------------
Q1.1: How can I see what is going on with my connection ?
A1.1: The ppp daemon throws lots of logging information (if asked to),
but some of this information may get lost.
Change your /etc/syslog.conf file so that is has a line
daemon,local2.debug,daemon.notice /etc/ppp/log
(the separation is made out of *tabs*, NOT spaces!)
and create a zero-sized log file:
touch /etc/ppp/log
Then restart the syslog daemon (e.g.: send a SIGHUP to it as root).
Then enable the debug and kdebug options at yawmppp.pref's PPP options
notebook page.
The log file should give more information than you actually need.
Even if you don't want to change your logging configuration, some of
pppd's log output may go to /var/log/messages.
Q1.2: Nothing happens when I hit the "V" button.
A1.2: The pppd daemon requires root privileges to run. The solution here is
to set the setuid bit on pppd's executable:
chmod 4755 `which pppd`
You must run this as root. Notice that the quotes are backticks.
Q1.3: Yawmppp/pppd complain about not having root privileges.
A1.3: Maybe you're trying a noauth connection with a non-setuid pppd. If you
really need to keep pppd non-setuid root, add the
noauth
line to your
/etc/ppp/options
file.
Q1.4: Why doesn't it shows with the NeXTSTEP(tm) look
in my system as it does in the screenshots ?
A1.4: The GTK+ GUI toolkit allows themeing. It means that you may turn
your GTK+ applications to look like Macintosh(tm), Aqua(tm),
NeXT(tm) or whatever you want. Even Windows(tm) if you're sick
enough for it.
You can make your themes or download ready ones (faster).
There are lots of GTK+ themes at
http://gtk.themes.org
You can browse documentation on how to add the themes at the same
site. To use gtk.themes.org pixmap themes you'll probably need
the gtk-engines and imlib packages, you can find them perusing
the site.
The NeXT look seen in the screenshots at yawmppp.seul.org is
provided by the Xenophilia engine:
http://www.obsession.se/johan/gtk.html
(if this link ever gets broken, search for Xenophilia at
freshmeat.net)
Q1.X: Where can I get more info ?
A1.X: You can read the PPP-HOWTO and ISP-Hookup-HOWTO from the LDP
(Linux Documentation Project), available from
http://sunsite.unc.edu/LDP/HOWTO/
(Linux distributions may have it installed under /usr/doc/HOWTO)
You can also read the ppp FAQ that comes with ppp's source, which
can be downloaded from:
ftp://cs.anu.edu.au/pub/software/ppp
Q2.1: How do I setup PAP/CHAP ?
A2.1: PAP and CHAP are authentication protocols and some ISPs require them to
be used. Their purpose is to confirm identity throughout the connection.
Unless you're afraid of someone tapping your phone line and transmitting
"bogus" data through YOUR PPP link, you should not worry about it, unless
your ISP does.
First, you'll have to set yawmppp.pref's local PPP options on your
ISP entry to reflect the desired behaviour about CHAP/PAP.
If your ISP doesn't even present a login prompt, you'll want to
check the "don't generate login/password pairs" in the "More Settings"
dialog.
Then, as root, edit /etc/ppp/chap-secrets and/or /etc/ppp/pap-secrets
as desired.
The ppp FAQ (included in the source distribution of ppp) tells the nitty
gritty, but basically you'll have a set of lines, one for each ISP that
reads like this:
username * password
where username is your username, password is your password. The
first * means the server (any) and the second * means the allowed IPs
(any). The log output of ppp may help you if you still can't get a
conection. Read Q1.1 for instructions to get the most of ppp's log.
Q2.2: My modem dials, connects, but hangs up some seconds later.
What is happening ?
A2.2: There are several possibilities, which you will only be sure by reading the
logs. Here they are:
1. bad login/password, or your ISP is under maintenance and refused login
2. the ISP required CHAP/PAP authentication and you either didn't have
a proper secret to give in the secret files (read Q2.1), or
has the refuse-chap/refuse-pap options on, or had a bad (wrong) secret.
If this is the case, asking help from your ISP is a good idea.
3. your ISP is taking too long to answer for the initial PPP requests.
It may be busy, buggy, bad configured, or gone BSOD (Q2.3).
You can try setting on the "passive" option or increase the
lcp-max-configure number.
---

82
yawmppp/INSTALL Normal file
View file

@ -0,0 +1,82 @@
Installation instructions for YAWMPPP.
Upgrading ?
-----------
If so, just follow the usual INSTALL instructions, run
yawmppp.pref and click Ok or Apply. It will not
damage your previous versions' ISP entries or log, and will write the
new pppd command line to your ~/.yawmppp scripts.
Upgrading from 1.x.x to 2.x.x:
------------------------------
The configuration files of 2.x.x are placed separated from 1.x.x
files. You are can uninstall 1.x.x before installing 2.x.x, but it
isn't necessary. (to do so, unpack the 1.x.x tar.gz, configure and
make uninstall).
Just notice that if you chmod'ed the files in ~/.yawmppp to
prevent yawmppp from overwriting your manual changes, the
new version will not be able to add new data to them, ok ?
NOTE!
--------------------------------------------------------------
Installing this program requires root privileges, ask your
local system/network administrator kindly if she/he wants
to install this software for you ;-)
you need root access for installation.
What the installation will do
----------------------------------------------------------
The installation requires a program
be copied to /etc/ppp:
/etc/ppp/yagetmodemspeed
and will also copy an icon to /usr/local/share/icons
the yawmppp binaries will be installed in
/usr/local/bin (you can change the /usr/local prefix,
see below)
/usr/local/bin/yawmppp
/usr/local/bin/yawmppp.pref
/usr/local/bin/yawmppp.log
the documentation will be installed in
/usr/local/doc/yawmppp-<version>
and yawmppp's man page will be placed in
/usr/local/man/man1
Installation
--------------------------------------------------------------
1) % tar zxvf yawmppp-2.x.x.tar.gz
2) % cd yawmppp-2.x.x
3) % ./configure
4) % make
5) % su
6) # make install
As non-privileged user:
7) % yawmppp & (try 'yawmppp -h &' for help)
If you have no ISP entries configured you'll see the yawmppp.pref
GUI.
FreeBSD note: if configure fails to find the X11 includes you may have
to use the --with-x-includes=DIR option, type "configure --help" for
information.
Extras
--------------------------------------------------------------
Changing the prefix: if you want the binaries to be installed
somewhere else than /usr/local, do a
./configure --prefix=/where/I/want/the/prefix/to/be
in the 3) step above.

42
yawmppp/Makefile.in Normal file
View file

@ -0,0 +1,42 @@
# YAWMPPP toplevel Makefile
#GTKLIB = @GTK_LIBS@
#GTKFLAG = @GTK_FLAGS@
#RLFLAG = -DVERSION=\"@MK_YAWMPPP_RELEASE@\"
PROGINST = @INSTALL@
all: build_src
build_src:
@$(MAKE) -C src
install:
@$(MAKE) -C src install
$(PROGINST) -d -g 0 -o 0 -m 0755 @prefix@/doc/yawmppp-@MK_YAWMPPP_RELEASE@
$(PROGINST) -g 0 -o 0 -m 0644 README @prefix@/doc/yawmppp-@MK_YAWMPPP_RELEASE@
$(PROGINST) -g 0 -o 0 -m 0644 COPYING @prefix@/doc/yawmppp-@MK_YAWMPPP_RELEASE@
$(PROGINST) -g 0 -o 0 -m 0644 CHANGELOG @prefix@/doc/yawmppp-@MK_YAWMPPP_RELEASE@
$(PROGINST) -g 0 -o 0 -m 0644 INSTALL @prefix@/doc/yawmppp-@MK_YAWMPPP_RELEASE@
$(PROGINST) -g 0 -o 0 -m 0644 FAQ @prefix@/doc/yawmppp-@MK_YAWMPPP_RELEASE@
install-strip:
@$(MAKE) -C src install-strip
$(PROGINST) -d -g 0 -o 0 -m 0755 @prefix@/doc/yawmppp-@MK_YAWMPPP_RELEASE@
$(PROGINST) -g 0 -o 0 -m 0644 README @prefix@/doc/yawmppp-@MK_YAWMPPP_RELEASE@
$(PROGINST) -g 0 -o 0 -m 0644 COPYING @prefix@/doc/yawmppp-@MK_YAWMPPP_RELEASE@
$(PROGINST) -g 0 -o 0 -m 0644 CHANGELOG @prefix@/doc/yawmppp-@MK_YAWMPPP_RELEASE@
$(PROGINST) -g 0 -o 0 -m 0644 INSTALL @prefix@/doc/yawmppp-@MK_YAWMPPP_RELEASE@
$(PROGINST) -g 0 -o 0 -m 0644 FAQ @prefix@/doc/yawmppp-@MK_YAWMPPP_RELEASE@
uninstall:
@echo "----> Uninstalling YAWMPPP from prefix @prefix@"
rm -f @prefix@/bin/yawmppp @prefix@/bin/yawmppp.pref @prefix@/bin/yawmppp.log /etc/ppp/managednsonthefly /etc/ppp/yagetmodemspeed @prefix@/share/icons/redphone.xpm @prefix@/share/icons/pppdoc.xpm @prefix@/share/icons/pedestal.xpm @prefix@/man/man1/yawmppp.1x
rm -rf @prefix@/doc/yawmppp*
@echo "----> done."
clean:
@$(MAKE) -C src clean
distclean:
@$(MAKE) -C src distclean
rm -f config.* Makefile *~

278
yawmppp/README Normal file
View file

@ -0,0 +1,278 @@
YAWMPPP
version 2.0.2
Yet Another PPP Window Maker dock applet
(C) 2000 Felipe Bergo
Table of Contents
Overview
Requirements
Installing
Features
Files
Reporting Bugs
Usage Hints
Programs
Interface Guide
Window Manager Placement
Configuration
DNS Servers
Modem Ports
Login/Password expects
Trouble?
More Documentation
Overview
--------
YAWMPPP sits in Window Maker's dock (or AfterStep's Wharf, or keeps
standing as a 64x64 window with other Window Managers) and manages
PPP connections. For window managers not capable of docking
yawmppp also provides a bar shaped version (yawmppp.thin).
It includes a GUI to easily setup your ISP entries, so that you
don't need to edit CHAT scripts.
YAWMPPP is distributed under the terms of the GNU General Public
License, version 2 or later (at your choice). A copy of the
license is provided in the file COPYING in this same directory.
Requirements
------------
YAWMPPP is known to run on Linux (tested with 2.2 kernels) and FreeBSD
(tested with 3.4-RELEASE) and has been reported to work with NetBSD 1.5.
You'll need:
- root access to install YAWMPPP
- A kernel with PPP support compiled in.
- pppd, the ppp daemon, installed in /usr/sbin/pppd
(currently this path mandatory for the builtin scripts to
work). If you wish to use YAWMPPP as non-root pppd must
have the setuid bit set. The RedHat installation already
brings this set.
Version 2.3.11 or newer is recommended.
- the "chat" program (usually included in the pppd package, comes
with the FreeBSD distribution too).
- GTK+ 1.2.1 or greater. 1.2.6 recommended.
If you don't have it you can grab it from
http://www.gtk.org
Remember to get the GLib too (needed by GTK+).
On RedHat-based systems (RedHat itself, Mandrake, Conectiva,
Independence, etc.) you'll need these packages installed to
compile YAWMPPP:
glib-1.2.x
glib-devel-1.2.x
gtk+-1.2.x
gtk+-devel-1.2.x
Author: Felipe Bergo <bergo@seul.org>, who built YAWMPPP
using code from the WMPPP application developed by
Martijn Pieterse and Antoine Nulle.
YAWMPPP's web page is located at
http://yawmppp.seul.org
For more information on WMPPP see
http://windowmaker.mezaway.org
Installing
----------
Read the file INSTALL for instructions. Be sure to read this file
entirely before using YAWMPPP
Features
--------
YAWMPPP features all things the standard pppd offers and gives
you some additional amusements:
* Integrated online timer;
* Integrated modem RX/TX LED's;
* Integrated YAWMPPP status LED;
* Integrated autoscaling PPP transfer statistics;
* Integrated bytes/second Speed-O-Meter;
* Automatic detection of active ppp interfaces;
* Several commandline options (try '-h' for help);
* Easy ISP configuration GUI
* Multiple ISP entries support
* Logging facility with GUI viewer
Files
-----
README This file.
INSTALL Installation instructions.
CHANGELOG Description of changes.
COPYING GNU General Public License Version 2.
FAQ Frequently Asked Questions
Reporting Bugs
--------------
If you discover any bugs in this software, please send a
bug report to bergo@seul.org and describe the
problem as detailed as you can.
Usage Hints
-----------
First of all: you can type "man yawmppp" for help at the command line.
Programs:
---------
yawmppp - The PPP dock applet
yawmppp.thin - A PPP applet for non dock-capable window managers
(e.g. Enlightenment, Sapphire...)
yawmppp.pref - The Dialing setup tool (can be run from
yawmppp by clicking the left mouse
button in the display area)
yawmppp.log - The log view tool (can be run from yawmppp
by clicking the middle or right mouse buttons
in the display area)
Interface guide (yawmppp)
-------------------------
Please, don't laugh at the drawing.
+-----------------------------+ A : Connection timer
|+---------------------------+|
||AAAAAAAAAAA BB CC DD || B : RX LED (blinks when PPP packets
||AAAAAAAAAAA BB CC DD || are received)
|| ||
||EEEEEEEEEEEEEEEEEEEEEEEEEEE|| C : TX LED (blinks when PPP packets
||EEEEEEEEEEEEEEEEEEEEEEEEEEE|| are sent)
||EEEEEEEEEEEEEEEEEEEEEEEEEEE||
||EEEEEEEEEEEEEEEEEEEEEEEEEEE|| D : ON/OFF LED: dark when there is no
|| || active connection, GREEN if
||FFFFFFFFFF GGGGGGGGGGGGG|| the connection is up, YELLOW
||FFFFFFFFFF GGGGGGGGGGGGG|| while dialing, RED on error.
|+---------------------------+|
|+-----++-----+ +-----++-----+| E : Speed history
|| || | | || ||
|| < || > | | V || X || F : ISP entry name (short)
|| || | | || ||
|+-----++-----+ +-----++-----|| G : Connection speed, speed-o-meter,
+-----------------------------+ error messages
< : selects prior ISP. You can't change
the ISP entry while online
> : selects next ISP.
V : connects to currently selected ISP
X : closes current connection.
You can click the display area with the left mouse button to open the
ISP configuration tool (yawmppp.pref) or with any other mouse button
to open the connection log viewer (yawmppp.log).
Window Manager Placement
------------------------
Window Maker: Window Maker users simply drag and drop YAWMPPP on
the WindowMaker Dock or the Clip.
Press the right mouse button on YAWMPPP's outer edges and
select "Settings..." from the popup menu that appears.
Enable the 'Start when WindowMaker is started' option,
then click on the 'OK' button in the Docked Applications
Panel.
AfterStep: Afterstep users put something like this in their Wharf rc
file "Wharf yawmppp - MaxSwallow "yawmppp" yawmppp &"
(this should be somewhere under ~/GNUstep/Library/AfterStep)
Elsewhere: For other windowmanagers, YAWMPPP runs nicely as a 64x64
pixel shaped icon on your desktop. You may prefer to run
yawmppp.thin when not using Window Maker or AfterStep.
Configuration
-------------
YAWMPPP's configuration files stay beneath ~/.yawmppp2, which will
be created as soon as you run yawmppp for the first time. The main
configuration file is yawmppprc. You should use the yawmppp.pref
application to create your entries. If you're willing to edit entries
by hand, create some bogus entries with yawmppp.pref and take a look
at the generated files for hints. It should be easy to figure out.
The format has changed since YAWMPPP 1.x.x, thus the
directory has changed (from ~/.yawmppp to ~/.yawmppp2).
Don't try copying files between 1.x.x and 2.x.x versions.
Modem ports
-----------
On Linux the serial ports are (or at least should be :-) ):
/dev/cua0 _or_ /dev/ttyS0 : DOS' COM1
/dev/cua1 _or_ /dev/ttyS1 : " COM2
/dev/cua2 _or_ /dev/ttyS2 : " COM3
/dev/cua3 _or_ /dev/ttyS3 : " COM4
If you don't know where your modem is, type
dmesg | grep tty
It should print something like
ttyS00 at 0x03f8 (irq = 4) is a 16550A
ttyS01 at 0x02f8 (irq = 3) is a 16550A
ttyS02 at 0x03e8 (irq = 4) is a 16550A
If it shows the wrong irq to you, add a setserial command
to one of your boot time scripts (maybe /etc/rc.d/rc.local)
like:
/bin/setserial /dev/ttyS2 irq 10
See "man setserial" for more information.
On FreeBSD the dialout serial ports are
/dev/cuaa0 (kernel interface sio0)
/dev/cuaa1 (kernel interface sio1)
/dev/cuaa2 (kernel interface sio2)
/dev/cuaa3 (kernel interface sio3)
If it fails to recognize your modem's port, or gives it the wrong
IRQ, you have to compile a new kernel with the correct settings.
Read the FreeBSD handbook if don't know how to do this
(/usr/share/doc/books/handbook)
Login/Password Expects
----------------------
The supplied expects for login and password are rather common,
but if it fails, connect to your ISP using a standard communication
program (like minicom) and watch what the ISP sends to ask for
login and password.
Trouble?
--------
Read the FAQ in this same directory.
More Documentation
------------------
Linux users can read the ISP-Hookup and PPP howtos. These howtos
are available from
http://sunsite.unc.edu/LDP/HOWTO/
If you are on a major Linux distribution the HOWTOs should be
installed. Try looking beneath /usr/doc.
You may also get the ppp source and read the FAQ included, it is
at
ftp://cs.anu.edu.au/pub/software/ppp

8
yawmppp/TODO Normal file
View file

@ -0,0 +1,8 @@
Yawmppp TODO
- Provide an easy way for the user to browse the chat/ppp logs. This
is tough because of security guards put around the log files, I'm
wondering a way to make it (securely).

2531
yawmppp/configure vendored Executable file

File diff suppressed because it is too large Load diff

179
yawmppp/configure.in Normal file
View file

@ -0,0 +1,179 @@
dnl configure.in for yawmppp
dnl by Felipe Bergo (bergo@seul.org)
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/gtksetup/applet.c)
AC_PREREQ(2.0)
AC_CHECK_PROG(GNU_MAKE,make,yes)
AC_CHECK_PROG(GOTSED,sed,yes,no)
AC_PROG_CC
AC_PROG_INSTALL
AC_HEADER_STDC
AC_HEADER_CHECK(unistd.h,,AC_MSG_ERROR(required header file missing))
AC_HEADER_CHECK(sys/wait.h,,AC_MSG_ERROR(required header file missing))
AC_HEADER_CHECK(sys/stat.h,,AC_MSG_ERROR(required header file missing))
AC_HEADER_CHECK(sys/param.h,,AC_MSG_ERROR(required header file missing))
AC_HEADER_CHECK(sys/types.h,,AC_MSG_ERROR(required header file missing))
AC_HEADER_CHECK(sys/ioctl.h,,AC_MSG_ERROR(required header file missing))
AC_HEADER_CHECK(sys/socket.h,,AC_MSG_ERROR(required header file missing))
AC_PATH_X
XINC="$x_includes"
XLIB="$x_libraries"
if test "tmp$no_x" = "tmpyes" ; then
AC_MSG_ERROR(
[
** You must have the X11R6 system. If you have an X11R6 system installed
and are seeing this message, try using the --x-includes and --x-libraries
options with configure. Use the --help option for help.
]
)
fi
AC_HEADER_CHECK(X11/Xlib.h,,AC_MSG_WARN(required header file missing ?))
AC_HEADER_CHECK(X11/xpm.h,,AC_MSG_WARN(required header file missing ?))
AC_HEADER_CHECK(X11/extensions/shape.h,,AC_MSG_WARN(required header file missing ?))
AC_SUBST(XINC)
AC_SUBST(XLIB)
AC_MSG_CHECKING(Operating System)
OSTYPE=`uname -s`
AC_MSG_RESULT("$OSTYPE")
SYSDEF="UNKNOWN"
case $OSTYPE in
Linux)
AC_HEADER_CHECK(asm/types.h,,AC_MSG_ERROR(required header file missing))
AC_HEADER_CHECK(linux/if.h,,AC_MSG_ERROR(required header file missing))
AC_HEADER_CHECK(linux/ppp_defs.h,,AC_MSG_ERROR(required header file missing))
AC_HEADER_CHECK(linux/if_ppp.h,,AC_MSG_ERROR(required header file missing))
SYSDEF="LINUX"
;;
FreeBSD)
AC_HEADER_CHECK(net/if.h,,AC_MSG_ERROR(required header file missing))
dnl AC_HEADER_CHECK(net/if_ppp.h,,AC_MSG_ERROR(required header file missing))
AC_HEADER_CHECK(net/ppp_defs.h,,AC_MSG_ERROR(required header file missing))
SYSDEF="FREEBSD"
;;
OpenBSD)
AC_MSG_WARN(*************************************************)
AC_MSG_WARN(* *)
AC_MSG_WARN(* OpenBSD support not tested - if it works *)
AC_MSG_WARN(* please report to bergo@seul.org. Good Luck. *)
AC_MSG_WARN(* *)
AC_MSG_WARN(*************************************************)
sleep 2
AC_HEADER_CHECK(net/if.h,,AC_MSG_ERROR(required header file missing))
dnl AC_HEADER_CHECK(net/if_ppp.h,,AC_MSG_ERROR(required header file missing))
AC_HEADER_CHECK(net/ppp_defs.h,,AC_MSG_ERROR(required header file missing))
SYSDEF="OPENBSD"
;;
NetBSD)
AC_MSG_WARN(*************************************************)
AC_MSG_WARN(* *)
AC_MSG_WARN(* NetBSD support not tested - if it works *)
AC_MSG_WARN(* please report to bergo@seul.org. Good Luck. *)
AC_MSG_WARN(* *)
AC_MSG_WARN(*************************************************)
sleep 2
AC_HEADER_CHECK(net/if.h,,AC_MSG_ERROR(required header file missing))
dnl AC_HEADER_CHECK(net/if_ppp.h,,AC_MSG_ERROR(required header file missing))
AC_HEADER_CHECK(net/ppp_defs.h,,AC_MSG_ERROR(required header file missing))
SYSDEF="NETBSD"
;;
esac
if test "$SYSDEF" = "UNKNOWN" ; then
AC_HEADER_CHECK(net/if.h,,AC_MSG_ERROR(required header file missing))
AC_HEADER_CHECK(net/if_ppp.h,,AC_MSG_ERROR(required header file missing))
AC_HEADER_CHECK(net/ppp_defs.h,,AC_MSG_ERROR(required header file missing))
AC_MSG_WARN(*************************************************)
AC_MSG_WARN(* *)
AC_MSG_WARN(* This system has not been tested. I will try *)
AC_MSG_WARN(* compiling with BSDish settings. If it works *)
AC_MSG_WARN(* please report to bergo@seul.org. Good Luck! *)
AC_MSG_WARN(* *)
AC_MSG_WARN(*************************************************)
sleep 2
SYSDEF="BSDISH"
fi
AC_SUBST(SYSDEF)
dnl now gtk
AC_PATH_PROG(GTKCONFIG,gtk-config,no)
if test "$GTKCONFIG" = "no" ; then
AC_MSG_ERROR(
[
-(GTK >= 1.2.1 NOT FOUND)---------------------------------------
The config application requires the GTK libary. See the
README for information on how to install GTK.
----------------------------------------------------------------
])
else
dnl check for gtk-version
GTK_LIBS=`$GTKCONFIG --libs`
GTK_FLAGS=`$GTKCONFIG --cflags`
dnl test for Gtk+ >= 1.2.1
AC_MSG_CHECKING(for gtk+ >=1.2.1)
dnl copied from gtk+'s aclocal.m4. These guys must love sed
GTK_MAJOR=`$GTKCONFIG --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
GTK_MINOR=`$GTKCONFIG --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
GTK_MICRO=`$GTKCONFIG --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
GTK121_FINE=1
if test $GTK_MAJOR -lt 1 ; then
GTK121_FINE=0
else
if test $GTK_MAJOR -eq 1 ; then
if test $GTK_MINOR -lt 2 ; then
GTK121_FINE=0
fi
if test $GTK_MINOR -eq 2 ; then
if test $GTK_MICRO -lt 1 ; then
GTK121_FINE=0
fi
fi
fi
fi
if test "$GTK121_FINE" = "1" ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(
[
-(GTK >= 1.2.1 NOT FOUND)---------------------------------------
The config application requires the GTK libary. See the
README for information on how to install GTK.
----------------------------------------------------------------
]
)
fi
fi
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_FLAGS)
MK_YAWMPPP_RELEASE="2.0.2"
AC_SUBST(MK_YAWMPPP_RELEASE)
AC_OUTPUT(Makefile src/Makefile src/dockapp/Makefile src/gtksetup/Makefile src/gtklog/Makefile src/thinppp/Makefile)
echo
echo "--> type make to compile yawmppp"
echo

250
yawmppp/install-sh Normal file
View file

@ -0,0 +1,250 @@
#! /bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0

71
yawmppp/src/Makefile.in Normal file
View file

@ -0,0 +1,71 @@
# yawmppp/src
CC = @CC@
CFLAGS = -O2 -Wall
OBJS = isprc.o ycommon.o misc.o list.o
RLFLAG = -DVERSION=\"@MK_YAWMPPP_RELEASE@\" -D@SYSDEF@
PROGINST = @INSTALL@
GTKLIB = @GTK_LIBS@
GTKFLAG = @GTK_FLAGS@
all: isprc.o ycommon.o misc.o list.o about_obj \
build_dockapp build_gtksetup build_gtklog \
build_thinppp
$(OBJS): %.o : %.c %.h
$(CC) $(CFLAGS) $(RLFLAG) -o $@ -c $<
about_obj: about.c about.h
$(CC) $(GTKFLAG) $(RLFLAG) -c about.c -o about.o
build_gtklog:
@$(MAKE) -C gtklog
build_dockapp:
@$(MAKE) -C dockapp
build_thinppp:
@$(MAKE) -C thinppp
build_gtksetup:
@$(MAKE) -C gtksetup
install:
$(PROGINST) -m 0755 -d @prefix@/share/icons
$(PROGINST) -m 0755 -d @prefix@/man/man1
$(PROGINST) -m 0755 -d @prefix@/bin
$(PROGINST) -m 0755 -d /etc/ppp
$(PROGINST) -m 0755 -d @prefix@/doc/yawmppp-@MK_YAWMPPP_RELEASE@
$(PROGINST) -m 0644 stepphone.xpm @prefix@/share/icons/stepphone.xpm
$(PROGINST) -m 0644 yawmppp.1x @prefix@/man/man1/yawmppp.1x
@$(MAKE) -C dockapp install
@$(MAKE) -C thinppp install
@$(MAKE) -C gtksetup install
@$(MAKE) -C gtklog install
install-strip:
$(PROGINST) -m 0755 -d @prefix@/share/icons
$(PROGINST) -m 0755 -d @prefix@/bin
$(PROGINST) -m 0755 -d /etc/ppp
$(PROGINST) -m 0755 -d @prefix@/doc/yawmppp-@MK_YAWMPPP_RELEASE@
$(PROGINST) -m 0644 stepphone.xpm @prefix@/share/icons/stepphone.xpm
$(PROGINST) -m 0644 yawmppp.1x @prefix@/man/man1/yawmppp.1x
@$(MAKE) -C dockapp install-strip
@$(MAKE) -C thinppp install-strip
@$(MAKE) -C gtksetup install-strip
@$(MAKE) -C gtklog install-strip
clean:
@$(MAKE) -C dockapp clean
@$(MAKE) -C thinppp clean
@$(MAKE) -C gtksetup clean
@$(MAKE) -C gtklog clean
rm -f $(OBJS) about.o *~
distclean:
@$(MAKE) -C dockapp distclean
@$(MAKE) -C thinppp distclean
@$(MAKE) -C gtksetup distclean
@$(MAKE) -C gtklog distclean
rm -f Makefile

120
yawmppp/src/about.c Normal file
View file

@ -0,0 +1,120 @@
/*
YAWMPPP - PPP dock app/helper for WindowMaker
Copyright (C) 2000, 2001:
Author: Felipe Bergo (bergo@seul.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id: about.c,v 1.1.1.1 2001/02/22 06:15:21 bergo Exp $
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include "about.h"
#include "stepphone.xpm"
GtkWidget *about;
/* data must be a pointer to parent widget (GtkWindow) */
void applet_about (GtkWidget * widget, gpointer data)
{
GtkStyle *style;
GdkPixmap *phone;
GtkWidget *pi,*v,*h,*text,*h2,*b,*p,*v2;
char tabout[1024];
GdkBitmap *mask;
int i;
about=gtk_window_new(GTK_WINDOW_DIALOG);
gtk_window_set_transient_for(GTK_WINDOW(about),GTK_WINDOW(data));
gtk_window_set_wmclass(GTK_WINDOW(about),"yawmppp","about");
gtk_widget_realize(about);
gtk_window_set_policy(GTK_WINDOW(about),TRUE,TRUE,TRUE);
gtk_window_set_title (GTK_WINDOW (about), "About YAWMPPP");
style=gtk_widget_get_style(about);
phone=gdk_pixmap_create_from_xpm_d(about->window,&mask,
&style->bg[GTK_STATE_NORMAL],
(gchar **)stepphone_xpm);
pi=gtk_pixmap_new(phone,mask);
gdk_pixmap_unref(phone);
v=gtk_vbox_new(FALSE,2);
gtk_container_add(GTK_CONTAINER(about),v);
h=gtk_hbox_new(FALSE,2);
gtk_box_pack_start(GTK_BOX(v),h,FALSE,TRUE,2);
v2=gtk_vbox_new(FALSE,4);
gtk_box_pack_start(GTK_BOX(h),v2,FALSE,FALSE,2);
gtk_box_pack_start(GTK_BOX(v2),pi,FALSE,FALSE,6);
strcpy(tabout,"YAWMPPP\nYet Another PPP Dock Applet for Window Maker\n");
strcat(tabout,"Version ");
strcat(tabout,VERSION);
strcat(tabout,"\nCopyright (C) 2000, 2001 Felipe Bergo\n");
strcat(tabout,"email: bergo@seul.org\n\n");
strcat(tabout,"YAWMPPP is distributed under the terms of the GNU\n");
strcat(tabout,"General Public License, version 2 or later.\n");
strcat(tabout,"YAWMPPP comes with ABSOLUTELY NO WARRANTY;\n");
strcat(tabout,"This is free software, and you are welcome to\n");
strcat(tabout,"redistribute it under certain conditions.\n");
strcat(tabout,"Read the file COPYING for details.\n\n");
strcat(tabout,"To learn more about free software visit\n");
strcat(tabout,"http://www.gnu.org\n");
text=gtk_label_new(tabout);
gtk_box_pack_start(GTK_BOX(h),text,FALSE,TRUE,2);
gtk_label_set_justify(GTK_LABEL(text),GTK_JUSTIFY_LEFT);
h2=gtk_hbox_new(TRUE,2);
gtk_box_pack_start(GTK_BOX(v),h2,FALSE,TRUE,2);
for(i=0;i<3;i++) {
p=gtk_label_new(" ");
gtk_box_pack_start(GTK_BOX(h2),p,FALSE,FALSE,2);
gtk_widget_show(p);
}
b=gtk_button_new_with_label("Dismiss");
gtk_box_pack_start(GTK_BOX(h2),b,FALSE,TRUE,4);
gtk_container_set_border_width(GTK_CONTAINER(about),6);
gtk_widget_show(b);
gtk_widget_show(text);
gtk_widget_show(pi);
gtk_widget_show(h2);
gtk_widget_show(h);
gtk_widget_show(v2);
gtk_widget_show(v);
gtk_widget_show(about);
gtk_signal_connect(GTK_OBJECT(b),"clicked",
GTK_SIGNAL_FUNC(about_dismiss),NULL);
gtk_grab_add(about);
}
void
about_dismiss(GtkWidget *wid,gpointer data)
{
gtk_grab_remove(about);
gtk_widget_destroy(about);
}

8
yawmppp/src/about.h Normal file
View file

@ -0,0 +1,8 @@
#ifndef ABOUT_H
#define ABOUT_H
void about_dismiss(GtkWidget *wid,gpointer data);
void applet_about (GtkWidget * widget, gpointer data);
#endif

View file

@ -0,0 +1,35 @@
CC = @CC@
LIBDIR = -L/usr/X11R6/lib -L@XLIB@
LIBS = -lXpm -lXext -lX11
CFLAGS = -O2 -Wall -I.. -I@XINC@
RLFLAG = -DVERSION=\"@MK_YAWMPPP_RELEASE@\" -D@SYSDEF@
OBJS = yawmppp.o wmgeneral.o
DOTHS = yawmppp.h wmgeneral.h ../misc.h ../list.h ../isprc.h ../ycommon.h
EOBJS = ../isprc.o ../ycommon.o ../misc.o ../list.o
PROGINST = @INSTALL@
PIXMAPS = dockxpm.xpm
all: yawmppp_bin getmodemspeed_bin
$(OBJS): %.o : %.c $(DOTHS) $(PIXMAPS)
$(CC) -c $(CFLAGS) $(RLFLAG) $< -o $*.o
yawmppp_bin: $(OBJS)
$(CC) -o yawmppp $^ $(EOBJS) -lXext $(LIBDIR) $(LIBS)
getmodemspeed_bin: getmodemspeed.c
$(CC) $(CFLAGS) getmodemspeed.c -o yagetmodemspeed
clean:
rm -f $(OBJS) yawmppp yagetmodemspeed
distclean:
rm -f Makefile *~
install:
$(PROGINST) -m 0755 yawmppp @prefix@/bin/yawmppp
$(PROGINST) -m 0755 yagetmodemspeed /etc/ppp/yagetmodemspeed
install-strip:
$(PROGINST) -s -m 0755 yawmppp @prefix@/bin/yawmppp
$(PROGINST) -s -m 0755 yagetmodemspeed /etc/ppp/yagetmodemspeed

View file

@ -0,0 +1,228 @@
/* XPM */
static char * dockxpm_xpm[] = {
"64 192 33 1",
" c None",
". c #000000",
"+ c #202020",
"@ c #C7C3C7",
"# c #283C38",
"$ c #F7F3FF",
"% c #86828E",
"& c #AEAAAE",
"* c #139613",
"= c #0FAA0F",
"- c #0ABD0A",
"; c #06CE06",
"> c #04D604",
", c #07CA07",
"' c #0EAD0E",
") c #09C109",
"! c #00EA00",
"~ c #0ABC0A",
"{ c #05D305",
"] c #11A111",
"^ c #0CB70C",
"/ c #188318",
"( c #139713",
"_ c #0FA90F",
": c #B60418",
"< c #00EB00",
"[ c #E7C308",
"} c #71E371",
"| c #35C26D",
"1 c #0F9846",
"2 c #49C349",
"3 c #1ADF69",
"4 c #10773A",
" ",
" ",
" ",
" ",
" ",
" ........................................................ ",
" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ",
" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ",
" .+++###+++###+++++++###+++###++++++++++++++++++++++++++@ ",
" .++#+++#+#+++#++#++#+++#+#+++#+++#######+++#+++++##++++@ ",
" .++#+++#+#+++#++#++#+++#+#+++#++++#####+++###+++####+++@ ",
" .+++###+++###+++++++###+++###++++++###+++#####++####+++@ ",
" .++#+++#+#+++#+++++#+++#+#+++#++++++#+++#######++##++++@ ",
" .++#+++#+#+++#++#++#+++#+#+++#+++++++++++++++++++++++++@ ",
" .+++###+++###+++#+++###+++###++++++++++++++++++++++++++@ ",
" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ",
" .######################################################@ ",
" .######################################################@ ",
" .######################################################@ ",
" .######################################################@ ",
" .######################################################@ ",
" .######################################################@ ",
" .######################################################@ ",
" .######################################################@ ",
" .######################################################@ ",
" .######################################################@ ",
" .######################################################@ ",
" .######################################################@ ",
" .######################################################@ ",
" .######################################################@ ",
" .######################################################@ ",
" .######################################################@ ",
" .######################################################@ ",
" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ",
" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ",
" .+####+####+####+####+####++++####+####+####++++++####+@ ",
" .+#++#+#++#+#++#+#++#+#++#++++#++#+#++#+#++#++++++#++#+@ ",
" .+#++#+#++#+#++#+#++#+#++#++++#++#+#++#+#++#+#++#+#++#+@ ",
" .+####+####+####+####+####++++####+####+####+#+#++####+@ ",
" .+#++#+#++#+#++#+#++#+#++#++++#++#+#++#+#++#+##+++#++#+@ ",
" .+#++#+#++#+#++#+#++#+#++#++++#++#+#++#+#++#+#+#++#++#+@ ",
" .+####+####+####+####+####++++####+####+####+#++#+####+@ ",
" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ",
" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ",
" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ",
" ",
" ",
" .......................... .......................... ",
" .$$$$$$$$$$$%$$$$$$$$$$$%@ .$$$$$$$$$$$%$$$$$$$$$$$%@ ",
" .$&&&&&&&&&&.$&&&&&&&&&&.@ .$&&&&&&&&&&.$&&&&&&&&&&.@ ",
" .$&&&&&.&&&&.$&&&&.&&&&&.@ .$&&&&&&..&&.$&..&&&..&&.@ ",
" .$&&&&..&&&&.$&&&&..&&&&.@ .$&&&&&...&&.$&...&...&&.@ ",
" .$&&&...&&&&.$&&&&...&&&.@ .$&..&...&&&.$&&.....&&&.@ ",
" .$&&....&&&&.$&&&&....&&.@ .$&.....&&&&.$&&&...&&&&.@ ",
" .$&&&...&&&&.$&&&&...&&&.@ .$&....&&&&&.$&&.....&&&.@ ",
" .$&&&&..&&&&.$&&&&..&&&&.@ .$&...&&&&&&.$&...&...&&.@ ",
" .$&&&&&.&&&&.$&&&&.&&&&&.@ .$&..&&&&&&&.$&..&&&..&&.@ ",
" .$&&&&&&&&&&.$&&&&&&&&&&.@ .$&&&&&&&&&&.$&&&&&&&&&&.@ ",
" .%...........%...........@ .%...........%...........@ ",
" @@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
"...........%...........%$$$$$$$$$$$%$$$$$$$$$$$% #######+++#+++",
".&&&&&&&&&&$.&&&&&&&&&&$$&&&&&&&&&&.$&&&&&&&&&&. +#####+++###++",
".&&&&&&..&&$.&..&&&..&&$$&&&&&&..&&.$&..&&&..&&. ++###+++#####+",
".&&&&&...&&$.&...&...&&$$&&&&&...&&.$&...&...&&. +++#+++#######",
".&..&...&&&$.&&.....&&&$$&..&...&&&.$&&.....&&&. ",
".&.....&&&&$.&&&...&&&&$$&.....&&&&.$&&&...&&&&. *=-;>;-+++,+++",
".&....&&&&&$.&&.....&&&$$&....&&&&&.$&&.....&&&. +')>!>+++~{!++",
".&...&&&&&&$.&...&...&&$$&...&&&&&&.$&...&...&&. ++-;>+++]^,{,+",
".&..&&&&&&&$.&..&&&..&&$$&..&&&&&&&.$&..&&&..&&. +++-+++/(_^~^_",
".&&&&&&&&&&$.&&&&&&&&&&$$&&&&&&&&&&.$&&&&&&&&&&. ",
"%$$$$$$$$$$$%$$$$$$$$$$$%...........%........... ",
" ",
"...........%...........%$$$$$$$$$$$%$$$$$$$$$$$% +##+ +::+ ",
".&&&&&&&&&&$.&&&&&&&&&&$$&&&&&&&&&&.$&&&&&&&&&&. #### :$:: ",
".&&&&&.&&&&$.&&&&.&&&&&$$&&&&&.&&&&.$&&&&.&&&&&. #### :::: ",
".&&&&..&&&&$.&&&&..&&&&$$&&&&..&&&&.$&&&&..&&&&. +##+ +::+ ",
".&&&...&&&&$.&&&&...&&&$$&&&...&&&&.$&&&&...&&&. ",
".&&....&&&&$.&&&&....&&$$&&....&&&&.$&&&&....&&. +<<+ +[[+ ",
".&&&...&&&&$.&&&&...&&&$$&&&...&&&&.$&&&&...&&&. <$<< [$[[ ",
".&&&&..&&&&$.&&&&..&&&&$$&&&&..&&&&.$&&&&..&&&&. <<<< [[[[ ",
".&&&&&.&&&&$.&&&&.&&&&&$$&&&&&.&&&&.$&&&&.&&&&&. +<<+ +[[+ ",
".&&&&&&&&&&$.&&&&&&&&&&$$&&&&&&&&&&.$&&&&&&&&&&. ",
"%$$$$$$$$$$$%$$$$$$$$$$$%...........%........... }#|1} ",
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
"###2+2}}2+2}}2+2##2+2}}2+2}}2+2}}2+2}}2+2}}2+2}}2+####+####+####",
"#++}+#++}+#++}+}++}+}++#+}++#+#++}+}++}+}++}+}++}+#++#+#++#+#++#",
"#++}+#++}+#++}+}++}+}++#+}++#+#++}+}++}+}++}+}++}+}++}+}++}+#++#",
"###2+2}}2+2}}2+2}}2+2}}2+2}}2+###2+2}}2+2}}2+2##2+}#}#+}}}}+####",
"#++}+}++#+#++}+#++}+#++}+}++}+#++}+}++}+#++}+}++}+}}+#+}++}+#++#",
"#++}+}++#+#++}+#++}+#++}+}++}+#++}+}++}+#++}+}++}+}+}#+}++}+#++#",
"###}+2}}2+2}}2+###2+2}}2+2}}2+###2+2}}2+2}}2+2}}2+}##}+}##}+####",
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
"2}}2+2}}2+2}}2+2}}2+2}}2++++####+####+####++++++####++++++++++++",
"}++#+}++}+}++}+}++}+}++}++++#++#+#++#+#++#++++++#++#++++++++++++",
"}++#+}++}+}++}+}++}+}++}++++#++#+#++#+#++#+#++#+#++#++++++++++++",
"2}}#+2}}++2}}++2##2+2}}+++++####+####+####+#+#++####++++++++++++",
"}++#+}++}+}++}+}++}+}++}++++#++#+#++#+#++#+##+++#++#++++++++++++",
"}++#+}++}+}++}+}++}+}++}++++#++#+#++#+#++#+#+#++#++#++++++++++++",
"2}}2+2##2+2##2+2}}2+2##2++++####+####+####+#++#+####++++++++++++",
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
"++###+++###+++++++###+++###+++++++++++++++++++++++++++++++++++++",
"+#+++#+#+++#++#++#+++#+#+++#++++++++++++++++++++++++++++++++++++",
"+#+++#+#+++#++#++#+++#+#+++#++++++++++++++++++++++++++++++++++++",
"++###+++###+++++++###+++###+++++++++++++++++++++++++++++++++++++",
"+#+++#+#+++#+++++#+++#+#+++#++++++++++++++++++++++++++++++++++++",
"+#+++#+#+++#++#++#+++#+#+++#++++++++++++++++++++++++++++++++++++",
"++###+++###+++#+++###+++###+++++++++++++++++++++++++++++++++++++",
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
" ",
" ",
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
"+#}}#+}}}#+#}}#+}}}#+}}}}+}}}}+#}}#+}##}+#}##+###}+}##}+}###+ ",
"+}++}+}++}+}++}+}++}+}++#+}++#+}++#+}++}+#}+#+#++}+}++}+}++#+ ",
"+}++}+}++}+}++#+}++}+}++#+}++#+}++#+}++}+#}+#+#++}+}+}#+}++#+ ",
"+}}}}+}}}#+}###+}##}+}}}#+}}}#+}#}}+}}}}+#}##+###}+}}##+}###+ ",
"+}++}+}++}+}++#+}++}+}++#+}++#+}++}+}++}+#}+#+#++}+}+}#+}++#+ ",
"+}++}+}++}+}++}+}++}+}++#+}++#+}++}+}++}+#}+#+}++}+}++}+}++#+ ",
"+}##}+}}}#+#}}#+}}}#+}}}}+}###+#}}#+}##}+#}##+#}}#+}##}+}}}}+ ",
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
"+}##}+}##}+#}}#+}}}#+#}}#+}}}#+#}}#+#}}}+}##}+}##}+}##}+}##}+ ",
"+}}}}+}}+}+}++}+}++}+}++}+}++}+}++}+#+}#+}++}+}++}+}++}+}++}+ ",
"+}++}+}+}}+}++}+}++}+}++}+}++}+}++#+#+}#+}++}+}++}+}++}+#}}#+ ",
"+}##}+}##}+}##}+}}}#+}##}+}}}#+#}}#+##}#+}##}+}##}+}##}+#}}#+ ",
"+}++}+}++}+}++}+}++#+}++}+}+}#+#++}+#+}#+}++}+}++}+}}}}+#}}#+ ",
"+}++}+}++}+}++}+}++#+}+}#+}++}+}++}+#+}#+}++}+#}}#+}}}}+}++}+ ",
"+}##}+}##}+#}}#+}###+#}#}+}##}+#}}#+##}#+}}}}+#}}#+}##}+}##}+ ",
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
"+}##}+}}}}+####+####+####+####+####+####+####+####+####+####+ ",
"+}#+}+#++}+#++#+#++#+#++#+#++#+#++#+#++#+#++#+#++#+#++#+#++#+ ",
"+}##}+#+}#+#++#+#++#+#++#+#++#+#++#+#++#+#++#+#++#+#++#+#++#+ ",
"+#}}#+#}##+####+####+####+####+####+####+####+####+####+####+ ",
"+#+}#+#}+#+#++#+#++#+#++#+#++#+#++#+#++#+#++#+#++#+#++#+#++#+ ",
"+#+}#+}++#+#++#+#++#+#++#+#++#+#++#+#++#+#++#+#++#+#++#+#++#+ ",
"+#}##+}}}}+####+####+####+####+####+####+####+####+####+####+ ",
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
"+#}}#+}###+####+###}+}}}}+#}}#+#}}#+}###+####+###}+####+}###+ ",
"+}++}+}++#+#++#+#++}+}++#+}++}+}++#+}++#+#}+#+#++}+}++}+}++#+ ",
"+}++}+}++#+#}}#+#++}+}++#+}++#+}++#+}++#+##+#+#++}+}+}#+}++#+ ",
"+}}}}+}}}#+}##}+#}}}+}}}#+}}##+}#}}+}}}#+#}##+###}+}}##+}###+ ",
"+}++}+}++}+}++#+}++}+}++#+}++#+}++}+}++}+#}+#+#++}+}+}#+}++#+ ",
"+}++}+}++}+}++}+}++}+}++#+}++#+}++}+}++}+#}+#+}++}+}++}+}++#+ ",
"+}##}+}}}#+#}}#+#}}}+}}}}+}###+#}}#+}##}+#}##+#}}#+}##}+#}}#+ ",
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
"+}##}+####+####+}}}#+#}}#+####+#}}#+####+####+}##}+}##}+}##}+ ",
"+}}}}+##+#+#++#+}++}+}++}+#++#+}++}+#+}#+#++#+}++}+}++}+}++}+ ",
"+}++}+#+##+#++#+}++}+}++}+#++#+}++#+#+}#+#++#+}++}+}++}+#}}#+ ",
"+}##}+}#}}+#}}#+}}}#+}##}+}#}#+#}}#+#}}}+}##}+}##}+}##}+#}}#+ ",
"+}++}+}}+}+}++}+}++#+}++}+}}#}+#++}+#+}#+}++}+}++}+}}}}+#}}#+ ",
"+}++}+}++}+}++}+}++#+}+}#+}++#+}++}+#+}#+}++}+#}}#+}}}}+}++}+ ",
"+}##}+}##}+#}}#+}###+#}#}+}###+#}}#+##}#+#}}#+#}}#+}##}+}##}+ ",
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
"+}##}+####+2}}2+###2+2}}2+2}}2+2##2+2}}2+2}}2+2}}2+2}}2+2}}2+ ",
"+}#+}+#++#+}++}+#+}}+#++}+#++}+}++}+}++#+}++#+#++}+}++}+}++}+ ",
"+}##}+}}}}+}++}+#++}+#++}+#++}+}++}+}++#+}++#+#++}+}++}+}++}+ ",
"+#}}#+###}+2##2+###2+2}}2+2}}2+2}}2+2}}2+2}}2+###2+2}}2+2}}2+ ",
"+#+}#+#}}#+}++}+#++}+}++#+#++}+#++}+#++}+}++}+#++}+}++}+#++}+ ",
"+#+}#+}++#+}++}+#++}+}++#+#++}+#++}+#++}+}++}+#++}+}++}+#++}+ ",
"+#}##+}}}}+2}}2+###}+2}}2+2}}2+###2+2}}2+2}}2+###2+2}}2+2}}2+ ",
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
" ",
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
"++333+++###4+43334+43334+4###4+43334+43334+43334+43334+43334++++",
"+3+++3+#+++3+#+++3+#+++3+3+++3+3+++#+3+++#+#+++3+3+++3+3+++3++3+",
"+3+++3+#+++3+#+++3+#+++3+3+++3+3+++#+3+++#+#+++3+3+++3+3+++3++4+",
"+4###4++###4+43334++3334+43334+43334+43334++###4+43334+43334++++",
"+3+++3+#+++3+3+++#+#+++3+#+++3+#+++3+3+++3+#+++3+3+++3+#+++3++++",
"+3+++3+#+++3+3+++#+#+++3+#+++3+#+++3+3+++3+#+++3+3+++3+#+++3++3+",
"++333+++###4+43334+43334++###4+43334+43334++###4+43334+43334++4+",
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

View file

@ -0,0 +1,17 @@
#include <stdio.h>
int main(void) {
FILE *fd;
char temp[256];
fd = popen("tac /etc/ppp/connect-errors | grep '['CONNECT'|'CARRIER']' | head -1", "r");
while (fgets(temp, 256, fd)) {
printf("%s", temp);
}
pclose(fd);
return 0;
}

View file

@ -0,0 +1,369 @@
/*
WMPPP - PPP dock app/helper for WindowMaker
Copyright (C) 1997-2000:
Authors: Martijn Pieterse (pieterse@xs4all.nl)
Antoine Nulle (warp@xs4all.nl)
Felipe Bergo (bergo@seul.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include <stdarg.h>
#include <X11/Xlib.h>
#include <X11/xpm.h>
#include <X11/extensions/shape.h>
#include "wmgeneral.h"
Window Root;
int screen;
int x_fd;
int d_depth;
XSizeHints mysizehints;
XWMHints mywmhints;
Pixel back_pix, fore_pix;
char *Geometry = "";
Window iconwin, win;
GC NormalGC;
XpmIcon wmgen;
Pixmap pixmask;
typedef struct
{
int enable;
int top;
int bottom;
int left;
int right;
}
MOUSE_REGION;
MOUSE_REGION mouse_region[MAX_MOUSE_REGION];
static void GetXPM (XpmIcon *, char **);
static Pixel GetColor (char *);
void RedrawWindow (void);
void AddMouseRegion (int, int, int, int, int);
int CheckMouseRegion (int, int);
static void
GetXPM (XpmIcon * wmgen, char *pixmap_bytes[])
{
XWindowAttributes attributes;
int err;
/* For the colormap */
XGetWindowAttributes (display, Root, &attributes);
wmgen->attributes.valuemask |= (XpmReturnPixels | XpmReturnExtensions);
err = XpmCreatePixmapFromData (display, Root, pixmap_bytes, &(wmgen->pixmap),
&(wmgen->mask), &(wmgen->attributes));
if (err != XpmSuccess)
{
fprintf (stderr, "Not enough free colorcells.\n");
exit (1);
}
}
static Pixel
GetColor (char *name)
{
XColor color;
XWindowAttributes attributes;
XGetWindowAttributes (display, Root, &attributes);
color.pixel = 0;
if (!XParseColor (display, attributes.colormap, name, &color))
{
fprintf (stderr, "wm.app: can't parse %s.\n", name);
}
else if (!XAllocColor (display, attributes.colormap, &color))
{
fprintf (stderr, "wm.app: can't allocate %s.\n", name);
}
return color.pixel;
}
static int
flush_expose (Window w)
{
XEvent dummy;
int i = 0;
while (XCheckTypedWindowEvent (display, w, Expose, &dummy))
i++;
return i;
}
void
RedrawWindow (void)
{
flush_expose (iconwin);
XCopyArea (display, wmgen.pixmap, iconwin, NormalGC,
0, 0, wmgen.attributes.width, wmgen.attributes.height, 0, 0);
flush_expose (win);
XCopyArea (display, wmgen.pixmap, win, NormalGC,
0, 0, wmgen.attributes.width, wmgen.attributes.height, 0, 0);
}
void
RedrawWindowXY (int x, int y)
{
flush_expose (iconwin);
XCopyArea (display, wmgen.pixmap, iconwin, NormalGC,
x, y, wmgen.attributes.width, wmgen.attributes.height, 0, 0);
flush_expose (win);
XCopyArea (display, wmgen.pixmap, win, NormalGC,
x, y, wmgen.attributes.width, wmgen.attributes.height, 0, 0);
}
void
AddMouseRegion (int index, int left, int top, int right, int bottom)
{
if (index < MAX_MOUSE_REGION)
{
mouse_region[index].enable = 1;
mouse_region[index].top = top;
mouse_region[index].left = left;
mouse_region[index].bottom = bottom;
mouse_region[index].right = right;
}
}
int
CheckMouseRegion (int x, int y)
{
int i;
int found;
found = 0;
for (i = 0; i < MAX_MOUSE_REGION && !found; i++)
{
if (mouse_region[i].enable &&
x <= mouse_region[i].right &&
x >= mouse_region[i].left &&
y <= mouse_region[i].bottom &&
y >= mouse_region[i].top)
found = 1;
}
if (!found)
return -1;
return (i - 1);
}
void
createXBMfromXPM (char *xbm, char **xpm, int sx, int sy)
{
int i, j;
int width, height, numcol;
char zero;
unsigned char bwrite;
int bcount;
sscanf (*xpm, "%d %d %d", &width, &height, &numcol);
zero = xpm[1][0];
for (i = numcol + 1; i < numcol + sy + 1; i++)
{
bcount = 0;
bwrite = 0;
for (j = 0; j < sx; j++)
{
bwrite >>= 1;
if (xpm[i][j] != zero)
{
bwrite += 128;
}
bcount++;
if (bcount == 8)
{
*xbm = bwrite;
xbm++;
bcount = 0;
bwrite = 0;
}
}
}
}
void
copyXPMArea (int x, int y, int sx, int sy, int dx, int dy)
{
XCopyArea (display, wmgen.pixmap, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy);
}
void
copyXBMArea (int x, int y, int sx, int sy, int dx, int dy)
{
XCopyArea (display, wmgen.mask, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy);
}
void
setMaskXY (int x, int y)
{
XShapeCombineMask (display, win, ShapeBounding, x, y, pixmask, ShapeSet);
XShapeCombineMask (display, iconwin, ShapeBounding, x, y, pixmask, ShapeSet);
}
void
openXwindow (int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, int pixmask_width, int pixmask_height)
{
unsigned int borderwidth = 1;
XClassHint classHint;
char *display_name = NULL;
char *wname = argv[0];
XTextProperty name;
XGCValues gcv;
unsigned long gcm;
char *geometry = NULL;
int dummy = 0;
int i, wx, wy;
for (i = 1; argv[i]; i++)
{
if (!strcmp (argv[i], "-display"))
{
display_name = argv[i + 1];
i++;
}
if (!strcmp (argv[i], "-geometry"))
{
geometry = argv[i + 1];
i++;
}
}
if (!(display = XOpenDisplay (display_name)))
{
fprintf (stderr, "%s: can't open display %s\n",
wname, XDisplayName (display_name));
exit (1);
}
screen = DefaultScreen (display);
Root = RootWindow (display, screen);
d_depth = DefaultDepth (display, screen);
x_fd = XConnectionNumber (display);
/* Convert XPM to XImage */
GetXPM (&wmgen, pixmap_bytes);
/* Create a window to hold the stuff */
mysizehints.flags = USSize | USPosition;
mysizehints.x = 0;
mysizehints.y = 0;
back_pix = GetColor ("white");
fore_pix = GetColor ("black");
XWMGeometry (display, screen, Geometry, NULL, borderwidth, &mysizehints,
&mysizehints.x, &mysizehints.y, &mysizehints.width, &mysizehints.height, &dummy);
mysizehints.width = 64;
mysizehints.height = 64;
win = XCreateSimpleWindow (display, Root, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
iconwin = XCreateSimpleWindow (display, win, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
/* Activate hints */
XSetWMNormalHints (display, win, &mysizehints);
classHint.res_name = wname;
classHint.res_class = wname;
XSetClassHint (display, win, &classHint);
XSelectInput (display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask);
XSelectInput (display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask);
if (XStringListToTextProperty (&wname, 1, &name) == 0)
{
fprintf (stderr, "%s: can't allocate window name\n", wname);
exit (1);
}
XSetWMName (display, win, &name);
/* Create GC for drawing */
gcm = GCForeground | GCBackground | GCGraphicsExposures;
gcv.foreground = fore_pix;
gcv.background = back_pix;
gcv.graphics_exposures = 0;
NormalGC = XCreateGC (display, Root, gcm, &gcv);
/* ONLYSHAPE ON */
pixmask = XCreateBitmapFromData (display, win, pixmask_bits, pixmask_width, pixmask_height);
XShapeCombineMask (display, win, ShapeBounding, 0, 0, pixmask, ShapeSet);
XShapeCombineMask (display, iconwin, ShapeBounding, 0, 0, pixmask, ShapeSet);
/* ONLYSHAPE OFF */
mywmhints.initial_state = WithdrawnState;
mywmhints.icon_window = iconwin;
mywmhints.icon_x = mysizehints.x;
mywmhints.icon_y = mysizehints.y;
mywmhints.window_group = win;
mywmhints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint;
XSetWMHints (display, win, &mywmhints);
XSetCommand (display, win, argv, argc);
XMapWindow (display, win);
if (geometry)
{
if (sscanf (geometry, "+%d+%d", &wx, &wy) != 2)
{
fprintf (stderr, "Bad geometry string.\n");
exit (1);
}
XMoveWindow (display, win, wx, wy);
}
}

View file

@ -0,0 +1,42 @@
#ifndef WMGENERAL_H_INCLUDED
#define WMGENERAL_H_INCLUDED
/***********/
/* Defines */
/***********/
#define MAX_MOUSE_REGION (16)
/************/
/* Typedefs */
/************/
typedef struct {
Pixmap pixmap;
Pixmap mask;
XpmAttributes attributes;
} XpmIcon;
/*******************/
/* Global variable */
/*******************/
Display *display;
/***********************/
/* Function Prototypes */
/***********************/
void AddMouseRegion(int index, int left, int top, int right, int bottom);
int CheckMouseRegion(int x, int y);
void openXwindow(int argc, char *argv[], char **, char *, int, int);
void RedrawWindow(void);
void RedrawWindowXY(int x, int y);
void createXBMfromXPM(char *, char **, int, int);
void copyXPMArea(int, int, int, int, int, int);
void copyXBMArea(int, int, int, int, int, int);
void setMaskXY(int, int);
#endif

View file

@ -0,0 +1,991 @@
/*
YAWMPPP - PPP dock app/helper for WindowMaker
Copyright (C) 2000,2001:
Author: Felipe Bergo (bergo@seul.org)
based on the wmppp application by
Martijn Pieterse (pieterse@xs4all.nl)
Antoine Nulle (warp@xs4all.nl)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id: yawmppp.c,v 1.1.1.1 2001/02/22 07:16:01 bergo Exp $
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <ctype.h>
#include <signal.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <sys/types.h>
#include <X11/Xlib.h>
#include <X11/xpm.h>
#include <X11/extensions/shape.h>
#include "wmgeneral.h"
#include "misc.h"
#include "isprc.h"
#include "ycommon.h"
#include "dockxpm.xpm"
#include "yawmppp.h"
/* external vars */
extern char **environ;
/* global variables */
long starttime;
char *ProgName;
char *active_interface = "ppp0";
int TimerDivisor = 60;
int updaterate = 5;
int dock_mask_width = 64;
int dock_mask_height = 64;
char dock_mask_bits[64 * 64];
int current_isp = 0;
int num_isps = 0;
int got_sched=0;
int caution=1;
struct YAWMPPP_ISP_INFO IspData[MAX_ISPS];
/* log data */
struct {
time_t start;
time_t end;
int status; /* 0=ok 1=error 2=crash */
char longname[128];
char shortname[16];
char phone[32];
char user[32];
} logconn;
/* PPP variables */
#define PPP_UNIT 0
int ppp_h = -1;
int ppp_open = 0;
#define PPP_STATS_HIS 54
int pixels_per_byte;
int ppp_history[PPP_STATS_HIS + 1][2];
/* main */
int
main (int argc, char *argv[])
{
int i;
/* Parse Command Line */
ProgName = argv[0];
if (strlen (ProgName) >= 5)
ProgName += (strlen (ProgName) - 5);
for (i = 1; i < argc; i++)
{
char *arg = argv[i];
if (*arg == '-')
{
switch (arg[1])
{
case 'c':
caution=1;
break;
case 'd':
if (strcmp (arg + 1, "display"))
{
usage ();
exit (1);
}
break;
case 'g':
if (strcmp (arg + 1, "geometry"))
{
usage ();
exit (1);
}
break;
case 'i':
if (!argv[i + 1])
{
usage ();
exit (1);
}
if (strncmp (argv[i + 1], "ppp", 3))
{
usage ();
exit (1);
}
active_interface = argv[i + 1];
i++;
break;
case 'p':
caution=2;
break;
case 't':
TimerDivisor = 1;
break;
case 'u':
i++;
if (!argv[i])
{
usage ();
exit (1);
}
updaterate = atoi (argv[i]);
if (updaterate < 1 || updaterate > 10)
{
usage ();
exit (1);
}
break;
case 'v':
printversion ();
exit (0);
break;
case 'z':
printf("Caution level: %d\n",caution);
break;
default:
usage ();
exit (0);
break;
}
}
}
for (i = 0; i < MAX_ISPS; i++)
memset(&IspData[i],0,sizeof(struct YAWMPPP_ISP_INFO));
make_config_dir();
signal(SIGUSR1,sigusr_handler);
signal(SIGHUP,sigusr_handler);
signal(SIGINT,sigusr_handler);
signal(SIGTERM,sigusr_handler);
write_pid_file();
clean_guards();
yawmppp_routine (argc, argv);
return 0;
}
void
yawmppp_routine (int argc, char **argv)
{
int i, j;
int but_stat;
long currenttime;
long lasttime;
long waittime;
long ppptime;
int hour, minute;
long timetolog;
long ppp_send, ppp_sl = -1;
long ppp_recv, ppp_rl = -1;
long ppp_sbytes, ppp_rbytes;
long ppp_osbytes, ppp_orbytes;
struct stat st;
pid_t stop_child = 0;
pid_t start_child = 0;
int status;
int isonline = 0;
XEvent Event;
int speed_ind = 10;
/* Initialize some stuff */
get_statistics (active_interface, &ppp_rl, &ppp_sl,
&ppp_orbytes, &ppp_osbytes);
if (caution>0)
close_ppp();
grab_isp_info(1);
/* Open the display */
createXBMfromXPM (dock_mask_bits, dockxpm_xpm,
dock_mask_width, dock_mask_height);
openXwindow (argc, argv, dockxpm_xpm, dock_mask_bits,
dock_mask_width, dock_mask_height);
/* V Button */
AddMouseRegion (0, 35, 48, 46, 58);
/* x Button */
AddMouseRegion (1, 47, 48, 58, 58);
/* < Button */
AddMouseRegion (2, 5, 48, 16, 58);
/* > Button */
AddMouseRegion (3, 17, 48, 28, 58);
/* ISP display */
AddMouseRegion (4, 5, 6, 59, 43);
starttime = 0;
currenttime = time (0);
ppptime = 0;
but_stat = -1;
waittime = 0;
timetolog=0;
/* 888k8 on bottom */
copyXPMArea (ERR_SRC_X+28, ERR_SRC_Y+9, 25, 8, ERR_DEST_X, ERR_DEST_Y);
DrawISPName ();
while (1)
{
lasttime = currenttime;
currenttime = time (0);
/* Check if any child has left the playground */
i = waitpid (0, &status, WNOHANG);
if (i == stop_child && stop_child != 0)
{
starttime = 0;
SetOffLED (LED_PPP_POWER);
SetOffLED (LED_PPP_RX);
SetOffLED (LED_PPP_TX);
/* 888k8 on bottom */
copyXPMArea (ERR_SRC_X+28, ERR_SRC_Y+9, 25, 8,
ERR_DEST_X, ERR_DEST_Y);
RedrawWindow ();
stop_child = 0;
}
if (i == start_child && start_child != 0)
{
if (WIFEXITED (status))
{
if (WEXITSTATUS (status) == 10)
{
starttime = 0;
/* 88k8 on bottom */
copyXPMArea (ERR_SRC_X+28, ERR_SRC_Y+9, 25, 8,
ERR_DEST_X, ERR_DEST_Y);
SetOffLED (LED_PPP_POWER);
DrawTime (0, 1);
RedrawWindow ();
}
start_child = 0;
}
}
/* On-line detectie! 1x per second */
if (currenttime != lasttime)
{
i = 0;
if (stillonline (active_interface))
{
i = 1;
if (!starttime)
{
starttime = currenttime;
if (stat (STAMP_FILE, &st) == 0)
starttime = st.st_mtime;
SetOnLED (LED_PPP_POWER);
waittime = 0;
/* 88k8 on bottom */
copyXPMArea (ERR_SRC_X+28, ERR_SRC_Y+9, 25, 8,
ERR_DEST_X, ERR_DEST_Y);
if (IspData[current_isp].SpeedAction)
DrawSpeedInd (IspData[current_isp].SpeedAction);
speed_ind = currenttime + 10;
RedrawWindow ();
}
}
if (!i && starttime)
{
starttime = 0;
SetErrLED (LED_PPP_POWER);
logconn.status=1;
/* Error */
copyXPMArea (ERR_SRC_X, ERR_SRC_Y+9, 25, 8,
ERR_DEST_X, ERR_DEST_Y);
if (IspData[current_isp].IfDownAction)
execCommand (IspData[current_isp].IfDownAction);
RedrawWindow ();
}
}
if (waittime && waittime <= currenttime)
{
SetOffLED (LED_PPP_POWER);
RedrawWindow ();
waittime = 0;
}
if ((starttime)&&(!isonline)) {
isonline=1;
logconn.start=time(NULL);
logconn.status=0;
strcpy(logconn.longname,IspData[current_isp].LongName);
strcpy(logconn.shortname,IspData[current_isp].ShortName);
strcpy(logconn.user,IspData[current_isp].User);
strcpy(logconn.phone,IspData[current_isp].Phone);
if (!strlen(logconn.shortname))
strcpy(logconn.shortname,"empty");
if (!strlen(logconn.longname))
strcpy(logconn.longname,"empty");
if (!strlen(logconn.user))
strcpy(logconn.user,"empty");
if (!strlen(logconn.phone))
strcpy(logconn.phone,"empty");
make_guards();
}
if ((!starttime)&&(isonline)) {
isonline=0;
logconn.end=time(NULL);
write_log();
if (got_sched)
make_delayed_update();
if (caution>0)
close_ppp();
}
/* If we are on-line. Print the time we are */
if (starttime)
{
i = currenttime - starttime;
i /= TimerDivisor;
if (TimerDivisor == 1)
if (i > 59 * 60 + 59)
i /= 60;
minute = i % 60;
hour = (i / 60) % 100;
i = hour * 100 + minute;
DrawTime (i, currenttime % 2);
/* We are online, so we can check for send/recv packets */
get_statistics (active_interface, &ppp_recv, &ppp_send,
&ppp_rbytes, &ppp_sbytes);
if (caution>1)
close_ppp();
if (ppp_send != ppp_sl)
SetOnLED (LED_PPP_TX);
else
SetOffLED (LED_PPP_TX);
if (ppp_recv != ppp_rl)
SetOnLED (LED_PPP_RX);
else
SetOffLED (LED_PPP_RX);
ppp_sl = ppp_send;
ppp_rl = ppp_recv;
/* Every five seconds we check to load on the line */
if (currenttime - timetolog >= 0) {
timetolog=currenttime + 60;
make_guards();
}
if ((currenttime - ppptime >= 0) || (ppptime == 0))
{
ppptime = currenttime + updaterate;
ppp_history[PPP_STATS_HIS][0] = ppp_rbytes - ppp_orbytes;
ppp_history[PPP_STATS_HIS][1] = ppp_sbytes - ppp_osbytes;
ppp_orbytes = ppp_rbytes;
ppp_osbytes = ppp_sbytes;
DrawStats (54, 17, 5, 32);
for (j = 1; j < 55; j++)
{
ppp_history[j - 1][0] = ppp_history[j][0];
ppp_history[j - 1][1] = ppp_history[j][1];
}
if (currenttime > speed_ind)
{
DrawLoadInd ((ppp_history[54][0] + ppp_history[54][1]) / updaterate);
}
}
RedrawWindow ();
}
while (XPending (display))
{
XNextEvent (display, &Event);
switch (Event.type)
{
case Expose:
RedrawWindow ();
break;
case DestroyNotify:
XCloseDisplay (display);
while (start_child | stop_child)
{
i = waitpid (0, &status, WNOHANG);
if (i == stop_child)
stop_child = 0;
if (i == start_child)
start_child = 0;
usleep (50000l);
}
exit (0);
break;
case ButtonPress:
i = CheckMouseRegion (Event.xbutton.x, Event.xbutton.y);
switch (i)
{
case 0:
ButtonDown (BUT_V);
break;
case 1:
ButtonDown (BUT_X);
break;
case 2:
ButtonDown (BUT_REW);
break;
case 3:
ButtonDown (BUT_FF);
break;
}
but_stat = i;
RedrawWindow ();
break;
case ButtonRelease:
i = CheckMouseRegion (Event.xbutton.x, Event.xbutton.y);
// Button but_stat omhoogdoen!
switch (but_stat)
{
case 0:
ButtonUp (BUT_V);
break;
case 1:
ButtonUp (BUT_X);
break;
case 2:
ButtonUp (BUT_REW);
break;
case 3:
ButtonUp (BUT_FF);
break;
}
if (i == but_stat && but_stat >= 0)
{
switch (i)
{
case 0:
if (!starttime)
{
/* 888k8 */
copyXPMArea (ERR_SRC_X+28, ERR_SRC_Y+9,
25, 8,
ERR_DEST_X, ERR_DEST_Y);
DrawTime (0, 1);
start_child = execCommand (IspData[current_isp].StartAction);
SetWaitLED (LED_PPP_POWER);
waittime = ORANGE_LED_TIMEOUT + currenttime;
}
break;
case 1:
if (stop_child == 0)
{
stop_child = execCommand (IspData[current_isp].StopAction);
}
break;
case 2:
if (!starttime)
{
current_isp--;
if (current_isp < 0)
current_isp = num_isps - 1;
if (current_isp < 0)
current_isp=0;
DrawISPName ();
}
break;
case 3:
if (!starttime)
{
current_isp++;
if (current_isp == num_isps)
current_isp = 0;
DrawISPName ();
}
break;
case 4:
if (Event.xbutton.button==Button1)
run_pref_app();
else
run_log_app();
break;
}
}
RedrawWindow ();
but_stat = -1;
break;
default:
break;
}
}
usleep (50000L);
}
}
/* DrawTime */
void
DrawTime (int i, int j)
{
int k = 1000;
copyXPMArea (TIMER_SZE_X * ((i / k) % 10) + 1, TIMER_SRC_Y,
5, 7,
TIMER_DES_X + 6 * 0, TIMER_DES_Y);
k = k / 10;
copyXPMArea (TIMER_SZE_X * ((i / k) % 10) + 1, TIMER_SRC_Y,
5, 7,
TIMER_DES_X + 6 * 1, TIMER_DES_Y);
k = k / 10;
/* colon */
if (j)
copyXPMArea (62, TIMER_SRC_Y,
1, 7,
TIMER_DES_X + 6 * 2 + 1, TIMER_DES_Y);
else
copyXPMArea (63, TIMER_SRC_Y,
1, 7,
TIMER_DES_X + 6 * 2 + 1, TIMER_DES_Y);
copyXPMArea (TIMER_SZE_X * ((i / k) % 10) + 1, TIMER_SRC_Y,
5, 7,
TIMER_DES_X + 6 * 2 + 4, TIMER_DES_Y);
k = k / 10;
copyXPMArea (TIMER_SZE_X * ((i / k) % 10) + 1, TIMER_SRC_Y,
5, 7,
TIMER_DES_X + 6 * 3 + 4, TIMER_DES_Y);
}
void
DrawStats (int num, int size, int x_left, int y_bottom)
{
int pixels_per_byte;
int j, k;
pixels_per_byte = size;
for (j = 0; j < num; j++)
if ((ppp_history[j][0]+ppp_history[j][1]) > pixels_per_byte)
pixels_per_byte = ppp_history[j][0] + ppp_history[j][1];
pixels_per_byte /= size;
for (k = 0; k < num; k++)
for (j = 0; j < size; j++)
{
if (j < (ppp_history[k][0] / pixels_per_byte))
copyXPMArea (58 + 2, 92, 1, 1, k + x_left, y_bottom - j);
else if (j < (ppp_history[k][0] + ppp_history[k][1]) / pixels_per_byte)
copyXPMArea (58 + 1, 92, 1, 1, k + x_left, y_bottom - j);
else
copyXPMArea (58 + 0, 92, 1, 1, k + x_left, y_bottom - j);
}
}
void
PrintLittle (int i, int *k)
{
switch (i)
{
case -1:
*k -= 5;
copyXPMArea (12 * 5, ERR_SRC_Y, 4, 8, *k, ERR_DEST_Y);
break;
case 0:
*k -= 5;
copyXPMArea (45, ERR_SRC_Y, 5, 8, *k, ERR_DEST_Y);
break;
default:
*k -= 5;
copyXPMArea (i * 5 - 5, ERR_SRC_Y, 5, 8, *k, ERR_DEST_Y);
break;
}
}
void
DrawSpeedInd (char *speed_action)
{
int linespeed, i, k;
FILE *fp;
char *p;
char temp[128];
fp = popen (speed_action, "r");
if (fp)
{
linespeed = 0;
while (fgets (temp, 128, fp))
;
pclose (fp);
if ((p = strstr (temp, "CONNECT")))
{
linespeed = atoi (p + 8);
}
k = ERR_DEST_X+25;
i = (linespeed % 1000) / 100;
linespeed /= 1000;
PrintLittle (i, &k);
k -= 5;
copyXPMArea (ERR_SRC_X+50, ERR_SRC_Y, 5, 8, k, ERR_DEST_Y);
do
{
PrintLittle (linespeed % 10, &k);
linespeed /= 10;
}
while (linespeed);
}
}
/* DrawLoadInd */
void
DrawLoadInd (int speed)
{
int i, k;
k = ERR_DEST_X+25;
for (i = 0; i < 5; i++)
PrintLittle (-1, &k);
k = ERR_DEST_X+25;
do
{
PrintLittle (speed % 10, &k);
speed /= 10;
}
while (speed);
}
/* usage */
void
usage (void)
{
fprintf (stderr,
"\nyawmppp - Yet Another Window Maker PPP dock applet\n\n");
fprintf (stderr,
"version %s\n\n",VERSION);
fprintf (stderr, "usage:\n");
fprintf (stderr, "-h this help screen\n");
fprintf (stderr, "-i <device> (ppp0, ppp1, etc)\n");
fprintf (stderr, "-t set the on-line timer to MM:SS instead of HH:MM\n");
fprintf (stderr, "-u <update rate> (1..10), default 5 seconds\n");
fprintf (stderr, "-v print the version number\n");
fprintf (stderr, "-paranoid be paranoid about open sockets\n");
fprintf (stderr, "\n");
}
/* printversion */
void
printversion (void)
{
fprintf (stderr, "%s\n", VERSION);
}
/* SetOnLED */
void
SetOnLED (int led)
{
switch (led)
{
case LED_PPP_POWER:
copyXPMArea (LED_ON_X, LED_ON_Y, LED_SZE_X, LED_SZE_Y, LED_PWR_X, LED_PWR_Y);
break;
case LED_PPP_RX:
copyXPMArea (ARR_DN_X, ARR_DN_Y+ARR_ACTV, ARR_W, ARR_H, LED_RCV_X, LED_RCV_Y);
break;
case LED_PPP_TX:
copyXPMArea (ARR_UP_X, ARR_UP_Y+ARR_ACTV, ARR_W, ARR_H, LED_SND_X, LED_SND_Y);
break;
}
}
/* SetOffLED */
void
SetOffLED (int led)
{
switch (led)
{
case LED_PPP_POWER:
copyXPMArea (LED_OFF_X, LED_OFF_Y, LED_SZE_X, LED_SZE_Y, LED_PWR_X, LED_PWR_Y);
break;
case LED_PPP_RX:
copyXPMArea (ARR_DN_X, ARR_DN_Y , ARR_W, ARR_H, LED_RCV_X, LED_RCV_Y);
break;
case LED_PPP_TX:
copyXPMArea (ARR_UP_X, ARR_UP_Y, ARR_W, ARR_H, LED_SND_X, LED_SND_Y);
break;
}
}
/* SetErrELD */
void
SetErrLED (int led)
{
switch (led)
{
case LED_PPP_POWER:
copyXPMArea (LED_ERR_X, LED_ERR_Y, LED_SZE_X, LED_SZE_Y, LED_PWR_X, LED_PWR_Y);
break;
}
}
/* SetWaitLED */
void
SetWaitLED (int led)
{
switch (led)
{
case LED_PPP_POWER:
copyXPMArea (LED_WTE_X, LED_WTE_Y, LED_SZE_X, LED_SZE_Y, LED_PWR_X, LED_PWR_Y);
break;
}
}
/* Button Up */
void
ButtonUp (int button)
{
switch (button)
{
case BUT_V:
copyXPMArea (BUT_V_SRC_X+BUT_UP_INC, BUT_V_SRC_Y,
12, 11,
BUT_V_X, BUT_V_Y);
break;
case BUT_X:
copyXPMArea (BUT_X_SRC_X+BUT_UP_INC, BUT_X_SRC_Y,
12, 11,
BUT_X_X, BUT_X_Y);
break;
case BUT_REW:
copyXPMArea (BUT_R_SRC_X+BUT_UP_INC, BUT_R_SRC_Y,
12, 11,
BUT_R_X, BUT_R_Y);
break;
case BUT_FF:
copyXPMArea (BUT_F_SRC_X+BUT_UP_INC, BUT_F_SRC_Y,
12, 11,
BUT_F_X, BUT_F_Y);
break;
}
}
/* Button Down */
void
ButtonDown (int button)
{
switch (button)
{
case BUT_V:
copyXPMArea (BUT_V_SRC_X, BUT_V_SRC_Y,
12, 11,
BUT_V_X, BUT_V_Y);
break;
case BUT_X:
copyXPMArea (BUT_X_SRC_X, BUT_X_SRC_Y,
12, 11,
BUT_X_X, BUT_X_Y);
break;
case BUT_REW:
copyXPMArea (BUT_R_SRC_X, BUT_R_SRC_Y,
12, 11,
BUT_R_X, BUT_R_Y);
break;
case BUT_FF:
copyXPMArea (BUT_F_SRC_X, BUT_F_SRC_Y,
12, 11,
BUT_F_X, BUT_F_Y);
break;
}
}
void
DrawISPName (void)
{
int i, s;
s = strlen (IspData[current_isp].ShortName);
for (i = 0; i < 5; i++)
{
if (s >= (i + 1))
draw_isp_char (i, IspData[current_isp].ShortName[i]);
else
draw_isp_char (i, ' ');
}
}
void
draw_isp_char (int pos, char letter)
{
int sx = 0, sy = 0, ac = 0;
if ((!ac) && (letter >= 'A') && (letter <= 'Z'))
{
sx = UPPER_ABC_BASE_X;
sy = UPPER_ABC_BASE_Y;
sy += 8 * ((letter - 'A') / 12);
sx += 5 * ((letter - 'A') % 12);
ac = 1;
}
if ((!ac) && (letter >= 'a') && (letter <= 'z'))
{
sx = LOWER_ABC_BASE_X;
sy = LOWER_ABC_BASE_Y;
sy += 8 * ((letter - 'a') / 12);
sx += 5 * ((letter - 'a') % 12);
ac = 1;
}
if ((!ac) && (letter >= '0') && (letter <= '9'))
{
sx = DIGIT_BASE_X;
sy = DIGIT_BASE_Y;
sx += 5 * (letter - '0');
ac = 1;
}
if (!ac)
{
sx = SPACE_BASE_X;
sy = SPACE_BASE_Y;
}
copyXPMArea (sx, sy, 4, 7, ISP_BASE_X + 5 * pos, ISP_BASE_Y);
}
void
sigusr_handler(int signum)
{
if (signum==SIGUSR1) {
if (!starttime) {
grab_isp_info(0);
if (current_isp>=num_isps)
current_isp=0;
DrawISPName();
RedrawWindow();
} else {
got_sched=1;
warn_pref();
}
}
else {
remove_pid_file();
exit(0);
}
}
void
make_delayed_update(void)
{
grab_isp_info(0);
if (current_isp>=num_isps)
current_isp=0;
DrawISPName();
RedrawWindow();
got_sched=0;
}

View file

@ -0,0 +1,142 @@
/* DEFINES */
#define START_ACTION (NULL)
#define STOP_ACTION (NULL)
#define SPEED_ACTION (NULL)
#define IFDOWN_ACTION (NULL)
#define STAMP_FILE "/var/run/ppp0.pid"
#define LED_PPP_RX (1)
#define LED_PPP_TX (2)
#define LED_PPP_POWER (3)
#define BUT_V (1)
#define BUT_X (2)
#define BUT_REW (3)
#define BUT_FF (4)
#define TIMER_SRC_Y (176)
#define TIMER_DES_Y (8)
#define TIMER_DES_X (7)
#define TIMER_SZE_X (6)
#define LED_ON_X (51)
#define LED_ON_Y (87)
#define LED_OFF_X (51)
#define LED_OFF_Y (82)
#define LED_ERR_X (57)
#define LED_ERR_Y (82)
#define LED_WTE_X (57)
#define LED_WTE_Y (87)
#define LED_SZE_X (4)
#define LED_SZE_Y (4)
#define LED_PWR_X (52)
#define LED_PWR_Y (9)
#define LED_SND_X (44)
#define LED_SND_Y (9)
#define LED_RCV_X (37)
#define LED_RCV_Y (9)
#define ISP_BASE_X (6)
#define ISP_BASE_Y (35)
#define UPPER_ABC_BASE_X (1)
#define UPPER_ABC_BASE_Y (124)
#define LOWER_ABC_BASE_X (1)
#define LOWER_ABC_BASE_Y (148)
#define DIGIT_BASE_X (11)
#define DIGIT_BASE_Y (164)
#define SPACE_BASE_X (11)
#define SPACE_BASE_Y (140)
#define ERR_DEST_X (34)
#define ERR_DEST_Y (35)
#define ERR_SRC_X (0)
#define ERR_SRC_Y (94)
#define BUT_V_X (35)
#define BUT_V_Y (48)
#define BUT_X_X (47)
#define BUT_X_Y (48)
#define BUT_R_X (5)
#define BUT_R_Y (48)
#define BUT_F_X (17)
#define BUT_F_Y (48)
#define BUT_V_SRC_X (0)
#define BUT_V_SRC_Y (70)
#define BUT_X_SRC_X (12)
#define BUT_X_SRC_Y (70)
#define BUT_R_SRC_X (0)
#define BUT_R_SRC_Y (82)
#define BUT_F_SRC_X (12)
#define BUT_F_SRC_Y (82)
#define BUT_UP_INC (24)
#define ARR_UP_X (50)
#define ARR_UP_Y (70)
#define ARR_DN_X (57)
#define ARR_DN_Y (70)
#define ARR_ACTV (5)
#define ARR_W (7)
#define ARR_H (4)
#define ORANGE_LED_TIMEOUT (60)
/* prototypes */
void usage (void);
void printversion (void);
void DrawTime (int, int);
void DrawStats (int, int, int, int);
void DrawSpeedInd (char *);
void DrawLoadInd (int);
void DrawISPName (void);
void SetOnLED (int);
void SetErrLED (int);
void SetWaitLED (int);
void SetOffLED (int);
void ButtonUp (int);
void ButtonDown (int);
void yawmppp_routine (int, char **);
int get_statistics (char *, long *, long *, long *, long *);
int stillonline (char *);
void draw_isp_char (int, char);
void grab_isp_info (int);
void sigusr_handler(int signum);
void remove_pid_file(void);
void write_pid_file(void);
void make_config_dir(void);
void run_pref_app(void);
void run_log_app(void);
void add_dns(void);
void remove_dns(void);
void warn_pref(void);
void make_delayed_update(void);
/* logs */
void clean_guards(void);
void make_guards(void);
void write_log(void);
/* pcmcia blues ? */
void open_ppp(void);
void close_ppp(void);

View file

@ -0,0 +1,35 @@
#
# gtklog: shows yawmppp log files
#
CC = @CC@
CFLAGS = -Wall -O2
GTKLIB = @GTK_LIBS@
GTKFLAG = @GTK_FLAGS@
RLFLAG = -DVERSION=\"@MK_YAWMPPP_RELEASE@\"
PROGINST = @INSTALL@
EOBJS = ../about.o
ALLDOTOS = loglist.o
ALLDOTHS = loglist.h
all: build_gtklog
build_gtklog: $(ALLDOTOS)
$(CC) $(ALLDOTOS) $(EOBJS) -o yawmppp.log $(GTKLIB)
$(ALLDOTOS): %.o : %.c $(ALLDOTHS)
$(CC) $(CFLAGS) $(RLFLAG) $(GTKFLAG) -I.. -c $< -o $@
install:
$(PROGINST) -m 0755 yawmppp.log @prefix@/bin/yawmppp.log
install-strip:
$(PROGINST) -s -m 0755 yawmppp.log @prefix@/bin/yawmppp.log
clean:
rm -f $(ALLDOTOS) yawmppp.log
distclean:
rm -f Makefile *~

View file

@ -0,0 +1,875 @@
/*
YAWMPPP - PPP dock app/helper for WindowMaker
Copyright (C) 2000:
Author: Felipe Bergo (bergo@seul.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id: loglist.c,v 1.1.1.1 2001/02/22 07:35:59 bergo Exp $
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <gtk/gtk.h>
#include "loglist.h"
#include "about.h"
#include "status_error.xpm"
#include "status_crash.xpm"
#include "status_ok.xpm"
#include "stepphone.xpm"
GtkWidget *applet,*loglist,*lresume[2],*hgraph,*wgraph;
GdkPixmap *iconmap[3];
GdkBitmap *maskmap[3];
GdkPixmap *hcanvas=NULL;
GdkPixmap *wcanvas=NULL;
GList *log=NULL;
/* start end difftime statuspix staustext handle name phone user */
static int colsize[8]={160,160,64,54,45,110,64,64};
static char *resumeo[]=
{
"All time",
"Today",
"Yesterday",
"This week",
"This month",
"This year",
"Last 24 hours",
"Last 7 days",
"Last 30 days",
"Last 365 days"
};
static char *titles[8]={"Start time",
"End time",
"Online time",
"Status",
"ISP",
"Dialup entry",
"Phone",
"User"};
static char *wdays[]={
"Sun","Mon","Tue","Wed","Thu","Fri","Sat"
};
static long hourly[24],weekly[7];
int nsrc[256];
GList *users=NULL;
GList *isps=NULL;
/* constraints */
time_t time_cons[2];
int useridx,ispidx;
int
main(int argc,char **argv)
{
int i;
for(i=0;i<24;i++)
hourly[i]=0;
for(i=0;i<7;i++)
weekly[i]=0;
for(i=0;i<256;i++)
nsrc[i]=i;
time_cons[0]=0;
time_cons[1]=0;
useridx=ispidx=0;
gtk_init(&argc,&argv);
gdk_rgb_init();
load_log();
create_loglist();
update_list();
make_resume();
gtk_main();
g_list_free(users);
g_list_free(isps);
for(i=0;i<3;i++)
gdk_pixmap_unref(iconmap[i]);
free_log();
return 0;
}
void
create_loglist(void)
{
GtkWidget *mvb,*sw,*dhb,*dhw[30];
GdkBitmap *mask;
GdkPixmap *myicon;
GtkStyle *style;
GList *pt;
int i;
applet=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size(GTK_WINDOW(applet),780,510);
gtk_window_set_title (GTK_WINDOW (applet), "YAWMPPP Connection Log");
gtk_window_set_wmclass(GTK_WINDOW(applet),"yawmppp","log");
gtk_container_set_border_width(GTK_CONTAINER(applet),4);
gtk_widget_show (applet);
style=gtk_widget_get_style(applet);
myicon = gdk_pixmap_create_from_xpm_d (applet->window, &mask,
&style->bg[GTK_STATE_NORMAL],
(gchar **) stepphone_xpm);
gdk_window_set_icon (applet->window, NULL, myicon, mask);
gdk_window_set_icon_name(applet->window,"The Log");
mvb=gtk_vbox_new(FALSE,0);
gtk_container_add(GTK_CONTAINER(applet),mvb);
dhb=gtk_hbox_new(FALSE,0);
gtk_box_pack_start(GTK_BOX(mvb),dhb,FALSE,TRUE,0);
/* data */
dhw[0]=gtk_label_new("Show summary for:");
gtk_box_pack_start(GTK_BOX(dhb),dhw[0],FALSE,FALSE,4);
dhw[1]=gtk_option_menu_new();
gtk_box_pack_start(GTK_BOX(dhb),dhw[1],FALSE,FALSE,2);
dhw[2]=gtk_menu_new();
for(i=0;i<10;i++) {
dhw[3]=gtk_menu_item_new_with_label(resumeo[i]);
gtk_signal_connect(GTK_OBJECT(dhw[3]),"activate",
GTK_SIGNAL_FUNC(time_menu),&nsrc[i]);
gtk_menu_append(GTK_MENU(dhw[2]),dhw[3]);
gtk_widget_show(dhw[3]);
}
gtk_option_menu_set_menu(GTK_OPTION_MENU(dhw[1]),dhw[2]);
dhw[12]=gtk_label_new("include entries from");
gtk_box_pack_start(GTK_BOX(dhb),dhw[12],FALSE,FALSE,4);
dhw[13]=gtk_option_menu_new();
gtk_box_pack_start(GTK_BOX(dhb),dhw[13],FALSE,FALSE,2);
dhw[14]=gtk_menu_new();
for(i=0,pt=isps;pt!=NULL;pt=g_list_next(pt),i++) {
dhw[3]=gtk_menu_item_new_with_label((char *)(pt->data));
gtk_signal_connect(GTK_OBJECT(dhw[3]),"activate",
GTK_SIGNAL_FUNC(isp_menu),&nsrc[i]);
gtk_menu_append(GTK_MENU(dhw[14]),dhw[3]);
gtk_widget_show(dhw[3]);
}
gtk_option_menu_set_menu(GTK_OPTION_MENU(dhw[13]),dhw[14]);
dhw[15]=gtk_label_new("include connections as");
gtk_box_pack_start(GTK_BOX(dhb),dhw[15],FALSE,FALSE,4);
dhw[16]=gtk_option_menu_new();
gtk_box_pack_start(GTK_BOX(dhb),dhw[16],FALSE,FALSE,2);
dhw[17]=gtk_menu_new();
for(i=0,pt=users;pt!=NULL;pt=g_list_next(pt),i++) {
dhw[3]=gtk_menu_item_new_with_label((char *)(pt->data));
gtk_signal_connect(GTK_OBJECT(dhw[3]),"activate",
GTK_SIGNAL_FUNC(user_menu),&nsrc[i]);
gtk_menu_append(GTK_MENU(dhw[17]),dhw[3]);
gtk_widget_show(dhw[3]);
}
gtk_option_menu_set_menu(GTK_OPTION_MENU(dhw[16]),dhw[17]);
dhw[5]=gtk_hseparator_new();
gtk_box_pack_start(GTK_BOX(mvb),dhw[5],FALSE,FALSE,3);
dhw[3]=gtk_hbox_new(FALSE,4);
gtk_box_pack_start(GTK_BOX(mvb),dhw[3],FALSE,TRUE,3);
dhw[4]=lresume[0]=gtk_label_new("\n\n\n\n\n");
dhw[6]=lresume[1]=gtk_label_new("\n\n\n\n\n");
for(i=0;i<2;i++)
gtk_label_set_justify(GTK_LABEL(lresume[i]),GTK_JUSTIFY_LEFT);
gtk_box_pack_start(GTK_BOX(dhw[3]),dhw[4],FALSE,TRUE,4);
gtk_box_pack_start(GTK_BOX(dhw[3]),dhw[6],FALSE,TRUE,4);
hgraph=dhw[7]=gtk_drawing_area_new();
gtk_drawing_area_size(GTK_DRAWING_AREA(dhw[7]),24*9+2,120);
gtk_widget_set_events(dhw[7],GDK_EXPOSURE_MASK);
gtk_box_pack_start(GTK_BOX(dhw[3]),dhw[7],FALSE,FALSE,4);
wgraph=dhw[8]=gtk_drawing_area_new();
gtk_drawing_area_size(GTK_DRAWING_AREA(dhw[8]),7*20+2,120);
gtk_widget_set_events(dhw[8],GDK_EXPOSURE_MASK);
gtk_box_pack_start(GTK_BOX(dhw[3]),dhw[8],FALSE,FALSE,4);
dhw[11]=gtk_hseparator_new();
gtk_box_pack_start(GTK_BOX(mvb),dhw[11],FALSE,FALSE,4);
dhw[9]=gtk_hbox_new(FALSE,2);
dhw[10]=gtk_label_new("Raw log listing (unfiltered):");
gtk_box_pack_start(GTK_BOX(mvb),dhw[9],FALSE,FALSE,4);
gtk_box_pack_start(GTK_BOX(dhw[9]),dhw[10],FALSE,FALSE,2);
/* list */
sw=gtk_scrolled_window_new(NULL,NULL);
gtk_box_pack_start(GTK_BOX(mvb),sw,TRUE,TRUE,4);
gtk_widget_show(sw);
gtk_container_set_border_width(GTK_CONTAINER(sw),0);
loglist=gtk_clist_new(8);
gtk_clist_set_shadow_type(GTK_CLIST(loglist),GTK_SHADOW_IN);
gtk_clist_set_selection_mode(GTK_CLIST(loglist),GTK_SELECTION_SINGLE);
for(i=0;i<8;i++) {
gtk_clist_set_column_title(GTK_CLIST(loglist),i,titles[i]);
gtk_clist_set_column_width(GTK_CLIST(loglist),i,colsize[i]);
}
gtk_clist_column_titles_passive(GTK_CLIST(loglist));
gtk_clist_column_titles_show(GTK_CLIST(loglist));
gtk_clist_set_row_height(GTK_CLIST(loglist),16);
gtk_clist_set_column_auto_resize(GTK_CLIST(loglist),1,FALSE);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_ALWAYS);
gtk_container_add(GTK_CONTAINER(sw),loglist);
gtk_widget_show(loglist);
/* bottom */
dhw[18]=gtk_hseparator_new();
gtk_box_pack_start(GTK_BOX(mvb),dhw[18],FALSE,FALSE,4);
dhw[19]=gtk_table_new(1,6,TRUE);
dhw[21]=gtk_button_new_with_label(" About... ");
dhw[22]=gtk_button_new_with_label(" Close ");
dhw[23]=gtk_hbox_new(TRUE,6);
gtk_box_pack_start(GTK_BOX(mvb),dhw[19],FALSE,FALSE,4);
gtk_table_attach_defaults(GTK_TABLE(dhw[19]),dhw[23],4,6,0,1);
gtk_box_pack_start(GTK_BOX(dhw[23]),dhw[21],FALSE,TRUE,4);
gtk_box_pack_start(GTK_BOX(dhw[23]),dhw[22],FALSE,TRUE,4);
for(i=0;i<24;i++)
if (i!=20)
gtk_widget_show(dhw[i]);
gtk_widget_show(dhb);
gtk_widget_show(mvb);
iconmap[0] = gdk_pixmap_create_from_xpm_d (applet->window, &maskmap[0],
&style->bg[GTK_STATE_NORMAL],
(gchar **) status_ok_xpm);
iconmap[1] = gdk_pixmap_create_from_xpm_d (applet->window, &maskmap[1],
&style->bg[GTK_STATE_NORMAL],
(gchar **) status_error_xpm);
iconmap[2] = gdk_pixmap_create_from_xpm_d (applet->window, &maskmap[2],
&style->bg[GTK_STATE_NORMAL],
(gchar **) status_crash_xpm);
/* signal plumbing */
gtk_signal_connect (GTK_OBJECT (applet), "delete_event",
GTK_SIGNAL_FUNC (applet_kill), NULL);
gtk_signal_connect (GTK_OBJECT (applet), "destroy",
GTK_SIGNAL_FUNC (applet_destroy), NULL);
gtk_signal_connect (GTK_OBJECT (hgraph), "expose_event",
GTK_SIGNAL_FUNC (hgra_expose), NULL);
gtk_signal_connect (GTK_OBJECT (hgraph), "configure_event",
GTK_SIGNAL_FUNC (hgra_configure), NULL);
gtk_signal_connect (GTK_OBJECT (wgraph), "expose_event",
GTK_SIGNAL_FUNC (wgra_expose), NULL);
gtk_signal_connect (GTK_OBJECT (wgraph), "configure_event",
GTK_SIGNAL_FUNC (wgra_configure), NULL);
gtk_signal_connect (GTK_OBJECT (dhw[21]), "clicked",
GTK_SIGNAL_FUNC (applet_about),
(gpointer)GTK_WINDOW(applet));
gtk_signal_connect (GTK_OBJECT (dhw[22]), "clicked",
GTK_SIGNAL_FUNC (applet_destroy), NULL);
}
void
load_log(void)
{
FILE *f;
char *p;
char temp[256],aux[256];
GList *pt;
struct logentry *le;
if (users)
g_list_free(users);
if (isps)
g_list_free(isps);
users=NULL;
isps=NULL;
users=g_list_append(users,"All users");
isps=g_list_append(isps,"All ISPs");
p=getenv("HOME");
sprintf(temp,"%s/.yawmppp2/logfile",p);
if (log)
free_log();
f=fopen(temp,"r");
if (!f)
return;
while(fgets(aux,255,f))
prepend_log_entry(aux);
fclose(f);
for(pt=log;pt!=NULL;pt=g_list_next(pt)) {
le=(struct logentry *)(pt->data);
if (!already_exists(le->user,users)) {
users=g_list_append(users,(gpointer)(le->user));
}
if (!already_exists(le->shortname,isps))
isps=g_list_append(isps,(gpointer)(le->shortname));
}
}
void
prepend_log_entry(char *logline)
{
char *p;
struct logentry *le;
le=(struct logentry *)g_malloc0(sizeof(struct logentry));
if ((p=strtok(logline,"\t\n"))==NULL) { g_free(le); return; }
le->start=(time_t)atol(p);
if ((p=strtok(NULL,"\t\n"))==NULL) { g_free(le); return; }
le->end=(time_t)atol(p);
if ((p=strtok(NULL,"\t\n"))==NULL) { g_free(le); return; }
le->status=atoi(p);
if ((p=strtok(NULL,"\t\n"))==NULL) { g_free(le); return; }
strncpy(le->longname,p,128);
if ((p=strtok(NULL,"\t\n"))==NULL) { g_free(le); return; }
strncpy(le->shortname,p,16);
if ((p=strtok(NULL,"\t\n"))==NULL) { g_free(le); return; }
strncpy(le->phone,p,32);
if ((p=strtok(NULL,"\t\n"))==NULL) { g_free(le); return; }
strncpy(le->user,p,32);
log=g_list_prepend(log,(gpointer)(le));
}
void
free_log(void)
{
GList *pt;
for(pt=log;pt!=NULL;pt=g_list_next(pt))
g_free(pt->data);
g_list_free(log);
log=NULL;
}
void
update_list(void)
{
GList *pt;
struct logentry *le;
char tmp[8][128];
gchar *pp[8];
int ontime,h,m,s,i;
int lc;
gtk_clist_freeze(GTK_CLIST(loglist));
gtk_clist_clear(GTK_CLIST(loglist));
for(i=0;i<8;i++)
pp[i]=tmp[i];
for(lc=0,pt=log;pt!=NULL;pt=g_list_next(pt),lc++) {
le=(struct logentry *)(pt->data);
strcpy(tmp[0],ctime(&(le->start)));
strcpy(tmp[1],ctime(&(le->end)));
ontime=(int)(le->end - le->start);
h=ontime/3600;
ontime-=3600*h;
m=ontime/60;
ontime-=60*m;
s=ontime;
sprintf(tmp[2],"%.4d:%.2d:%.2d",h,m,s);
switch(le->status) {
case 0:
strcpy(tmp[3],"OK");
break;
case 1:
strcpy(tmp[3],"Error");
break;
default:
strcpy(tmp[3],"Crash");
}
strcpy(tmp[4],le->shortname);
strcpy(tmp[5],le->longname);
strcpy(tmp[6],le->phone);
strcpy(tmp[7],le->user);
gtk_clist_append(GTK_CLIST(loglist),pp);
gtk_clist_set_pixtext(GTK_CLIST(loglist),lc,3,
tmp[3],6,
iconmap[le->status%3],
maskmap[le->status%3]);
}
gtk_clist_thaw(GTK_CLIST(loglist));
}
gint
applet_kill (GtkWidget * widget, GdkEvent * event, gpointer data)
{
return FALSE;
}
void
applet_destroy (GtkWidget * widget, gpointer data)
{
gtk_main_quit();
}
void
make_resume(void)
{
static char temp[1024],aux[256];
GList *pt;
long olt,ldiff,avg,maior,menor;
struct logentry *le;
int h,m,s,
i,n,t,
j,o,u,
k,p,v;
int ec;
int sv[3];
for(i=0;i<24;i++)
hourly[i]=0;
for(i=0;i<7;i++)
weekly[i]=0;
strcpy(temp,"Summary:\n\n");
olt=0;
sv[0]=sv[1]=sv[2]=0;
ec=0;
maior=0;
menor=time(NULL); /* unless you've been wired since
Jan 1 1970 this will work... ;-) */
for(pt=log;pt!=NULL;pt=g_list_next(pt)) {
le=(struct logentry *)(pt->data);
if (time_cons[1]!=0)
if ((le->end < time_cons[0])||(le->start > time_cons[1]))
continue;
if (useridx)
if (strcmp((char *)(g_list_nth_data(users,useridx)),le->user))
continue;
if (ispidx)
if (strcmp((char *)(g_list_nth_data(isps,ispidx)),le->shortname))
continue;
ec++;
ldiff=(le->end - le->start);
olt+=ldiff;
sv[le->status]++;
add_hourly(le->start,le->end);
add_weekly(le->start,le->end);
if (ldiff>maior)
maior=ldiff;
if (ldiff<menor)
menor=ldiff;
}
sprintf(aux,"Connections: %d\n"\
"Disconnected OK: %d\n"\
"Disconnected Error: %d\n"\
"Disconnected Crash: %d\n",ec,sv[0],sv[1],sv[2]);
strcat(temp,aux);
gtk_label_set_text(GTK_LABEL(lresume[0]),temp);
if (ec)
avg=olt/ec;
else
avg=0;
h=olt/3600;
olt-=3600*h;
m=olt/60;
olt-=60*m;
s=olt;
i=avg/3600;
avg-=3600*i;
n=avg/60;
avg-=60*n;
t=avg;
j=maior/3600;
maior-=3600*j;
o=maior/60;
maior-=60*o;
u=maior;
k=menor/3600;
menor-=3600*k;
p=menor/60;
menor-=60*p;
v=menor;
strcpy(temp,"\n\n");
sprintf(aux,"Online time: %.4d:%.2d:%.2d\n"\
"Average connection length: %.4d:%.2d:%.2d\n"\
"Longer connection: %.4d:%.2d:%.2d\n"\
"Shorter connection: %.4d:%.2d:%.2d\n",
h,m,s,
i,n,t,
j,o,u,
k,p,v);
strcat(temp,aux);
gtk_label_set_text(GTK_LABEL(lresume[1]),temp);
gtk_widget_queue_resize(hgraph);
gtk_widget_queue_resize(wgraph);
}
void
add_hourly(long s,long e)
{
time_t t;
struct tm *st;
for(t=s;t<=e;t+=30) {
st=localtime(&t);
if (!st)
exit(2);
hourly[st->tm_hour]++;
}
}
void
add_weekly(long s,long e)
{
time_t t;
struct tm *st;
for(t=s;t<=e;t+=30) {
st=localtime(&t);
if (!st)
exit(2);
weekly[st->tm_wday]++;
}
}
gint
hgra_expose(GtkWidget *widget,GdkEventExpose *ee,gpointer data)
{
gdk_draw_pixmap(widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
hcanvas,
ee->area.x, ee->area.y,
ee->area.x, ee->area.y,
ee->area.width, ee->area.height);
return FALSE;
}
gint
hgra_configure(GtkWidget *widget,GdkEventConfigure *ee,gpointer data)
{
GdkGC *mygc;
int x,y,cx,xs;
int i,v;
long max;
float fac;
GdkFont *fn;
char tmp[64];
if (hcanvas!=NULL)
gdk_pixmap_unref(hcanvas);
mygc=gdk_gc_new(widget->window);
hcanvas=gdk_pixmap_new(widget->window,x=widget->allocation.width,
y=widget->allocation.height,-1);
gdk_draw_rectangle(hcanvas,widget->style->white_gc,TRUE,0,0,x,y);
gdk_draw_rectangle(hcanvas,widget->style->black_gc,FALSE,0,0,x-1,y-1);
max=0;
for(i=0;i<24;i++)
if (hourly[i]>max)
max=hourly[i];
if (max==0) max=1;
fac=((float)(y-18-16))/((float)max);
cx=1;
xs=(x-2)/24;
fn=gdk_font_load("-*-helvetica-medium-r-*-*-8-*-*-*-*-*-*-*");
for (i=0;i<24;i++) {
v=(int)(((float)hourly[i])*fac);
gdk_rgb_gc_set_foreground(mygc,0xc0c0c0);
gdk_draw_line(hcanvas,mygc,cx,1,cx,y-2);
gdk_rgb_gc_set_foreground(mygc,0x004080);
gdk_draw_rectangle(hcanvas,mygc,TRUE,cx,y-18-v,xs,v);
cx+=xs;
}
gdk_rgb_gc_set_foreground(mygc,0x000000);
for(cx=1,i=0;i<24;i+=2) {
sprintf(tmp,"%2d",i);
gdk_draw_string(hcanvas,fn,mygc,cx,y-6,tmp);
cx+=2*xs;
}
gdk_draw_line(hcanvas,widget->style->black_gc,0,y-18,x-1,y-18);
gdk_rgb_gc_set_foreground(mygc,0xffffff);
gdk_draw_rectangle(hcanvas,mygc,TRUE,0,0,22*4,13);
gdk_rgb_gc_set_foreground(mygc,0x000000);
gdk_draw_rectangle(hcanvas,mygc,FALSE,0,0,22*4,13);
gdk_font_unref(fn);
fn=gdk_font_load("-*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*");
gdk_draw_string(hcanvas,fn,mygc,5,10,"hourly summary");
gdk_font_unref(fn);
gdk_gc_destroy(mygc);
return FALSE;
}
gint
wgra_expose(GtkWidget *widget,GdkEventExpose *ee,gpointer data)
{
gdk_draw_pixmap(widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
wcanvas,
ee->area.x, ee->area.y,
ee->area.x, ee->area.y,
ee->area.width, ee->area.height);
return FALSE;
}
gint
wgra_configure(GtkWidget *widget,GdkEventConfigure *ee,gpointer data)
{
GdkGC *mygc;
int x,y,cx,xs;
int i,v;
long max;
float fac;
GdkFont *fn;
if (wcanvas!=NULL)
gdk_pixmap_unref(wcanvas);
mygc=gdk_gc_new(widget->window);
wcanvas=gdk_pixmap_new(widget->window,x=widget->allocation.width,
y=widget->allocation.height,-1);
gdk_draw_rectangle(wcanvas,widget->style->white_gc,TRUE,0,0,x,y);
gdk_draw_rectangle(wcanvas,widget->style->black_gc,FALSE,0,0,x-1,y-1);
max=0;
for(i=0;i<7;i++)
if (weekly[i]>max)
max=weekly[i];
if (!max) max=1;
fac=((float)(y-18-16))/((float)max);
cx=1;
xs=(x-2)/7;
fn=gdk_font_load("-*-helvetica-medium-r-*-*-8-*-*-*-*-*-*-*");
for (i=0;i<7;i++) {
v=(int)(((float)weekly[i])*fac);
gdk_rgb_gc_set_foreground(mygc,0xc0c0c0);
gdk_draw_line(wcanvas,mygc,cx,1,cx,y-2);
gdk_rgb_gc_set_foreground(mygc,0x004080);
gdk_draw_rectangle(wcanvas,mygc,TRUE,cx,y-18-v,xs,v);
gdk_rgb_gc_set_foreground(mygc,0x000000);
gdk_draw_string(wcanvas,fn,mygc,cx,y-6,wdays[i]);
cx+=xs;
}
gdk_draw_line(wcanvas,widget->style->black_gc,0,y-18,x-1,y-18);
gdk_rgb_gc_set_foreground(mygc,0xffffff);
gdk_draw_rectangle(wcanvas,mygc,TRUE,0,0,23*4,13);
gdk_rgb_gc_set_foreground(mygc,0x000000);
gdk_draw_rectangle(wcanvas,mygc,FALSE,0,0,23*4,13);
gdk_font_unref(fn);
fn=gdk_font_load("-*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*");
gdk_draw_string(wcanvas,fn,mygc,5,10,"weekday summary");
gdk_font_unref(fn);
gdk_gc_destroy(mygc);
return FALSE;
}
void
time_menu(GtkMenuItem *gmi,gpointer data)
{
int x;
struct tm *his;
time_t t;
x=*((int *)data);
t=time(NULL);
his=localtime(&t);
switch(x) {
case 0: /* all */
time_cons[0]=time_cons[1]=0;
break;
case 1: /* today */
his->tm_sec=0;
his->tm_min=0;
his->tm_hour=0;
time_cons[0]=mktime(his);
his->tm_sec=59;
his->tm_min=59;
his->tm_hour=23;
time_cons[1]=mktime(his);
break;
case 2: /* yesterday */
t-=24*3600;
his=localtime(&t);
his->tm_sec=0;
his->tm_min=0;
his->tm_hour=0;
time_cons[0]=mktime(his);
his->tm_sec=59;
his->tm_min=59;
his->tm_hour=23;
time_cons[1]=mktime(his);
break;
case 3: /* this week */
t-=((long)(24*3600))*((long)(his->tm_wday));
his=localtime(&t);
his->tm_sec=0;
his->tm_min=0;
his->tm_hour=0;
time_cons[0]=mktime(his);
time_cons[1]=time(NULL);
break;
case 4: /* this month */
t-=((long)(24*3600))*((long)(his->tm_mday));
his=localtime(&t);
his->tm_sec=0;
his->tm_min=0;
his->tm_hour=0;
time_cons[0]=mktime(his);
time_cons[1]=time(NULL);
break;
case 5: /* this year */
t-=((long)(24*3600))*((long)(his->tm_yday));
his=localtime(&t);
his->tm_sec=0;
his->tm_min=0;
his->tm_hour=0;
time_cons[0]=mktime(his);
time_cons[1]=time(NULL);
break;
case 6: /* Last 24 hours */
time_cons[0]=t-24*3600;
time_cons[1]=t;
break;
case 7: /* Last 7 days */
time_cons[0]=t-7*24*3600;
time_cons[1]=t;
break;
case 8: /* Last 30 days */
time_cons[0]=t-30*24*3600;
time_cons[1]=t;
break;
case 9:
time_cons[0]=t-365*24*3600;
time_cons[1]=t;
break;
default:
return;
}
make_resume();
}
void
user_menu(GtkMenuItem *gmi,gpointer data)
{
useridx=*((int *)data);
make_resume();
}
void
isp_menu(GtkMenuItem *gmi,gpointer data)
{
ispidx=*((int *)data);
make_resume();
}
int
already_exists(char *s,GList *pt)
{
GList *w;
for(w=pt;w!=NULL;w=g_list_next(w)) {
if (!strcmp((char *)(w->data),s))
return 1;
}
return 0;
}

View file

@ -0,0 +1,39 @@
#ifndef LOGLIST_H
#define LOGLIST_H
#include <gtk/gtk.h>
void create_loglist(void);
void load_log(void);
void prepend_log_entry(char *);
void free_log(void);
void update_list(void);
void make_resume(void);
void add_hourly(long s,long e);
void add_weekly(long s,long e);
gint applet_kill (GtkWidget * widget, GdkEvent * event, gpointer data);
void applet_destroy (GtkWidget * widget, gpointer data);
void time_menu(GtkMenuItem *gmi,gpointer data);
void user_menu(GtkMenuItem *gmi,gpointer data);
void isp_menu(GtkMenuItem *gmi,gpointer data);
int already_exists(char *s,GList *pt);
gint hgra_expose(GtkWidget *,GdkEventExpose *,gpointer);
gint hgra_configure(GtkWidget *,GdkEventConfigure *,gpointer);
gint wgra_expose(GtkWidget *,GdkEventExpose *,gpointer);
gint wgra_configure(GtkWidget *,GdkEventConfigure *,gpointer);
struct logentry {
time_t start;
time_t end;
int status; /* 0=ok 1=error 2=crash */
char longname[128];
char shortname[16];
char phone[32];
char user[32];
};
#endif

View file

@ -0,0 +1,64 @@
/* XPM */
static char * status_crash_xpm[] = {
"16 16 45 1",
" c None",
". c #000000",
"+ c #FF8A3D",
"@ c #FFE43A",
"# c #FFEBD1",
"$ c #080808",
"% c #484848",
"& c #585858",
"* c #545454",
"= c #474747",
"- c #292929",
"; c #606060",
"> c #6D6D6D",
", c #737373",
"' c #5D5D5D",
") c #2B2B2B",
"! c #181818",
"~ c #111111",
"{ c #575757",
"] c #828282",
"^ c #8D8D8D",
"/ c #060606",
"( c #0D0D0D",
"_ c #404040",
": c #595959",
"< c #A7A7A7",
"[ c #3F3F3F",
"} c #242424",
"| c #0A0A0A",
"1 c #0C0C0C",
"2 c #3D3D3D",
"3 c #555555",
"4 c #3B3B3B",
"5 c #222222",
"6 c #323232",
"7 c #494949",
"8 c #1A1A1A",
"9 c #020202",
"0 c #252525",
"a c #383838",
"b c #0F0F0F",
"c c #171717",
"d c #131313",
"e c #030303",
"f c #010101",
" .+..@. ",
" .@+.++. ",
" .++.#.. ",
" ....@.#.++. ",
" $%&*=@.#.@@. ",
" .-;>,>')#)!.. ",
" ~{>]^]>)))/( ",
"._:,^<^,:[}|1. ",
".23>]^]>345$.. ",
".67'>,>'7689.. ",
".0a73:37a}b... ",
".c}64[46}d..e. ",
" 9b85}58b...f ",
" .f9$|$9..... ",
" ........ ",
" ...... "};

View file

@ -0,0 +1,124 @@
/* XPM */
static char * status_error_xpm[] = {
"16 16 105 2",
" c None",
". c #000000",
"+ c #B81818",
"@ c #B61818",
"# c #AD1514",
"$ c #A11111",
"% c #920B0B",
"& c #7E0504",
"* c #B91819",
"= c #B9191B",
"- c #B51A1B",
"; c #C21D1C",
"> c #C21A1B",
", c #B51718",
"' c #9B0E0E",
") c #7E0505",
"! c #6F0204",
"~ c #B21717",
"{ c #B41919",
"] c #952A2A",
"^ c #B37575",
"/ c #971C1C",
"( c #BF1D1C",
"_ c #B81718",
": c #880E0E",
"< c #824040",
"[ c #5C1617",
"} c #620204",
"| c #B71819",
"1 c #A21819",
"2 c #DBC6C4",
"3 c #FEFEFC",
"4 c #CDACAB",
"5 c #901414",
"6 c #955959",
"7 c #CFC1C0",
"8 c #550204",
"9 c #6D0204",
"0 c #A21110",
"a c #BB1819",
"b c #B11C1C",
"c c #994948",
"d c #F2EBEA",
"e c #F8F4F3",
"f c #9B5F5F",
"g c #7C3333",
"h c #F7F4F2",
"i c #764849",
"j c #5C0204",
"k c #710204",
"l c #9C0F0F",
"m c #C31D1B",
"n c #A01C1C",
"o c #B88786",
"p c #E3D7D5",
"q c #A17B7B",
"r c #5B0204",
"s c #6B0204",
"t c #930C0B",
"u c #AA1414",
"v c #BA191A",
"w c #B51A1A",
"x c #7F1414",
"y c #CAB0AF",
"z c #BFADAC",
"A c #550405",
"B c #850707",
"C c #990E0E",
"D c #A51212",
"E c #9A1111",
"F c #77201F",
"G c #DED5D4",
"H c #571617",
"I c #600204",
"J c #6C0204",
"K c #790304",
"L c #840706",
"M c #890808",
"N c #6D0909",
"O c #B2908F",
"P c #C5B7B6",
"Q c #4A0204",
"R c #660204",
"S c #6E0204",
"T c #750304",
"U c #977171",
"V c #E6DFDE",
"W c #501617",
"X c #D6CBCA",
"Y c #A08584",
"Z c #510204",
"` c #680204",
" . c #530204",
".. c #7C5253",
"+. c #5A0204",
"@. c #6D3E3F",
"#. c #642A2B",
"$. c #650204",
"%. c #703E3F",
"&. c #560204",
"*. c #690204",
"=. c #570204",
"-. c #6E3E3F",
";. c #630204",
">. c #640204",
" . . . . . . ",
" . . + @ # $ % & . . ",
" . * = - ; > , ' ) ! ! . ",
" . ~ { ] ^ / ( _ : < [ } ! . ",
" . | 1 2 3 4 / 5 6 3 7 8 9 . ",
". 0 a b c d e f g h 3 i j ! k . ",
". l @ m n o 3 3 p 3 q r s k k . ",
". t u v w x y 3 3 z A s ! k k . ",
". B C D E F p 3 3 G H I J ! k . ",
". K L M N O 3 G G 3 P Q R k S . ",
". k T } U 3 V W W X 3 Y Z ` k . ",
" . S .7 3 ..8 +.@.3 3 #.$.. ",
" . ! } H %.&.s *.=.-.-.+.J . ",
" . ! R ;.9 k k J >.>.s . ",
" . . k k S k k k . . ",
" . . . . . . "};

View file

@ -0,0 +1,23 @@
/* XPM */
static char * status_ok_xpm[] = {
"16 16 4 1",
" c None",
". c #000000",
"+ c #7FDB82",
"@ c #1CA525",
" . ",
" .+.",
" .+@.",
" .+@.",
" .+@. ",
" .+@. ",
" . .+@. ",
" .+. .+@. ",
" .+@@. .+@. ",
" .@@@. .+@. ",
" .@@@..+@. ",
" .@@@+@@. ",
" .@@@@. ",
" .@@@. ",
" .@. ",
" . "};

View file

@ -0,0 +1,37 @@
#
# gtksetup: a setup applet for yawmppp
#
CC = @CC@
CFLAGS = -Wall -O2
GTKLIB = @GTK_LIBS@
GTKFLAG = @GTK_FLAGS@
RLFLAG = -DVERSION=\"@MK_YAWMPPP_RELEASE@\" -DIPREFIX=\"@prefix@\" -D@SYSDEF@
PROGINST = @INSTALL@
ALLDOTOS = applet.o msgbox.o
ALLDOTHS = applet.h msgbox.h ../isprc.h
EOBJS = ../isprc.o ../about.o
all: build_gtksetup
build_gtksetup: $(ALLDOTOS)
$(CC) $(ALLDOTOS) $(EOBJS) -o yawmppp.pref $(GTKLIB)
$(ALLDOTOS): %.o : %.c $(ALLDOTHS)
$(CC) $(CFLAGS) $(RLFLAG) $(GTKFLAG) -I.. -c $< -o $@
install:
$(PROGINST) -m 0755 yawmppp.pref @prefix@/bin/yawmppp.pref
$(PROGINST) -m 0644 pppdoc.xpm @prefix@/share/icons/pppdoc.xpm
install-strip:
$(PROGINST) -s -m 0755 yawmppp.pref @prefix@/bin/yawmppp.pref
$(PROGINST) -m 0644 pppdoc.xpm @prefix@/share/icons/pppdoc.xpm
clean:
rm -f $(ALLDOTOS) yawmppp.pref
distclean:
rm -f Makefile *~

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,182 @@
#ifndef YAWMPPP_APPLET_H
#define YAWMPPP_APPLET_H
#include <gtk/gtk.h>
#include "isprc.h"
/* not less than the dock applet */
#define MAX_ISPS 40
#define ERR_MAX_ISPS "You can't have more than 40 entries."
#define ERR_CANT_MKDIR "Unable to create directory ~/.yawmppp\n"\
"Current configuration could not be\n"\
"written."
#define ERR_CANT_WRITE "Unable to create configuration files\n"\
"in directory ~/.yawmppp. Current configuration\n"\
"may not have been only partially written."
#define ERR_DIDNT_WRITE "There were errors when saving the configuration.\n"\
"Do you still wish to close wmppp.pref and [maybe] lose\n"\
"current data ?"
#define INFO_CANT_APPLY_NOW "The dock applet will update itself only when\n"\
"the current connection is over."
#define ERR_CANT_SU "Script didn't run properly. Bad password ?"
#define MAX_EXPECT_PAIRS 16
struct PREF_ISP_INFO {
char LongName[128];
char ShortName[16];
char Device[64];
char Username[32];
char Password[32];
char Phone[32];
char ModemInit1[256];
char ModemInit2[256];
char UserString[32];
char PassString[32];
char PulseDial[8];
char ModemSpeed[16];
/* appended in 1.1.0 */
int nExpectPairs;
char s_expect[MAX_EXPECT_PAIRS][32];
char s_send[MAX_EXPECT_PAIRS][32];
struct ISP_PPP ppp; /* defined in ../isprc.h */
/* appended in 1.1.2 */
int nologin;
};
struct PREF_PPP_OPT {
int defaultroute;
int lock;
int passive;
int debug;
int kdebug;
int noauth;
int noipdefault;
int linectl; /* 0=modem 1=local */
int flowctl; /* 0=crtscts 1=xonxoff 2=nocrtscts 3=DC */
int mtu;
int mru;
int lcp[5]; /* in the same order as in the dialog */
int chap;
int pap;
int usepeerdns;
};
void create_preferences_panel(void);
void clear_and_disable_right_pane(void);
void load_rc_entries(void);
void update_right_pane(void);
void commit_back_to_db(void);
void fill_list(void);
int write_and_apply_data(void);
void check_client(void);
int file_exists(char *s);
void find_out_paths(void);
void test_set_path(char *,char *);
void xlate_ppp_to_pref(struct YAWMPPP_ISP_INFO *wii,
struct PREF_ISP_INFO *pii);
GtkWidget *hlabel_new(char *);
GtkWidget *make_ppp_pane(void);
void get_ppp_pane(void);
void set_ppp_pane(void);
char *mk_ppp_string(struct PREF_PPP_OPT *modi,char *sep);
void read_ppp_options_from_rc(char *p);
char *wrapped_strtok(char *a,char *b);
gint applet_kill (GtkWidget * widget, GdkEvent * event, gpointer data);
void applet_destroy (GtkWidget * widget, gpointer data);
void applet_apply (GtkWidget * widget, gpointer data);
void applet_save_and_quit (GtkWidget * widget, gpointer data);
void list_select(GtkCList *cl,gint row,gint column,
GdkEventButton *geb,gpointer data);
void list_unselect(GtkCList *cl,gint row,gint column,
GdkEventButton *geb,gpointer data);
void list_moveup(GtkWidget *gw,gpointer data);
void list_movedown(GtkWidget *gw,gpointer data);
void list_remove(GtkWidget *gw,gpointer data);
void list_duplicate(GtkWidget *gw,gpointer data);
void list_add(GtkWidget *gw,gpointer data);
/* more settings dialog */
void pop_advanced(GtkWidget *gw,gpointer data);
void adv_ok (GtkWidget * widget, gpointer data);
void adv_cancel (GtkWidget * widget, gpointer data);
void adv_destroy (GtkWidget * widget, gpointer data);
void enable_local_ppp(gboolean e);
void ppp_override_toggle(GtkToggleButton *gtb,gpointer data);
/* more settings dialog */
void isp_rename(GtkEditable *ge,gpointer data);
void make_ppp_default(GtkWidget *w,gpointer data);
/* expect/send */
void pop_expect(GtkWidget *w,gpointer data);
void exp_ok (GtkWidget * widget, gpointer data);
void exp_cancel (GtkWidget * widget, gpointer data);
void exp_destroy (GtkWidget * widget, gpointer data);
void exp_update(void);
void exp_up(GtkWidget *widget,gpointer data);
void exp_down(GtkWidget *widget,gpointer data);
void exp_disable(void);
void exp_enable(void);
void exp_select(GtkCList *cl,gint row,gint column,
GdkEventButton *geb,gpointer data);
void exp_unselect(GtkCList *cl,gint row,gint column,
GdkEventButton *geb,gpointer data);
void exp_add_delay(void);
void exp_remove(void);
void exp_add(void);
void expa_destroy (GtkWidget * widget, gpointer data);
void expa_ok (GtkWidget * widget, gpointer data);
void expa_cancel (GtkWidget * widget, gpointer data);
/* expect/send */
void extract_delimited_string(char *dest,char *src,int count,char delim,int max);
/* help */
void pop_help (GtkWidget * widget, gpointer data);
void help_dead (GtkWidget * widget, gpointer data);
void help_die (GtkWidget * widget, gpointer data);
void unman(char *s);
void add_man(char *manpage,GtkWidget *text,int index);
void add_docfile(char *source,GtkWidget *text,int index);
/* misc */
void run_as_root(char *what);
gint pwd_kill (GtkWidget * widget, GdkEvent * event, gpointer data);
void pwd_cancel(GtkWidget *gw,gpointer data);
void pwd_ok(GtkWidget *gw,gpointer data);
void pwd_view(GtkWidget *gw,gpointer data);
void spwd_destroy (GtkWidget * widget, gpointer data);
void spwd_close(GtkWidget *gw,gpointer data);
int try_run_script(char *cmd);
#endif

View file

@ -0,0 +1,100 @@
/* XPM */
static char * bong_xpm[] = {
"64 64 33 1",
" c None",
". c #020204",
"+ c #FEFEFC",
"@ c #710204",
"# c #A21213",
"$ c #6E1414",
"% c #B9191A",
"& c #3C0204",
"* c #891514",
"= c #550304",
"- c #8A090A",
"; c #A31D1D",
"> c #661719",
", c #570B0C",
"' c #8A1C1C",
") c #801514",
"! c #7E0504",
"~ c #BB1E1D",
"{ c #320204",
"] c #4A0304",
"^ c #6C0C0C",
"/ c #711B1C",
"( c #AE1614",
"_ c #970D0C",
": c #AF1B1C",
"< c #7E1D1C",
"[ c #7D0C0C",
"} c #C51E1C",
"| c #971414",
"1 c #620204",
"2 c #600D0C",
"3 c #971C1C",
"4 c #C41A1C",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ........ ",
" ....#____--!.... ",
" ..(((#((#_#_--!!@@.. ",
" .(%(%%%%(((##__-!!!@!. ",
" ..(%%4%4%4%%((##__-!!@@@.. ",
" .(%%44%44}}4%4%((__-!!@@@@@. ",
" .(%%%%%%:%}}4}4%%##_-!@@@@@@@. ",
" .#(%4%::33;;}}4444(_-!@111@1@@@. ",
" .(%%%(|'$/<';~}}4%#_[2=]]=11@@@. ",
" .((%%%;'$+++/<;~}4(#)2]++&]=11@@!. ",
" ._(%(%:*$+++++/<;~~|*^,++++&]=@1@@@. ",
" ._(%%%:*+++++++<3;||^,++++++]=1@@@@. ",
" ._#(%%%:3/++++++//')$2++++++&]=@@@@@@. ",
" .__(%4%~;'/++++++>$^2++++++&]=11@@@@@. ",
" ._#((44~:3</++++++2,,++++++&]=1@@@@@@. ",
" ._##%%}}};'/+++++++,++++++]=111@@@@@@. ",
" .--_#(%%}}~;'/++++++++++++]]=1@@@@@@@@@. ",
" .-__#((%4}}%3)>++++++++++]]1@11@@@@@@@@. ",
" .--__#(%%}~%#*$2++++++++&,=1@@@@@@@@@@@. ",
" .!--_#(#%%%%;*2,++++++++&]=@@1@@@@@@@@@. ",
" .!!-__##(%(#|)2,++++++++&]==@@@@@@@@@@@. ",
" .@!!-__#####[^]++++++++++&]==11@1@@@@@@. ",
" .@@!!-_____[^2++++++++++++{]=11@@@@@@@@. ",
" .@@!!!---_[^=]+++++++++++++{]=11@@@1@@@. ",
" .@@!!!!!!^1]++++++&&++++++{&=11@@@@@@. ",
" .@@@!!!@1=]++++++&&&&++++++&&]=11@@@@. ",
" .@@@@@@1=&++++++&&]]&&++++++&]=11@@@@. ",
" .@@@@@1=]&++++++&]==]&{++++++&]11@@@@. ",
" .@@@@1=&++++++&]==1=]&+++++++]=1@@@. ",
" .@@@@11]&++++&&]11@1=]{+++++{]=@1@@. ",
" .@@@11=&&++{]==1@111]]{+++{]=11@@. ",
" .@@@11=]&&]]=1@@@@11]]&&&]]11@@. ",
" .@@@@11====1@@@@@@@11=]]]=1@@@@. ",
" .@@@@11111@1@@@@@@@11111111@@. ",
" .@@@@@@@1@@@@@@@@@@@@@@@@@@. ",
" ..@@@@@@@@@@@@@@@@@@@@@@.. ",
" .@@@@@@@@1@@@@@@@@@@@. ",
" ..@@@@@@@@@@@@@@@@.. ",
" ....@@@@1@@@.... ",
" ........ ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

View file

@ -0,0 +1,26 @@
/* XPM */
static char * cmd_del_xpm[] = {
"20 20 3 1",
" c None",
". c #000000",
"+ c #7B7D7B",
" ",
" ",
" ",
" ",
" .+ .+ ",
" ...+ ...+ ",
" ...+ ...+ ",
" ...+ ...+ ",
" ......+ ",
" ....+ ",
" ....+ ",
" ......+ ",
" ...++...+ ",
" ...+ ...+ ",
" ...+ ...+ ",
" .+ .+ ",
" ",
" ",
" ",
" "};

View file

@ -0,0 +1,13 @@
/* XPM */
static char * cmd_down_xpm[] = {
"13 7 3 1",
" c None",
". c #000000",
"+ c #7B7D7B",
"............+",
" ..........+ ",
" ........+ ",
" ......+ ",
" ....+ ",
" ..+ ",
" + "};

View file

@ -0,0 +1,27 @@
/* XPM */
static char * cmd_dup_xpm[] = {
"20 20 4 1",
" c None",
". c #000000",
"+ c #FFFFFF",
"@ c #7B7D7B",
" ",
" ",
" ...... ",
" ..++++. ",
" .+.++++.@ ",
" .++.++++.... ",
" .....++++.++.@ ",
" .++++++++.++.@ ",
" .++++++++.++.@ ",
" .++++++++.++.@ ",
" .++++++++.++.@ ",
" .++++++++.++.@ ",
" .++++++++.++.@ ",
" .++++++++.++.@ ",
" ..........++.@ ",
" @@.++++++++.@ ",
" .++++++++.@ ",
" ..........@ ",
" @@@@@@@@@@ ",
" "};

View file

@ -0,0 +1,27 @@
/* XPM */
static char * cmd_new_xpm[] = {
"20 20 4 1",
" c None",
". c #000000",
"+ c #FFFFFF",
"@ c #7B7D7B",
" ",
" ",
" ",
" ...... ",
" ..++++.@ ",
" .+.++++.@ ",
" .++.++++.@ ",
" .....++++.@ ",
" .++++++++.@ ",
" .++++++++.@ ",
" .++++++++.@ ",
" .++++++++.@ ",
" .++++++++.@ ",
" .++++++++.@ ",
" .++++++++.@ ",
" ..........@ ",
" @@@@@@@@@@ ",
" ",
" ",
" "};

View file

@ -0,0 +1,13 @@
/* XPM */
static char * cmd_up_xpm[] = {
"13 7 3 1",
" c None",
". c #000000",
"+ c #7B7D7B",
" .. ",
" ....+ ",
" ......+ ",
" ........+ ",
" ..........+ ",
"............+",
" ++++++++++++"};

View file

@ -0,0 +1,132 @@
/* XPM */
static char * exclam_xpm[] = {
"64 64 65 1",
" c None",
". c #020204",
"+ c #958204",
"@ c #C6C604",
"# c #EAE604",
"$ c #4E4204",
"% c #AAA604",
"& c #E7C704",
"* c #282204",
"= c #CDB304",
"- c #E8D604",
"; c #F5F504",
"> c #A89204",
", c #6A6204",
"' c #D8D504",
") c #C1A504",
"! c #383304",
"~ c #727204",
"{ c #EEEA04",
"] c #FAD904",
"^ c #141204",
"/ c #D5BB04",
"( c #A28E04",
"_ c #EDCE04",
": c #E0C204",
"< c #B19A04",
"[ c #3C3C04",
"} c #B9A204",
"| c #FEFD04",
"1 c #C5AB04",
"2 c #8C7904",
"3 c #FAE404",
"4 c #302C04",
"5 c #F2DE04",
"6 c #565204",
"7 c #7C6B04",
"8 c #6E5E04",
"9 c #201C04",
"0 c #DEDC04",
"a c #DFCB04",
"b c #937E04",
"c c #FEEB04",
"d c #0D0A04",
"e c #8E8A04",
"f c #DDBE04",
"g c #F4D104",
"h c #B79C04",
"i c #CECE04",
"j c #AAAA04",
"k c #FADE04",
"l c #8E7E04",
"m c #BAAA04",
"n c #F1D804",
"o c #FEF304",
"p c #E2D204",
"q c #463E04",
"r c #625204",
"s c #9A8604",
"t c #B2A204",
"u c #EECA04",
"v c #2E2604",
"w c #D2B504",
"x c #AE9604",
"y c #726304",
"z c #3E3604",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" 0s ",
" ', ",
" #'}l ",
" {a/(4 ",
" ;;'=}4 ",
" |5-/mb* ",
" ||3na1hv ",
" ||35n_/1+y ",
" |co||#_=}s* ",
" |||@!..!>)<* ",
" |c|9....^}hb9 ",
" ||cj......y1hv ",
" |c3j......8=1sy ",
" ||33|......>/=}+* ",
" |33]c......xuf1h* ",
" ||33536....!)g&=}b9 ",
" |c3k]3~....$fguf1h4 ",
" ||33]]k%....y:]g&w)+y ",
" |c3k]]]@....2_]gg:=}s* ",
" ||3k]]]]c....x_]]guf1<9 ",
" ||33k]]]]c!..9)]]]]g&wh29 ",
" |c33k]]]]c6..!w]]g]guf1>9 ",
" ||33]]g]]]3e..r:]]]]gg&=h29 ",
" |33k]]]]g]]%..y&]]]]]gu:1hv ",
" ||ckk]]]]]]]|..xg]]]]]]g&/)sy ",
" |335]]]]]]]]39^h]]g]]]]g_&=}+* ",
" ||33]]g]]]g]]kh21]]]g]]]]guf1h* ",
" |c3k]]]]g]]]||jtk]]]]]g]]ng&=}b9 ",
" ||3k]]]]]]]]|j...9sg]]]]]]]guf1h4 ",
" |c33]]]]]]]]|9....^w]]]]]g]gg&w)+y ",
" ||3k]]]g]]]]]c......h]]g]]]]]gu&=}s* ",
" |c3k]]]]]g]]]]8....q1]]]]]]]]]guf1h* ",
" |;35]]g]g]]]]]]_2!!y):]]]]g]]]]g_&=hb9 ",
" ;;5nngggggggggg__ufwf&ggggggg_gg_u:/)xv ",
" {-aa&::ffffff:::ff::f:ffff::ffff:f/=}x28 ",
" 0'/=m1))))111)))1)))))))))1)1111))))hx(279 ",
" im%<>(>((>(((((((>((>(((>>(((((((((((sb27^ ",
" 0[!*^...................................ddd. ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

View file

@ -0,0 +1,100 @@
/* XPM */
static char * info_xpm[] = {
"64 64 33 1",
" c None",
". c #020208",
"+ c #8E8E91",
"@ c #56565B",
"# c #3A3A3F",
"$ c #06025F",
"% c #0A068F",
"& c #1E1E25",
"* c #040237",
"= c #0A0A71",
"- c #050250",
"; c #090677",
"> c #0E0EA9",
", c #0A069C",
"' c #E2E2E4",
") c #09065F",
"! c #060641",
"~ c #030223",
"{ c #C6C6C7",
"] c #72727E",
"^ c #AAAAAD",
"/ c #FEFEFC",
"( c #1E1E3C",
"_ c #0A0654",
": c #0C0A80",
"< c #0E0A8F",
"[ c #06064F",
"} c #0D0A9D",
"| c #56566A",
"1 c #3A3A54",
"2 c #040244",
"3 c #0A0684",
"4 c #09066C",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ....................................... ",
" .}}}}}}}}}}}}}}}},,%333%%,,}}}}}}}}}}}. ",
" .>>>>>>>>>>>>>>>}}:;)));:}}}>>>>>>>>>>. ",
" .}>>>>>>>>>>>>>,,%)[*~*2$3,,>>>>>>>>}}. ",
" .>,>,>,>,>,>,>},<4!({/'|!)<,,>,>,>}>}>. ",
" .>}}>}>}>}>}>}},:-~'////(-:,,}>}>}>}}}. ",
" .}}}}}}}}}}}}},%;[|/////|!;%,}}}}}}}}}. ",
" .>><}<}}}<}}<}<342|/////12=%<}<}}<}>><. ",
" .<<<}<<<<<}<><%:;[~'///^~_;<%}<<}<<<<<. ",
" .<<}<<}<<<<<<<%3;[!(+^]~2);%<<<<<><<<<. ",
" .<<<<<<<<<<<:%3;;)-*~~*2);;3<<<<:<<:<:. ",
" .:<<:<<<<::<;;;4[[2**~*[);3:<:<<<:::<:. ",
" .:::::::::3;;$[-2~~~~~*-$;;::<=:3:::3;. ",
" .=::::=:::;;;[2~~&@^'/]!$;;:::::33:::;. ",
" .:==:=:::=3$[-]^'/////|*)$;=;3===:;=:=. ",
" .;;;;;;4;;;$)!////////&*[$;==;;:==;;=;. ",
" .=========$)$*~|+'////.~$$$;;==4;;==4=. ",
" .)4444444=$4$[~..^///^~*[44=)4===44=4). ",
" .44))4)=444$[-*~.////^.*-$44)=))_==)4). ",
" .=====)=)=)$$$*~&////@~*-$)=_4)4)))==). ",
" .____)))[)))[-*~@////#~!--=))_)=)))))[. ",
" ._)))[)))[))-2~.+////.~*--))))_)_)_))). ",
" .)___)[)[)[--2*.^///'.~2--____)___)[[[. ",
" .[[[[[[[)[[--*~.////^.~*--[[[[[[[[[_[[. ",
" .[[[[[[[[[--2~~&////]~~*-[[[[-[[[[_[--. ",
" .--[-[2[[[!-*~~@////@.**2[[[[[[[2-!_!-. ",
" .!!2!!!!2!!2*~.+////&~~***!!!22!!!2!!!. ",
" .!!!2!2!22*2*~.^////..~**2*2!!2!!!22!*. ",
" .***!*!*!!**~~./////..~~~*****!*2*!!*!. ",
" .!!*!*!*****~~./////&..~~~~***!!!**!**. ",
" .*~!~**~***~~../////{@@^+~~**~*~*~!**~. ",
" .~*~!~!~!~~*~~.'////////+~~~~**~!~~!~*. ",
" .*~~~!~~~*~~~~.@/////{+#.~~~~~~!~~~~!~. ",
" .~~~~~~~~~~~~~...@@#...~.~~~~~~~~~~~~~. ",
" .~~~~~~~~~~~~~~~......~.~~~~~~~~~~~~~~. ",
" .~~~~~~~~~~~.~.~.~.~.~.~.~~~~~~~~~~~.~. ",
" .~.~.~.~~.~.~~.~.~.~.~.~.~.~.~.~.~.~~.. ",
" ....................................... ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

View file

@ -0,0 +1,188 @@
/*
Message Box Composite Widget
(currently included in various software packages)
Copyright (C) 1999-2000 Felipe Paulo Guazzi Bergo
bergo@seul.org
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include "msgbox.h"
#include "bong.xpm"
#include "exclam.xpm"
#include "info.xpm"
#include "question.xpm"
/* PRIVATE */
void message_box_click_yes(GtkWidget *widget,gpointer data);
void message_box_click_no(GtkWidget *widget,gpointer data);
void message_box_click_cancel(GtkWidget *widget,gpointer data);
void message_box_click_ok(GtkWidget *widget,gpointer data);
gint immortal(GtkWidget *widget,GdkEvent *event,gpointer data);
struct msgbox_data {
gint answer_available;
MsgBoxResult answer;
} cmdata;
gchar ** mb_icons[5]={NULL,bong_xpm,info_xpm,exclam_xpm,question_xpm};
MsgBoxResult
message_box(GtkWindow *parent,char *txt,char *title,MsgBoxType mbt,MsgBoxIcon mbi)
{
GtkWidget *msgbox,*b[3],*lb,*tbl,*hs;
GdkBitmap *mask;
GdkPixmap *dqmark;
GtkWidget *tqmark;
GtkStyle *style;
int i,nb;
cmdata.answer_available=FALSE;
msgbox=gtk_window_new(GTK_WINDOW_DIALOG);
tbl=gtk_table_new(3,4,FALSE);
gtk_container_add(GTK_CONTAINER(msgbox),tbl);
gtk_window_set_title(GTK_WINDOW(msgbox),title);
if (parent!=NULL)
gtk_window_set_transient_for(GTK_WINDOW(msgbox),parent);
gtk_container_set_border_width(GTK_CONTAINER(msgbox),4);
gtk_window_set_position(GTK_WINDOW(msgbox),GTK_WIN_POS_CENTER);
gtk_window_set_policy(GTK_WINDOW(msgbox),TRUE,TRUE,TRUE);
gtk_widget_realize(msgbox);
style=gtk_widget_get_style(msgbox);
if (mbi!=MSGBOX_ICON_NONE) {
dqmark=gdk_pixmap_create_from_xpm_d(msgbox->window,&mask,
&style->bg[GTK_STATE_NORMAL],
mb_icons[mbi]);
tqmark=gtk_pixmap_new(dqmark,mask);
gtk_table_attach(GTK_TABLE(tbl),tqmark,0,1,0,1,GTK_FILL,GTK_FILL,5,5);
gtk_widget_show(tqmark);
}
lb=gtk_label_new(txt);
gtk_label_set_justify(GTK_LABEL(lb),GTK_JUSTIFY_LEFT);
gtk_table_attach(GTK_TABLE(tbl),lb,1,4,0,1,GTK_FILL,GTK_FILL,10,10);
gtk_widget_show(lb);
hs=gtk_hseparator_new();
gtk_table_attach(GTK_TABLE(tbl),hs,0,4,1,2,GTK_FILL,GTK_FILL,0,10);
gtk_widget_show(hs);
/* buttons */
switch(mbt) {
case MSGBOX_OK:
nb=1;
b[0]=gtk_button_new_with_label("OK");
gtk_signal_connect(GTK_OBJECT(b[0]),"clicked",
GTK_SIGNAL_FUNC(message_box_click_ok),NULL);
break;
case MSGBOX_OKCANCEL:
nb=2;
b[0]=gtk_button_new_with_label("OK");
gtk_signal_connect(GTK_OBJECT(b[0]),"clicked",
GTK_SIGNAL_FUNC(message_box_click_ok),NULL);
b[1]=gtk_button_new_with_label("Cancel");
gtk_signal_connect(GTK_OBJECT(b[1]),"clicked",
GTK_SIGNAL_FUNC(message_box_click_cancel),NULL);
break;
case MSGBOX_YESNO:
nb=2;
b[0]=gtk_button_new_with_label("Yes");
gtk_signal_connect(GTK_OBJECT(b[0]),"clicked",
GTK_SIGNAL_FUNC(message_box_click_yes),NULL);
b[1]=gtk_button_new_with_label("No");
gtk_signal_connect(GTK_OBJECT(b[1]),"clicked",
GTK_SIGNAL_FUNC(message_box_click_no),NULL);
break;
case MSGBOX_YESNOCANCEL:
nb=3;
b[0]=gtk_button_new_with_label("Yes");
gtk_signal_connect(GTK_OBJECT(b[0]),"clicked",
GTK_SIGNAL_FUNC(message_box_click_yes),NULL);
b[1]=gtk_button_new_with_label("No");
gtk_signal_connect(GTK_OBJECT(b[1]),"clicked",
GTK_SIGNAL_FUNC(message_box_click_no),NULL);
b[2]=gtk_button_new_with_label("Cancel");
gtk_signal_connect(GTK_OBJECT(b[2]),"clicked",
GTK_SIGNAL_FUNC(message_box_click_cancel),NULL);
break;
default:
nb=0;
}
for(i=0;i<nb;i++)
gtk_table_attach(GTK_TABLE(tbl),b[i],
4-nb+i,4-nb+i+1,
2,3,
GTK_FILL,
(i?GTK_SHRINK:GTK_FILL),2,2);
GTK_WIDGET_SET_FLAGS(b[0],GTK_CAN_DEFAULT);
gtk_widget_grab_default(b[0]);
for(i=0;i<nb;i++)
gtk_widget_show(b[i]);
gtk_signal_connect(GTK_OBJECT(msgbox),"delete_event",
GTK_SIGNAL_FUNC(immortal),NULL);
gtk_widget_show(tbl);
gtk_widget_show(msgbox);
gtk_grab_add(msgbox);
/* gtk_main MUST be running before message_box is called!!! */
while(!cmdata.answer_available)
gtk_main_iteration();
gtk_grab_remove(msgbox);
gtk_widget_destroy(msgbox);
return(cmdata.answer);
}
void message_box_click_yes(GtkWidget *widget,gpointer data) {
cmdata.answer=MSGBOX_R_YES;
cmdata.answer_available=TRUE;
}
void message_box_click_no(GtkWidget *widget,gpointer data) {
cmdata.answer=MSGBOX_R_NO;
cmdata.answer_available=TRUE;
}
void message_box_click_cancel(GtkWidget *widget,gpointer data) {
cmdata.answer=MSGBOX_R_CANCEL;
cmdata.answer_available=TRUE;
}
void message_box_click_ok(GtkWidget *widget,gpointer data) {
cmdata.answer=MSGBOX_R_OK;
cmdata.answer_available=TRUE;
}
gint immortal(GtkWidget *widget,GdkEvent *event,gpointer data) {
return TRUE;
}

View file

@ -0,0 +1,100 @@
/* GPL'd (C) 1999-2000 Felipe Bergo -- bergo@seul.org */
/*
This module is built up of the following files:
msgbox.h
msgbox.cc _OR_ msgbox.c
question.xpm
bong.xpm
exclamation.xpm
info.xpm
*/
/* return values */
#ifndef FB_MSGBOX_H
#define FB_MSGBOX_H
#include <gtk/gtk.h>
/* ENUMS */
typedef enum
{
MSGBOX_ICON_NONE,
MSGBOX_ICON_ERROR,
MSGBOX_ICON_INFO,
MSGBOX_ICON_EXCLAMATION,
MSGBOX_ICON_QUESTION
} MsgBoxIcon;
typedef enum
{
MSGBOX_OK,
MSGBOX_OKCANCEL,
MSGBOX_YESNO,
MSGBOX_YESNOCANCEL
} MsgBoxType;
typedef enum
{
MSGBOX_R_OK,
MSGBOX_R_YES,
MSGBOX_R_NO,
MSGBOX_R_CANCEL
} MsgBoxResult;
/* prototype */
/*
obs 1: this call blocks until the user picks a choice.
obs 2: parent can be NULL.
obs 3: you must have a gtk_main loop running before calling it.
*/
MsgBoxResult message_box(GtkWindow *parent,
char *txt,
char *title,
MsgBoxType mbt,
MsgBoxIcon mbi);
/*
excerpt from my 900-page book
"The Ultimate Guide to Message Box Icons
Felipe Bergo - 0th edition
Prentice Room publishers,
ISBN 6666-6666-6666"
MSGBOX_ICON_NONE No icon.
MSGBOX_ICON_ERROR Should be used on errors, i.e.,
something wrong really happened.
Currently included icon is a white
cross in a red circle. "bong.xpm"
MSGBOX_ICON_QUESTION Should be used on any questions, like
confirmations. Currently included
icon is a white question mark in a
green circle. "question.xpm"
MSGBOX_ICON_EXCLAMATION Should be used on warnings, like when
your code tries to allocate a resource
and it is busy (and being busy is "normal").
Currently included icon is a black exclamation
mark in an yellow triangle.
MSGBOX_ICON_INFO Should be used on general informative
messages, like "Operation Finished",
"Scan finished: 999999 blocks,
999998 bad, 1 good.", and the like.
Currently included icon is a white "i"
in a blue square.
The return value is an enum of MsgBoxResult type.
*/
#endif

View file

@ -0,0 +1,140 @@
/* XPM */
static char * padlock_xpm[] = {
"64 64 73 1",
" c None",
". c #020202",
"+ c #464646",
"@ c #818181",
"# c #C2C2C2",
"$ c #3D3326",
"% c #929292",
"& c #5F5E5C",
"* c #B59470",
"= c #262626",
"- c #FEE6BE",
"; c #2C221B",
"> c #ACACAC",
", c #8F6E52",
"' c #DDC097",
") c #B4B4B4",
"! c #DADADA",
"~ c #231E19",
"{ c #BFA787",
"] c #1C1A18",
"^ c #8A8A8A",
"/ c #BABABA",
"( c #D4D4D4",
"_ c #777777",
": c #CECECE",
"< c #8E8E8E",
"[ c #5E4636",
"} c #171411",
"| c #666666",
"1 c #4C392D",
"2 c #A27E5E",
"3 c #D2B792",
"4 c #F4D2A5",
"5 c #DEDEDE",
"6 c #A98561",
"7 c #D9B287",
"8 c #707070",
"9 c #110E0B",
"0 c #9E7A5A",
"a c #F1CA9E",
"b c #989693",
"c c #FDDEB1",
"d c #5E4A36",
"e c #9A9A9A",
"f c #6C543E",
"g c #424242",
"h c #6A6A6A",
"i c #F8F8F8",
"j c #565656",
"k c #2A2A2A",
"l c #0B0A08",
"m c #ECC698",
"n c #795E46",
"o c #463E30",
"p c #B08C66",
"q c #E2E2E2",
"r c #E8E8E8",
"s c #2E2A26",
"t c #4A4A4A",
"u c #CDA67E",
"v c #505050",
"w c #A4A4A4",
"x c #D1AE84",
"y c #060606",
"z c #594636",
"A c #E7C094",
"B c #534131",
"C c #7E624A",
"D c #3C2D21",
"E c #C09A72",
"F c #DEB78B",
"G c #F0F0F0",
"H c #CACACA",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" .kjjjjvg}. ",
" ]hw(!(:#)_gl. ",
" }%5qq!(::H#w_k. ",
" 9^rrrq5!(:H##/b~. ",
" 9#GGr:v==~$%#))b}. ",
" .wiii_9y ylgw)>^l. ",
" ^Giirh .t>)w8. ",
" .eiiG@. .vw>@. ",
" ]eGi)y .@w^}. ",
" 8(GG)l ._ww|. ",
" _!rrwy .hweh. ",
" 8(q(j. .e/)8. ",
" 8(5#] .b)>h. ",
" 8H(/] .%>>|. ",
" hH(/] .<>w<g ",
" .&#:)] .@ww<v ",
" twHH>] ._ee_= ",
" tw##w] ,,y_b%&. ",
" $</#e] ...$$;,,,,;_%<&.~; ",
" .j>)b9lyAAFFac44mo8<^&f2.., ",
" n$j>)b+4ccc----c4'o+@8o&'mB... ",
" ByD~&w>eBm4ccccccc!'b];]$*'a{... ",
" 9}nn7,&w>%oFAa444444am3x{{x#mE9.9. ",
" ..s7xuCjew<ouFAa44444am'333''}l]s;. ",
" .xy.,En]&%k;{FAmmaaaaammm''7y.~1D;. ",
" .FACyfCvy.}2{u7AAAmmmmAm20o}]f[1D;. ",
" .FAudDlD0p*EEx77FAFFAooo.zBnnf[B$;. ",
" .FAu2nDly*EEuuux~9}99lEp6p0,Cf[1$;. ",
" .Fau6nBDy..y.yllyu7AaA7uEp2,Cfd1D;. ",
" .Fmu6nBD.BBfn,06Eu7AaAFuEp2,CfdBD;. ",
" .Fmu6CBDyBBfn,0pEu7Aam7uEp2,Cfd1$;. ",
" .Fmu6CBDyzzfn,06Eu7AaAFuEp2,Cfd1$;. ",
" .Fmu6nBDyBBfn,06Eu7Aam7uEp2,Cf[1D;. ",
" .Fmu6CBD.[[fn,26Eu7AaAFuEp2,CfdBD;. ",
" .Fmu6CBDyBBfn,06Eu7Aam7uEp2,Cfd1$;. ",
" .Fmu6CBD.[Bfn,26EuxAaAFuEp6,Cfd1$;. ",
" .Fmu6CBDyBBfn,06Eu7AamFuEp2,Cf[1D;. ",
" .Fmu6CBDyz[fn,26EuxAaAFuEp2,CfdBD;. ",
" .Fmu6CBD.BBfn,0pEu7AaAFuEp2,Cfd1$;. ",
" .Fmu6nBDy[Bfn,06Eu7AaAFuEp2,Cfd1$;. ",
" .Fmu6CB$.BBfn,06Eu7AaAFuEp2,Cf[1D]. ",
" .Fmu6CBDyB[fn,26Eu7AaAFuEp2,CfdBD. ",
" .Fmu6nBDyBBfn,0pEu7AaAFuEp2,Cfd19. ",
" .Fmu6CBDy[Bfn,06EuxAaAFuEp2,Cfd9. ",
" .pmu6CBDyBBfn,06Eu7AaAFuEp2,C$.. ",
" .2u6nBDyz[fn,06Eu7AaAFuEp2dD. ",
" y;,CBD.BBfn,0pEu7AaAFuE0]. ",
" ..nBDy[Bfn,06Eu7AaAF$... ",
" ..y;.BBfn,0pEE6*E... ",
" ...zBfnD$1zB... ",
" .l999. ",
" ",
" ",
" ",
" ",
" ",
" "};

View file

@ -0,0 +1,100 @@
/* XPM */
static char * pppdoc_xpm[] = {
"32 32 65 1",
" c None",
". c #010401",
"+ c #FBFAFB",
"@ c #A6A3A5",
"# c #4E4A4F",
"$ c #C6C9C7",
"% c #D8D7D8",
"& c #E8EBE9",
"* c #919492",
"= c #9A90E3",
"- c #958BC8",
"; c #A79ADD",
"> c #2B3264",
", c #4E5285",
"' c #64589F",
") c #BB9CF9",
"! c #6B62B1",
"~ c #7F60F1",
"{ c #836DE4",
"] c #4F4CBD",
"^ c #836DCA",
"/ c #A485FF",
"( c #906FFF",
"_ c #8178C9",
": c #47408D",
"< c #8D7CD5",
"[ c #001256",
"} c #011080",
"| c #693BFF",
"1 c #6A5BD8",
"2 c #7C6895",
"3 c #37318E",
"4 c #9C7AFB",
"5 c #7056F5",
"6 c #5A41D8",
"7 c #071256",
"8 c #2B25B0",
"9 c #001143",
"0 c #0F2292",
"a c #463FA4",
"b c #000B7A",
"c c #422ED9",
"d c #B9BCBA",
"e c #22247D",
"f c #4630EB",
"g c #7F5CFF",
"h c #8568FF",
"i c #7A57FF",
"j c #9E87D8",
"k c #7047F4",
"l c #3120CF",
"m c #5E27FF",
"n c #3B0FDC",
"o c #14257B",
"p c #A693D6",
"q c #6D40FF",
"r c #AD95FF",
"s c #14205B",
"t c #001299",
"u c #1406C7",
"v c #2417A4",
"w c #CFBAFF",
"x c #09219E",
"y c #00138C",
"z c #C7ABFE",
" ",
" ............... ",
" .+++++++++++++.. ",
" .+++++++++++++.@. ",
" .++#++#++##+++.+@. ",
" .++#+#+#+#+#++.++@. ",
" .++#+#+++#+#++...... ",
" .++#++#++##++++$%$%. ",
" .++#+++#+#+++++++++. ",
" .++#+#+#+#+++++++++. ",
" .&&#&&#&&#&&&&&&&&&. ",
" .&&&&&&&&&&&&&&+&&&...... ",
" .&&********@****...#=--;>. ",
" .%%&%&%&%&%%%&..,'))-'!~{]. ",
" .%%%%%%%%%%%..'^//(_:<[}|12. ",
" .$$*******$.3/4]:5678~9[0a>. ",
" .$$$$$$$$$._~/'>->b[85c1[3'. ",
" .$$$$$d$$._((c9a/7efgfhg1>. ",
" .ddddddd.=h4i898hf||]jekh-. ",
" .........'{h|l9h|mn!aop!{{;. ",
" .}}q|c9l|mml]p,'3r(j. ",
" .sti|u9tu|q|lo^^!ok~). ",
" .77vv8[}blgqqc:86gr)w2.",
" .so^i:}xyychq|k{=wz/j2.",
" ...39bbbyx6i|/wwrgq4. ",
" .7tyyyytl4)4~g~^^. ",
" ..}xxyyb5gi~4:.. ",
" ..oyybfi5^.. ",
" ..[}{:.. ",
" .... ",
" ",
" "};

View file

@ -0,0 +1,100 @@
/* XPM */
static char * question_xpm[] = {
"64 64 33 1",
" c None",
". c #020204",
"+ c #41891C",
"@ c #1C4807",
"# c #256812",
"$ c #6BC22C",
"% c #889C80",
"& c #4EA624",
"* c #2D470C",
"= c #516D44",
"- c #618C40",
"; c #54B62A",
"> c #1E570D",
", c #337817",
"' c #0D3104",
") c #093704",
"! c #46981F",
"~ c #2F5713",
"{ c #BEC7BA",
"] c #E7EAE6",
"^ c #76B32C",
"/ c #AAB6A3",
"( c #AAC2A4",
"_ c #D1D9CE",
": c #497A2A",
"< c #FEFEFC",
"[ c #5E9A27",
"} c #62A927",
"| c #071E04",
"1 c #677A5C",
"2 c #65B82C",
"3 c #396819",
"4 c #203A05",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" .......... ",
" ...,,,333~>>@... ",
" ..+++-+::333#>>>@@.. ",
" ..!![[[[-++:,33#>>@@@).. ",
" .![&[[[[[-+:::33#~>>@@@4). ",
" .[&}}}}}[[[-+,,33##~~~@*444. ",
" .&}};;;}}}[++:33#~~~~~~*@444). ",
" .[}};;;&&[-+:,33~~>*>~~~~**444). ",
" .&&}^2;;;&+:333~**4444***~*@4444'. ",
" .!}}22;;;&+:3==-%%%1**44*****44'4)'. ",
" .[}}^2$2&[3~%{_{/_<<<_%*4****4444''. ",
" .!}}}^$$2}:3/]<1~*=/<<<<{~4***444'4''. ",
" .[[^^^$$^[:{<<<1*~>*<<<<<_*44*44'4'''. ",
" .+[[}^^$22--<<<<_~>*@{<<<<<%4**444|4'4'. ",
" .+[[^}^$$}[%<<<<<:#>@/<<<<</44*4444|4''. ",
" .-[[}}22$2&[<<<<<-#>@/<<<<</4**44|44444. ",
" .++[[}};;;2}[(<<<_,#>){<<<<<=4**4444|4'4'. ",
" .,+[[[&;;;;2&![}!,,#>@<<<<</44**444444444. ",
" .,,+!&&&;;;22}[!!+,#>%<<<<{****444444444). ",
" .,+++!!&&;;;;2;&!!,#3]<<]%~@>@**444444444. ",
" .#,++!!!&&&;;2}&&+,>%<</3**~>*@4'4444444'. ",
" .#,,++!!!&&&};;&!+,,<]1@>>>~>@*4'44444444. ",
" .##,,++!+!!!&&&&!+#%_,>>~>~~~@@44444444'4. ",
" .>##,,+++!!!!!!!!,#(%>>#>#>>**4'4444444'4. ",
" .>###,,++,+!!+!+,,#(#>>>~>~~@*44444444|4'. ",
" .>>###,,+,+,+++,,##:~>>#>~>@*@444444444''. ",
" .>>###,,,,,,,,,#>>@@@@>>@*@44@44444'|'|. ",
" .>>>######,,###>@=-1~4*@*@@444@4444'44'. ",
" .@@>>>#######>>@%]]<_=444444@4)44''|'|'. ",
" .@@@@>>>>>>>>@3<<<<<]')4444444''4'4''. ",
" .)@@@@@>@>>@@)=<<<<<]|'4)4))4)4''''|'. ",
" .)))@)@@@@@@)4_<<<<%|''44)4))'''''). ",
" .))))))))))))'4%{{1'|4')4)))))')'''. ",
" .)'')))))))'|||||||'''))))))))))). ",
" .)''''))'''''|||'|''''')')')))). ",
" .'''''''''''''''''''')))))')). ",
" .''''))''''''''''')'')))))'. ",
" .)''''))))''''''''))))))). ",
" ..')')'))''''''''')')).. ",
" ..)))')')''''))))).. ",
" ...))')''''''... ",
" .......... ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

175
yawmppp/src/isprc.c Normal file
View file

@ -0,0 +1,175 @@
/*
YAWMPPP - PPP dock app/helper for WindowMaker
Copyright (C) 2000:
Authors: Felipe Bergo (bergo@seul.org)
contains code from the wmppp application by
Martijn Pieterse (pieterse@xs4all.nl)
Antoine Nulle (warp@xs4all.nl)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "isprc.h"
int
GetISPInfo(char *rcname,struct YAWMPPP_ISP_INFO *wii,int max)
{
FILE *f;
int num_isps;
char temp[512],work[512];
char *q;
char *tokens=" :\n\t";
char *tokens2="\n";
memset(&wii[0],0,sizeof(struct YAWMPPP_ISP_INFO));
f=fopen(rcname,"r");
if (!f) return 0;
num_isps=0;
/* level 0 */
while( fgets(temp,128,f) ) {
strcpy(work,temp);
q=work;
q=strtok(q,tokens);
if (!q) continue;
if (!strcmp(q,"ISP.BEGIN")) {
if (num_isps>=max) continue;
/* enter ISP.BEGIN block */
memset(&wii[num_isps],0,sizeof(struct YAWMPPP_ISP_INFO));
wii[num_isps].ppp.override=0;
wii[num_isps].ppp.noipdefault=1;
wii[num_isps].ppp.noauth=1;
wii[num_isps].ppp.passive=0;
wii[num_isps].ppp.defaultroute=1;
wii[num_isps].ppp.chap=AUTH_DONTCARE;
wii[num_isps].ppp.pap=AUTH_DONTCARE;
while( fgets(temp,128,f) ) {
strcpy(work,temp);
q=work;
q=strtok(q,tokens);
if (!strcmp(q,KEY_LONGNAME)) {
q=strtok(NULL,tokens2);
if (q) strncpy(wii[num_isps].LongName,q,128);
continue;
}
if (!strcmp(q,KEY_SHORTNAME)) {
q=strtok(NULL,tokens2);
if (q) strncpy(wii[num_isps].ShortName,q,16);
continue;
}
if (!strcmp(q,KEY_STARTACTION)) {
q=strtok(NULL,tokens2);
if (q) strncpy(wii[num_isps].StartAction,q,512);
continue;
}
if (!strcmp(q,KEY_STOPACTION)) {
q=strtok(NULL,tokens2);
if (q) strncpy(wii[num_isps].StopAction,q,512);
continue;
}
if (!strcmp(q,KEY_IFDOWNACTION)) {
q=strtok(NULL,tokens2);
if (q) strncpy(wii[num_isps].IfDownAction,q,512);
continue;
}
if (!strcmp(q,KEY_SPEEDACTION)) {
q=strtok(NULL,tokens2);
if (q) strncpy(wii[num_isps].SpeedAction,q,512);
continue;
}
if (!strcmp(q,KEY_PPPSTUFF)) {
q=strtok(NULL,tokens2);
if (q) strncpy(wii[num_isps].PPPLine,q,512);
continue;
}
if (!strcmp(q,KEY_CHATSTUFF)) {
q=strtok(NULL,tokens2);
if (q) strncpy(wii[num_isps].ChatFile,q,512);
continue;
}
if (!strcmp(q,KEY_USER)) {
q=strtok(NULL,tokens2);
if (q) strncpy(wii[num_isps].User,q,32);
continue;
}
if (!strcmp(q,KEY_PHONE)) {
q=strtok(NULL,tokens2);
if (q) strncpy(wii[num_isps].Phone,q,32);
continue;
}
/* ppp options per ISP */
if (!strcmp(q,KEY_PPP_OVER)) {
q=strtok(NULL,tokens2);
if (q) wii[num_isps].ppp.override=atoi(q);
continue;
}
if (!strcmp(q,KEY_PPP_DEFAULTROUTE)) {
q=strtok(NULL,tokens2);
if (q) wii[num_isps].ppp.defaultroute=atoi(q);
continue;
}
if (!strcmp(q,KEY_PPP_PASSIVE)) {
q=strtok(NULL,tokens2);
if (q) wii[num_isps].ppp.passive=atoi(q);
continue;
}
if (!strcmp(q,KEY_PPP_NOAUTH)) {
q=strtok(NULL,tokens2);
if (q) wii[num_isps].ppp.noauth=atoi(q);
continue;
}
if (!strcmp(q,KEY_PPP_NOIPDEFAULT)) {
q=strtok(NULL,tokens2);
if (q) wii[num_isps].ppp.noipdefault=atoi(q);
continue;
}
if (!strcmp(q,KEY_PPP_CHAP)) {
q=strtok(NULL,tokens2);
if (q) wii[num_isps].ppp.chap=atoi(q);
continue;
}
if (!strcmp(q,KEY_PPP_PAP)) {
q=strtok(NULL,tokens2);
if (q) wii[num_isps].ppp.pap=atoi(q);
continue;
}
if (!strcmp(q,KEY_NOLOGIN)) {
q=strtok(NULL,tokens2);
if (q) wii[num_isps].nologin=atoi(q);
continue;
}
if (!strcmp(q,"ISP.END")) {
num_isps++;
break;
}
}
}
}
fclose(f);
return(num_isps);
}

64
yawmppp/src/isprc.h Normal file
View file

@ -0,0 +1,64 @@
#ifndef YAWMPPP_ISPRC_H
#define YAWMPPP_ISPRC_H
#define KEY_LONGNAME "LongName"
#define KEY_SHORTNAME "ShortName"
#define KEY_STARTACTION "StartAction"
#define KEY_STOPACTION "StopAction"
#define KEY_SPEEDACTION "SpeedAction"
#define KEY_IFDOWNACTION "IfDownAction"
#define KEY_USER "User"
#define KEY_PHONE "Phone"
#define KEY_PPP_OVER "PPPOptionsOverride"
#define KEY_PPP_DEFAULTROUTE "PPPDefaultRoute"
#define KEY_PPP_PASSIVE "PPPPassive"
#define KEY_PPP_NOAUTH "PPPNoAuth"
#define KEY_PPP_NOIPDEFAULT "PPPNoIPDefault"
#define KEY_PPP_CHAP "PPPChap"
#define KEY_PPP_PAP "PPPPap"
#define KEY_NOLOGIN "NoLogin"
#define KEY_PPPSTUFF "PPPLine"
#define KEY_CHATSTUFF "ChatFile"
#define AUTH_REQUIRE 0
#define AUTH_REFUSE 1
#define AUTH_DONTCARE 2
struct ISP_PPP {
int override;
int defaultroute;
int passive;
int noauth;
int noipdefault;
int chap;
int pap;
int usepeerdns;
};
struct YAWMPPP_ISP_INFO {
char LongName[128];
char ShortName[16];
char StartAction[512];
char StopAction[512];
char SpeedAction[512];
char IfDownAction[512];
char PPPLine[512];
char ChatFile[512];
char User[32];
char Phone[32];
struct ISP_PPP ppp;
int nologin;
};
int
GetISPInfo(char *rcname,struct YAWMPPP_ISP_INFO *wii,int max);
#endif

169
yawmppp/src/list.c Normal file
View file

@ -0,0 +1,169 @@
/* Generic single linked list to keep various information
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
Author: Kresten Krab Thorup
Many modifications by Alfredo K. Kojima
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable
to be covered by the GNU General Public License. This exception does not
however invalidate any other reasons why the executable file might be
covered by the GNU General Public License. */
#include "list.h"
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#include <stdlib.h>
/* Return a cons cell produced from (head . tail) */
INLINE LinkedList*
list_cons(void* head, LinkedList* tail)
{
LinkedList* cell;
cell = (LinkedList*)malloc(sizeof(LinkedList));
cell->head = head;
cell->tail = tail;
return cell;
}
/* Return the length of a list, list_length(NULL) returns zero */
INLINE int
list_length(LinkedList* list)
{
int i = 0;
while(list)
{
i += 1;
list = list->tail;
}
return i;
}
/* Return the Nth element of LIST, where N count from zero. If N
larger than the list length, NULL is returned */
INLINE void*
list_nth(int index, LinkedList* list)
{
while(index-- != 0)
{
if(list->tail)
list = list->tail;
else
return 0;
}
return list->head;
}
/* Remove the element at the head by replacing it by its successor */
INLINE void
list_remove_head(LinkedList** list)
{
if (!*list) return;
if ((*list)->tail)
{
LinkedList* tail = (*list)->tail; /* fetch next */
*(*list) = *tail; /* copy next to list head */
free(tail); /* free next */
}
else /* only one element in list */
{
free(*list);
(*list) = 0;
}
}
/* Remove the element with `car' set to ELEMENT */
/*
INLINE void
list_remove_elem(LinkedList** list, void* elem)
{
while (*list)
{
if ((*list)->head == elem)
list_remove_head(list);
*list = (*list ? (*list)->tail : NULL);
}
}*/
INLINE LinkedList *
list_remove_elem(LinkedList* list, void* elem)
{
LinkedList *tmp;
if (list) {
if (list->head == elem) {
tmp = list->tail;
free(list);
return tmp;
}
list->tail = list_remove_elem(list->tail, elem);
return list;
}
return NULL;
}
/* Return element that has ELEM as car */
INLINE LinkedList*
list_find(LinkedList* list, void* elem)
{
while(list)
{
if (list->head == elem)
return list;
list = list->tail;
}
return NULL;
}
/* Free list (backwards recursive) */
INLINE void
list_free(LinkedList* list)
{
if(list)
{
list_free(list->tail);
free(list);
}
}
/* Map FUNCTION over all elements in LIST */
INLINE void
list_mapcar(LinkedList* list, void(*function)(void*))
{
while(list)
{
(*function)(list->head);
list = list->tail;
}
}

59
yawmppp/src/list.h Normal file
View file

@ -0,0 +1,59 @@
/* Generic single linked list to keep various information
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
Author: Kresten Krab Thorup
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable
to be covered by the GNU General Public License. This exception does not
however invalidate any other reasons why the executable file might be
covered by the GNU General Public License. */
#ifndef __LIST_H_
#define __LIST_H_
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
# define INLINE inline
#else
# define INLINE
#endif
typedef struct LinkedList {
void *head;
struct LinkedList *tail;
} LinkedList;
INLINE LinkedList* list_cons(void* head, LinkedList* tail);
INLINE int list_length(LinkedList* list);
INLINE void* list_nth(int index, LinkedList* list);
INLINE void list_remove_head(LinkedList** list);
INLINE LinkedList *list_remove_elem(LinkedList* list, void* elem);
INLINE void list_mapcar(LinkedList* list, void(*function)(void*));
INLINE LinkedList*list_find(LinkedList* list, void* elem);
INLINE void list_free(LinkedList* list);
#endif

164
yawmppp/src/misc.c Normal file
View file

@ -0,0 +1,164 @@
/* dock.c- built-in Dock module for WindowMaker
*
* WindowMaker window manager
*
* Copyright (c) 1997 Alfredo K. Kojima
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdlib.h>
#include <string.h>
#include "list.h"
#include "misc.h"
/*
*----------------------------------------------------------------------
* parse_command--
* Divides a command line into a argv/argc pair.
*----------------------------------------------------------------------
*/
#define PRC_ALPHA 0
#define PRC_BLANK 1
#define PRC_ESCAPE 2
#define PRC_DQUOTE 3
#define PRC_EOS 4
#define PRC_SQUOTE 5
typedef struct {
short nstate;
short output;
} DFA;
static DFA mtable[9][6] = {
{{3,1},{0,0},{4,0},{1,0},{8,0},{6,0}},
{{1,1},{1,1},{2,0},{3,0},{5,0},{1,1}},
{{1,1},{1,1},{1,1},{1,1},{5,0},{1,1}},
{{3,1},{5,0},{4,0},{1,0},{5,0},{6,0}},
{{3,1},{3,1},{3,1},{3,1},{5,0},{3,1}},
{{-1,-1},{0,0},{0,0},{0,0},{0,0},{0,0}}, /* final state */
{{6,1},{6,1},{7,0},{6,1},{5,0},{3,0}},
{{6,1},{6,1},{6,1},{6,1},{5,0},{6,1}},
{{-1,-1},{0,0},{0,0},{0,0},{0,0},{0,0}}, /* final state */
};
char*
next_token(char *word, char **next)
{
char *ptr;
char *ret, *t;
int state, ctype;
t = ret = malloc(strlen(word)+1);
ptr = word;
state = 0;
*t = 0;
while (1) {
if (*ptr==0)
ctype = PRC_EOS;
else if (*ptr=='\\')
ctype = PRC_ESCAPE;
else if (*ptr=='"')
ctype = PRC_DQUOTE;
else if (*ptr=='\'')
ctype = PRC_SQUOTE;
else if (*ptr==' ' || *ptr=='\t')
ctype = PRC_BLANK;
else
ctype = PRC_ALPHA;
if (mtable[state][ctype].output) {
*t = *ptr; t++;
*t = 0;
}
state = mtable[state][ctype].nstate;
ptr++;
if (mtable[state][0].output<0) {
break;
}
}
if (*ret==0)
t = NULL;
else
t = strdup(ret);
free(ret);
if (ctype==PRC_EOS)
*next = NULL;
else
*next = ptr;
return t;
}
extern void
parse_command(char *command, char ***argv, int *argc)
{
LinkedList *list = NULL;
char *token, *line;
int count, i;
line = command;
do {
token = next_token(line, &line);
if (token) {
list = list_cons(token, list);
}
} while (token!=NULL && line!=NULL);
count = list_length(list);
*argv = malloc(sizeof(char*)*count);
i = count;
while (list!=NULL) {
(*argv)[--i] = list->head;
list_remove_head(&list);
}
*argc = count;
}
extern pid_t
execCommand(char *command)
{
pid_t pid;
char **argv;
int argc;
parse_command(command, &argv, &argc);
if (argv==NULL) {
return 0;
}
if ((pid=fork())==0) {
char **args;
int i;
args = malloc(sizeof(char*)*(argc+1));
if (!args)
exit(10);
for (i=0; i<argc; i++) {
args[i] = argv[i];
}
args[argc] = NULL;
execvp(argv[0], args);
exit(10);
}
return pid;
}

9
yawmppp/src/misc.h Normal file
View file

@ -0,0 +1,9 @@
#ifndef __MISC_H
#define __MISC_H
#include <unistd.h>
extern void parse_command(char *, char ***, int *);
extern pid_t execCommand(char *);
#endif /* __MISC_H */

115
yawmppp/src/stepphone.xpm Normal file
View file

@ -0,0 +1,115 @@
/* XPM */
static char * stepphone_xpm[] = {
"48 48 64 1",
" c None",
". c #020202",
"+ c #E6E6E6",
"@ c #9A9A9A",
"# c #5E5E5E",
"$ c #424242",
"% c #363636",
"& c #222222",
"* c #B2B2B2",
"= c #8A8A8A",
"- c #1A1A1A",
"; c #EAEAEA",
"> c #EEEEEE",
", c #161616",
"' c #D2D2D2",
") c #767676",
"! c #525252",
"~ c #F2F2F2",
"{ c #0E0E0E",
"] c #F6F6F6",
"^ c #6E6E6E",
"/ c #BABABA",
"( c #FAFAFA",
"_ c #4E4E4E",
": c #BEBEBE",
"< c #9E9E9E",
"[ c #262626",
"} c #0A0A0A",
"| c #626262",
"1 c #969696",
"2 c #3A3A3A",
"3 c #DEDEDE",
"4 c #A2A2A2",
"5 c #7E7E7E",
"6 c #C2C2C2",
"7 c #4A4A4A",
"8 c #2A2A2A",
"9 c #5A5A5A",
"0 c #060606",
"a c #FEFEFE",
"b c #CACACA",
"c c #A6A6A6",
"d c #464646",
"e c #323232",
"f c #929292",
"g c #666666",
"h c #D6D6D6",
"i c #1E1E1E",
"j c #AEAEAE",
"k c #565656",
"l c #6A6A6A",
"m c #121212",
"n c #727272",
"o c #8E8E8E",
"p c #2E2E2E",
"q c #AAAAAA",
"r c #C6C6C6",
"s c #DADADA",
"t c #7A7A7A",
"u c #828282",
"v c #3E3E3E",
"w c #CECECE",
"x c #E2E2E2",
"y c #B6B6B6",
" ",
" .......... ",
" ................ ",
" .................... ",
" ........................ ",
" ............................ ",
" .............................. ",
" ................0}}{{}00........ ",
" ..............}{m&8peee[i;](aaaaaa ",
" ............0{,ip$_#^n)^|7b3>(aaaaaa ",
" ...........}m&8v!g51qy//*cof*';]aaaaaa ",
" .........},&2_lu@*6h2vdvv2b_)<b;]aaaaa ",
" ........},&2!noj6hvvv(]]~aa2.vl@b;(aaaaa ",
" ......0mi%k)1/'2v%(~(aaaaa>(_0%^ch~aaaaa ",
" ......0,p_n1/wvv]]]aaa]$dk5];$k.$5/+(aaaaa ",
" .....}-%#=*wv2~~;aa~~a2aak)n~v$l.#cs]aaaaa ",
" .....0-%|16v2(]+a(+;>]$t~(dqu5!9..!1h]aaaaaa ",
" ....}-%g<b%](~aa^2d(]^d=~~$dd@0.!._@'~(aaaaa ",
" ...0,%g@bv(~;a]5$aadnnkk;]>]($m$d.k<h]aaaaaa ",
" ....{8kfr%(~~(x@$:(~$d$;]~]+~]]0i.pgq3]aaaaaaa ",
" ...0-du:v~~]a>])d)]a$~~x;]^a(]+l.}8gch~aaaaaaa ",
" ...{[94%aa~>(>xndf~]~~+]5aa%n](_^.i_=:+]aaaaaa ",
" ...{p^yvoaaa>>>=$(]++;na(d5()aad_n.p#1r+]aaaaa ",
" ...{en:%=n5;>+~5d]~3;;xd=~oaa%n__kg0%|<b;(aaaa ",
" ..0m%)6vof^+_v!,0m_$2$2!,l)0-9}^g$9l.%lc'~aaaa ",
" ...m%t:d4)n~_d$00im$$$kvd0mkmll.m$vdn.v5:+(aaa ",
" ..0{e)/2%oo~!vm[}-m-d_vdd$mgl0{_7_dgnt}#4s]aaa ",
" ...{e^yd4%dd{,!m0m,m-k!__v_0mdd_klgll9.71'>aaa ",
" ...}&94v55o~97!0-[i,m,9!7$7d$d$l^^^9$n.$=w>aaa ",
" ..0-d5/%jo)##00&m,,-ii#9$p!9^nll!v$!n.dob~(a ",
" ..0{8k=:22d.00-m,im,-&-!d_#|^l#_d_7!t._1']aa ",
" ...0,ekuc6h.0,,i,---,i-mk9gg_$_d7kd9.}^j3]aa ",
" ...0,8d|5<$p00m---i---mmg7kd$_!$!..%#fr+(a ",
" ....0{ipvk=gd8.0&-iim--m!!$$k$|..8dl163~(a ",
" .....0m-&6c=gdp00&mim,,$_!kg..pdgojbx]aa ",
" .......0{;srq=gd8.0m-,,9!_..pdg=j6s;](aa ",
" ........a~;srq=gdp..m,^0.pdg=c6s;~aaaa ",
" ........aaa~;src=g7e..0p7g=c6s;]aaaaaa ",
" .......aaaa(~;srqon#k|n=qrs;](aaaaaa ",
" ......aaaaaaa~;3b*c<c*b3;]aaaaaaaa ",
" aaaaaaaaaaaaa(]>x3h3x;](aaaaaaaa ",
" aaaaaaaaaaaaaaa(]]](aaaaaaaaaa ",
" aaaaaaaaaaaaaaaaaaaaaaaaaaaa ",
" aaaaaaaaaaaaaaaaaaaaaaaa ",
" aaaaaaaaaaaaaaaaaaaa ",
" aaaaaaaaaaaaaaaa ",
" aaaaaaaaaa ",
" "};

View file

@ -0,0 +1,36 @@
#
# thinppp: non-docked PPP applet
#
CC = @CC@
CFLAGS = -Wall -O2
GTKLIB = @GTK_LIBS@
GTKFLAG = @GTK_FLAGS@
RLFLAG = -DVERSION=\"@MK_YAWMPPP_RELEASE@\" -DIPREFIX=\"@prefix@\" -D@SYSDEF@
PROGINST = @INSTALL@
ALLDOTOS = thinppp.o
ALLDOTHS = thinppp.h ../isprc.h ../misc.h ../list.h ../ycommon.h
EOBJS = ../isprc.o ../ycommon.o ../misc.o ../list.o
all: build_thinppp
build_thinppp: $(ALLDOTOS)
$(CC) $(ALLDOTOS) $(EOBJS) -o yawmppp.thin $(GTKLIB)
$(ALLDOTOS): %.o : %.c $(ALLDOTHS)
$(CC) $(CFLAGS) $(RLFLAG) $(GTKFLAG) -I.. -c $< -o $@
install:
$(PROGINST) -m 0755 yawmppp.thin @prefix@/bin/yawmppp.thin
install-strip:
$(PROGINST) -s -m 0755 yawmppp.thin @prefix@/bin/yawmppp.thin
clean:
rm -f $(ALLDOTOS) yawmppp.thin
distclean:
rm -f Makefile *~

View file

@ -0,0 +1,96 @@
/* XPM */
static char * backxpm_xpm[] = {
"320 20 73 1",
" c None",
". c #020204",
"+ c #C6C6C4",
"@ c #CACACC",
"# c #ACAAAC",
"$ c #8E8E8C",
"% c #B6B6B4",
"& c #CECECC",
"* c #BBBBBC",
"= c #424244",
"- c #1E1E1C",
"; c #2D2E2C",
"> c #B2B2B4",
", c #D2D2D4",
"' c #4C4C4C",
") c #121214",
"! c #848288",
"~ c #969694",
"{ c #5E5E5C",
"] c #727274",
"^ c #3A3A3C",
"/ c #262624",
"( c #3E3E3C",
"_ c #9A9A9C",
": c #2A2A2C",
"< c #565654",
"[ c #363634",
"} c #666664",
"| c #626264",
"1 c #868684",
"2 c #767674",
"3 c #6A6A6C",
"4 c #212624",
"5 c #222224",
"6 c #F6F2FC",
"7 c #E2E2E4",
"8 c #C6C2C4",
"9 c #283C38",
"0 c #222B2B",
"a c #A2A2A4",
"b c #263430",
"c c #929294",
"d c #8A8A8C",
"e c #7C7C7C",
"f c #464644",
"g c #323234",
"h c #2A3E3C",
"i c #263A34",
"j c #525254",
"k c #FEFEFC",
"l c #766264",
"m c #945C5C",
"n c #7A3E3C",
"o c #8B5254",
"p c #7A5354",
"q c #854A4C",
"r c #826E6C",
"s c #8E7E7C",
"t c #8E5654",
"u c #926E6C",
"v c #8E6664",
"w c #9F2B2C",
"x c #AE0204",
"y c #A41C1C",
"z c #964A4C",
"A c #A80E0C",
"B c #8A7674",
"C c #9A3A3C",
"D c #9A2224",
"E c #924244",
"F c #7E5A5C",
"G c #725E5C",
"H c #922E2C",
"................................................................................................................................................................................................................................................................................................................................",
".++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++@#.++++$+++++++$%@##.",
".&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@&#.@@*=-*&&&&&*-;*%>.",
".,,#''##)!#~.{##.##.##.#.!###)]])^^/#^/^/{#.^^/!#############################################################################################################################################################################################;;;;;#########################;################################(.@_:--<#####[--:}].",
".,,#_._|:##''/##/11.11/#./##|.]2^##^]^]##.#.##2^####..........................##.............................##..........................##...................................................................................###############>;;;#########################;::###..........................##^.+#;--:####{---322.",
".,,##'')!##)~41#']'[']'#.'1#/^3]5]])~[']{5#.]]^{####.66666666666!66666666666!7##.---------------------------7##.66666666666!66666666666!8##.-----------------------------9999999999999999999999999---------------------------7######|45503###a#;a###|45503#######|45503##;;;;b##.66666666666!66666666666!8##^.@#c---3##d---2#]].",
".&&_a$.5aae4a<fa3[5e5g3_.e[3f[33433ea['33$_.333aaaa_.6##########.6##########.7a_.5hhhh5hhhh5hhhh5hhhh5hhhh5-7a_.6##########.6##########.+a_.55hhh555hhh5555555hhh555hhh5599999999999999999999999995hhhh5hhhh5hhhh555555hhhh5-7aaaaa<5-54043aaaaaaaa<5-5404}aaaaa<5-54043aaaaaaa_.6###.##.###.6##########.+aa^.@aa|--;aa0-)2aa33.",
".@@___g}__f5g[)__5)_)5__._)52[}3g____g}____.________.6#####.####.6####.#####.7__.-i--i-i--i-i--i-i--i-i--i-57__.6######..##.6#..###..##.8__.-i---i-i---i--i--i---i-i---i-9999999999999999999999999-i--i-i--i-i--i------i--i-57____<5-40bbb;3_~____<5-40bbbb3___<5-40bbb03_______.6##..##..##.6#........#.8__^.@___[--|=--]___33.",
".+@cccg|cc)!cc-]c5jcj5~c.cj5cg||g~ccc;|~~~c.cccccc~c.6####..####.6####..####.7~c.5h55h5h55h5h55h5h55h5h55h-57~c.6#####...##.6#...#...##.8~c.5h555h5h555h55h55h555h5h555h599999999999999999999999995h55h5h55h5h55h5h55h5h55h-57c$~~55-50bib0<~cc~~~55-50bib0<c~c45-50bib0<ccccc~c.6#.$.##.j.#.6#.kkkkkk.#.8cc^.@ccc!4-:-/1ccc~}|.",
".88$$$3e$d{d$$3ed3edelmmnmopdqre3dms$ltddm${$$us$$dd.6###...####.6####...###.7dd.-iiii-iiii-iiii-iiii-iiii5-7dd.6#..#...###.6##.....###.+dd.--iii---iii-------iii---iii--9999999999999999999999999-iiii-iiii-iiii-i-i--iiii5-7$$dd5--400bb03dd$ddd5--400b003$d$---400bb03dddd$dd.6#.$.##.<.#.6#.k....k.#.8$d^.@d$$$}--/edd$$d{{.",
".**!11111!1!111111111vwwxywz!xm111xt1tx11xAB!1wt111!.6##....####.6####....##.71!.5h55h5h55h5h55h5h55h5h55i5571!.6#.....####.6###...####.+1!.5h555h5h555h55555h555h5h555h599999999999999999999999995h55h5h55h5h55h5hh555h55i5-7111!----04004!1!111!----00004!111----00004!111111!.6#.$$..$j.#.6#.kkkkkk.#.81!^.@!!1!!g--31!111{<.",
".**!e!eee!e!e!e!eeeee!!ext!!!xCtttxtetxeexwxtewte!e!.6###...####.6####...###.7e!.-i--i-i--i-i--i-i--i-i--h--7e!.6#....#####.6##.....###.8e!.-i---i-i---i--i--i---i-i---i-9999999999999999999999999-i--i-i--i-i--i-i-i--i--i5-7!ee!45---4555_e!eee!45---544-_eee45---545-_e!ee!e!.6##.$$$j.##.6#.k....k.#.+e!^.@e!e!{-;-:!!eee<<.",
".*%222ee2e2e2e2eeeee22e2xo222xyDDwxo2oxe2x2ExDwo2e22.6####..####.6####..####.722.5hhhh5hhhh5hhhh5hhhh5hhih55722.6#...######.6#...#...##.+22.55hhh555hhh555h555hhh555hhh5599999999999999999999999995hhhh5hhhh5hhhh5h55h5hhhi5-72e22'55--5--ja22e222'55----5'a2e2'55----5ja2e22e22.6###.$<.###.6#.kkkkkk.#.+22^.@2e2|-<34-[eee2j'.",
".>%]]]]3]3]3]3]3]3]3]]]]xq]]]xq2]]xq]qx]]x]]FAxq]3]].6#####.####.6####.#####.7]].-----------------------5--57]].6#..#######.6#..###..##.8]].-----------------------------9999999999999999999999999------------------------55-7]]]]]j4----'a3]]]]]]]j4--5-'a]]]]]j4---5'a3]3]23]].6###.$j.###.6#.k....k.#.8]]^.@23}4=]]}5-j3]]''.",
".#>333333333333333333333Dp333Dp333Dp3pD33D333GHp3333.6##########.6##########.733.5555555555555555555555-55-5733.6##########.6##########.833.55555555555555555555555555555999999999999999999999999955555555555555555555555--5-7}33333{{31a~3333333333{{3!a~3333333{{3!__333333333.6###.$j.###.6#.kkkkkk.#.833^.+335[3333'--{33'f.",
".>#}}|}}}}}}}}}|}|}|||||||||||||||}|||||||||||}|}|||.!...........s...........7||.7777777777777777777777777777||.!...........!...........8||.7777777777777777777777777777777777777777777777777777777777777777777777777777777777}||}||}||||}}}}|}||}||}||||}||||}||}|||}}}}}}|}|||.!...........!...........8||^.@}[g|}||}}'-/|}==.",
".#a{{<{<{<{<{<{<{<{{<{{{<{{{{<{{{<{{{<{{{<{{<{{<{{{{77777777777777777777777777<{{<{<<{<<{<<{<<{<<{<<{<{<{{{<{{{888888888888888888888888+8{<{{<<{<<{<<{<<{<<{<<{<<{<<{<<{<<{<<{<<{<<{<<{<<{<<{<<{<<{<<{<<{<<{<<{<<{<<{<<{{{{{{<{{<{{<{<{{<{<{{<{{<{{<{<{{<{{<{<{{<{{{<{<{<{<{{{{{888888888888888888888888+8<{^.@<'j<{{{{<{[(j<=(.",
"._~^^(^(^(^(^(((((^^(^^^(^^^^(^[^(^[^(^^^(^^(^^(^^[^^^^^^^^(^^^^(^^^^^^^^^^^^^([^(^((^((^((^((^((^((^(^(^^^(^[^^^^^^(^(^^^^^^^^^^^^^^^^^^^([^((^((^((^((^((^((^((^((^((^((^((^((^((^((^((^((^((^((^((^((^((^((^((^((^((^^^[^^(^^(^^(^(^^(^h^^(^^(^^(^(^^h^^(((^^(^^^(^(^(^(^^^[^^^^^^^^^^^^^^^^^^^^^^^^^^((^^.#^^^(^[[^(^^^((^^.",
"._~^^^^[^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(^[^^[^^^^^^^^^^^^^^[^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^.>^^^^^^^^^^^^^^^^.",
"................................................................................................................................................................................................................................................................................................................................"};

View file

@ -0,0 +1,260 @@
/* XPM */
static char * dataxpm_xpm[] = {
"64 192 65 1",
" c None",
". c #020204",
"+ c #1E861C",
"@ c #968428",
"# c #424244",
"$ c #CAC214",
"% c #9A4A4C",
"& c #760A0C",
"* c #EE8284",
"= c #12763B",
"- c #B2A224",
"; c #DEE20C",
"> c #222224",
", c #0AD10C",
"' c #273634",
") c #C4C4C4",
"! c #969697",
"~ c #545453",
"{ c #686869",
"] c #8A2624",
"^ c #D3D3D4",
"/ c #12AA14",
"( c #ADAAAC",
"_ c #72E274",
": c #89878B",
"< c #967A34",
"[ c #E7E7E8",
"} c #06EA04",
"| c #624E34",
"1 c #747473",
"2 c #272B2C",
"3 c #39393A",
"4 c #B8B8B9",
"5 c #121210",
"6 c #E67674",
"7 c #CA4644",
"8 c #4AC24C",
"9 c #A20204",
"0 c #BC2C2A",
"a c #07DE04",
"b c #1E5E1C",
"c c #FEA2A4",
"d c #F8F4FC",
"e c #F6FE04",
"f c #B11B1A",
"g c #82623C",
"h c #C63A3C",
"i c #C2BA1C",
"j c #1ADE6C",
"k c #159618",
"l c #2A7E24",
"m c #D65A5C",
"n c #0FBB0C",
"o c #02FE04",
"p c #7E7E7C",
"q c #5E5E5C",
"r c #821A1C",
"s c #D6D214",
"t c #6E5E34",
"u c #7A663C",
"v c #A28E2C",
"w c #DCDCDA",
"x c #1E1E1C",
"y c #2A3E3C",
"z c #CBCBCC",
" ",
" !(q>xx>{!( !(q>xx>{!( !(q>xx>{!( !(q>xx>{!( ",
" (~=nn,,k{( (~tv-i$@{( (~r07mm%{( (~>x>22>{! ",
" ~=/n,a}ak{ ~|<-is;s@{ ~&fhm6*6%{ q>x>22''21 ",
" >k/na}o},~ >g@-i;e;i~ >9f7m*c*m~ xx>>2'y'2~ ",
" xk/n,}}},{ xg<-is;si{ >9fhm6*6m{ xxxx2''22{ ",
" xk/nn,,,np xg<v-i$i-p x9f07mmm7p >x>x>222>p ",
" >+k/nnnnn( >gg<v---v( x99f0h7h0( >>xxxx>>x( ",
" ~b+k////+! ~|gg<<@<u! ~&99ffff]! ~x>>xxxx~: ",
" {~b+kkkl(1 1~|ugggt!1 1~&9999r(1 1~>xx>x~!1 ",
" {{q~{:(:{{ {{qq{:(({{ {{qq{p(!{{ {{qq{p(!{{ ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
"{1{1~{1{1{1{~{1:!)))):))))))):4z(( ",
"11{>5{1p1p1{5x{!!zz4#>4zzzzz4>2444 ",
"1!2x>~(((((3xx>[[z!2x>q(((((3xx2q{ ",
"1('xx2((((qxxx{[[)('xx2((((qxxx{1p ",
"1(!xxx{((:xxxp([[z(!xxx{((:xxxp(1{ ",
"1(!qxx'!(2x51!([[)(!qx>2((2x51!({{ ",
"1!!!3xxq#xx1!!![[z!!!3>xq#xx1!!!1{ ",
"1!!!p>x2x>:!!!![wz!!!p>x2x>:!!!!{q ",
"1::!:{xx>p:::::wwz::!:{xx2p:::!:qq ",
"1:::::'x>{:::::[^zp:::p'xx{:::::q~ ",
"1ppppqx2x2p:p1pwwzppppqx2x2ppp1p~~ ",
"11p1qxq{>x3ppp1^zz1p1{x~{>x3ppp1~~ ",
"11{{>#11{>x~{11^zz1{{>#11{>x~{11## ",
"1{{>3{{{{#xxq{{^z){{>3{{{{#xxq{{~# ",
"1{3'q{{q{{#>>q{zzz{3'q{{{{{~x2q{## ",
"1~|~~qqqq~q3#~~z)zq#~qqqqq~q'#~~## ",
"q))))))4)z4))))))(333#3'333333##33 ",
"{))4))))))))))))4433333333#3333333 ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
"...........p...........pdddddddddddpdddddddddddp ",
".(((.((.(((d.((((((((((dd(((.((.(((.d((((((((((. ",
".((..((..((d.(........(dd((..((..((.d(........(. ",
".(.:.((.~.(d.(.dddddd.([d(.:.((.~.(.d(.dddddd.(. ",
".(.:.((.~.(d.(.d5..5d.(dd(.:.((.~.(.d(.d5..5d.(. ",
".(.!:..:~.(d.4.dddddd.(dd(.!:..:~.(.d(.dddddd.(. ",
".((.:!:q.((d.(.d5..5d.(dd((.:!:q.((.d(.d5..5d.(. ",
".(((.:~.(((d.4.dddddd.(dd(((.:~.(((.d4.dddddd.(. ",
".(((.!~.(((d.(.d5..5d.(dd(((.!~.(((.d(.d5..5d.(. ",
".(((.:~.(((d.4.dddddd.(dd(((.:~.(((.d4.dddddd.(. ",
":dddddddddddpdddddddddd[:...........p...5..5.... ",
" ",
"...........:...........:dddddddddddpdddddddddddp ",
".((((((((((d.((((((((((dd((((((((((.d((((((((((. ",
".((((((..((d.(..(((..(([d((((((..((.d(..(((..((. ",
".(((((...((d.(...(...((dd(((((...((.d(...(...((. ",
".(..(...(((d.((.....(((dd(..(...(((.d((.....(((. ",
".(.....((((d.(((...(((([d(.....((((.d(((...((((. ",
".(....(((((d.((.....(((dd(....(((((.d((.....(((. ",
".(...((((((d.(...(...((dd(...((((((.d(...(...((. ",
".(..(((((((d.(..(((..((dd(..(((((((.d(..(((..((. ",
".((((((((((d.((((((((((dd((((((((((.d((((((((((. ",
":ddddddddddd:dddddddddd[p...........p........... ",
" ",
"...........p...........:dddddddddddpdddddddddddp ",
".((((((((((d.(((((((((([d((((((((((.d((((((((((. ",
".(((((.((((d.((((.(((((dd(((((.((((.d((((.(((((. ",
".((((..((((d.((((..((((dd((((..((((.d((((..((((. ",
".(((...((((d.((((...(((dd(((...((((.d((((...(((. ",
".((....((((d.((((....(([d((....((((.d((((....((. ",
".(((...((((d.((((...(((dd(((...((((.d((((...(((. ",
".((((..((((d.((((..((((dd((((..((((.d((((..((((. ",
".(((((.((((d.((((.(((((dd(((((.((((.d((((.(((((. ",
".((((((((((d.((((((((((dd((((((((((.d((((((((((. ",
":dddddddddddpdddddddddddp...........p........... _'8k_ ",
"xxxxxx>x>x>xxxxxxxx>xxx>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"yyy8x8__8x8__8>83y8>8__8>8__8>8__8>8__8>8__8>8__8>yyyy>yyyy>yyyy",
"yx>_x3>>_>3>x_>_x>_>_>>yx_>>yxy>>_>_>>_x_>>_x_>>_xyxxyxyxxyxyxxy",
"yxx_xyxx_>y>>_>_x>_>_x>3>_xxyxyx>_>_x>_>_x>_>_x>_x_xx_x_xx_xyxxy",
"3yy8x8__8x8__8>8__8x8__8>8__8>yyy8>8__8>8__8x8yy8>_y_y>____xyyyy",
"yx>_x_x>yx'>x_xyx>_x3x>_x_x>_xyxx_x_x>_xyxx_>_xx_x__xy>_>>_xyxxy",
"y>x_>_xxyxy>x_xyxx_xy>x_>_>x_xyxx_>_xx_xyx>_x_x>_x_x_'x_>x_xyxxy",
"yyy_x8__8x8__8xyyy8>8__8x8__8xyyy8x8__8>8__8x8__8>_yy_>_yy_xyyyy",
"xxx>>>x>x>x>>x>xx>xxx>x>x>xx>xxxx>>>x>xx>>x>>x>x>xxxxxxxx>>>xxxx",
">x>xx>x>x>x>x>x>x>x>xx>x>x>xx>x>xx>x>x>>x>x>x>x>x>x>>>x>xxx>xx>>",
"8__8>8__8>8__8x8__8>8__8>x>xyyyyxyyyyxyyyy>x>x>xyyyy>x>x>>>x>>xx",
"_>xyx_>>_x_>>_>_>x_>_>>_x>x>yxxyxyxxyxyxxyx>x>xxyxxy>x>xxx>xx>>>",
"_>xy>_x>_>_x>_>_>>_>_>x_>xxx'>xyxy>xyxyxxyxy>xyxyxx'>x>>>>x>>xxx",
"8__yx8__>x8__>x8yy8x8__>x>x>3yyyxyyyyxyyyyxyxyxxyyyyx>xxx>xx>>>>",
"_>xy>_x>_>_x>_>_xx_>_x>_x>xxyxxyxyxxyxyxxyxyy>xxyxxy>x>>>x>>xxxx",
"_x>yx_>x_>_>x_>_>x_>_>x_>x>>yxxyxyxxyxyxxyxyxyxxyxxyxxxx>xx>>>>>",
"8__8>8yy8>8yy8>8__8>8yy8>x>xyyyyxyyyyxyyyyxyxxyxyy''>>>>x>>xxxxx",
">x>>x>xx>x>x>x>x>>x>x>x>x>xxxxxxxxxxxxxxxx>x>x>xx>x>xxx>xx>>>>>>",
"xxyyyx>xyyyx>x>x>xyyyx>xyyyx>xx>x>xx>x>x>x>x>xx>x>x>>>>x>>xxxxxx",
">yxx>yxyxx>yx>yx>yxx>yxyxx>yx>>xx>x>x>x>x>x>x>>x>x>xxx>xx>>>>>>>",
"xy>xxyxy>xxyxxyxxy>xxyxy>xxyxx>x>x>x>x>x>x>x>x>x>>x>>>x>>xxxxxxx",
"xxyyyxxxyyyx>xx>xxyyyxxxyyyx>x>x>x>x>x>x>x>x>x>x>x>xx>xx>>>>>>>>",
"xyxxxyxyxxxyx>x>xyxxxyxyxxxy>x>x>x>x>x>x>x>x>x>>x>x>>x>>xxxxxxxx",
">yx>>yxyx>>yx>yxxyx>xyxyx>xyx>x>x>x>x>x>x>x>xx>xx>xx>xx>>>>>>>>>",
"xxyyyx>xyyyxxxyx>xyyyx>xyyyx>x>x>x>x>x>x>x>x>x>>x>>>x>>xxxxxxxxx",
">xxxx>xxxx>x>>x>xxxx>x>xxxx>x>x>x>x>x>x>x>x>x>xx>xx>xx>>>>>>>>>>",
"x>x>x>x>x>x>x>x>x>>x>xx>>x>x>x>x>x>x>x>x>x>x>x>>x>>x>>xxxxxxxxxx",
">x>x>x>x>x>x>x>x>xx>x>>xx>x>x>x>x>x>x>x>x>x>x>xx>x>xx>>>>>>>>>>>",
" ",
" ",
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ",
">y__y>___y>y__y>___y>____>____>y__y>_yy_>y_yy>yyy_>_yy_>_yyyx ",
"x_>>_x_>>_x_>>_x_>>_>_>>yx_>>yx_>>yx_xx_xy_xyxyxx_x_xx_x_xxy> ",
"x_x>_>_xx_x_x>y>_xx_>_xxy>_x>y>_xxy>_>>_xy_xyxyx>_>_>_y>_xxyx ",
">____x___y>_y''x_yy_x___'x___'x_y__>____x'_yyxyyy_>__''>_yyyx ",
">_xx_>_x>_x_>x'>_xx_x_x>yx_xxyx_xx_x_xx_xy_xyxyxx_x_>_'x_xxyx ",
">_x>_>_xx_x_xx_x_x>_>_x>y>_>xyx_>x_>_x>_xy_xyx_xx_>_xx_>_>xyx ",
">_yy_x___y>y__y>___yx____x_yyyxy__yx_yy_xy_''xy__yx_yy_x____x ",
"x>xx>>>xx>xx>>>x>x>x>>xx>>xxxxxx>x>x>xx>xxxx>x>xx>x>x>x>x>x>> ",
">_yy_>_yy_>y__yx___yxy__yx___y>y__yxy___>_y'_x_yy_>_yy_x_yy_x ",
"x____>__x_x_x>_>_>x_>_x>_>_x>_x_x>_xy>_y>_>x_>_>x_x_>x_x_xx_> ",
">_x>_x_>__>_>x_>_>x_>_>x_>_>x_>_>xyxyx_yx_>>_x_>x_>_>x_>y__'x ",
"x_yy_>_yy_>_yy_>___y>_yy_>___yxy__yxyy_y>_yy_>_yy_>_yy_x'__yx ",
">_x>_x_>x_x_>x_>_>xyx_x>_x_>_yxyx>_xyx_yx_xx_>_x>_x____>y__yx ",
"x_x>_>_>>_>_x>_>_>xy>_>_y>_>x_>_x>_xyx_yx_>>_xy__y>____x_xx_> ",
">_yy_x_yy_xy__yx_yyyxy_y_x_yy_xy__yxyy_yx____>y__yx_yy_>_yy_x ",
"xx>xx>x>xx>x>x>>xxxxx>xx>>x>x>x>x>x>xx>xx>>x>xx>x>x>>x>>xxxx> ",
">_yy_x____>yyyyxyyyyxyyyyxyyyyxyyyyxyyyyxyyyyxyyyyxyyyyxyyyyx ",
"x_y>_xy>>_xyxxyxyxxyxyxxyxyxxyxyxxyxyxxyxyxxyxyxxyxyxxyxy>xyx ",
">_yy_>yx_yxyxxyxyxxyxyxxyxyxxyxyxxyxyxxyxyxxyxyxxyxyxxyx'xxyx ",
"xy__yxy_yyxyyyyxyyyyxyyyyxyyyyxyyyyxyyyyxyyyyxyyyyxyyyy>yyyy> ",
"xyx_yxy_xyxyxxyxyxxyxyxxyxyxxyxyxxyxyxxyxyxxyxyxxyxyxxyxyxxyx ",
"x'>_yx_xxyxyxxyxyxxyxyxxyxyxxyxyxxyxyxxyxyxxyxyxxyxyxxy>'>xyx ",
">y_yyx____xyyyyxyyyyxyyyyxyyyyxyyyyxyyyyxyyyyxyyyyxyy''xyy''x ",
"x>xxx>>>x>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>xxx>>> ",
">y__yx_yyyxyyyyxyyy_>____>y__yxy__yx_yyyxyyyyxyyy_>yyyyx_yyyx ",
"x_x>_>_xxyxyxxyxyxx_>_>xyx_x>_x_>xy>_xxyxy_xyxyxx_x_x>_x_xxyx ",
">_>x_>_>xyxy__yxyx>_x_>xyx_>xy>_x>yx_>xyxyyxyxyx>_>_x_yx_xxyx ",
"x____x___yx_yy_xy___x___y>__yy>_y__>___yxy_yyxyyy_>__yyx_yyy> ",
">_>>_>_>x_>_xxy>_>>_>_>xyx_xxyx_x>_>_>x_xy_xyxyxx_>_x_yx_xxyx ",
"x_>x_x_x>_x_x>_x_>x_x_>xy>_>xy>_>x_x_>x_xy_xyx_>>_>_x>_x_>xyx ",
">_yy_>___y>y__yxy___2____x_yyyxy__y>_yy_xy_yyxy__yx_yy_>'__'x ",
">xxx>>>x>xx>x>x>>x>xx>x>>x>xxxx>x>x>xxx>xx>xxxx>x>x>x>x>>x>>x ",
">_yy_xyyyyxyyyyx___yxy__yxyyyyxy__yxyyyyxyyyyx_yy_>_yy_x_yy_x ",
"x____xyyxyxyxxy>_>x_>_x>_xyxxy>_x>_xyx_yxyxxy>_xx_>_xx_>_xx_> ",
">_>x_xyxyyxyxxyx_>>_x_>x_>yxxyx_>xyxyx_yxyxxyx_>>_x_>>_xy__yx ",
"x_yy_x_y__xy__y>___y>_yy_x_y_y>y__yxy___x_yy_>_yy_>_yy_xy__yx ",
">_x>_x__x_>_>x_x_>xyx_x>_>__y_xyx>_>yx_y>_xx_x_x>_x____xy__yx ",
">_x>_x_>>_x_x>_>_>xy>_x_yx_xxyx_>x_xy>_yx_>>_xy__y>____x_x>_> ",
"x_yy_>_yy_>y__yx_yyyxy_y_>_yyyxy__yxyy_yxy__y>y__yx_yy_>_y'_x ",
">>xx>x>xxx>x>x>x>xxx>x>x>x>xxxx>x>>xxx>xx>>xx>xx>x>>x>>x>xx>> ",
"x_yy_>yyyyx8__8>yyy8x8__8>8__8>8yy8>8__8>8__8>8__8>8__8>8__8x ",
">_yx_xyxxy>_>>_xyx__xy>>_xy>>_x_xx_x_x>yx_>xyxy>>_x_x>_>_x>_> ",
"x_yy_x____>_x>_xyx>_>yxx_>yxx_>_>>_>_>xy>_>>yxyxx_>_>x_>_xx_x ",
"xy__yxyyy_>8yy8xyyy8>8__8>8__8x8__8x8__8x8__8xyyy8>8__8>8__8> ",
">yx_yxy__yx_x>_xyxx_>_>>yxy>>_2yx>_>y>>_>_>>_>yxx_>_x>_>yxx_x ",
"xy>_yx_>xy>_x>_xy>>_x_xxyxy>x_xy>x_xy>x_x_>x_xy>>_>_x>_xy>x_> ",
"xy_yyx____x8__8xyyy_>8__8>8__8xyyy8>8__8>8__8xyyy8x8__8>8__8x ",
"xxxxxx>x>>>>>>x>xxx>x>>x>x>x>>xxxx>x>x>>x>x>x>xxx>>>>>x>x>x>> ",
">x>>x>>x>xx>xx>x>x>x>>x>x>x>xx>>x>x>x>>x>>>x>x>x>x>x>xx>x>xxx ",
">xx>x>x>x>x>>x>x>x>xx>x>x>x>>xx>x>x>>xx>xx>x>x>x>x>x>>x>xx>>> ",
" ",
">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>xxxxxxx",
"xxjjjxxx'''=x=jjj=x=jjj=x='''=x=jjj=x=jjj=x=jjj=x=jjj=x=jjj=>>>>",
">jx>xj>y>>xjx'xxxjxyxxxjxjx>xjxjxxxyxjxxx'>'xxxjxjxxxjxj>>>jxxjx",
">jx>xjxy>x>jxy>x>jxyx>>j>j>>>jxj>>xyxjx>x'xyxx>jxj>>>jxjxx>j>x=>",
"x=yyy=xxyyy=x=jjj=xxjjj=>=jjj=x=jjj=>=jjj=>xyyy=>=jjj=>=jjj=x>>x",
">jxxxj>yxxxj>j>x>yxyxx>jxy>x>j>yxxxjxj>x>j>yxxxjxjxx>jxyx>>jxx>>",
"xj>x>jxyx>>j>j>xxyxy>x>jxy>x>jxyx>>j>j>x>j>'>x>j>jx>xjxyxx>j>>jx",
">>jjj>xxyyy=x=jjj=x=jjj=>xyyy=x=jjj=>=jjj=x>yyy=x=jjj=>=jjj=xx=>",
"xxx>x>x>xxx>>>>x>>x>>>>x>xxxx>>x>>x>x>x>>>x>xxx>>>>>x>x>x>x>>>>x",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,153 @@
/* DEFINES */
#include <gtk/gtk.h>
#define MAX_ISPS 40
#define START_ACTION (NULL)
#define STOP_ACTION (NULL)
#define SPEED_ACTION (NULL)
#define IFDOWN_ACTION (NULL)
#define STAMP_FILE "/var/run/ppp0.pid"
/* leds */
#define LED_PWR_X (226)
#define LED_PWR_Y (5)
#define LED_SND_X (255)
#define LED_SND_Y (5)
#define LED_RCV_X (242)
#define LED_RCV_Y (5)
#define LED_PPP_RX (1)
#define LED_PPP_TX (2)
#define LED_PPP_POWER (3)
#define LED_ON_X (1)
#define LED_ON_Y (1)
#define LED_OFF_X (34)
#define LED_OFF_Y (1)
#define LED_ERR_X (23)
#define LED_ERR_Y (1)
#define LED_WTE_X (12)
#define LED_WTE_Y (1)
#define LED_SZE_X (10)
#define LED_SZE_Y (10)
#define LED_GREEN (1)
#define LED_RED (2)
#define LED_YELLOW (3)
#define LED_DARK (4)
/* buttons */
#define BUT_V (1)
#define BUT_X (2)
#define BUT_REW (3)
#define BUT_FF (4)
#define BUT_CONF (5)
#define BUT_LOG (6)
#define BUT_KILL (7)
#define BUT_DRAG (8)
#define BUT_V_X (112)
#define BUT_V_Y (5)
#define BUT_X_X (124)
#define BUT_X_Y (5)
#define BUT_R_X (53)
#define BUT_R_Y (5)
#define BUT_F_X (65)
#define BUT_F_Y (5)
#define BUT_C_X (273)
#define BUT_C_Y (5)
#define BUT_L_X (285)
#define BUT_L_Y (5)
#define BUT_K_X (302)
#define BUT_K_Y (1)
#define BUT_K_SRC_X (0)
#define BUT_K_SRC_Y (30)
/* displays */
#define TIMER_SRC_Y (176)
#define TIMER_DES_Y (6)
#define TIMER_DES_X (141)
#define TIMER_SZE_X (6)
#define ISP_BASE_X (82)
#define ISP_BASE_Y (6)
#define ERR_DEST_X (195)
#define ERR_DEST_Y (6)
#define ERR_SRC_X (0)
#define ERR_SRC_Y (94)
#define UPPER_ABC_BASE_X (1)
#define UPPER_ABC_BASE_Y (124)
#define LOWER_ABC_BASE_X (1)
#define LOWER_ABC_BASE_Y (148)
#define DIGIT_BASE_X (11)
#define DIGIT_BASE_Y (164)
#define SPACE_BASE_X (11)
#define SPACE_BASE_Y (140)
#define HIST_SRC_X (58)
#define HIST_SRC_Y (92)
#define BUT_V_SRC_X (0)
#define BUT_V_SRC_Y (70)
#define BUT_X_SRC_X (12)
#define BUT_X_SRC_Y (70)
#define BUT_R_SRC_X (0)
#define BUT_R_SRC_Y (82)
#define BUT_F_SRC_X (12)
#define BUT_F_SRC_Y (82)
#define BUT_C_SRC_X (0)
#define BUT_C_SRC_Y (58)
#define BUT_L_SRC_X (12)
#define BUT_L_SRC_Y (58)
#define BUT_UP_INC (24)
#define ORANGE_LED_TIMEOUT (60)
void create_thinppp(void);
gboolean exposed(GtkWidget *w,GdkEventExpose *gee,gpointer data);
gboolean bpress(GtkWidget *w,GdkEventButton *geb,gpointer data);
gboolean brelease(GtkWidget *w,GdkEventButton *geb,gpointer data);
gboolean bmotion(GtkWidget *w,GdkEventMotion *geb,gpointer data);
gboolean wdestroy(GtkWidget *w,GdkEvent *ev,gpointer data);
void refresh(void);
void setled(int index,int type);
void paste_xpm(int dx,int dy,int sx,int sy,int w,int h);
void DrawISPName (void);
void draw_isp_char (int pos, char letter);
void DrawTime (int i, int j);
void DrawStats (int num, int size, int x_left, int y_bottom);
void PrintLittle (int i, int *k);
void DrawSpeedInd (char *speed_action);
void DrawLoadInd (int speed);
void init_ppp(void);
gint thinppp(gpointer data);
void sigusr_handler(int signum);
void make_delayed_update(void);
void usage (void);
void printversion (void);
void grab_me(void);
void ungrab_me(void);
gboolean inbox(int x,int y,int bx,int by,int bw,int bh);
void read_initial_position(void);
void save_initial_position(void);

167
yawmppp/src/yawmppp.1x Normal file
View file

@ -0,0 +1,167 @@
.TH YAWMPPP 1x "22 Feb 2001" "Free Software" "User Manuals"
.SH NAME
yawmppp \- Window Maker dock front end for pppd and chat
.SH SYNOPSIS
yawmppp [\fB\-h\fR] [\fB\-i\fR \fIdevice\fR] [\fB-t\fR]
[\fB\-u\fR \fIupdate rate\fR] [\fB\-v\fR]
[\fB\-caution\fR | \fB-paranoid\fR]
yawmppp.thin [\fB\-h\fR] [\fB\-i\fR \fIdevice\fR] [\fB-t\fR]
[\fB\-u\fR \fIupdate rate\fR] [\fB\-v\fR]
[\fB\-caution\fR | \fB-paranoid\fR]
.SH DESCRIPTION
This man page documents version 2.0.2 of \fByawmppp\fR.
.B "yawmppp"
is \fBY\fRet \fBA\fRnother \fBW\fRindow \fBM\fRaker
\fBPPP\fR dock applet.
.B "yawmppp"
runs docked in Window Maker's dock (or clip), swallowed in
AfterStep's wharf or as a iconic shaped window on other
window managers. If you are not using a dock-capable
window manager (Window Maker and AfterStep) then you may
prefer to run \fByawmppp.thin\fR instead, which is
the same applet shaped as an horizontal bar, designed
for use without a dock.
It provides a front end for the programs chat and pppd, in
a way that you probably shouldn't ever need to edit
directly these programs' scripts.
The \fBv\fR button starts a connection to the currently
selected ISP entry (whose handle is shown in the bottom
left corner of the display). The \fBx\fR button closes
the current connection. The arrow buttons let you
select a dialing entry.
To create and edit dialing entries you should use the
\fByawmppp.pref\fR program, which can be run by clicking the
left mouse button in yawmppp's display area.
You can see a log of your connections with the \fByawmppp.log\fR
program, which can be run by clicking yawmppp's display area
with any mouse button but the left.
.SH DISPLAY
Yawmppp's display has a connection timer at the top left corner,
three LEDs at the top right meaning RX,TX and POWER. The RX/TX
leds blinking upon the receive/send of PPP packets. The
POWER led is dark when you're offline, yellow when dialing,
green when connected, red when an error has ocurred with the
connection.
In the middle of the display is an auto-scaling load graph. The
bottom left corner shows the current ISP's handle and the
bottom right corner displays the CONNECT speed in the first
10 seconds of connection, then starts showing the
characters-per-second rate.
.SH "COMMAND-LINE OPTIONS"
.IP "\-caution"
.IP "\-paranoid"
these options will change the way yawmppp touches the PPP interface.
Caution will keep associated structures open while
the connection is up only. Paranoid will open and close the
structures LOTS of times to keep them closed as much as possible.
These options are meant for PCMCIA & APM (notebooks, maybe PDAs) users
who run into trouble with cardctl commands. Don't use these options unless
you really need them. And if you need, check if caution is enough,
be paranoid only when absolutely necessary. When none is
specified, \fB-caution\fR is default.
.IP "\-i device"
use a ppp device other then ppp0.
.IP "\-h"
shows a brief help message
.IP "\-t"
set timer to MM:SS instead of HH:MM
.IP "\-u update\-rate"
sets the interval for statistics update (load graph and cps rate).
If not set, defaults to 5 seconds.
.IP "\-v"
shows version and exits.
.SH "PPPD OPTIONS"
yawmppp.pref provides a good set of options from pppd, but if need
any other that isn't (yet) directly supported, put it in
/etc/ppp/options. Per-ISP options are placed in /etc/ppp/peers,
as newer pppd versions require (since 2.3.7 at least). Whenever
YAWMPPP needs to write some file there, it will ask for the
superuser password on an xterm. Configuration files must go
under /etc/ppp/peers or the noauth option, usually required to
connect to ISPs, won't be allowed.
.SH "DNS Handling"
In the past, YAWMPPP changed the named(8) configuration files to
set DNS up, but nowadays pppd has taken over this task with the
usepeerdns option. From pppd 2.3.11 up, DNS should work out of the
box. pppd 2.3.10 and some earlier versions may require working
/etc/ppp/ip-up and /etc/ppp/ip-down files. Some distributions
provide these files worked out (Red Hat), others
don't (Slackware). Here is a sample minimalist set of these files:
\fB/etc/ppp/ip-up\fR
.br
#!/bin/sh
.br
echo "search mydomain.org" > /etc/resolv.conf
.br
echo "nameserver $DNS1" >> /etc/resolv.conf
.br
\fB/etc/ppp/ip-down\fR
.br
#!/bin/sh
.br
echo "search mydomain.org" > /etc/resolv.conf
.br
echo "nameserver" >> /etc/resolv.conf
.br
.SH "FILES"
.IR ~/.yawmppp2
.br
.IR ~/.yawmppp2/yawmppprc
.br
.IR ~/.yawmppp2/logfile
.br
.SH "BUGS"
.BR "yawmppp "
You must set your PAP/CHAP secrets directly in the /etc/ppp/chap-secrets
and /etc/ppp/pap-secrets files. For security reasons, yawmppp cannot do
it for you.
If you run more than one copy of yawmppp or yawmppp.thin you'll get
repeated log entries.
.SH "PORTABILITY"
.BR "yawmppp "
has been reported to run on Linux, NetBSD and FreeBSD. Your
mileage may vary on Linux, as pppd configuration can vary wildly from
distribution to distribution.
On Slackware Linux 7.0 you must set up /etc/ppp/ip-up and /etc/ppp/ip-down
on your own to get DNS resolution working.
The minimalist sample given in this man page works.
.SH "CREDITS"
.BR "yawmppp "
was written by Felipe Bergo <bergo@seul.org>. The dock applet
is based on wmppp 1.3.0, which was written by Martijn Pieterse and
Antoine Nulle.
.SH "UNRESTRICTIONS"
.BR "yawmppp "
is free; anyone may redistribute copies of \fByawmppp\fR to anyone under the
terms stated in the GNU General Public License. A copy of the license accompanies
each copy of \fByawmppp\fR.
.SH "WEB SITE"
http://yawmppp.seul.org
.SH "SEE ALSO"
\fBpppd\fR(8), \fBchat\fR(8), \fBresolver\fR(5), \fBsetserial\fR(8),
\fBttys\fR(4)

410
yawmppp/src/ycommon.c Normal file
View file

@ -0,0 +1,410 @@
/*
YAWMPPP - PPP dock app/helper for WindowMaker
Copyright (C) 2000,2001:
Author: Felipe Bergo (bergo@seul.org)
based on the wmppp application by
Martijn Pieterse (pieterse@xs4all.nl)
Antoine Nulle (warp@xs4all.nl)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id: ycommon.c,v 1.1.1.1 2001/02/22 07:15:59 bergo Exp $
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <ctype.h>
#include <signal.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#ifdef LINUX
#define _LINUX_SOCKET_H
#endif
/* guessworks for critters beyond the realm of Linux and FreeBSD */
#ifdef OPENBSD
#define FREEBSD
#endif
#ifdef NETBSD
#define FREEBSD
#endif
#ifdef BSDISH
#define FREEBSD
#endif
#ifdef LINUX
#include <asm/types.h>
#include <linux/if.h>
#include <linux/ppp_defs.h>
#include <linux/if_ppp.h>
#endif
#ifdef FREEBSD
#include <net/if.h>
#include <net/ppp_defs.h>
#include <net/if_ppp.h>
#endif
#include "ycommon.h"
#include "isprc.h"
extern struct LogStruct logconn;
extern int ppp_h;
extern int ppp_open;
extern struct YAWMPPP_ISP_INFO IspData[MAX_ISPS];
extern int num_isps;
extern int current_isp;
extern char *active_interface;
/* LOGS = ~/.yawmppp2/log */
void
clean_guards(void)
{
char *p;
char temp[128],aux[128];
FILE *f;
p = getenv ("HOME");
strcpy (temp, p);
strcat (temp, "/.yawmppp2/.floatlog");
f=fopen(temp,"r");
if (!f)
return; /* fine: no crash file */
if (!fgets(aux,128,f)) return;
if ((p=strtok(aux,"\n"))==NULL) return;
logconn.start=atoi(p);
if (!fgets(aux,128,f)) return;
if ((p=strtok(aux,"\n"))==NULL) return;
logconn.end=atoi(p);
if (!fgets(aux,128,f)) return;
if ((p=strtok(aux,"\n"))==NULL) return;
logconn.status=atoi(p);
if (!fgets(aux,128,f)) return;
if ((p=strtok(aux,"\n"))==NULL) return;
strcpy(logconn.longname,p);
if (!fgets(aux,128,f)) return;
if ((p=strtok(aux,"\n"))==NULL) return;
strcpy(logconn.shortname,p);
if (!fgets(aux,128,f)) return;
if ((p=strtok(aux,"\n"))==NULL) return;
strcpy(logconn.phone,p);
if (!fgets(aux,128,f)) return;
if ((p=strtok(aux,"\n"))==NULL) return;
strcpy(logconn.user,p);
fclose(f);
logconn.status=2; /* CRASH */
write_log();
}
void
make_guards(void)
{
char *p;
char temp[128];
FILE *f;
p = getenv ("HOME");
strcpy (temp, p);
strcat (temp, "/.yawmppp2/.floatlog");
f=fopen(temp,"w");
if (!f) return;
logconn.end=time(NULL);
fprintf(f,"%lu\n%lu\n%d\n",logconn.start,logconn.end,logconn.status);
fprintf(f,"%s\n%s\n%s\n",logconn.longname,logconn.shortname,logconn.phone);
fprintf(f,"%s\n",logconn.user);
fclose(f);
}
void
write_log(void)
{
char *p;
char temp[128];
FILE *f;
int i,s;
p = getenv ("HOME");
strcpy (temp, p);
strcat (temp, "/.yawmppp2/logfile");
f=fopen(temp,"a");
if (!f) return;
s=strlen(logconn.phone);
for(i=0;i<s;i++)
if (logconn.phone[i]=='\t')
logconn.phone[i]=' ';
s=strlen(logconn.shortname);
for(i=0;i<s;i++)
if (logconn.shortname[i]=='\t')
logconn.shortname[i]=' ';
s=strlen(logconn.longname);
for(i=0;i<s;i++)
if (logconn.longname[i]=='\t')
logconn.longname[i]=' ';
s=strlen(logconn.user);
for(i=0;i<s;i++)
if (logconn.user[i]=='\t')
logconn.user[i]=' ';
fprintf(f,"%lu\t%lu\t%d\t%s\t%s\t%s\t%s\n",
logconn.start,
logconn.end,
logconn.status,
logconn.longname,
logconn.shortname,
logconn.phone,
logconn.user);
fclose(f);
chmod(temp,0600);
p = getenv ("HOME");
strcpy (temp, p);
strcat (temp, "/.yawmppp2/.floatlog");
unlink(temp);
}
void
warn_pref(void)
{
char *p;
char temp[128];
FILE *f;
p=getenv("HOME");
strcpy (temp, p);
strcat (temp, "/.yawmppp2/.delayedupdate");
f=fopen(temp,"w");
if (!f) return;
fprintf(f,"This file shouldn't last more than a few millisecs...\n");
fclose(f);
}
/* PPP */
void
open_ppp(void)
{
/* Open the ppp device. */
if (ppp_open)
return;
if ((ppp_h = socket (AF_INET, SOCK_DGRAM, 0)) >= 0)
ppp_open = 1;
}
void
close_ppp(void)
{
if (!ppp_open)
return;
close(ppp_h);
ppp_open=0;
}
/* other stuff */
void
write_pid_file(void)
{
char *p;
char temp[128];
FILE *f;
p = getenv ("HOME");
strcpy (temp, p);
strcat (temp, "/.yawmppp2/yawmppp.pid");
f=fopen(temp,"w");
if (f) {
fprintf(f,"%d",getpid());
fclose(f);
}
}
void
remove_pid_file(void)
{
char *p;
char temp[128];
p = getenv ("HOME");
strcpy (temp, p);
strcat (temp, "/.yawmppp2/yawmppp.pid");
unlink(temp);
}
void
make_config_dir(void)
{
struct stat ss;
char tmp[256];
sprintf(tmp,"%s/.yawmppp2",getenv("HOME"));
if (stat(tmp,&ss)<0)
mkdir(tmp,0700);
}
void
grab_isp_info(int rof)
{
char *p;
char temp[128];
p = getenv ("HOME");
strcpy (temp, p);
strcat (temp, "/.yawmppp2/yawmppprc");
num_isps=GetISPInfo(temp,&IspData[0],MAX_ISPS);
if ((!num_isps)&&(rof)) {
run_pref_app();
}
}
void
run_pref_app(void)
{
if (!fork()) {
execlp("yawmppp.pref","yawmppp.pref",NULL);
execlp("/usr/local/bin/yawmppp.pref","yawmppp.pref",NULL);
execlp("/usr/bin/yawmppp.pref","yawmppp.pref",NULL);
exit(2);
}
}
void
run_log_app(void)
{
if (!fork()) {
execlp("yawmppp.log","yawmppp.log",NULL);
execlp("/usr/local/bin/yawmppp.log","yawmppp.log",NULL);
execlp("/usr/bin/yawmppp.log","yawmppp.log",NULL);
exit(2);
}
}
/* essential */
/* get_statistics */
int
get_statistics (char *devname, long *ip, long *op, long *is, long *os)
{
struct ifpppstatsreq req;
struct ppp_stats ppp_cur;
memset (&ppp_cur, 0, sizeof (ppp_cur));
open_ppp();
if (!ppp_open)
return(-1);
memset(&req,0,sizeof(req));
#ifdef LINUX
req.stats_ptr=(caddr_t) & req.stats;
strcpy(req.ifr__name, active_interface);
#endif
#ifdef FREEBSD
strcpy(req.ifr_name, active_interface);
#endif
if (ioctl(ppp_h,SIOCGPPPSTATS,&req) >= 0)
ppp_cur=req.stats;
*op = ppp_cur.p.ppp_opackets;
*ip = ppp_cur.p.ppp_ipackets;
*is = ppp_cur.p.ppp_ibytes;
*os = ppp_cur.p.ppp_obytes;
return 0;
}
/* stillonline */
int
stillonline (char *ifs)
{
#ifdef LINUX
FILE *fp;
char temp[128];
#endif
#ifdef FREEBSD
struct ifreq req;
#endif
int i=0;
#ifdef LINUX
fp = fopen ("/proc/net/route", "r");
if (fp)
{
while (fgets (temp, 128, fp))
{
if (strstr (temp, ifs))
{
i = 1; /* Line is alive */
}
}
fclose (fp);
}
#endif
#ifdef FREEBSD
strcpy(req.ifr_name,active_interface);
open_ppp();
if (!ppp_open)
return 0;
if (ioctl(ppp_h,SIOCGIFFLAGS,&req)>=0) {
if (req.ifr_flags&IFF_UP)
i=1;
}
#endif
return i;
}

36
yawmppp/src/ycommon.h Normal file
View file

@ -0,0 +1,36 @@
#ifndef YAWMPPP_COMMON_H
#define YAWMPPP_COMMON_H
#define MAX_ISPS 40
struct LogStruct {
time_t start;
time_t end;
int status; /* 0=ok 1=error 2=crash */
char longname[128];
char shortname[16];
char phone[32];
char user[32];
};
void clean_guards(void);
void make_guards(void);
void write_log(void);
void warn_pref(void);
void open_ppp(void);
void close_ppp(void);
void write_pid_file(void);
void remove_pid_file(void);
void make_config_dir(void);
void grab_isp_info(int rof);
void run_pref_app(void);
void run_log_app(void);
int get_statistics (char *devname, long *ip, long *op, long *is, long *os);
int stillonline (char *ifs);
#endif