1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-29 04:25:55 -04:00

Prepare KH thread branch

svn path=/icecast/branches/kh/thread/; revision=7013
This commit is contained in:
brendan 2004-07-06 06:47:07 +00:00
parent a99d5ef19b
commit 5960df0ce8
224 changed files with 0 additions and 27708 deletions

View File

@ -1,20 +0,0 @@
Makefile
Makefile.in
aclocal.m4
autom4te.cache
compile
config.cache
config.guess
config.sub
config.h.in
config.log
config.status
configure
depcomp
install-sh
libtool
ltconfig
ltmain.sh
missing
mkinstalldirs
*.tar.gz

View File

@ -1,4 +0,0 @@
Jack Moffitt <jack@icecast.org>
Michael Smith <msmith@icecast.org>
oddsock <oddsock@xiph.org>
Karl Heyes <karl@xiph.org>

340
COPYING
View File

@ -1,340 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 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
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) <year> <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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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) year 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.

48
HACKING
View File

@ -1,48 +0,0 @@
Note that these instructions are *not* necessary for distribution
tarballs; they have separate configure/build instructions.
Building this package from CVS is mainly intended for developers.
General users should obtain official distribution packages; both
source and binary distributions are available at
http://www.icecast.org/
-----
These are *brief* instructions on how to build this package from CVS.
Yes, there are details left out.
There are generally four steps necessary when building from CVS (i.e.,
a developer's copy):
1. cvs checkout of the sources, or cvs update. RTFM from your
favorite flavor of CVS documentation; information on the xiph.org
CVS repository can be found at http://www.xiph.org/cvs.html.
2. [re-]generate files such as "configure" and "Makefile.in" with the
GNU autoconf/automake tools. Run the "autogen.sh" script to
perform this step.
*** IF YOU ARE NOT BUILDING WITH GNU MAKE *AND* GCC: you must set
the AUTOMAKE_FLAGS environment variable to "--include-deps"
before running autogen.sh. For example:
csh% setenv AUTOMAKE_FLAGS --include-deps
csh% ./autogen.sh
or
sh% AUTOMAKE_FLAGS=--include-deps ./autogen.sh
3. Run configure. There are several options available; see
"./configure --help" for more information.
4. Run "make" to build the source.
In general, steps 2 and 3 need to be re-run every time any of the
following files are modified (either manually or by a cvs update):
configure.in
acinclude.m4
Running "make clean" after running steps 2 and 3 is generally also
advisable before running step 4. It isn't *always* necessary, but
unless you understand the workings of autoconf/automake, it's safest
to just do it.

View File

@ -1,22 +0,0 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = 1.6 foreign dist-zip
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src conf debian doc web admin win32
EXTRA_DIST = HACKING m4/acx_pthread.m4 m4/ogg.m4 m4/vorbis.m4 \
m4/xiph_compiler.m4 m4/xiph_curl.m4 m4/xiph_net.m4 \
m4/xiph_types.m4 m4/xiph_xml2.m4 icecast.spec
docdir = $(datadir)/doc/$(PACKAGE)
doc_DATA = README AUTHORS COPYING NEWS TODO
debug:
$(MAKE) all CFLAGS="@DEBUG@"
profile:
$(MAKE) all CFLAGS="@PROFILE@"
static:
$(MAKE) all LDFLAGS="${LDFLAGS} -all-static"

87
NEWS
View File

@ -1,87 +0,0 @@
2003-10-12
Added documentation
2003-04-23
Support aliases
2003-03-09
Support listening on multiple sockets.
2003-03-08
Support for shoutcast source protocol added.
2003-03-08
Started implementing generic admin interface. Supports (so far):
- dynamic configuration of mount fallbacks
/admin/fallbacks?mount=/mount&fallback=/fallback
- setting of mp3 metadata
/admin/metadata?mount=/mount&mode=updinfo&song=New%20Title
- dumping raw xml stats
/admin/rawstats
- listing all connected clients on a mountpoint:
/admin/listclients?mount=/mountname
2003-03-05
Implemented the ability to reread the config file on SIGHUP. For now, this
does not affect configuration for currently running sources (only new
sources and global parameters like max-listeners)
2003-03-02
More features:
-- per mountpoint listener maxima
-- static configuration of mountpoint fallbacks
-- stream dumping (write incoming stream to disk)
2003-02-27
Fix log buffering on win32 - previously, logs were never flushed, so they
only got output every few tens or hundreds of lines.
2003-02-27
Support new icy-audio-info header, to communicate various parameters to
clients and yp servers, including sample rate, quality, channels, bitrate
2003-02-25
Full support for relaying mp3 metadata (if turned on in config file)
2003-02-25
Allow configuration of maximum client queue length (in bytes)
2003-02-14
Finished full IPv6 support.
2003-02-12
Allow configuring local mountpoint seperately from remote mountpoint for
relays
2003-02-12
Per mountpoint usernames and passwords (for sources)
2003-02-11
Now that it's been officially assigned, use application/ogg instead of
application/x-ogg
2003-02-07
Allow relaying of mp3 streams from icecast 1.x and shoutcast
2003-02-07
Added ability to configure individual relays (rather than just all streams
from a single server).
2003-02-03
Added support for YP directory services listings
are only used by the yp listing routines
2003-02-03
Support command line parameter -b to run in the background (not supported
on win32)
2002-12-31
Implement configurable mountpoint fallbacks (on source exit, clients are
transferred to another mountpoint automatically, without disconnecting
them)
2002-12-31
Implemented full mp3 metadata support.
(older stuff is missing from here)

56
README
View File

@ -1,56 +0,0 @@
icecast 2.x - README
---------------------------------------------------------------------
Icecast is a streaming media server which currently supports Ogg
Vorbis and MP3 audio streams. It can be used to create an Internet
radio station or a privately running jukebox and many things in
between. It is very versatile in that new formats can be added
relatively easily and supports open standards for commuincation and
interaction.
Icecast is distributed under the GNU GPL, version 2. A copy of this
license is included with this software in the COPYING file.
Prerequisites
---------------------------------------------------------------------
icecast requires the following packages :
* libxml2 - http://xmlsoft.org/downloads.html
* libxslt - http://xmlsoft.org/XSLT/downloads.html
* curl - http://curl.haxx.se/download.html (>= version 7.10 required)
NOTE: icecast may be compiled without curl, however this will
disable all Directory server interaction (YP).
* ogg/vorbis - http://www.vorbis.com/files (>= version 1.0 required)
A Note About RPMS
---------------------------------------------------------------------
This section only applies to you if your operating system uses RPMS.
In order to build icecast, you will need to install the "devel" RPM
packages for each of the prerequisite packages in addition to the
normal RPMS for each package.
please check the websites for each of the prerequisite packages for
appropriate download links for RPMS.
Build/Install
---------------------------------------------------------------------
To build icecast on a Unix platform, perform the following :
Run
./configure
make
make install
To build and install this release.
A sample config file will be placed in /usr/local/etc (on UNIX) or in
the current working directory (on Win32) and is called icecast.xml
Documentation for icecast is available in the doc directory, by
viewing doc/index.html in a browser.
Please email us at icecast@xiph.org or icecast-dev@xiph.org, or come and see
us at irc.freenode.net, channel #icecast, if you have any troubles.

53
TODO
View File

@ -1,53 +0,0 @@
BUGS
----
- logging - bytes send and time listening may both be broken?
FEATURES
--------
- Should icecast automatically (i.e. without needing -c) look for the config
file in /etc/icecast.xml or something?
- pull out vorbis comments. and send to stats. This seems to be being
done, but it isn't working right.
- directory server GUID checks
directory server does GET /GUID-asldjfasldfjalsdkfjasldkfj HTTP/1.0
and either gets a 404 if it's wrong, or a 200 if it's correct.
- adding new stats type, event. events don't modify the global stats tree,
ie, source /1234.ogg disconnected
- support W3C Extended Logging (http://www.w3.org/TR/WD-logfile.html)
toggle between this and Apache Combined Log Format in the config file.
default to apache style.
- allow using get_predata() stuff to send an "intro" to any newly-connected
user?
- stats to list currently connected clients: ip and hostname
- general registerable url-handlers in connection.c rather than hard-coded list
(already getting unmaintainable)
- httpp - split out query string for further processing
- option to use ipv6 (equiv to using <bind-address>::</bindaddress>, I think.
- abstract all admin functionality to a set of commands, and command handlers.
Make /admin/* just parse according to a set of rules, and dispatch generic
commands through that.
Use this for alternative admin interfaces (GUI? telnet interface?)
- all timer-based functionality (yp updates, slave/relay checks) should have a
single timer thread which dispatches events through the normal event
mechanism (to worker threads from the main pool). This will reduce the
extraneous thread count.
- race condition between avl_tree_unlock(pending_tree) and
thread_cond_wait(&fserv_cond) in fserv.c, it's a pain to fix but should be.
- do we need to use locks on the avl client_trees in source.c and fserv.c?

View File

@ -1 +0,0 @@
Makefile.in

View File

@ -1,8 +0,0 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = foreign
admindir = $(pkgdatadir)/admin
dist_admin_DATA = listclients.xsl listmounts.xsl moveclients.xsl response.xsl \
stats.xsl manageauth.xsl

View File

@ -1,79 +0,0 @@
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
<xsl:output method="html" indent="yes" />
<xsl:template match = "/icestats" >
<html>
<head>
<title>Icecast Streaming Media Server</title>
<link rel="stylesheet" type="text/css" href="/style.css" />
</head>
<body bgcolor="black">
<center>
<table border="0" cellpadding="1" cellspacing="3">
<tr>
<td align="center">
<a class="nav" href="listmounts.xsl">List MountPoints</a> |
<a class="nav" href="moveclients.xsl">Move Listeners</a> |
<a class="nav" href="stats.xsl">Stats</a> |
<a class="nav" href="/status.xsl">Status Page</a>
</td></tr>
</table>
</center>
<table border="0" width="90%%">
<tr>
<td width="50"></td>
<td>
<h2>List Connected Listeners</h2>
<div class="roundcont">
<div class="roundtop">
<img src="/corner_topleft.jpg" class="corner" style="display: none" />
</div>
<div class="newscontent">
<xsl:for-each select="source">
<h3>
<xsl:if test="server_name"><xsl:value-of select="server_name" /> </xsl:if>
(<xsl:value-of select="@mount" />)</h3>
<table border="0" cellpadding="1" cellspacing="5" bgcolor="444444">
<tr>
<td align="center">
<a class="nav2" href="listclients.xsl?mount={@mount}">Show Listeners</a> |
<a class="nav2" href="moveclients.xsl?mount={@mount}">Move Listeners</a> |
<a class="nav2" href="killsource.xsl?mount={@mount}">Kill Source</a>
</td></tr>
</table>
<br></br>
<table cellpadding="2" cellspacing="4" border="0" >
<tr>
<td ><b>IP</b></td>
<td ><b>Connected For</b></td>
<td ><b>User Agent</b></td>
<td ></td>
</tr>
<xsl:variable name = "themount" ><xsl:value-of select="@mount" /></xsl:variable>
<xsl:for-each select="listener">
<tr>
<td><xsl:value-of select="IP" /><xsl:if test="username"> (<xsl:value-of select="username" />)</xsl:if></td>
<td><xsl:value-of select="Connected" /> seconds</td>
<td><xsl:value-of select="UserAgent" /></td>
<td><a class="nav2" href="killclient.xsl?mount={$themount}&amp;id={ID}">kill</a></td>
</tr>
</xsl:for-each>
</table>
<br></br>
<br></br>
</xsl:for-each>
</div>
<div class="roundbottom">
<img src="/corner_bottomleft.jpg" class="corner" style="display: none" />
</div>
</div>
<br></br><br></br>
</td>
<td width="50"></td>
</tr>
</table>
<div class="poster">
<img align="left" src="/icecast.png" />Support icecast development at <a class="nav" href="http://www.icecast.org">www.icecast.org</a></div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,65 +0,0 @@
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
<xsl:output method="html" indent="yes" />
<xsl:template match = "/icestats" >
<html>
<head>
<title>Icecast Streaming Media Server</title>
<link rel="stylesheet" type="text/css" href="/style.css" />
</head>
<body bgcolor="black">
<center>
<table border="0" cellpadding="1" cellspacing="3">
<tr>
<td align="center">
<a class="nav" href="listmounts.xsl">List MountPoints</a> |
<a class="nav" href="moveclients.xsl">Move Listeners</a> |
<a class="nav" href="stats.xsl">Stats</a> |
<a class="nav" href="/status.xsl">Status Page</a>
</td></tr>
</table>
</center>
<table border="0" width="90%%">
<tr>
<td width="50"></td>
<td>
<h2>List Mountpoints</h2>
<div class="roundcont">
<div class="roundtop">
<img src="/corner_topleft.jpg" class="corner" style="display: none" />
</div>
<div class="newscontent">
<xsl:for-each select="source">
<h3>
<xsl:if test="server_name"><xsl:value-of select="server_name" /> </xsl:if>
(<xsl:value-of select="@mount" />)
<xsl:if test="authenticator"> <a href="manageauth.xsl?mount={@mount}"><img border="0" src="/key.gif"/></a> </xsl:if>
</h3>
<table border="0" cellpadding="1" cellspacing="5" bgcolor="444444">
<tr>
<td align="center">
<a class="nav2" href="listclients.xsl?mount={@mount}">Show Listeners</a> |
<a class="nav2" href="moveclients.xsl?mount={@mount}">Move Listeners</a> |
<a class="nav2" href="killsource.xsl?mount={@mount}">Kill Source</a>
<xsl:if test="authenticator"> | <a class="nav2" href="manageauth.xsl?mount={@mount}">Manage Authentication</a></xsl:if>
</td></tr>
</table>
<br></br>
<p><xsl:value-of select="listeners" /> Listener(s)</p>
<br></br>
</xsl:for-each>
</div>
<div class="roundbottom">
<img src="/corner_bottomleft.jpg" class="corner" style="display: none" />
</div>
</div>
<br></br><br></br>
</td>
<td width="50"></td>
</tr>
</table>
<div class="poster">
<img align="left" src="/icecast.png" />Support icecast development at <a class="nav" href="http://www.icecast.org">www.icecast.org</a></div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,91 +0,0 @@
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
<xsl:output method="html" indent="yes" />
<xsl:template match = "/icestats" >
<html>
<head>
<title>Icecast Streaming Media Server</title>
<link rel="stylesheet" type="text/css" href="/style.css" />
</head>
<body bgcolor="black">
<center>
<table border="0" cellpadding="1" cellspacing="3">
<tr>
<td align="center">
<a class="nav" href="listmounts.xsl">List MountPoints</a> |
<a class="nav" href="moveclients.xsl">Move Listeners</a> |
<a class="nav" href="stats.xsl">Stats</a> |
<a class="nav" href="/status.xsl">Status Page</a>
</td></tr>
</table>
</center>
<table border="0" width="90%%">
<tr>
<td width="50"></td>
<td>
<h2>Show defined users</h2>
<div class="roundcont">
<div class="roundtop">
<img src="/corner_topleft.jpg" class="corner" style="display: none" />
</div>
<div class="newscontent">
<xsl:for-each select="iceresponse">
<xsl:value-of select="message" />
</xsl:for-each>
<xsl:for-each select="source">
<h3>
<xsl:if test="server_name"><xsl:value-of select="server_name" /> </xsl:if>
(<xsl:value-of select="@mount" />)</h3>
<table border="0" cellpadding="1" cellspacing="5" bgcolor="444444">
<tr>
<td align="center">
<a class="nav2" href="listclients.xsl?mount={@mount}">Show Listeners</a> |
<a class="nav2" href="moveclients.xsl?mount={@mount}">Move Listeners</a> |
<a class="nav2" href="killsource.xsl?mount={@mount}">Kill Source</a>
</td></tr>
</table>
<br></br>
<form method="GET" action="manageauth.xsl">
<table cellpadding="2" cellspacing="4" border="0" >
<tr>
<td ><b>User Id</b></td>
<td ><b>Password</b></td>
<td ></td>
</tr>
<xsl:variable name = "themount" ><xsl:value-of select="@mount" /></xsl:variable>
<xsl:for-each select="User">
<tr>
<td><xsl:value-of select="username" /></td>
<td><xsl:value-of select="password" /></td>
<td><a class="nav2" href="manageauth.xsl?mount={$themount}&amp;username={username}&amp;action=delete">delete</a></td>
</tr>
</xsl:for-each>
<tr>
<td ><input type="text" name="username" /></td>
<td ><input type="text" name="password" /></td>
</tr>
<tr>
<td colspan="2"><input type="Submit" name="Submit" value="Add New User" /></td>
</tr>
</table>
<input type="hidden" name="mount" value="{@mount}"/>
<input type="hidden" name="action" value="add"/>
</form>
<br></br>
<br></br>
</xsl:for-each>
</div>
<div class="roundbottom">
<img src="/corner_bottomleft.jpg" class="corner" style="display: none" />
</div>
</div>
<br></br><br></br>
</td>
<td width="50"></td>
</tr>
</table>
<div class="poster">
<img align="left" src="/icecast.png" />Support icecast development at <a class="nav" href="http://www.icecast.org">www.icecast.org</a></div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,61 +0,0 @@
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
<xsl:output method="html" indent="yes" />
<xsl:template match = "/icestats" >
<html>
<head>
<title>Icecast Streaming Media Server</title>
<link rel="stylesheet" type="text/css" href="/style.css" />
</head>
<body bgcolor="black">
<center>
<table border="0" cellpadding="1" cellspacing="3">
<tr>
<td align="center">
<a class="nav" href="listmounts.xsl">List MountPoints</a> |
<a class="nav" href="moveclients.xsl">Move Listeners</a> |
<a class="nav" href="stats.xsl">Stats</a> |
<a class="nav" href="/status.xsl">Status Page</a>
</td></tr>
</table>
</center>
<table border="0" width="90%%">
<tr>
<td width="50"></td>
<td>
<xsl:variable name = "currentmount" ><xsl:value-of select="current_source" /></xsl:variable>
<h2>Move Clients from (<xsl:value-of select="current_source" />)</h2>
<div class="roundcont">
<div class="roundtop">
<img src="/corner_topleft.jpg" class="corner" style="display: none" />
</div>
<div class="newscontent">
<h3>Move to which mountpoint ?</h3>
<xsl:for-each select="source">
<table border="0" cellpadding="1" cellspacing="5" >
<tr>
<td>Move from (<xsl:copy-of select="$currentmount" />) to (<xsl:value-of select="@mount" />)</td>
<td><xsl:value-of select="listeners" /> Listeners</td>
<td><a class="nav2" href="moveclients.xsl?mount={$currentmount}&amp;destination={@mount}">Move Clients</a></td>
</tr>
</table>
<br></br>
<br></br>
</xsl:for-each>
</div>
<div class="roundbottom">
<img src="/corner_bottomleft.jpg" class="corner" style="display: none" />
</div>
</div>
<br></br><br></br>
</td>
<td width="50"></td>
</tr>
</table>
<div class="poster">
<img align="left" src="/icecast.png" />Support icecast development at <a class="nav" href="http://www.icecast.org">www.icecast.org</a></div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,54 +0,0 @@
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
<xsl:output method="html" indent="yes" />
<xsl:template match = "/iceresponse" >
<html>
<head>
<title>Icecast Streaming Media Server</title>
<link rel="stylesheet" type="text/css" href="/style.css" />
</head>
<body bgcolor="black">
<center>
<table border="0" cellpadding="1" cellspacing="3">
<tr>
<td align="center">
<a class="nav" href="listmounts.xsl">List MountPoints</a> |
<a class="nav" href="moveclients.xsl">Move Listeners</a> |
<a class="nav" href="stats.xsl">Stats</a> |
<a class="nav" href="/status.xsl">Status Page</a>
</td></tr>
</table>
</center>
<table border="0" width="90%%">
<tr>
<td width="50"></td>
<td>
<h2>Icecast Server Response</h2>
<div class="roundcont">
<div class="roundtop">
<img src="/corner_topleft.jpg" class="corner" style="display: none" />
</div>
<div class="newscontent">
<h3>Response</h3>
<xsl:for-each select="/iceresponse">
Message : <xsl:value-of select="message" /><br></br>
Return Code: <xsl:value-of select="return" /><br></br>
</xsl:for-each>
<br></br>
<br></br>
</div>
<div class="roundbottom">
<img src="/corner_bottomleft.jpg" class="corner" style="display: none" />
</div>
</div>
<br></br><br></br>
</td>
<td width="50"></td>
</tr>
</table>
<div class="poster">
<img align="left" src="/icecast.png" />Support icecast development at <a class="nav" href="http://www.icecast.org">www.icecast.org</a></div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,101 +0,0 @@
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
<xsl:output method="html" indent="yes" />
<xsl:template match = "/icestats" >
<html>
<head>
<title>Icecast Streaming Media Server</title>
<link rel="stylesheet" type="text/css" href="/style.css" />
</head>
<body bgcolor="black">
<center>
<table border="0" cellpadding="1" cellspacing="3">
<tr>
<td align="center">
<a class="nav" href="listmounts.xsl">List Mountpoints</a> |
<a class="nav" href="moveclients.xsl">Move Listeners</a> |
<a class="nav" href="stats.xsl">Stats</a> |
<a class="nav" href="/status.xsl">Status Page</a>
</td></tr>
</table>
</center>
<table border="0" width="90%%">
<tr>
<td width="50"></td>
<td>
<h2>Icecast Status Page</h2>
<div class="roundcont">
<div class="roundtop">
<img src="/corner_topleft.jpg" class="corner" style="display: none" />
</div>
<div class="newscontent">
<h3>Global Server Stats</h3>
<table border="0" cellpadding="4">
<xsl:for-each select="/icestats">
<xsl:for-each select="*">
<xsl:if test = "name()!='source'">
<tr>
<td width="130"><xsl:value-of select="name()" /></td>
<td class="streamdata"><xsl:value-of select="." /></td>
</tr>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</table>
</div>
<div class="roundbottom">
<img src="/corner_bottomleft.jpg" class="corner" style="display: none" />
</div>
</div>
<br></br>
<br></br>
<div class="roundcont">
<div class="roundtop">
<img src="/corner_topleft.jpg" class="corner" style="display: none" />
</div>
<div class="newscontent">
<xsl:for-each select="source">
<xsl:if test = "listeners!=''">
<h3>
<xsl:if test="server_name"><xsl:value-of select="server_name" /> </xsl:if>
(<xsl:value-of select="@mount" />)
<xsl:if test="authenticator"> <a href="manageauth.xsl?mount={@mount}"><img border="0" src="/key.gif"/></a> </xsl:if>
</h3>
<table border="0" cellpadding="1" cellspacing="5" bgcolor="444444">
<tr>
<td align="center">
<a class="nav2" href="listclients.xsl?mount={@mount}">List Clients</a> |
<a class="nav2" href="moveclients.xsl?mount={@mount}">Move MountPoints</a> |
<a class="nav2" href="killsource.xsl?mount={@mount}">Kill Source</a>
<xsl:if test="authenticator"> | <a class="nav2" href="manageauth.xsl?mount={@mount}">Manage Authentication</a></xsl:if>
</td></tr>
</table>
<br></br>
<table cellpadding="5" cellspacing="0" border="0">
<xsl:for-each select="*">
<tr>
<td width="130"><xsl:value-of select="name()" /></td>
<td class="streamdata"><xsl:value-of select="." /></td>
</tr>
</xsl:for-each>
</table>
<br></br>
<br></br>
</xsl:if>
</xsl:for-each>
</div>
<div class="roundbottom">
<img src="/corner_bottomleft.jpg" class="corner" style="display: none" />
</div>
</div>
<br></br><br></br>
</td>
<td width="50"></td>
</tr>
</table>
<div class="poster">
<img align="left" src="/icecast.png" />Support icecast development at <a class="nav" href="http://www.icecast.org">www.icecast.org</a></div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,113 +0,0 @@
#!/bin/sh
# Run this to set up the build system: configure, makefiles, etc.
# (based on the version in enlightenment's cvs)
package="icecast"
olddir=`pwd`
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
cd "$srcdir"
DIE=0
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have autoconf installed to compile $package."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]\).*/\1/"
# do we need automake?
if test -r Makefile.am; then
echo Checking for automake version
options=`fgrep AUTOMAKE_OPTIONS Makefile.am`
AM_NEEDED=`echo "$options" | $VERSIONGREP`
AM_PROGS=automake
AC_PROGS=aclocal
if test -n "$AM_NEEDED" && test "x$AM_NEEDED" != "x$options"
then
AM_PROGS="automake-$AM_NEEDED automake$AM_NEEDED $AM_PROGS"
AC_PROGS="aclocal-$AM_NEEDED aclocal$AM_NEEDED $AC_PROGS"
else
AM_NEEDED=""
fi
AM_PROGS="$AUTOMAKE $AM_PROGS"
AC_PROGS="$ACLOCAL $AC_PROGS"
for am in $AM_PROGS; do
($am --version > /dev/null 2>&1) 2>/dev/null || continue
ver=`$am --version | head -1 | $VERSIONGREP`
AWK_RES=`echo $ver $AM_NEEDED | awk '{ if ( $1 >= $2 ) print "yes"; else print "no" }'`
if test "$AWK_RES" = "yes"; then
AUTOMAKE=$am
echo " found $AUTOMAKE"
break
fi
done
for ac in $AC_PROGS; do
($ac --version > /dev/null 2>&1) 2>/dev/null || continue
ver=`$ac --version < /dev/null | head -1 | $VERSIONGREP`
AWK_RES=`echo $ver $AM_NEEDED | awk '{ if ( $1 >= $2 ) print "yes"; else print "no" }'`
if test "$AWK_RES" = "yes"; then
ACLOCAL=$ac
echo " found $ACLOCAL"
break
fi
done
test -z $AUTOMAKE || test -z $ACLOCAL && {
echo
if test -n "$AM_NEEDED"; then
echo "You must have automake version $AM_NEEDED installed"
echo "to compile $package."
else
echo "You must have automake installed to compile $package."
fi
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
fi
(libtoolize --version) > /dev/null 2>&1 || {
echo
echo "You must have libtool installed to compile $package."
echo "Download the appropriate package for your system,"
echo "or get the source from one of the GNU ftp sites"
echo "listed in http://www.gnu.org/order/ftp.html"
DIE=1
}
if test "$DIE" -eq 1; then
exit 1
fi
echo "Generating configuration files for $package, please wait...."
ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4"
if test -n "$ACLOCAL"; then
echo " $ACLOCAL $ACLOCAL_FLAGS"
$ACLOCAL $ACLOCAL_FLAGS
fi
echo " autoheader"
autoheader
echo " libtoolize --automake"
libtoolize --automake
if test -n "$AUTOMAKE"; then
echo " $AUTOMAKE --add-missing"
$AUTOMAKE --add-missing
fi
echo " autoconf"
autoconf
if test -z "$*"; then
echo "I am going to run ./configure with no arguments - if you wish "
echo "to pass any to it, please specify them on the $0 command line."
fi
cd $olddir
$srcdir/configure "$@" && echo

View File

@ -1,2 +0,0 @@
Makefile
Makefile.in

View File

@ -1,28 +0,0 @@
## Process this with automake to create Makefile.in
AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = icecast.xml.in
DISTCLEANFILES = icecast.xml.dist
docdir = $(datadir)/$(PACKAGE)/doc
doc_DATA = icecast.xml.dist
install-data-hook:
$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
test -f $(DESTDIR)$(sysconfdir)/icecast.xml || \
$(INSTALL_DATA) icecast.xml.dist $(DESTDIR)$(sysconfdir)/icecast.xml
edit = sed -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
-e 's,@localstatedir\@,$(localstatedir),g' \
-e 's,@PACKAGE\@,$(PACKAGE),g'
icecast.xml.dist: $(srcdir)/icecast.xml.in
$(edit) $(srcdir)/icecast.xml.in > icecast.xml.dist
debug:
$(MAKE) all CFLAGS="@DEBUG@"
profile:
$(MAKE) all CFLAGS="@PROFILE@"

View File

@ -1,136 +0,0 @@
<icecast>
<limits>
<clients>100</clients>
<sources>2</sources>
<threadpool>5</threadpool>
<queue-size>102400</queue-size>
<client-timeout>30</client-timeout>
<header-timeout>15</header-timeout>
<source-timeout>10</source-timeout>
<!-- If enabled, this will provide a burst of data when a client
first connects, thereby significantly reducing the startup
time for listeners that do substantial buffering. However,
it also significantly increases latency, so it's disabled
by default -->
<burst-on-connect>0</burst-on-connect>
</limits>
<authentication>
<!-- Sources log in with username 'source' -->
<source-password>hackme</source-password>
<!-- Relays log in username 'relay' -->
<relay-password>hackme</relay-password>
<!-- Admin logs in with the username given below -->
<admin-user>admin</admin-user>
<admin-password>hackme</admin-password>
</authentication>
<!-- Uncomment this if you want directory listings -->
<!--
<directory>
<yp-url-timeout>15</yp-url-timeout>
<yp-url>http://dir.xiph.org/cgi-bin/yp-cgi</yp-url>
</directory>
<directory>
<yp-url-timeout>15</yp-url-timeout>
<yp-url>http://www.oddsock.org/cgi-bin/yp-cgi</yp-url>
</directory>
-->
<!-- This is the hostname other people will use to connect to your server.
It affects mainly the urls generated by Icecast for playlists and yp
listings. -->
<hostname>localhost</hostname>
<!-- You can use these two if you only want a single listener -->
<!--<port>8000</port> -->
<!--<bind-address>127.0.0.1</bind-address>-->
<!-- You may have multiple <listener> elements -->
<listen-socket>
<port>8000</port>
<!-- <bind-address>127.0.0.1</bind-address> -->
</listen-socket>
<!--
<listen-socket>
<port>8001</port>
</listen-socket>
-->
<!--<master-server>127.0.0.1</master-server>-->
<!--<master-server-port>8001</master-server-port>-->
<!--<master-update-interval>120</master-update-interval>-->
<!--<master-password>hackme</master-password>-->
<!--
<relay>
<server>127.0.0.1</server>
<port>8001</port>
<mount>/example.ogg</mount>
<local-mount>/different.ogg</local-mount>
<relay-shoutcast-metadata>0</relay-shoutcast-metadata>
</relay>
-->
<!-- Only define a <mount> section if you want to use advanced options,
like alternative usernames or passwords
<mount>
<mount-name>/example-complex.ogg</mount-name>
<username>othersource</username>
<password>hackmemore</password>
<max-listeners>1</max-listeners>
<dump-file>/tmp/dump-example1.ogg</dump-file>
<fallback-mount>/example2.ogg</fallback-mount>
<authentication type="htpasswd">
<option name="filename" value="myauth"/>
<option name="allow_duplicate_users" value="0"/>
</authentication>
</mount>
-->
<fileserve>1</fileserve>
<paths>
<!-- basedir is only used if chroot is enabled -->
<basedir>@pkgdatadir@</basedir>
<!-- Note that if <chroot> is turned on below, these paths must both
be relative to the new root, not the original root -->
<logdir>@localstatedir@/log/@PACKAGE@</logdir>
<webroot>@pkgdatadir@/web</webroot>
<adminroot>@pkgdatadir@/admin</adminroot>
<!-- <pidfile>@pkgdatadir@/icecast.pid</pidfile> -->
<!-- Aliases: treat requests for 'source' path as being for 'dest' path
May be made specific to a port or bound address using the "port"
and "bind-address" attributes.
-->
<!--
<alias source="/foo" dest="/bar"/>
-->
<!-- Aliases: can also be used for simple redirections as well,
this example will redirect all requests for http://server:port/ to
the status page
-->
<alias source="/" dest="/status.xsl"/>
</paths>
<logging>
<accesslog>access.log</accesslog>
<errorlog>error.log</errorlog>
<loglevel>4</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
</logging>
<security>
<chroot>0</chroot>
<!--
<changeowner>
<user>nobody</user>
<group>nogroup</group>
</changeowner>
-->
</security>
</icecast>

View File

@ -1,125 +0,0 @@
AC_INIT([Icecast], [2.0.0], [icecast@xiph.org])
AC_PREREQ(2.54)
AC_CONFIG_SRCDIR(src/main.c)
dnl Process this file with autoconf to produce a configure script.
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_PROG_CC
AC_CANONICAL_HOST
AC_PROG_LIBTOOL
dnl Set some options based on environment
DEBUG="-g"
if test -z "$GCC"; then
XIPH_CPPFLAGS="-D_REENTRANT"
case $host in
*-*-irix*)
XIPH_CPPFLAGS="$XIPH_CPPFLAGS -w -signed"
PROFILE="-p -g3 -O2 -signed -D_REENTRANT"
;;
*-*-solaris*)
XIPH_CFLAGS="-xO4 -xcg92"
XIPH_CPPFLAGS="$XIPH_CPPFLAGS -v -w -fsimple -fast"
PROFILE="-xpg -g -Dsuncc"
;;
*)
XIPH_CFLAGS="-O"
PROFILE="-g -p"
;;
esac
case "$host" in
*openbsd* | *irix*)
;;
*) AC_DEFINE([_XOPEN_SOURCE], 600, [Define if you have POSIX and XPG specifications])
;;
esac
else
XIPH_CPPFLAGS="-Wall -ffast-math -fsigned-char"
PROFILE="-pg -g"
AC_DEFINE([_GNU_SOURCE], 1, [Define to include GNU extensions to POSIX])
fi
dnl Checks for programs.
dnl Checks for libraries.
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([alloca.h])
AC_CHECK_HEADERS(pwd.h, AC_DEFINE(CHUID, 1, [Define if you have pwd.h]),,)
AC_CHECK_HEADERS(unistd.h, AC_DEFINE(CHROOT, 1, [Define if you have unistd.h]),,)
dnl Checks for typedefs, structures, and compiler characteristics.
dnl Check for types
dnl Checks for library functions.
AC_CHECK_FUNCS(localtime_r poll)
AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP, 1,
[Define if you have nanosleep]))
XIPH_NET
dnl -- configure options --
XIPH_PATH_XSLT
XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$XSLT_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$XSLT_LIBS])
XIPH_PATH_VORBIS(, AC_MSG_ERROR([must have Ogg Vorbis v1.0 installed!]))
XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$VORBIS_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$VORBIS_LIBS])
ACX_PTHREAD(, AC_MSG_ERROR([POSIX threads missing]))
XIPH_VAR_APPEND([XIPH_CFLAGS],[$PTHREAD_CFLAGS])
XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$PTHREAD_CPPFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$PTHREAD_LIBS])
dnl -- YP support --
AC_ARG_ENABLE([yp],
AC_HELP_STRING([--disable-yp],[disable YP directory support]),
enable_yp="$enableval",
enable_yp="yes")
if test "x$enable_yp" = "xyes"
then
XIPH_PATH_CURL([
AC_CHECK_DECL([CURLOPT_NOSIGNAL],
[ AC_DEFINE([USE_YP], 1, [Define to compile in YP support code])
ICECAST_OPTIONAL="$ICECAST_OPTIONAL yp.o"
XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$CURL_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$CURL_LIBS])
], [ AC_MSG_NOTICE([Your curl dev files are too old (7.10 or above required), YP disabled])
], [#include <curl/curl.h>
])
],[ AC_MSG_NOTICE([libcurl not found, YP disabled])
])
else
AC_MSG_NOTICE([YP support disabled])
fi
dnl Make substitutions
AC_SUBST(XIPH_CPPFLAGS)
AC_SUBST(XIPH_CFLAGS)
AC_SUBST(XIPH_LIBS)
AC_SUBST(PTHREAD_CPPFLAGS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(LIBS)
AC_SUBST(DEBUG)
AC_SUBST(CFLAGS)
AC_SUBST(PROFILE)
AC_SUBST(ICECAST_OPTIONAL)
AC_OUTPUT([Makefile conf/Makefile debian/Makefile src/Makefile src/avl/Makefile
src/httpp/Makefile src/thread/Makefile src/log/Makefile
src/net/Makefile src/timing/Makefile doc/Makefile web/Makefile
admin/Makefile win32/Makefile win32/res/Makefile])

2
debian/.cvsignore vendored
View File

@ -1,2 +0,0 @@
Makefile
Makefile.in

8
debian/Makefile.am vendored
View File

@ -1,8 +0,0 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = 1.6 foreign
EXTRA_DIST = README.Debian changelog compat control copyright \
icecast2.1 icecast2.default icecast2.init icecast2.manpages \
icecast2.postinst icecast2.postrm icecast2.preinst rules watch

12
debian/README.Debian vendored
View File

@ -1,12 +0,0 @@
icecast2 for Debian
-------------------
It is recommended to run icecast under a dedicated user account, which only
has access to write the log files. The Debian package creates such an
account, named 'icecast', and uses it by default, but you are free to
reconfigure it and remove the account.
Edit /etc/default/icecast2 to change the init-script configuration.
-- Keegan Quinn <ice@thebasement.org>

198
debian/changelog vendored
View File

@ -1,198 +0,0 @@
icecast2 (1.9+2.0alphasnap2+20030802-1) unstable; urgency=low
* Added a 'watch' file to automate tracking of updates.
* Now uses dh-buildinfo to store information about the package build
environment. Added a Build-Dependancy to dh-buildinfo.
* Removed cdbs/autotools-vars.mk, from cdbs CVS, because a new release
was made.
* Enabled curl during configure stage, since --disable-curl was recently
broken upstream, and potentially broken YP support can be disabled at
runtime.
* Trimmed ancient upgrade nodes and other cruft, left over from
pre-Debian versions, from README.Debian.
* Removed some autotools build cruft, since bugs were fixed upstream.
* Normalized {preinst,postinst,postrm} filenames to
icecast2.{preinst,postinst,postrm}. Thanks to Emmanuel le Chevoir
for this suggestion.
* Fixed preinst; was stopping /usr/bin/icecast instead of
/usr/bin/icecast2. Thanks to Emmanuel le Chevoir for this suggestion.
* Removed prerm, since it was not serving any purpose. Thanks to
Emmanuel le Chevoir for this suggestion.
* Cleaned up postinst: removed old comments, fixed a path typo in the
configuration file location change message.
* Cleaned up postrm: removed old comments, fixed a typo in the group
removal test.
* Thanks to Jonas Smedegaard for sponsoring this package, and
providing many good suggestions.
-- Keegan Quinn <ice@thebasement.org> Sat, 2 Aug 2003 20:28:13 -0700
icecast2 (1.9+2.0alphasnap2+20030720-1.1) unstable; urgency=low
* NMU by sponsor (still closes: Bug#178160).
-- Jonas Smedegaard <dr@jones.dk> Wed, 23 Jul 2003 06:03:42 +0200
icecast2 (1.9+2.0alphasnap2+20030720-1) unstable; urgency=low
* New daily snapshot build.
* Added Build-Dependancy to cdbs, and increased debhelper version
requirement as recommended by cdbs README.
* Corrected Standards-Version to 3.6.0. This package now generates
no lintian errors.
* Updated Recommends for ices to ices2; it was renamed.
* Added more information to the long description.
* Thanks to Jonas Smedegaard for sponsoring this package.
* This revision still closes: #178160 - the last was not uploaded.
-- Keegan Quinn <ice@thebasement.org> Mon, 21 Jul 2003 08:55:27 -0700
icecast2 (1.9+2.0alphasnap2+20030714-0.2) unstable; urgency=low
* Sponsored upload. Closes: Bug#178160.
* Switch to cdbs (agreed with maintainer).
* Use cdbs autotools-vars.mk from CVS to avoid cross-compiling on same
host.
* Add build-dependency on libxml2-dev.
* Explicitly configure without curl support to avoid building broken
YP stuff.
* Hack src/Makefile.am to use AM_CFLAGS instead of CFLAGS (which is
overridden by cdbs), and add clean rule to avoid invoking automake.
* Disable daemon by default and hint about changing passwords before
enabling.
* Avoid moving config files from pre-Debian times - instead just print
a warning if config exists in old location (better mess as little as
possible with files not ever claimed to be ours).
* Update README.Debian to reflect the above, include note about YP
support not compiled in, and remove note regarding adoption.
* Strip paths from packaging scripts (they may move around in the
future, and if PATH is wrong then something else broken anyway).
* Avoid removing unused /usr/share/icecast2 on purge.
* Remove icecast group on purge only if empty.
* Standards-version 3.6 (no changes needed).
* Fix wrong escaping of sed vars in conf/Makefile.
* Symlink public files from /usr/share/icecast2 to /etc/icecast2
(instead of pointing public root dirs below /etc).
* Use upstream config (paths are properly included now).
-- Jonas Smedegaard <dr@jones.dk> Sun, 20 Jul 2003 20:19:30 +0200
icecast2 (1.9+2.0alphasnap2+20030714-0.1) unstable; urgency=low
* New daily snapshot build.
* Updated versioning scheme to reflect (as well as possible) that the
source is a daily snapshot now, not CVS.
-- Keegan Quinn <ice@thebasement.org> Mon, 14 Jul 2003 19:39:58 -0700
icecast2 (1.9+2.0alphacvs030704-0.1) unstable; urgency=low
* Constructed a build script to completely automate the construction
of the 'pristine' tarball from CVS. This doesn't really effect the
contents of the package, just makes it easier for me to rebuild.
* New CVS source.
* Removed Build-Dependancy on libcurl2-dev; packages built without this
library present will not have YP functionality, which is okay for
now since it's badly broken.
* Updated the default configuration file, including some new options
recently added upstream.
* Added a number of tweaks to clean up and rearrange new configuration
and documentation added to upstream install target.
* Moved the configuration file from /etc/icecast.xml to
/etc/icecast2/icecast.xml. See README.Debian.
* Nice ugly version number to reflect that upstream calls this the 2.0
alpha branch, without potentially introducing the need for an epoch.
-- Keegan Quinn <ice@thebasement.org> Thu, 3 Jul 2003 23:46:56 -0700
icecast2 (0.00.cvs030529-0.1) unstable; urgency=low
* New CVS source.
* Removed unnecessary debconf stuff.
* Added README.Debian.
* Path updates:
- /usr/share/icecast to /usr/share/icecast2,
- /var/log/icecast to /var/log/icecast2,
- /usr/bin/icecast to /usr/bin/icecast2,
- /usr/share/man/man8/icecast.8.gz to /usr/share/man/man8/icecast2.8.gz.
-- Keegan Quinn <ice@thebasement.org> Wed, 29 May 2003 22:53:21 -0700
icecast2 (0.00.cvs030403-0.2) unstable; urgency=low
* Tried to make the default configuration more understandable.
-- Keegan Quinn <ice@thebasement.org> Fri, 4 Apr 2003 10:55:27 -0800
icecast2 (0.00.cvs030403-0.1) unstable; urgency=low
* New CVS source.
* Minor changes to postrm.
-- Keegan Quinn <ice@thebasement.org> Thu, 3 Apr 2003 16:05:09 -0800
icecast2 (0.00.cvs030401-0.7) unstable; urgency=low
* Minor changes to postinst.
* Added --background flag to initscript, since this version of icecast
does not yet run detached.
-- Keegan Quinn <ice@thebasement.org> Thu, 3 Apr 2003 14:24:19 -0800
icecast2 (0.00.cvs030401-0.6) unstable; urgency=low
* Added Debianized configuration file.
* Created and set ownership of /var/log/icecast and /usr/share/icecast.
-- Keegan Quinn <ice@thebasement.org> Thu, 3 Apr 2003 14:15:11 -0800
icecast2 (0.00.cvs030401-0.5) unstable; urgency=low
* Attempt at making debconf work properly.
-- Keegan Quinn <ice@thebasement.org> Thu, 3 Apr 2003 12:07:16 -0800
icecast2 (0.00.cvs030401-0.4) unstable; urgency=low
* Minor edits to init.d script.
* Added bits to create and remove system accounts appropriately.
* Typo fix in the manual page.
-- Keegan Quinn <ice@thebasement.org> Thu, 3 Apr 2003 11:06:48 -0800
icecast2 (0.00.cvs030401-0.3) unstable; urgency=low
* Finished init.d script and manual page.
* Updated postinst to handle rc*.d links.
* Package is now lintian/linda clean.
-- Keegan Quinn <ice@thebasement.org> Wed, 2 Apr 2003 16:29:18 -0800
icecast2 (0.00.cvs030401-0.2) unstable; urgency=low
* Updated copyright (replacing dh_make template).
* Fixed duplicate conffiles.
-- Keegan Quinn <ice@thebasement.org> Wed, 2 Apr 2003 16:18:02 -0800
icecast2 (0.00.cvs030401-0.1) unstable; urgency=low
* New CVS source.
* Lots of packaging cleanup.
* Initial stab at manual page and init.d script.
-- Keegan Quinn <ice@thebasement.org> Wed, 2 Apr 2003 10:25:56 -0800
icecast2 (0.00.cvs030320-0.1) unstable; urgency=low
* New CVS source.
* Automated CVS original source creation.
-- Keegan Quinn <ice@thebasement.org> Thu, 20 Mar 2003 12:58:49 -0800
icecast2 (0.00.cvs030315-0.1) unstable; urgency=low
* Initial Release.
-- Keegan Quinn <ice@thebasement.org> Sun, 16 Mar 2003 13:45:23 -0800

1
debian/compat vendored
View File

@ -1 +0,0 @@
4

22
debian/control vendored
View File

@ -1,22 +0,0 @@
Source: icecast2
Section: sound
Priority: optional
Maintainer: Keegan Quinn <ice@thebasement.org>
Build-Depends: cdbs, debhelper (>> 4.1.0), dh-buildinfo, libogg-dev (>> 1.0.0), libvorbis-dev (>> 1.0.0), libxslt1-dev, libxml2-dev
Uploaders: Jonas Smedegaard <dr@jones.dk>
Standards-Version: 3.6.0
Package: icecast2
Architecture: any
Depends: ${shlibs:Depends}
Recommends: ices2
Description: streaming Ogg Vorbis/MP3 media server
Icecast is an audio broadcasting system. It can stream music in both
MPEG 1 Layer 3 (MP3) and Ogg Vorbis formats, supports multiple
streams on a single port through the use of "mountpoints," includes
web-based status and management interfaces, and has many other
advanced features.
.
Many standard audio players can connect and listen to Icecast-hosted
streams, since it's based on Nullsoft's Shoutcast protocol and HTTP.

26
debian/copyright vendored
View File

@ -1,26 +0,0 @@
This package was debianized by Keegan Quinn <ice@thebasement.org> on
Sun, 16 Mar 2003 13:45:23 -0800.
It was retrieved from http://www.xiph.org/~brendan/snapshots/icecast/
Upstream Authors: the icecast team <team@icecast.org>
Copyright (c) 1999, 2000 the icecast team
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 latfer 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.
On Debian systems, the complete text of the GNU General Public License
can be found in `/usr/share/common-licenses/GPL'.

24
debian/icecast2.1 vendored
View File

@ -1,24 +0,0 @@
.\" Hey, EMACS: -*- nroff -*-
.TH ICECAST2 1 "July 28, 2003"
.SH NAME
icecast2 \- an MP3/Ogg Vorbis broadcast streaming media server
.SH SYNOPSIS
.B icecast2
-c
.RI config.xml
.SH DESCRIPTION
\fBicecast2\fP is an audio broadcasting system that streams music in
Ogg Vorbis and/or MPEG 1 Layer III format. It accepts stream input
from sources like ices0 and ices2, and broadcasts to clients like xmms.
.SH OPTIONS
\fBicecast2\fP has no command line options, except to specify the location
of an XML configuration file. All operational aspects of the software
are controlled by this XML configuration file.
.SH SEE ALSO
The example configuration files, provided with the package documentation
are the only reliable source of information on this software.
It is still under very active development;
documentation will be written when it is possible to do so.
.SH AUTHOR
icecast2 was created by the icecast team <team@icecast.org>.
This manual page was written by Keegan Quinn <ice@thebasement.org>.

View File

@ -1,19 +0,0 @@
# Defaults for icecast2 initscript
# sourced by /etc/init.d/icecast2
# installed at /etc/default/icecast2 by the maintainer scripts
#
# This is a POSIX shell fragment
#
# Full path to the server configuration file
CONFIGFILE="/etc/icecast2/icecast.xml"
# Name or ID of the user and group the daemon should run under
USERID=icecast
GROUPID=icecast
# Edit /etc/icecast2/icecast.xml and change at least the passwords.
# Change this to true when done to enable the init.d script
ENABLE=false

67
debian/icecast2.init vendored
View File

@ -1,67 +0,0 @@
#! /bin/sh
#
# icecast2
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
# Further modified by Keegan Quinn <ice@thebasement.org>
# for use with Icecast 2
#
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/icecast2
NAME=icecast2
DESC=icecast2
test -x $DAEMON || exit 0
# Defaults
CONFIGFILE="/etc/icecast2/icecast.xml"
CONFIGDEFAULTFILE="/etc/default/icecast2"
USERID=icecast
GROUPID=icecast
ENABLE="false"
# Reads config file (will override defaults above)
[ -r "$CONFIGDEFAULTFILE" ] && . $CONFIGDEFAULTFILE
if [ "$ENABLE" != "true" ]; then
echo "$NAME daemon disabled - read $CONFIGDEFAULTFILE."
exit 0
fi
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
--background --exec $DAEMON -- -c $CONFIGFILE
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
echo "$NAME."
;;
reload|force-reload)
echo "Reloading $DESC configuration files."
start-stop-daemon --stop --signal 1 --quiet --exec $DAEMON
;;
restart)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
sleep 1
start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
--background --exec $DAEMON -- -c $CONFIGFILE
echo "$NAME."
;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
exit 1
;;
esac
exit 0

View File

@ -1 +0,0 @@
debian/icecast2.1

View File

@ -1,43 +0,0 @@
#! /bin/sh
# postinst script for icecast2
set -e
case "$1" in
configure)
;;
abort-upgrade|abort-remove|abort-deconfigure)
exit 0
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# Move configuration file to current location, if an old one exists
# and the init.d script configuration file was updated
if [ -f /etc/icecast.xml ] && grep -q /etc/icecast2/ /etc/default/icecast2; then
echo "It seems you have an old configuration lying around at"
echo "/etc/icecast.xml. You will need to manually merge with"
echo "the current configuration at /etc/icecast2/icecast.xml."
echo "See /usr/share/doc/icecast2/examples for new configuration options."
fi
# Check for an account named 'icecast'
if ! id icecast >/dev/null 2>&1; then
# Create the new system account
adduser --system --disabled-password --disabled-login \
--home /usr/share/icecast2 --no-create-home --group icecast
fi
chown -R icecast:icecast /var/log/icecast2
#DEBHELPER#
exit 0

View File

@ -1,29 +0,0 @@
#! /bin/sh
# postrm script for icecast2
set -e
case "$1" in
purge)
rm -rf /var/log/icecast2
if id icecast >/dev/null 2>&1; then
deluser icecast
fi
# Remove group only if empty
if getent group icecast | awk -F: ' { print $4 } ' | egrep -cq '^$'; then
groupdel icecast
fi
;;
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
esac
#DEBHELPER#
exit 0

View File

@ -1,27 +0,0 @@
#! /bin/sh
# preinst script for icecast2
set -e
case "$1" in
install|upgrade)
if [ "$1" = "upgrade" ]
then
start-stop-daemon --stop --quiet --oknodo \
--exec /usr/bin/icecast2 2>/dev/null || true
fi
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

34
debian/rules vendored
View File

@ -1,34 +0,0 @@
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
DEB_INSTALL_CHANGELOGS_ALL = NEWS
DEB_CONFIGURE_SYSCONFDIR = /etc/icecast2
DEB_MAKE_INVOKE += PACKAGE=icecast2 docdir=/usr/share/doc/icecast2 pkgdatadir=/usr/share/icecast2
binary-post-install/icecast2::
# Debian has a central copy of the GPL, no need to distribute again
rm -f $(DEB_DESTDIR)/usr/share/doc/icecast2/COPYING
# Live peacefully with icecast 1
mv $(DEB_DESTDIR)/usr/bin/icecast $(DEB_DESTDIR)/usr/bin/icecast2
# Move XSLT templates to /etc and replace with symlinks
for file in `cd $(DEB_DESTDIR)/usr/share && find icecast2 -type f -name *.xsl`; do \
mkdir -p $(DEB_DESTDIR)/etc/`dirname $$file`; \
mv $(DEB_DESTDIR)/usr/share/$$file $(DEB_DESTDIR)/etc/$$file; \
ln -s /etc/$$file $(DEB_DESTDIR)/usr/share/$$file; \
done
# NEWS is ChangeLog - avoid original name
rm -f $(DEB_DESTDIR)/usr/share/doc/icecast2/NEWS
mkdir -p $(CURDIR)/debian/icecast2/var/log/icecast2
# Store build information
dh_buildinfo
clean::
# Upstream forgot to clean this one it seems...
rm -f conf/icecast.xml.dist

3
debian/watch vendored
View File

@ -1,3 +0,0 @@
version=2
http://www.icecast.org/download.html files/icecast/icecast-(.*)\.tar\.gz debian uupdate

View File

@ -1 +0,0 @@
Makefile.in

View File

@ -1,9 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
<!-- Sitemap 1.0 -->
</HEAD><BODY>
<UL>
</UL>
</BODY></HTML>

View File

@ -1,13 +0,0 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = foreign
docdir = $(datadir)/doc/icecast
doc_DATA = index.html icecast2_admin.html icecast2_basicsetup.html \
icecast2_config_file.html icecast2_faq.html icecast2_glossary.html \
icecast2_introduction.html icecast2_relay.html icecast2_stats.html \
icecast2_win32.html icecast2_yp.html
EXTRA_DIST = Index.hhk icecast2.chm icecast2.hhc icecast2.hhp index_win32.html \
stats1.jpg style.css win32_section1.html win32_section2.html \
win32_section3.html windowtitle.jpg $(doc_DATA)

Binary file not shown.

View File

@ -1,62 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
<!-- Sitemap 1.0 -->
</HEAD><BODY>
<OBJECT type="text/site properties">
<param name="ImageType" value="Folder">
</OBJECT>
<UL>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Icecast2 - Table of Contents">
<param name="Local" value="index.html">
</OBJECT>
<UL>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Introduction">
<param name="Local" value="icecast2_introduction.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Basic Setup">
<param name="Local" value="icecast2_basicsetup.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Icecast Config File">
<param name="Local" value="icecast2_config_file.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Admin Interface">
<param name="Local" value="icecast2_admin.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Server Statistics">
<param name="Local" value="icecast2_stats.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Relaying">
<param name="Local" value="icecast2_relay.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Listing in a YP Directory">
<param name="Local" value="icecast2_yp.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Listener Authentication">
<param name="Local" value="icecast2_listenerauth.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Win32 specific documentation">
<param name="Local" value="icecast2_win32.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Glossary">
<param name="Local" value="icecast2_glossary.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="FAQ">
<param name="Local" value="icecast2_faq.html">
</OBJECT>
</UL>
</UL>
</BODY></HTML>

View File

@ -1,23 +0,0 @@
[OPTIONS]
Auto Index=Yes
Compatibility=1.1 or later
Compiled file=icecast2.chm
Contents file=icecast2.hhc
Default Font=,8,0
Default Window=Icecast 2 Documentation
Default topic=index.html
Display compile progress=No
Full-text search=Yes
Index file=Index.hhk
Language=0x409 English (United States)
Title=Icecast 2
[WINDOWS]
Icecast 2 Documentation=,"icecast2.hhc","Index.hhk","index.html",,,,,,0x42520,,0x3006,[26,28,794,605],,,,,,,0
[FILES]
index.html
[INFOTYPES]

View File

@ -1,119 +0,0 @@
<LINK REL=STYLESHEET TYPE= "text/css" HREF= "style.css">
<div class=boxtest>
<body bgcolor="#efefef" text="#323232" link="#0000ff" vlink="#800080" alink="#ff0000">
<h1>Icecast 2 Admin Interface</h1>
<table width=100%><tr><td bgcolor="#007B79" height="10" align="center"></td></tr></table>
<br>
<br>
<br>
<h2>Overview</h2>
<p>This section contains information about the admin interface of icecast. Through this interface the user can manipulate many server features. From it you can gather statistics, mov e listeners from mountpoint to mountpoint, disconnect connected sources, disconnect connected listeners, and many other activities. Each function is enumerated here as well as an example usage of the function.</p>
<p>Each of these functions requires authentication via the &lt;admin-username&gt; and &lt;admin-password&gt; specified in the icecast config file. It is also important to note that in all the examples 192.168.1.10 is used as the example host and 8000 is used as the example port for the icecast server.</p>
<br>
<br>
<br>
<h2>Admin Functions (mount specific)</h2>
<p>All these admin functions are mount specific in that they only apply to a particular mountpoint (as opposed to applying to the entire server). Each of these functions requires a mountpoint to be specified as input.
<h3>Metadata Update</h3>
<h4>description</h4>
<div class=indentedbox>
This function provides the ability for either a source client or any external program to update the metadata information for a particular mountpoint. Currently the only metadata supported is song title and only for MP3 streams.
</div>
<h4>example</h4>
<pre>
http://192.168.1.10:8000/admin/metadata?mount=/mystream&mode=updinfo&song=ACDC+Back+In+Black
</pre>
<br>
<br>
<h3>Fallback Update</h3>
<h4>description</h4>
<div class=indentedbox>
This function provides the ability for either a source client or any external program to update the "fallback mountpoint" for a particular mountpoint. Fallback mounts are those that are used in the even of a source client disconnection. If a source client disconnects for some reason that all currently connected clients are sent immediately to the fallback mountpoint.
</div>
<h4>example</h4>
<pre>
http://192.168.1.10:8000/admin/fallbacks?mount=/mystream.ogg&fallback=/myfallback.ogg
</pre>
<br>
<br>
<h3>List Clients</h3>
<h4>description</h4>
<div class=indentedbox>
This function lists all the clients currently connected to a specific mountpoint. The results are sent back in XML form.
</div>
<h4>example</h4>
<pre>
http://192.168.1.10:8000/admin/listclients?mount=/mystream.ogg
</pre>
<br>
<br>
<h3>Move Clients (Listeners)</h3>
<h4>description</h4>
<div class=indentedbox>
This function provides the ability to migrate currently connected listeners from one mountpoint to another. This function requires 2 mountpoints to be passed in: mount (the *from* mountpoint) and destination (the *to* mountpoint). After processing this function all currently connected listeners on mount will be connected to destination. Note that the destination mountpoint must exist and have a sounce client already feeding it a stream.
</div>
<h4>example</h4>
<pre>
http://192.168.1.10:8000/admin/moveclients?mount=/mystream.ogg&destination=/mynewstream.ogg
</pre>
<br>
<br>
<h3>Kill Client (Listener)</h3>
<h4>description</h4>
<div class=indentedbox>
This function provides the ability to disconnect a specific listener of a currently connected mountpoint. Listeners are identified by a unique id that can be retrieved by via the "List Clients" admin function. This id must be passed in to the request. After processing this request, the listener will no longer be connected to the mountpoint.
</div>
<h4>example</h4>
<pre>
http://192.168.1.10:8000/admin/killclient?mount=/mystream.ogg&id=21
</pre>
<br>
<br>
<h3>Kill Source</h3>
<h4>description</h4>
<div class=indentedbox>
This function will provide the ability to disconnect a specific mountpoint from the server. The mountpoint to be disconnected is specified via the variable "mount".
</div>
<h4>example</h4>
<pre>
http://192.168.1.10:8000/admin/killsource?mount=/mystream.ogg
</pre>
<br>
<br>
<br>
<h2>Admin Functions (general)</h2>
<h3>Stats</h3>
<h4>description</h4>
<div class=indentedbox>
This admin function provides the ability to query the internal statistics kept by the icecast server. Almost all information about the internal workings of the server such as the mountpoints connected, how many client requests have been served, how many listeners for each mountpoint, etc, are available via this admin function.<br>
Note that this admin function can also be invoked via the http://server:port/admin/stats.xml syntax, however this syntax should not be used and will eventually become deprecated.
</div>
<h4>example</h4>
<pre>
http://192.168.1.10:8000/admin/stats
</pre>
<br>
<br>
<h3>List Mounts</h3>
<h4>description</h4>
<div class=indentedbox>
This admin function provides the ability to view all the currently connected mountpoints.
</div>
<h4>example</h4>
<pre>
http://192.168.1.10:8000/admin/listmounts
</pre>
<br>
<br>
<br>
<h2>Web-Based Admin Interface</h2>
<p>As an alternative to manually invoking these URLs, a web-based admin interface was developed. This interface provides the same functions that were identified and described above but presents them in a little nicer way. The Web-Based Admin Interface to icecast is shipped with icecast provided in the "admin" directory and comes ready to use. All the user needs to do is set the path to this directory in the config file via the &lt;adminroot&gt; config variable.</p>
<p>The Web-Based Admin Interface is a series of XSLT files which are used to display all the XML obtained via the URL admin interface. This can be changed and modified to suit the user's need. Knowledge of XSLT and transformations from XML to HTML are required in order to make changes to these scripts.</p>
<p>The main URL for the Web-Based Admin Interface is</p>
<pre>
http://192.168.1.10:8000/admin/stats.xsl
</pre>
<p>From this URL all of the other admin functions can be exercised.</p>
</div>
</body>
</html>

View File

@ -1,59 +0,0 @@
<LINK REL=STYLESHEET TYPE= "text/css" HREF= "style.css">
<div class=boxtest>
<body bgcolor="#efefef" text="#323232" link="#0000ff" vlink="#800080" alink="#ff0000">
<h1>Icecast 2 Basic Setup</h1>
<table width=100%><tr><td bgcolor="#007B79" height="10" align="center"></td></tr></table>
<br>
<br>
<br>
<h2>Basic Requirements</h2>
<p>This section will describe the essential requirements in setting up a simple Internet radio station. It is by no means a complete list but should give you enough to get started.</p>
<p>There are two major components involved: the streaming server (icecast in this case) and the source client. The icecast server will be the place where all listeners of your station will connect. The source client (in general) runs on a separate machine than icecast, but does not necessarily need to. Source clients send the content to icecast and provide the stream data (encoded audio) that is then relayed out to listeners by icecast.</p>
<p>It is important to note that not all source clients work with icecast2. You will need to check to make sure that icecast2 is supported by your chosen source client.</p>
<br>
<br>
<br>
<h2>The Basics</h2>
<p>Each icecast server can house multiple broadcasts (or mountpoints) each containing a separate stream of content. A listener can only listen to a single mountpoint at a time. This means you can have a single icecast server contain either multiple broadcasts with different content, or possibly the same broadcast but with streams of different bitrates or qualities. In this case each broadcast or stream is a separate mountpoint.</p>
<p>At this point, the steps outlined here related to the Unix version or Win32 console version of icecast. Icecast is also available in a Win32 GUI version, and the steps are similar in setup, but not quite the same.</p>
<p>The first step in the process is to find and install the icecast2 server itself. How to do this is not contained within this documentation. After installation you should have and icecast binary and 3 directories</p>
<center>
<table border=1 width=75%>
<tr><td>conf</td><td>Contains the icecast configuration file (icecast.xml) which defines all the configuration parameters for the server.</td></tr>
<tr><td>admin</td><td>Contains xslt files which are used by the icecast server to provide a web-based front end to the administration capabilities of the server.</td></tr>
<tr><td>logs</td><td>This is a blank directory which (if specified in the config file) will contain all the logs (there are 2) for icecast.</td></tr>
</table>
</center>
<p>The next step is to edit the icecast.xml file and set the appropriate values. Most of the default values are fine as provided, and for a basic setup the following entries should be changed :<br><br>
<pre>
&lt;source-password&gt; - will be used by the source client
&lt;admin-password&gt; - will be used to access admin features of icecast
&lt;listen-socket&gt; (both port and bind-address)
&lt;logdir&gt; - directory where log files will be placed
&lt;webroot&gt; - any static content can be placed here (file serving root)
&lt;adminroot&gt; - directory containing admin xslt files
</pre>
<p>Once the configuration file is modified, you should be able to start the server with the following command</p>
<pre>
icecast -c /path/to/icecast.xml
</pre>
<p>If no error messages are generated, then check the error.log file for the following message :</p>
<pre>
[2003-10-31 13:04:49] INFO main/main.c icecast server started
</pre>
<p>You can also verify that it started by visiting the following URL : http://yourip:port/admin/stats.xml. You should be prompted for a username and password. Enter the username "admin" and the password you entered for &lt;admin-password&gt;. If all is well, you should see an small XML tree which represents icecast statistics (more about that later).</p>
<p>Now that the icecast server is started you must now configure your source client. The information you will need for the source client is the following : <br>
<br>
IP address and Port of the icecast server - both of these come from &lt;listen-socket&gt;<br>
source password - from &lt;source-password&gt;<br>
<p>Additionally, you will need to choose a mountpoint and specify this in the source client. Icecast does not need to know about each mount point (although you can configure settings for specific mountpoint - this is covered under Advanced configuration) there are, however, some points to mention regarding mountpoints. All Ogg Vorbis streams should have mountpoints that end in .ogg (i,e. /mystream.ogg). This is due to the lazy way most media players infer the type of stream. MP3 streams usually do not contain an extension (/mystream). Mount points also should not contain any spaces or odd characters (again due to the lazy way many of the media players are coded).</p>
<p>Once you have configured your source client, you should be able to connect it to the icecast server. Verify that it is connected by hitting the stats.xml URL that was mentioned above.</p>
<p>Now that you have the source connnected, listening to the stream involves simply opening the appropriate following URL in a browser: http://yourip:port/mounpointyouspecified.m3u. So, for instance, if you attached your source client to an icecast server located at 192.168.1.10:8000 with a mountpoint of /mystream.ogg, then you would open : http://192.168.1.10:8000/mystream.ogg.m3u. Note that the .m3u extention will serve up a link that opens most media players. Also it is important to note that m3u need not contain only MP3 stream, it can contain streams of arbitrary content-type and is used by icecast to serve a playlist that represents your broadcast to listening clients. Alternatively you can open up the stream URL directly within your media player (http://192.168.1.10:8000/mystream.ogg in this case)</p>
<br>
<br>
<br>
</div>
</body>
</html>

View File

@ -1,409 +0,0 @@
<LINK REL=STYLESHEET TYPE= "text/css" HREF= "style.css">
<div class=boxtest>
<body bgcolor="#efefef" text="#323232" link="#0000ff" vlink="#800080" alink="#ff0000">
<h1>Icecast 2 Config File</h1>
<table width=100%><tr><td bgcolor="#007B79" height="10" align="center"></td></tr></table>
<h3>Overview</h3>
<p>
This section will describe each section of the config file and is grouped into the following sections:
</p>
<li><a href="#limits">Limits</a>
<li><a href="#authentication">Authentication</a>
<li><a href="#yp">YP Directory Settings</a>
<li><a href="#misc">Misc Server settings</a>
<li><a href="#relay">Relay settings</a>
<li><a href="#mount">Mount Specific settings</a>
<li><a href="#path">File path settings</a>
<li><a href="#log">Logging</a>
<li><a href="#security">Security</a>
<br>
<br>
<br>
<a name="limits"></a>
<h2>Limits</h2>
<pre>
&lt;limits&gt;
&lt;clients&gt;100&lt;clients&gt;
&lt;sources&gt;2&lt;sources&gt;
&lt;threadpool&gt;5&lt;threadpool&gt;
&lt;queue-size&gt;102400&lt;queue-size&gt;
&lt;client-timeout&gt;30&lt;client-timeout&gt;
&lt;header-timeout&gt;15&lt;header-timeout&gt;
&lt;source-timeout&gt;10&lt;source-timeout&gt;
&lt;burst-on-connect&gt;1&lt;burst-on-connect&gt;
&lt;limits&gt;
</pre>
<p>This section contains server level settings that, in general, do not need to be changed. Only modify this section if you are know what you are doing.
</p>
<h4>clients</h4>
<div class=indentedbox>
Total number of concurrent clients supported by the server. Listeners are considered clients, but so is accesses to any static content (i.e. fileserved content) and also any requests to gather stats. These are max *concurrent* connections for the entire server (not per mountpoint).
</div>
<h4>sources</h4>
<div class=indentedbox>
Maximum number of connected sources supported by the server.
</div>
<h4>threadpool</h4>
<div class=indentedbox>
This is the number of threads that are started to handle client connections. You may need to increase this value if you are running a high traffic stream. This recommended value is for a small to medium traffic server.
</div>
<h4>queue-size</h4>
<div class=indentedbox>
This is the maximum size (in bytes) of a client (listener) queue. A listener may temporarily lag behind due to network congestion and in this case an internal queue is maintained for each listener. If the queue grows larger than this config value, then the listener will be removed from the stream.
</div>
<h4>client-timeout</h4>
<div class=indentedbox>
This does not seem to be used.
</div>
<h4>header-timeout</h4>
<div class=indentedbox>
The maximum time (in seconds) to wait for a request to come in once the client has made a connection to the server. In general this value should not need to be tweaked.
</div>
<h4>source-timeout</h4>
<div class=indentedbox>
If a connected source does not send any data within this timeout period (in seconds), then the source connection will be removed from the server.
</div>
<h4>burst-on-connect</h4>
<div class=indentedbox>
With this enabled, a connecting client will be sent a burst of audio data from the stream. This will have the effect of reducing the startup time for the stream from the perspective of the listener. This is due to the fact that most media players have local buffers that must be filled before the stream begins to play. This may introduce a small latency in the stream (difference in time between when the source plays a clip and the listener hears a clip). If this latency is important to you, then you can disable this feature. The latency is bitrate-dependent, but as an example, for a 128kbps stream, the latency between the source and the player is ~ 1.5 secs WITHOUT burst on connect, and WITH burst on connect the latency is 3 secs.
</div>
<br>
<br>
<br>
<a name="authentication"></a>
<h2>Authentication</h2>
<pre>
&lt;authentication&gt;
&lt;source-password&gt;hackme&lt;source-password&gt;
&lt;relay-password&gt;hackme&lt;relay-password&gt;
&lt;admin-user&gt;admin&lt;admin-user&gt;
&lt;admin-password&gt;hackme&lt;admin-password&gt;
&lt;authentication&gt;
</pre>
<p>This section contains all the users and passwords used for administration purposes or to connect sources and relays.
</p>
<h4>source-password</h4>
<div class=indentedbox>
The unencrypted password used by sources to connect to icecast2. Currently, the username for all source connections must be 'source'. This is likely to change in the future.
</div>
<h4>relay-password</h4>
<div class=indentedbox>
Currently not used.
</div>
<h4>admin-user</h4>
<h4>admin-password</h4>
<div class=indentedbox>
The username/password used for all administration functions. This includes retrieving statistics, accessing the web-based administration screens, etc. A list of these functions can be found in the "Administration" section of the manual.
</div>
<br>
<br>
<br>
<a name="yp"></a>
<h2>YP Directory Settings</h2>
<pre>
&lt;directory&gt;
&lt;yp-url-timeout&gt;15&lt;yp-url-timeout&gt;
&lt;yp-url&gt;http://dir.xiph.org/cgi-bin/yp-cgi&lt;yp-url&gt;
&lt;directory&gt;
</pre>
<p>This section contains all the settings for listing a stream on any of the Icecast2 YP Directory servers. Multiple occurances of this section can be specified in order to be listed on multiple directory servers.
</p>
<h4>yp-url-timeout</h4>
<div class=indentedbox>
This value is the maximum time icecast2 will wait for a response from a particular directory server. The recommended value should be sufficient for most directory servers.
</div>
<h4>yp-url</h4>
<div class=indentedbox>
The URL which icecast2 uses to communicate with the Directory server. The value for this setting is provided by the owner of the Directory server.
</div>
<br>
<br>
<br>
<a name="misc"></a>
<h2>Misc Server Settings</h2>
<pre>
&lt;hostname&gt;localhost&lt;hostname&gt;
&lt;-- You can use these two if you only want a single listener --&gt;
&lt;-- &lt;port&gt;8000&lt;port&gt; --&gt;
&lt;-- &lt;bind-address&gt;127.0.0.1&lt;bind-address&gt; --&gt;
&lt;-- You may have multiple &lt;listener&gt; elements --&gt;
&lt;listen-socket&gt;
&lt;port&gt;8000&lt;port&gt;
&lt;bind-address&gt;127.0.0.1&lt;bind-address&gt;
&lt;listen-socket&gt;
&lt;fileserve&gt;1&lt;fileserve&gt;
</pre>
<p>This section contains miscellaneous server settings. Note that multiple listen-socket sections may be configured in order to have icecast2 listen on multiple network interfaces. If a bind-address is not specified for a particular listen-socket, then the hostname parameter will be used to specify the address that will be bound.
</p>
<h4>port</h4>
<div class=indentedbox>
The TCP port that will be used to accept client connections.
</div>
<h4>bind-address</h4>
<div class=indentedbox>
And option IP address that can be used to bind to a specific network card. If not supplied, then &lt;hostname&gt; will be used.
</div>
<h4>fileserve</h4>
<div class=indentedbox>
This flag turns on the icecast2 fileserver from which static files can be served. All files are served relative to the path specified in the &lt;paths&gt;&lt;webroot&gt; configuration setting.
</div>
<br>
<br>
<br>
<a name="relay"></a>
<h2>Relay Settings</h2>
<pre>
&lt;master-server&gt;127.0.0.1&lt;master-server&gt;
&lt;master-server-port&gt;8001&lt;master-server-port&gt;
&lt;master-update-interval&gt;120&lt;master-update-interval&gt;
&lt;master-password&gt;hackme&lt;master-password&gt;
&lt;relay&gt;
&lt;server&gt;127.0.0.1&lt;server&gt;
&lt;port&gt;8001&lt;port&gt;
&lt;mount&gt;example.ogg&lt;mount&gt;
&lt;local-mount&gt;different.ogg&lt;local-mount&gt;
&lt;relay-shoutcast-metadata&gt;0&lt;relay-shoutcast-metadata&gt;
&lt;relay&gt;
</pre>
<p>This section contains the server's relay settings. There are two types of relays: a "Master server relay" or a "Specific Mountpoint relay." A Master server relay is only supported between icecast2 servers and is used to relays all mountpoints on a remote icecast2 server.
<h3>Master Relay</h3>
The following diagram shows the basics of doing a Master relay. Note that Server 1 is configured with the &lt;master-server&gt;, &lt;master-server-port&gt;, etc settings and Server 2 is the server from which Server 1 will pull all attached mountpoints and relay them. Using a Master Server relay, ALL mountpoints on Server 2 will be relayed. If only specific mountpoints need to be relayed, then you must configure Server 1 as a "Specific Mountpoint Relay". Both Master server relays and Specific Mountpoint relays begin their "relaying" when the Server is started.
<pre>
|-----| |-----|
| | all mountpoints | | /mount1
| | &lt;------------------- | | /mount2.ogg
|-----| |-----| /mount3
Icecast 2 Icecast 2
Server 1 Server 2
(RELAY SERVER) (MASTER SERVER)
configured with
&lt;master-server&gt;
settings
</pre>
A server is configured as a Master Server relay by specifying the &lt;master-server&gt;, &lt;master-server-port&gt;,&lt;master-update-interval&gt;,&lt;master-password&gt; values in the config file. The server that is being relayed does not need any special configuration.
</p>
<h4>master-server</h4>
<div class=indentedbox>
This is the IP for the server which contains the mountpoints to be relayed (Master Server).
</div>
<h4>master-server-port</h4>
<div class=indentedbox>
This is the TCP Port for the server which contains the mountpoints to be relayed (Master Server).
</div>
<h4>master-update-interval</h4>
<div class=indentedbox>
The interval (in seconds) that the Relay Server will poll the Master Server for any new mountpoints to relay.
</div>
<h4>master-password</h4>
<div class=indentedbox>
This is the admin password on the Master server. It is used to query the server for a list of mountpoints to relay.
</div>
<br>
<h3>Specific Mountpoint Relay</h3>
The following diagram shows the basics of doing a Specific Mountpoint relay. Note that Server 1 is configured with the &lt;relay&gt; settings and Server 2 is the server from which Server 1 will pull the specified mountpoint(s) and relay them. Using a Specific Mountpoint Relay, only those mountpoints specified on Server 1 will be relayed from Server 2.
<pre>
|-----| |-----|
| | /mount3 | | /mount1
| | &lt;------------------- | | /mount2.ogg
|-----| |-----| /mount3
Icecast 2 Icecast 2/Shoutcast/Icecast
Server 1 Server 2
(RELAY SERVER) (REMOTE SERVER)
configured with
&lt;relay&gt;
settings
</pre>
Specific Mountpoint Relays can be configured to relay from an Icecast 2 server, as well as Icecast 1.x and Shoutcast.
A server is configured as a Specific Mountpoint Server relay by specifying a &lt;relay&gt; XML chunk in the config file for each mountpoint to be relayed. The server that is being relayed does not need any special configuration.
&lt;server&gt;127.0.0.1&lt;server&gt;
&lt;port&gt;8001&lt;port&gt;
&lt;mount&gt;example.ogg&lt;mount&gt;
&lt;local-mount&gt;different.ogg&lt;local-mount&gt;
&lt;relay-shoutcast-metadata&gt;0&lt;relay-shoutcast-metadata&gt;
</p>
<h4>server</h4>
<div class=indentedbox>
This is the IP for the server which contains the mountpoint to be relayed.
</div>
<h4>port</h4>
<div class=indentedbox>
This is the TCP Port for the server which contains the mountpoint to be relayed.
</div>
<h4>mount</h4>
<div class=indentedbox>
The mountpoint located on the remote server. If you are relaying a shoutcast stream, this must be '/'.
</div>
<h4>local-mount</h4>
<div class=indentedbox>
The name to use for the local mountpoint. This is what the mount will be named on the RELAY SERVER.
</div>
<h4>relay-shoutcast-metadata</h4>
<div class=indentedbox>
If you are relaying a Shoutcast stream, you need to specify this indicator to also relay the metadata (song titles) that is part of the Shoutcast stream (1=enabled, 0=disabled).
</div>
<br>
<br>
<br>
<a name="mount"></a>
<h2>Mount Specific Settings</h2>
<pre>
&lt;mount&gt;
&lt;mount-name&gt;/example-complex.ogg&lt;mount-name&gt;
&lt;username&gt;othersource&lt;username&gt;
&lt;password&gt;hackmemore&lt;password&gt;
&lt;max-listeners&gt;1&lt;max-listeners&gt;
&lt;dump-file&gt;/tmp/dump-example1.ogg&lt;dump-file&gt;
&lt;fallback-mount&gt;example2.ogg&lt;fallback-mount&gt;
&lt;authentication type="htpasswd"&gt;
&lt;option name="filename" value="myauth"/&gt;
&lt;option name="allow_duplicate_users" value="0"/&gt;
&lt;/authentication&gt;
&lt;mount&gt;
</pre>
<p>This section contains settings which apply only to a specific mountpoint. Within this section you can reserve a specific mountpoint and set a source username/password for that mountpoint (not yet implemented) as well as specify individual settings which will apply only to the supplied mountpoint.
</p>
<h4>mount-name</h4>
<div class=indentedbox>
The name of the mount point for which these settings apply.
</div>
<h4>username</h4>
<div class=indentedbox>
An optional value which will set the username that a source must use to connect using this mountpoint.
</div>
<h4>password</h4>
<div class=indentedbox>
An optional value which will set the password that a source must use to connect using this mountpoint.
</div>
<h4>max-listeners</h4>
<div class=indentedbox>
An optional value which will set the maximum number of listeners that can be attached to this mountpoint.
</div>
<h4>dump-file</h4>
<div class=indentedbox>
An optional value which will set the filename which will be a dump of the stream coming through on this mountpoint.
</div>
<h4>fallback-mount</h4>
<div class=indentedbox>
This specifies a mountpoint that is used in the case of a source disconnect. If listeners are connected to the mount specified by the &lt;mount-name&gt; config value, then if the source is disconnected; all currently connected clients will be moved to the fallback-mount.
</div>
<h4>authentication</h4>
<div class=indentedbox>
This specifies that the named mount point will require listener authentication. Currently, we only support a file-based authentication scheme (type=htpasswd). Users and encrypted password are placed in this file (separated by a :) and all requests for this mountpoint will require that a user and password be supplied for authentication purposes. These values are passed in via normal HTTP Basic Authentication means (i.e. http://user:password@stream:port/mountpoint.ogg). Users and Passwords are maintained via the web admin interface. A mountpoint configured with an authenticator will display a red key next to the mount point name on the admin screens. You can read more about listener authentication <a href="icecast2_listenerauth.html">here</a>.
</div>
<br>
<br>
<br>
<a name="path"></a>
<h2>Path Settings</h2>
<pre>
&lt;paths&gt;
&lt;basedir&gt;./&lt;basedir&gt;
&lt;logdir&gt;./logs&lt;logdir&gt;
&lt;pidfile&gt;./icecast.pid&lt;pidfile&gt;
&lt;webroot&gt;./web&lt;webroot&gt;
&lt;adminroot&gt;./admin&lt;adminroot&gt;
&lt;alias source="/foo" dest="/bar"/&gt;
&lt;paths&gt;
</pre>
<p>This section contains paths which are used for various things within icecast. All paths should not end in a '/'.
</p>
<h4>basedir</h4>
<div class=indentedbox>
This path is used in conjunction with the chroot settings, and specified the base directory that is chrooted to when the server is started. This feature is not supported on win32.
</div>
<h4>logdir</h4>
<div class=indentedbox>
This path specifies the base directory used for logging. Both the error.log and access.log will be created relative to this directory.
</div>
<h4>pidfile</h4>
<div class=indentedbox>
This pathname specifies the file to write at startup and to remove at normal shutdown. The file contains the process id of the icecast process. This could be read and used for sending signals icecast.
</div>
<h4>webroot</h4>
<div class=indentedbox>
This path specifies the base directory used for all static file requests. This directory can contain all standard file types (including mp3s and ogg vorbis files). For example, if webroot is set to /var/share/icecast2, and a request for http://server:port/mp3/stuff.mp3 comes in, then the file /var/share/icecast2/mp3/stuff.mp3 will be served.
</div>
<h4>adminroot</h4>
<div class=indentedbox>
This path specifies the base directory used for all admin requests. More specifically, this is used to hold the XSLT scripts used for the web-based admin interface. The admin directory contained within the icecast distribution contains these files.
</div>
<h4>alias source="/foo" dest="/bar"</h4>
<div class=indentedbox>
Aliases are used to provide a way to create multiple mountpoints that refer to the same mountpoint.
</div>
<br>
<br>
<br>
<a name="log"></a>
<h2>Logging Settings</h2>
<pre>
&lt;logging&gt;
&lt;accesslog&gt;access.log&lt;/accesslog&gt;
&lt;errorlog&gt;error.log&lt;/errorlog&gt;
&lt;loglevel&gt;4&lt;/loglevel&gt; &lt;-- 4 Debug, 3 Info, 2 Warn, 1 Error --&gt;
&lt;/logging&gt;
</pre>
<p>This section contains information relating to logging within icecast. There are two logfiles currently generated by icecast, an error.log (where all log messages are placed) and an access.log (where all stream/admin/http requests are logged).
</p>
<p>Note that on non-win32 platforms, a HUP signal can be sent to icecast in which the log files are re-opened for appending giving the ability move/remove the log files.
<h4>accesslog</h4>
<div class=indentedbox>
Into this file, all requests made to the icecast2 will be logged. This file is relative to the path specified by the &lt;logdir&gt; config value.
</div>
<h4>errorlog</h4>
<div class=indentedbox>
All icecast generated log messages will be written to this file. If the loglevel is set too high (Debug for instance) then this file can grow fairly large over time. Currently, there is no log-rotation implemented.
</div>
<h4>loglevel</h4>
<div class=indentedbox>
Indicates what messages are logged by icecast. Log messages are categorized into one of 4 types, Debug, Info, Warn, and Error.<br><br>The following mapping can be used to set the appropraite value :
</div>
<br>
<br>
<li>loglevel = 4 - Debug, Info, Warn, Error messages are printed
<li>loglevel = 3 - Info, Warn, Error messages are printed
<li>loglevel = 2 - Warn, Error messages are printed
<li>loglevel = 1 - Error messages only are printed
<br>
<a name="security"></a>
<h2>Security Settings</h2>
<pre>
&lt;security&gt;
&lt;chroot&gt;0&lt;/chroot&gt;
&lt;changeowner&gt;
&lt;user&gt;nobody&lt;/user&gt;
&lt;group&gt;nogroup&lt;/group&gt;
&lt;/changeowner&gt;
&lt;/security&gt;
</pre>
<p>This section contains configuration settings that can be used to secure the icecast server by performing a chroot to a secured location. This is currently not supported on win32.
</p>
<h4>chroot</h4>
<div class=indentedbox>
An indicator which specifies whether a chroot() will be done when the server is started. The chrooted path is specified by the &lt;basedir&gt; configuration value.
</div>
<h4>changeowner</h4>
<div class=indentedbox>
This section indicates the user and group that will own the icecast process when it is started. These need to be valid users on the system.
</div>
</div>
</body>
</html>

View File

@ -1,85 +0,0 @@
<LINK REL=STYLESHEET TYPE= "text/css" HREF= "style.css">
<div class=boxtest>
<body bgcolor="#efefef" text="#323232" link="#0000ff" vlink="#800080" alink="#ff0000">
<h1>Icecast 2 FAQ</h1>
<table width=100%><tr><td bgcolor="#007B79" height="10" align="center"></td></tr></table>
<br>
<br>
<br>
<h2>General Questions</h2>
<h4>What is Icecast?</h4>
<div class=indentedbox>
<p>
Icecast, the project, is a collection of programs and libraries for
streaming audio over the Internet. This includes:
</p>
<ul>
<li>icecast, a program that streams audio data to listeners</li>
<li>libshout, a library for communicating with Icecast servers</li>
<li>IceS, a program that sends audio data to Icecast servers</li>
</ul>
A source client is an external program which is responsible for sending content data to icecast. Some source clients that support icecast2 are Oddcast, ices2, ices0.3, and DarkIce.
</div>
<h4>What is icecast, the program?</h4>
<div class=indentedbox>
<p>
icecast streams audio to listeners, and is compatible with Nullsofts Shoutcast.
</p>
</div>
<h4>What is libshout ?</h4>
<div class=indentedbox>
<p>
From the README:
</p>
<blockquote>
<p>
libshout is a library for communicating with and sending data to an icecast server.
It handles the socket connection, the timing of the data, and prevents bad data from getting to the icecast server.
</p>
</blockquote>
</div>
<h4>What is IceS?</h4>
<div class=indentedbox>
<p>
IceS is a program that sends audio data to an icecast server to broadcast to clients.
IceS can either read audio data from disk,
such as from Ogg Vorbis files, or sample live audio from a sound card and encode it on the fly.
</p>
</div>
<h4>How can I view the stream status page?</h4>
<div class=indentedbox>
<p>
Check your icecast configuration file for an element
called &lt;webroot&gt;. This directory contains web stuff.
In it, place a file called “status.xsl” that
transforms an <acronym>XML</acronym> file containing stream
data into a web page
(either <acronym>XHTML</acronym> or <acronym>HTML</acronym>).
</p>
<p>
There are sample <acronym>XSL</acronym> stylesheets available
in icecast/web/ in the CVS distribution
of icecast.
</p>
<p>
In addition, the web directory can
hold multiple status transforms, if you cant decide which
one you want.
</p>
</div>
<h4>What can I use to listen to an Icecast stream?</h4>
<div class=indentedbox>
<p>
We maintain a list of Icecast-compatible audio players at
http://www.icecast.org/
</p>
</div>
</div>
</body>
</html>

View File

@ -1,37 +0,0 @@
<LINK REL=STYLESHEET TYPE= "text/css" HREF= "style.css">
<div class=boxtest>
<body bgcolor="#efefef" text="#323232" link="#0000ff" vlink="#800080" alink="#ff0000">
<h1>Icecast 2 Glossary</h1>
<table width=100%><tr><td bgcolor="#007B79" height="10" align="center"></td></tr></table>
<br>
<br>
<br>
<a name="source client"></a>
<h4>source client</h4>
<div class=indentedbox>
A source client is an external program which is responsible for sending content data to icecast. Some source clients that support icecast2 are Oddcast, ices2, ices0.3, and DarkIce.
</div>
<a name="slave server"></a>
<h4>slave server (Relay)</h4>
<div class=indentedbox>
The slave server in a relay configuration is the server that is pulling the data from the master server. It acts as a listening client to the master server.
</div>
<a name="master server"></a>
<h4>master server (Relay)</h4>
<div class=indentedbox>
The master server in a relay configuration is the server that has the stream that is being relayed.
</div>
<a name="mountpoint"></a>
<h4>mountpoint</h4>
<div class=indentedbox>
A mountpoint is a resource on the icecast server that represents a single broadcast stream. Mountpoints are named similar to files (/mystream.ogg, /mymp3stream). When listeners connect to icecast2, they must specify the mountpoint in the request (i.e. http://192.168.1.10:8000/mystream.ogg). Additionally, source clients must specify a mountpoint when they connect as well. Statistics are kept track of by mountpoint. Mountpoints are a fundamental aspect of icecast2 and how it is organized.
</div>
<a name="fallback"></a>
<h4>fallback mountpoint</h4>
<div class=indentedbox>
A fallback mountpoint is configured with a parent mountpoint. In the event of the parent mountpoint losing connection with icecast, Icecast will then move all clients currently connected to the now defunct mountpoint to it's fallback mountpoint.
</div>
</div>
</body>
</html>

View File

@ -1,43 +0,0 @@
<LINK REL=STYLESHEET TYPE= "text/css" HREF= "style.css">
<div class=boxtest>
<body bgcolor="#efefef" text="#323232" link="#0000ff" vlink="#800080" alink="#ff0000">
<h1>Icecast 2 Introduction</h1>
<table width=100%><tr><td bgcolor="#007B79" height="10" align="center"></td></tr></table>
<br>
<br>
<br>
<h2>What is Icecast ?</h2>
<p>Icecast is a streaming media server which currently supports Ogg Vorbis and MP3 audio streams. It can be used to create an Internet radio station or a privately running jukebox and many things in between. It is very versatile in that new formats can be added relatively easily and supports open standards for commuincation and interaction.</p>
<br>
<p>There are two major parts to most streaming media servers: the component providing the content (what we call <b>source clients</b>) and the component which is responsible for serving that content to listeners (this is the function of icecast).
</p>
<br>
<br>
<br>
<h2>What platforms are supported ?</h2>
<p>Currently the following Unix platforms are supported:</p>
<li>Linux (Most flavors including Redhat and Debian)
<li>FreeBSD
<li>OpenBSD
<li>Solaris
<p>Currently the following Windows platforms are supported:</p>
<li>Windows NT
<li>Windows 2000
<li>Windows XP
<br>
<br>
<br>
<h2>Where do I go for questions?</h2>
<p>There are many ways to contact the icecast development team</p>
<h3>Best Ways</h3>
<li>Icecast mailing list <a href="http://www.xiph.org/archives">http://www.xiph.org/archives</a>
<li>Icecast Developers mailing list <a href="http://www.xiph.org/archives">http://www.xiph.org/archives</a>
<li>Icecast IRC chat room - irc.freenode.net : #icecast
<h3>Alternate Ways</h3>
<li>team@icecast.org
<br>
<br>
<br>
</div>
</body>
</html>

View File

@ -1,54 +0,0 @@
<LINK REL=STYLESHEET TYPE= "text/css" HREF= "style.css">
<div class=boxtest>
<body bgcolor="#efefef" text="#323232" link="#0000ff" vlink="#800080" alink="#ff0000">
<h1>Icecast 2 Listener Authentication</h1>
<table width=100%><tr><td bgcolor="#007B79" height="10" align="center"></td></tr></table>
<br>
<br>
<br>
<h2>Listener Authentication</h2>
<p>Listener authentication is a feature of icecast which allows you to secure certain mountpoint so that in order to listen, a listener must provide a username and password. With this feature a simple pay-for-play operation can be setup. This section will show you the basics of setting up and maintaining this component.</p>
<br>
<br>
<br>
<h2>HTPASSWD Listener Authentication</h2>
<h3>Config File Entries</h3>
<p>In order to use listener authentication, you MUST configure a mount specific option. This means that you have to provide a &lt;mount&gt; section in the main icecast config file. The following is an example :</p>
<pre>
&lt;mount&gt;
&lt;mount-name&gt;/example-complex.ogg&lt;/mount-name&gt;
&lt;authentication type="htpasswd"&gt;
&lt;option name="filename" value="myauth"/&gt;
&lt;option name="allow_duplicate_users" value="0"/&gt;
&lt;/authentication&gt;
&lt;/mount&gt;
</pre>
<p>To support listener authentication you MUST provide at a minimum &lt;mount-name&gt; and &lt;authentication&gt;. The mount-name is the name of the mountpoint that you will use to connect your source client with and authentication configures what type of icecast2 authenticator to use. Currently, only a single type "htpasswd" is implemented. New authenticators will be added later. Each authenticator has a variable number of options that are required and these are specified as shown in the example. The htpasswd authenticator requires a few parameters. The first, filename, specifies the name of the file to use to store users and passwords. Note that this file need not exist (and probably will not exist when you first set it up). Icecast has built-in support for managing users and passwords via the web admin interface. More on this later in this section. The second option, allow_duplicate_users, if set to 0, will prevent multiple connections using the same username. Setting this value to 1 will enable mutltiple connections from the same username on a given mountpoint. Note there is no way to specify a "max connections" for a particular user.
<p>Icecast supports a mixture of streams that require listener authentication and those that do not. Only mounts that are named in the config file can be configured for listener authentication.</p>
<br>
<br>
<br>
<h3>Configuring Users and Passwords</h3>
<p>Once the appropriate entries are made to the config file, connect your source client (using the mountpoint you named in the config file). To configure users and passwords for this stream you must use the web-based admin interface. Navigate to http://server:ip/admin/stats.xsl to begin. If you have configured everything properly, you should see a screen like the following :</p>
<img border=1 src="listener_auth1.jpg">
<p>You will see a red key in front of all mountpoint configured for listener authentication. Also note that this page will only show CONNECTED mountpoints.</p>
<p>To manage users and passwords for this mountpoint, click on the red key or follow the "Manage Authentication" link. The following screen will be shown :</p>
<img border=1 src="listener_auth2.jpg">
<p>This screen will show all the users configured for this mountpoint. Adding users is as simple as entering a username and password in the fields and clicking "Add New User". Note that usernames MUST be unique and there are NO restrictions on passwords. You can delete users by clicking the appropriate delete link next to each user.</p>
<br>
<br>
<br>
<h3>Finishing it all off</h3>
<p>Ok, so you've created your users, and you have everything setup properly, how do your users login ? Well, we've provided a simple login form that you can use for this purpose. This page (http://server:port/auth.xsl) will bring up a form that users can use to enter their username and password.</p>
<img border=1 src="listener_auth3.jpg">
<p>This page will serve a m3u with the username and password and in most cases should open the correct media player and begin playing your stream</p>
<br>
<br>
<br>
<h2>A note about players and authentication</h2>
<p>We do not have an exaustive list of players that support listener authentication. We use standard HTTP basic authentication, and in general, many media players support this if they support anything at all. Winamp and Foobar2000 support HTTP basic authentication on windows, and XMMS supports it on unix platforms.</p>
</div>
</body>
</html>

View File

@ -1,47 +0,0 @@
<LINK REL=STYLESHEET TYPE= "text/css" HREF= "style.css">
<div class=boxtest>
<body bgcolor="#efefef" text="#323232" link="#0000ff" vlink="#800080" alink="#ff0000">
<h1>Icecast 2 Relaying</h1>
<table width=100%><tr><td bgcolor="#007B79" height="10" align="center"></td></tr></table>
<br>
<br>
<br>
<h2>Overview</h2>
<p>Relaying is the process by which one server mirrors one or more streams from a remote server. The servers need not be of the same type (i.e. icecast can relay from Shoutcast). Relaying is used primarily for large broadcasts that need to distribute listening clients across multiple physical machines.</p>
<br>
<br>
<h2>Type of Relays</h2>
<p>There are two types of relays that icecast supports. The first type is when both master and slave servers are icecast2 servers. In this case, a "master-slave" relay can be setup such that all that needs to be done is configure the slave server with the connection information (serverip:port) of the master server and the slave will mirror all mountpoints on the master server. The slave will also periodically check the master server to see if any new mountpoints have attached and if so will relay those as well. The second type of relay is a "single-broadcast" relay. In this case, the slave server is configured with a serverip+port+mount and only the mountpoint specified is relayed. In order to relay a broadcast stream on a Shoutcast server, you must use the "single-broadcast" relay and specify a mountpoint of "/".</p>
<br>
<br>
<br>
<h2>Setting Up A Master-Slave Relay</h2>
<p>In order to setup a relay of this type both servers (the one you wish to relay and the one doing the relaying) need to be icecast2 servers. The following configuration snippet is used as an example:</p>
<pre>
&lt;master-server&gt;192.168.1.11&lt;/master-server&gt;
&lt;master-server-port&gt;8001&lt;/master-server-port&gt;
&lt;master-update-interval&gt;120&lt;/master-update-interval&gt;
&lt;master-password&gt;hackme&lt;/master-password&gt;
</pre>
In this example, this configuration is setup in the server which will be doing the relaying (slave server). The master server in this case need not be configured (and actually is unaware of the relaying being performed) as a relay. When the slave server is started, it will connect to the master server located at 192.168.1.11:8001 and will begin to relay all mountpoints connected to the master server. Additionally, every master-update-interval (120 seconds in this case) the slave server will poll the master server to see if any new mountpoints have connected, and if so, the slave server will relay those as well. Note that the names of the mountpoints on the slave server will be identical to those on the master server.
<br>
<br>
<br>
<h2>Setting Up A Single-Broadcast Relay</h2>
<p>In this case, the master server need not be an icecast2 server. Supported master servers for a single-broadcast relay are Shoutcast, Icecast1.x, and of course Icecast2. The following configuration snippet is used as an example:</p>
<pre>
&lt;relay&gt;
&lt;server&gt;192.168.1.11&lt;/server&gt;
&lt;port&gt;8001&lt;/port&gt;
&lt;mount&gt;/example.ogg&lt;/mount&gt;
&lt;local-mount&gt;/different.ogg&lt;/local-mount&gt;
&lt;relay-shoutcast-metadata&gt;0&lt;/relay-shoutcast-metadata&gt;
&lt;/relay&gt;
</pre>
<p>In this example, this configuration is also setup in the server which will be doing the relaying (slave server). The master server in this case need not be configured (and actually is unaware of the relaying being performed) as a relay. When the slave server is started, it will connect to the master server located at 192.168.1.11:8001 and will begin to relay only the mountpoint specified (/example.ogg in this case). Using this type of relay, the user can override the local mountpoint name and make it something entirely different than the one on the master server. Additionally, if the server is a Shoutcast server, then the &lt;mount&gt; must be specified as /. And if you want the Shoutcast relay stream to have metadata contained within it (Shoutcast metadata is embedded in the stream itself) then the &lt;relay-shoutcast-metadata&gt; needs to be set to 1.</p>
<br>
<br>
<br>
</div>
</body>
</html>

View File

@ -1,83 +0,0 @@
<LINK REL=STYLESHEET TYPE= "text/css" HREF= "style.css">
<div class=boxtest>
<body bgcolor="#efefef" text="#323232" link="#0000ff" vlink="#800080" alink="#ff0000">
<h1>Icecast 2 Server Statistics</h1>
<table width=100%><tr><td bgcolor="#007B79" height="10" align="center"></td></tr></table>
<br>
<br>
<br>
<h2>Overview</h2>
<p>This section contains information about the server statistics available from icecast. An example stats XML tree will be shown and each element will be described. The following example stats tree will be used:</p>
<pre>
&lt;?xml version="1.0"?&gt;
&lt;icestats&gt;
&lt;client_connections&gt;13&lt;/client_connections&gt;
&lt;connections&gt;14&lt;/connections&gt;
&lt;source_connections&gt;1&lt;/source_connections&gt;
&lt;sources&gt;1&lt;/sources&gt;
&lt;source mount="/test.ogg"&gt;
&lt;artist&gt;&lt;/artist&gt;
&lt;audio_info&gt;ice-samplerate=32000;ice-bitrate=Quality -1;ice-channels=1&lt;/audio_info&gt;
&lt;ice-bitrate&gt;Quality -1&lt;/ice-bitrate&gt;
&lt;ice-channels&gt;1&lt;/ice-channels&gt;
&lt;ice-samplerate&gt;32000&lt;/ice-samplerate&gt;
&lt;listeners&gt;0&lt;/listeners&gt;
&lt;public&gt;0&lt;/public&gt;
&lt;title&gt;&lt;/title&gt;
&lt;type&gt;Ogg Vorbis&lt;/type&gt;
&lt;/source&gt;
&lt;/icestats&gt;
</pre>
<h3>General Statistics</h3>
<h4>client-connections</h4>
<div class=indentedbox>
Client connections are basically anything that is not a source connection. These include listeners (not concurrent, but cumulative), any admin function accesses, and any static content (file serving) accesses.
</div>
<h4>source-connections</h4>
<div class=indentedbox>
Source connections are the number of times (cumulative not currently connected) a source has connected to icecast.
</div>
<h4>connections</h4>
<div class=indentedbox>
The total of client + source connections.
</div>
<h4>sources</h4>
<div class=indentedbox>
The total of currently connected sources (mountpoints).
</div>
<h3>Source-specific Statistics</h3>
<h4>artist</h4>
<div class=indentedbox>
Artist of the current song (metadata set by source client).
</div>
<h4>title</h4>
<div class=indentedbox>
Title of the current song (metadata set by source client).
</div>
<h4>audio-info</h4>
<div class=indentedbox>
Information about the bitrate/samplerate/quality of the stream (set by source client). Also used for YP entries.
</div>
<h4>ice-bitrate</h4>
<h4>ice-samplerate</h4>
<h4>ice-channels</h4>
<div class=indentedbox>
Information about the bitrate/samplerate/quality of the stream (set by source client).
</div>
<h4>listeners</h4>
<div class=indentedbox>
The number of currently connected listeners.
</div>
<h4>public</h4>
<div class=indentedbox>
Flag that indicates whether this mount is being listed on a YP (sey by source client).
</div>
<h4>type</h4>
<div class=indentedbox>
Media type of the stream.
</div>
<br>
<br>
<br>
</body>
</html>

View File

@ -1,54 +0,0 @@
<!doctype html public "-//w3c//dtd html 3.2//en">
<LINK REL=STYLESHEET TYPE= "text/css" HREF= "style.css">
<div class="boxtest">
<h1>Icecast 2 - Win32 Specific Documentation</h1>
<table width=100%><tr><td bgcolor="#007B79" height="10" align="center"></td></tr></table>
<p>
The win32 port of icecast2 is simply a UI framework around the core icecast2 server. The win32 version of icecast2 directly uses the main executable of icecast (statically included) and simply provides a GUI interface to icecast2.
</p>
<p>
Most of the features of icecast2 are available in the win32 port.
</p>
<h2>Server Status Tab</h2>
<p>
The server status tab contains information regarding statistics that are global to the server. There are two types of statistics in icecast2: source level and global statistics. Global statistics are cumulative stats from all sources offered by the server. Source level statistics are stats which apply only to a single source attached to the server.
</p>
<p>
Examples of global statistics are:
</p>
<pre>
The number of current sources connected
The number of sources that have attempted connections
Total number of attempted connections to the server
</pre>
</p>
<p>
The Server Status tab contains at a minimal the global stats for the server. Additionally, you may add source specific stats to this tab. The intent is to provide a single "dashboard view" of what's going on in the server. To add source statistics to the Server Status tab, see the section on the Stats tab.
</p>
<h3>Adding stats to the window title</h3>
<p>
Any stat that is contained on the Server Status tab can be displayed as the icecast2 window title. This provides yet another mechanism by which you can view activities on the server. To enable this feature, right click on any stat in the Server Status tab as seen below :
</p>
<img src="windowtitle.jpg">
<br>
<br>
<br>
<h3>Removing source level stats from the Server Status Tab</h3>
<p>
To remove a source level stat that you have inserted onto the Server Status Tab, simple right click that statistic and select "Delete from Global Stats". The stat will be deleted from the Server Status tab, but will still remain on the source level Stats tab.
</p>
<h2>Editing The Icecast Config File</h2>
<p>
Editing the icecast2 configuration file is a very simple process. For a description of what each field means, see the main icecast documenation. Changes to the icecast2 configuration can only be done while the server is stopped. To edit the current server configuration file, select "Configuration/Edit Configuration" from the main menu.
</p>
<h2>Stats Tab</h2>
<p>
The stats tab contains a view of all the connected mountpoints and the statistics that go along with them. Each connected mountpoint is displayed in the left pane of the window, and all stats for the selected mountpoint are displayed in the right pane of the window.
</p>
<img src="stats1.jpg">
</div>
</body>
</html>

View File

@ -1,36 +0,0 @@
<LINK REL=STYLESHEET TYPE= "text/css" HREF= "style.css">
<div class=boxtest>
<body bgcolor="#efefef" text="#323232" link="#0000ff" vlink="#800080" alink="#ff0000">
<h1>Icecast 2 YP Directories</h1>
<table width=100%><tr><td bgcolor="#007B79" height="10" align="center"></td></tr></table>
<br>
<br>
<br>
<h2>Overview</h2>
<p>A YP (Yellow Pages) directory is a listing of broadcast streams. Icecast2 has it own YP directory located at http://dir.xiph.org. Currently icecast2 can only be listed in an icecast2-supported YP directory. This means that you cannot list your stream in the Shoutcast YP directory.</p>
<p>In the icecast2 configuration file are all the currently available YP directory servers. Listing your stream in a YP is a combination of settings in the icecast configuration file and also in your source client.</p>
<br>
<br>
<br>
<h2>Configuring icecast2 for YP Support</h2>
<p>First of all, icecast must have been built with YP support. This is automatically done if you have libcurl installed. If libcurl is not detected when icecats is compiled, then YP support is disabled.</p>
<p>If icecast has been built with YP support, then the following configuration options control the YP directory settings:</p>
<pre>
&lt;directory&gt;
&lt;yp-url-timeout&gt;15&lt;yp-url-timeout&gt;
&lt;yp-url&gt;http://dir.xiph.org/cgi-bin/yp-cgi&lt;yp-url&gt;
&lt;directory&gt;
</pre>
<p>Multiple directory XML chunks can be specified in order to be listed in multiple directories.</p>
<br>
<br>
<br>
<h2>Configuring Your Source Client for YP Support</h2>
<p>This is usually covered in the source client documentation. More specifically, the source client needs to provide the HTTP header ice-public:1 on connect in order to enable YP listing of the stream.</p>
<p>If a mountpoint is being listed on a YP, then you will see some additional statistics relating to the YP such as last-touch, currently-playing, etc.</p>
<br>
<br>
<br>
</div>
</body>
</html>

View File

@ -1,76 +0,0 @@
<LINK REL=STYLESHEET TYPE= "text/css" HREF= "style.css">
<div class=boxtest>
<body bgcolor="#efefef" text="#323232" link="#0000ff" vlink="#800080" alink="#ff0000">
<h1>Icecast 2 Documentation Table of Contents</h1>
<table width=100%><tr><td bgcolor="#007B79" height="10" align="center"></td></tr></table>
<li><a href="icecast2_introduction.html">Introduction</a>
<li><a href="icecast2_basicsetup.html">Basic Setup</a>
<li><a href="icecast2_config_file.html">Icecast Config File</a>
<li><a href="icecast2_admin.html">Admin Interface</a>
<li><a href="icecast2_stats.html">Server Statistics</a>
<li><a href="icecast2_relay.html">Relaying</a>
<li><a href="icecast2_yp.html">Listing in a YP directory</a>
<li><a href="icecast2_listenerauth.html">Listener Authentication</a>
<li><a href="icecast2_win32.html">Win32 specific documentation</a>
<li><a href="icecast2_glossary.html">Glossary</a>
<li><a href="icecast2_faq.html">FAQ</a>
<pre>
icecast 2.x - README
---------------------------------------------------------------------
Icecast is a streaming media server which currently supports Ogg
Vorbis and MP3 audio streams. It can be used to create an Internet
radio station or a privately running jukebox and many things in
between. It is very versatile in that new formats can be added
relatively easily and supports open standards for commuincation and
interaction.
Prerequisites
---------------------------------------------------------------------
icecast requires the following packages :
* libxml2 - http://xmlsoft.org/downloads.html
* libxslt - http://xmlsoft.org/XSLT/downloads.html
* curl - http://curl.haxx.se/download.html (>= version 7.10 required)
NOTE: icecast may be compiled without curl, however this will
disable all Directory server interaction (YP).
* ogg/vorbis - http://www.vorbis.com/files (>= version 1.0 required)
A Note About RPMS
---------------------------------------------------------------------
This section only applies to you if your operating system uses RPMS.
In order to build icecast, you will need to install the "devel" RPM
packages for each of the prerequisite packages in addition to the
normal RPMS for each package.
please check the websites for each of the prerequisite packages for
appropriate download links for RPMS.
Build/Install
---------------------------------------------------------------------
To build icecast on a Unix platform, perform the following :
Run
./configure
make
make install
To build and install this release.
A sample config file will be placed in /usr/local/etc (on UNIX) or in
the current working directory (on Win32) and is called icecast.xml
Documentation for icecast is available in the doc directory, by
viewing doc/icecast2_TOC.html in a browser.
Please email us at icecast@xiph.org or icecast-dev@xiph.org, or come and see
us at irc.freenode.net, channel #icecast, if you have any troubles.
</pre>

View File

@ -1,19 +0,0 @@
<!doctype html public "-//w3c//dtd html 3.2//en">
<LINK REL=STYLESHEET TYPE= "text/css" HREF= "style.css">
<html>
<head>
<title>Icecast2 Win32</title>
</head>
<div class="boxtest">
<h1>Icecast 2 - Win32 Specific Documentation</h1>
<table width=100%><tr><td bgcolor="#007B79" height="10" align="center"></td></tr></table>
<p>
The win32 port of icecast2 is simply a UI framework around the core icecast2 server. The win32 version of icecast2 uses directly the main executable of icecast (statically included) and simply provides a nicer, friendlier interface to icecast2.
</p>
<p>
All of the features of icecast2 are available in the win32 port.
</p>
</div>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

View File

@ -1,79 +0,0 @@
.ahem { display: none }
body {
font-family:'Lucida Grande', Verdana, Geneva, Lucida, sans-serif;
background:#000000;
link:#FFFFFF;
text:#323232;
vlink:#FFFFFF;
alink:#FFFFFF;
}
a {
font-weight: bold;
text-decoration: none;
}
a:link { color: #ff0; }
a:visited { color: #cc3; }
a:hover { color: #f00; }
code,pre {
font-size:90%;
color:#ffffff;
font-family:"Courier New",monospace;
background:#777777;
padding:0 0.5em
}
td {
color:#ffffff;
}
pre { padding:0.5em }
blockquote { margin:0.5em }
blockquote p { margin:0 }
.width300 { width:300px; background:red }
.width400 { width:400px; background:blue }
p.ruletest { color:red }
div.boxtest {
border:2px solid;
padding:30px;
background: #555555;
width:80%;;
color:#ffffff;
}
div.smallbox{
border:2px solid;
padding:40px;
background: #ffc;
width:600px;
text:#FFFFFF;
}
div.indentedbox {
border:0px solid;
padding:10px;
background: #779;
}
div.content {
border:20px solid;
padding:30px;
background: #ffc;
}
div.content {
width:400px;
voice-family: "\"}\"";
voice-family:inherit;
width:300px;
}
/* CSS1 UAs should see and use 2nd width */
html>body .content { width:300px }
p.ruletest { color: blue }

View File

@ -1,34 +0,0 @@
<LINK REL=STYLESHEET TYPE= "text/css" HREF= "style.css">
<div class=boxtest>
<body bgcolor="#efefef" text="#323232" link="#0000ff" vlink="#800080" alink="#ff0000">
<h1>Server Status Tab</h1>
<table width=100%><tr><td bgcolor="#007B79" height="10" align="center"></td></tr></table>
<h3>Overview</h3>
<p>
The server status tab contains information regarding statistics that are global to the server. There are two types of statistics in icecast2, source level and global statistics. Global statistics are those that are accumilations of stats from all sources offered by the server. Source level statistics are stats which apply only to a single source attached to the server.
</p>
<p>
Examples of global statistics are :
</p>
<pre>
The number of current sources connected
The number of sources that have attempted connections
Total number of attempted connections to the server
</pre>
</p>
<p>
The Server Status tab contains at a minimal the global stats for the server. Additionally, you may add source specific stats to this tab. The intent is to provide a single "dashboard view" of what's going on in the server. To add source statistics to the Server Status tab, see the section on the <a href="win32_section3.html">Stats</a> tab.
</p>
<h3>Adding stats to the window title</h3>
<p>
Any stat that is contained on the Server Status tab can be displayed as the icecast2 window title. This provides yet another mechanism by which you can view activities on the server. To enable this feature, right click on any stat in the Server Status tab as seen below :
</p>
<img src="windowtitle.jpg">
<p>
<h3>Removing source level stats from the Server Status Tab</h3>
<p>
To remove a source level stat that you have inserted onto the Server Status Tab, simple right click that statistic and select "Delete from Global Stats". The stat will be deleted from the Server Status tab, but will still remain on the source level Stats tab.
</p>
</p>
</div>

View File

@ -1,9 +0,0 @@
<LINK REL=STYLESHEET TYPE= "text/css" HREF= "style.css">
<div class=boxtest>
<body bgcolor="#efefef" text="#323232" link="#0000ff" vlink="#800080" alink="#ff0000">
<h1>Editing A Config File</h1>
<table width=100%><tr><td bgcolor="#007B79" height="10" align="center"></td></tr></table>
<p>
Editing the icecast2 configuration file is a very simple process. For a description of what each field means, see the main icecast documenation. Changes to the icecast2 configuration can only be done while the server is stopped. To edit the current server configuration file, select "Configuration/Edit Configuration" from the main menu.
</p>
</div>

View File

@ -1,9 +0,0 @@
<LINK REL=STYLESHEET TYPE= "text/css" HREF= "style.css">
<div class=boxtest>
<h1>Stats Tab</h1>
<table width=100%><tr><td bgcolor="#007B79" height="10" align="center"></td></tr></table>
<p>
Explanation of the stats tab here
</p>
<img src="stats1.jpg"><br>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

View File

@ -1,58 +0,0 @@
Name: icecast
Version: 2.0.0
Release: 1
Summary: Xiph Streaming media server that supports multiple audio formats.
Group: Applications/Multimedia
License: GPL
URL: http://www.icecast.org/
Vendor: Xiph.org Foundation <team@icecast.org>
Source: http://www.icecast.org/files/%{name}-%{version}.tar.gz
Prefix: %{_prefix}
BuildRoot: %{_tmppath}/%{name}-root
Requires: libvorbis >= 1.0
BuildRequires: libvorbis-devel >= 1.0
Requires: libogg >= 1.0
BuildRequires: libogg-devel >= 1.0
Requires: curl >= 7.10.0
BuildRequires: curl-devel >= 7.10.0
Requires: libxml2
BuildRequires: libxml2-devel
Requires: libxslt
BuildRequires: libxslt-devel
%description
Icecast is a streaming media server which currently supports Ogg Vorbis
and MP3 audio streams. It can be used to create an Internet radio
station or a privately running jukebox and many things in between.
It is very versatile in that new formats can be added relatively
easily and supports open standards for commuincation and interaction.
%prep
%setup -q -n %{name}-%{version}
%build
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{_prefix} --mandir=%{_mandir} --sysconfdir=/etc
make
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc README AUTHORS COPYING NEWS TODO
%doc doc/*.html
%doc doc/*.jpg
%doc doc/*.css
%config(noreplace) /etc/%{name}.xml
%{_bindir}/icecast
%{_prefix}/share/icecast/*
%changelog

View File

@ -1,270 +0,0 @@
dnl Available from the GNU Autoconf Macro Archive at:
dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_config_libconfig_in.html
dnl
# AC_CONFIG_LIBCONFIG_IN(LIBRARY, DESTINATION, MODULES)
# -----------------------------------------------------
# Generate a custom LIBRARY-config script. Create the script in the
# DESTINATION directory, including support for MODULES.
AC_DEFUN([AC_CONFIG_LIBCONFIG_IN],
[# create a custom library-config file ($1-config)
m4_if(AC_CONFIG_LIBCONFIG_IN_USEPKGCONFIG, [true],
[AC_PATH_PROG(PKG_CONFIG, pkg-config)])
pushdef([LIBCONFIG_DIR], [m4_if([$2], , , [$2/])])
LIBCONFIG_FILE="LIBCONFIG_DIR[]$1-config.in"
AC_SUBST(target)dnl
AC_SUBST(host)dnl
AC_SUBST(build)dnl
dnl create directory if it does not preexist
m4_if([$2], , , [AS_MKDIR_P([$2])])
AC_MSG_NOTICE([creating $LIBCONFIG_FILE])
echo '#! /bin/sh' >$LIBCONFIG_FILE
echo "# $1-config library configuration script" >>$LIBCONFIG_FILE
echo '# generated by ac_config_libconfig_in.m4' >>$LIBCONFIG_FILE
echo ' ' >>$LIBCONFIG_FILE
echo 'template_version="1.0.0"' >>$LIBCONFIG_FILE
echo ' ' >>$LIBCONFIG_FILE
echo 'package="@PACKAGE@"' >>$LIBCONFIG_FILE
echo ' ' >>$LIBCONFIG_FILE
echo '# usage instructions if no options given' >>$LIBCONFIG_FILE
echo 'if test "'"\$""#"'" -eq 0; then' >>$LIBCONFIG_FILE
echo ' cat <<EOF' >>$LIBCONFIG_FILE
m4_if($3, ,
[echo 'Usage: $1-config [[OPTIONS]]' >>$LIBCONFIG_FILE],
[echo 'Usage: $1-config [[OPTIONS]] [[LIBRARIES]]' >>$LIBCONFIG_FILE])
echo 'Options:' >>$LIBCONFIG_FILE
echo ' [[--prefix[=DIR]]]' >>$LIBCONFIG_FILE
echo ' [[--exec-prefix[=DIR]]]' >>$LIBCONFIG_FILE
echo ' [[--package]]' >>$LIBCONFIG_FILE
echo ' [[--version]]' >>$LIBCONFIG_FILE
echo ' [[--cppflags]]' >>$LIBCONFIG_FILE
echo ' [[--cflags-only]]' >>$LIBCONFIG_FILE
echo ' [[--cflags]]' >>$LIBCONFIG_FILE
echo ' [[--libs]]' >>$LIBCONFIG_FILE
echo ' [[--help]]' >>$LIBCONFIG_FILE
m4_if($3, , ,
[echo 'Libraries:' >>$LIBCONFIG_FILE
for module in $1 $3 ; do
echo " $module" >>$LIBCONFIG_FILE ;
done])
echo 'EOF' >>$LIBCONFIG_FILE
echo 'fi' >>$LIBCONFIG_FILE
echo ' ' >>$LIBCONFIG_FILE
echo '# parse options' >>$LIBCONFIG_FILE
echo 'o=""' >>$LIBCONFIG_FILE
echo 'h=""' >>$LIBCONFIG_FILE
echo 'for i' >>$LIBCONFIG_FILE
echo 'do' >>$LIBCONFIG_FILE
echo ' case $i in' >>$LIBCONFIG_FILE
options="prefix exec-prefix eprefix package version cppflags cflags-only cflags libs bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir infodir mandir target host build pkgdatadir pkglibdir pkgincludedir template-version help"
echo ' --prefix=*) prefix=`echo $i | sed -e "s/--prefix=//"` ;;' >>$LIBCONFIG_FILE
echo ' --exec-prefix=*) exec_prefix=`echo $i | sed -e "s/--exec-prefix=//"` ;;' >>$LIBCONFIG_FILE
echo ' --eprefix=*) exec_prefix=`echo $i | sed -e "s/--eprefix=//"` ;;' >>$LIBCONFIG_FILE
for option in $options ; do
case $option in
exec-prefix) echo " --$option) echo_exec_prefix=\"yes\" ;;" >>$LIBCONFIG_FILE ;;
template-version) echo " --$option) echo_template_version=\"yes\" ;;" >>$LIBCONFIG_FILE ;;
cflags-only) echo " --$option) echo_cflags_only=\"yes\" ;;" >>$LIBCONFIG_FILE ;;
*) echo " --$option) echo_$option=\"yes\" ;;" >>$LIBCONFIG_FILE ;;
esac
done
m4_if($3, , ,
[for module in $1 $3 ; do
echo " $module) echo_module_$module=\"yes\" ;" >>$LIBCONFIG_FILE ;
echo ' echo_module="yes" ;;' >>$LIBCONFIG_FILE ;
done])
echo ' //*|/*//*|./*//*) echo_extra="yes" ;;' >>$LIBCONFIG_FILE
echo ' *) eval "echo Unknown option: $i" ; exit 1 ;;' >>$LIBCONFIG_FILE
echo ' esac' >>$LIBCONFIG_FILE
echo 'done' >>$LIBCONFIG_FILE
echo ' ' >>$LIBCONFIG_FILE
# in the order of occurence a standard automake Makefile
echo '# defaults from configure; set only if not set previously' >>$LIBCONFIG_FILE
vars="prefix exec_prefix bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir infodir mandir includedir target host build"
for var in $vars ; do
echo "if test -z \"\$$var\" ; then" >>$LIBCONFIG_FILE
echo " $var=\"@$var@\"" >>$LIBCONFIG_FILE
echo 'fi' >>$LIBCONFIG_FILE
done
echo ' ' >>$LIBCONFIG_FILE
echo '# generate output' >>$LIBCONFIG_FILE
echo 'if test x$echo_module != xyes ; then' >>$LIBCONFIG_FILE
echo ' echo_module_$1="yes"' >>$LIBCONFIG_FILE
echo 'fi' >>$LIBCONFIG_FILE
AC_CONFIG_LIBCONFIG_IN_MODULES(m4_if([$3], , [$1], [m4_translit([$1 $3], [ ], [,])]))dnl
for option in $options extra; do
case $option in
exec-prefix) echo "if test x\$echo_exec_prefix = xyes ; then" >>$LIBCONFIG_FILE ;;
template-version) echo "if test x\$echo_template_version = xyes ; then" >>$LIBCONFIG_FILE ;;
cflags-only) echo "if test x\$echo_cflags_only = xyes ; then" >>$LIBCONFIG_FILE ;;
*) echo "if test x\$echo_$option = xyes ; then" >>$LIBCONFIG_FILE ;;
esac
case $option in
exec-prefix | eprefix) echo ' o="$o $exec_prefix"' >>$LIBCONFIG_FILE ;;
template-version) echo ' o="$o $template_version"' >>$LIBCONFIG_FILE ;;
cflags-only) echo ' o="$o $cflags"' >>$LIBCONFIG_FILE ;;
cppflags) echo ' o="$o $cppflags"' >>$LIBCONFIG_FILE ;;
cflags)
# echo ' i=`eval echo "$includedir"`' >>$LIBCONFIG_FILE ;
# echo ' i=`eval echo "$i"`' >>$LIBCONFIG_FILE ;
# echo ' if test "_$i" != "_/usr/include" ; then' >>$LIBCONFIG_FILE ;
# echo ' o="$o -I$includedir"' >>$LIBCONFIG_FILE ;
# echo ' fi' >>$LIBCONFIG_FILE ;
echo ' o="$o $cppflags $cflags"' >>$LIBCONFIG_FILE ;;
libs) echo ' o="$o -L$libdir $libs"' >>$LIBCONFIG_FILE ;;
help) echo ' h="1"' >>$LIBCONFIG_FILE ;;
pkgdatadir) echo " o=\"$o \${datadir}/\${package}\"" >>$LIBCONFIG_FILE ;;
pkglibdir) echo " o=\"$o \${libdir}/\${package}\"" >>$LIBCONFIG_FILE ;;
pkgincludedir) echo " o=\"$o \${includedir}/\${package}\"" >>$LIBCONFIG_FILE ;;
extra)
echo ' v=`echo $i | sed -e s://:\$:g`' >>$LIBCONFIG_FILE ;
echo ' v=`eval "echo $v"`' >>$LIBCONFIG_FILE ;
echo ' o="$o $v"' >>$LIBCONFIG_FILE ;;
*) echo " o=\"$o \$$option\"" >>$LIBCONFIG_FILE
esac
echo 'fi' >>$LIBCONFIG_FILE
done
echo ' ' >>$LIBCONFIG_FILE
echo '# output data' >>$LIBCONFIG_FILE
echo 'o=`eval "echo $o"`' >>$LIBCONFIG_FILE
echo 'o=`eval "echo $o"`' >>$LIBCONFIG_FILE
echo 'if test -n "$o" ; then ' >>$LIBCONFIG_FILE
echo ' eval "echo $o"' >>$LIBCONFIG_FILE
echo 'fi' >>$LIBCONFIG_FILE
echo ' ' >>$LIBCONFIG_FILE
echo '# help text' >>$LIBCONFIG_FILE
echo 'if test ! -z "$h" ; then ' >>$LIBCONFIG_FILE
echo ' cat <<EOF' >>$LIBCONFIG_FILE
echo 'All available options:' >>$LIBCONFIG_FILE
echo ' --prefix=DIR and change \$prefix and \$exec-prefix' >>$LIBCONFIG_FILE
echo ' --exec-prefix=DIR (affects all other options)' >>$LIBCONFIG_FILE
echo ' --prefix \$prefix $prefix' >>$LIBCONFIG_FILE
echo ' --exec_prefix or... ' >>$LIBCONFIG_FILE
echo ' --eprefix \$exec_prefix $exec_prefix' >>$LIBCONFIG_FILE
echo ' --version \$version $version' >>$LIBCONFIG_FILE
echo ' --cppflags C preprocessor flags' >>$LIBCONFIG_FILE
echo ' --cflags-only C compiler flags' >>$LIBCONFIG_FILE
echo ' --cflags C preprocessor and compiler flags' >>$LIBCONFIG_FILE
echo ' --libs -L\$libdir \$LIBS $libs' >>$LIBCONFIG_FILE
echo ' --package \$package $package' >>$LIBCONFIG_FILE
echo ' --bindir \$bindir $bindir' >>$LIBCONFIG_FILE
echo ' --sbindir \$sbindir $sbindir' >>$LIBCONFIG_FILE
echo ' --libexecdir \$libexecdir $libexecdir' >>$LIBCONFIG_FILE
echo ' --datadir \$datadir $datadir' >>$LIBCONFIG_FILE
echo ' --sysconfdir \$sysconfdir $sysconfdir' >>$LIBCONFIG_FILE
echo ' --sharedstatedir \$sharedstatedir$sharedstatedir' >>$LIBCONFIG_FILE
echo ' --localstatedir \$localstatedir $localstatedir' >>$LIBCONFIG_FILE
echo ' --libdir \$libdir $libdir' >>$LIBCONFIG_FILE
echo ' --infodir \$infodir $infodir' >>$LIBCONFIG_FILE
echo ' --mandir \$mandir $mandir' >>$LIBCONFIG_FILE
echo ' --target \$target $target' >>$LIBCONFIG_FILE
echo ' --host \$host $host' >>$LIBCONFIG_FILE
echo ' --build \$build $build' >>$LIBCONFIG_FILE
echo ' --pkgdatadir \$datadir/\$package ${datadir}/${package}' >>$LIBCONFIG_FILE
echo ' --pkglibdir \$libdir/\$package ${libdir}/${package}' >>$LIBCONFIG_FILE
echo ' --pkgincludedir \$includedir/\$package ${includedir}/${package}' >>$LIBCONFIG_FILE
echo ' --template-version \$template_version $template_version' >>$LIBCONFIG_FILE
echo ' --help' >>$LIBCONFIG_FILE
echo 'EOF' >>$LIBCONFIG_FILE
echo 'fi' >>$LIBCONFIG_FILE
m4_pushdef([LIBCONFIG_UP], [m4_translit([$1], [a-z], [A-Z])])dnl
LIBCONFIG_UP[]_CONFIG="LIBCONFIG_DIR[]$1-config"
AC_SUBST(LIBCONFIG_UP[]_CONFIG)
dnl AC_CONFIG_FILES(LIBCONFIG_DIR[]$1[-config], [chmod +x ]LIBCONFIG_DIR[]$1[-config])
m4_popdef([LIBCONFIG_DIR])
m4_popdef([LIBCONFIG_UP])
])
# AC_CONFIG_LIBCONFIG_IN_MODULES [(MODULE1 [, MODULE2 [, ...]])]
# --------------------------------------------------------------
#Output shell script using custom module variables.
AC_DEFUN([AC_CONFIG_LIBCONFIG_IN_MODULES],
[m4_if([$1], , ,
[# create module definition for $1
dnl we're going to need uppercase, lowercase and user-friendly versions of the
dnl string `MODULE'
m4_pushdef([MODULE_UP], m4_translit([$1], [a-z], [A-Z]))dnl
m4_pushdef([MODULE_DOWN], m4_translit([$1], [A-Z], [a-z]))dnl
if test -z "$MODULE_DOWN[]_cppflags" ; then
if test -n "$MODULE_UP[]_CPPFLAGS" ; then
MODULE_DOWN[]_cppflags="$MODULE_UP[]_CPPFLAGS"
else
dnl AC_MSG_WARN([variable `MODULE_DOWN[]_cppflags' undefined])
MODULE_DOWN[]_cppflags=''
fi
fi
AC_SUBST(MODULE_DOWN[]_cppflags)
if test -z "$MODULE_DOWN[]_cflags" ; then
if test -n "$MODULE_UP[]_CFLAGS" ; then
MODULE_DOWN[]_cflags="$MODULE_UP[]_CFLAGS"
else
dnl AC_MSG_WARN([variable `MODULE_DOWN[]_cflags' undefined])
MODULE_DOWN[]_cflags=''
fi
fi
AC_SUBST(MODULE_DOWN[]_cflags)dnl
if test -z "$MODULE_DOWN[]_libs" ; then
if test -n "$MODULE_UP[]_LIBS" ; then
MODULE_DOWN[]_libs="$MODULE_UP[]_LIBS"
else
AC_MSG_WARN([variable `MODULE_DOWN[]_libs' and `MODULE_UP[]_LIBS' undefined])
MODULE_DOWN[]_libs='-l$1'
fi
if test -n "$MODULE_UP[]_LIBDEPS" ; then
MODULE_DOWN[]_libs="$MODULE_DOWN[]_libs $MODULE_UP[]_LIBDEPS"
fi
fi
AC_SUBST(MODULE_DOWN[]_libs)dnl
if test -z "$MODULE_UP[]_VERSION" ; then
AC_MSG_WARN([variable `MODULE_UP[]_VERSION' undefined])
MODULE_UP[]_VERSION="$VERSION"
fi
AC_SUBST(MODULE_UP[]_VERSION)dnl
echo 'if test x$echo_module_$1 = xyes ; then' >>$LIBCONFIG_FILE
AC_CONFIG_LIBCONFIG_IN_MODULES_VARS([cppflags], [MODULE_DOWN[]_cppflags], [cppflags])
AC_CONFIG_LIBCONFIG_IN_MODULES_VARS([cflags], [MODULE_DOWN[]_cflags], [cflags])
AC_CONFIG_LIBCONFIG_IN_MODULES_VARS([libs], [MODULE_DOWN[]_libs], [libs])
AC_CONFIG_LIBCONFIG_IN_MODULES_VARS([version], [MODULE_UP[]_VERSION], [modversion])
echo 'fi' >>$LIBCONFIG_FILE
m4_popdef([MODULE_UP])dnl
m4_popdef([MODULE_DOWN])dnl
AC_CONFIG_LIBCONFIG_IN_MODULES(m4_shift($@))])dnl
])
# AC_CONFIG_LIBCONFIG_IN_MODULES_VARS [(VAR, SUBSTITUTION,
# PKGCONFIG_ARGS)]
# --------------------------------------------------------
# Output AC_CONFIG_LIBCONFIG_IN_MODULES variables.
# VAR = variable to set
# SUBSTITUTION = set if pkg-config is not available
# PKGCONFIG_ARGS = args for pkg-config
AC_DEFUN([AC_CONFIG_LIBCONFIG_IN_MODULES_VARS],
[m4_if(AC_CONFIG_LIBCONFIG_IN_USEPKGCONFIG, [true],
[
echo 'if test -x "`which pkg-config`" ; then' >>$LIBCONFIG_FILE
echo ' if pkg-config --atleast-pkgconfig-version=0.7 --exists "MODULE_DOWN"; then' >>$LIBCONFIG_FILE
echo ' $1="@S|@$1 `pkg-config --$3 MODULE_DOWN`"' >>$LIBCONFIG_FILE
echo ' fi' >>$LIBCONFIG_FILE
echo 'else' >>$LIBCONFIG_FILE
echo ' $1="@S|@$1 @$2@"' >>$LIBCONFIG_FILE
echo 'fi' >>$LIBCONFIG_FILE
],
[echo ' $1="@S|@$1 @$2@"' >>$LIBCONFIG_FILE
])])
# AC_CONFIG_LIBCONFIG_IN_PKGCONFIG
# --------------------------------
# Enable pkgconfig support in libconfig script (default)
AC_DEFUN([AC_CONFIG_LIBCONFIG_IN_PKGCONFIG],
[m4_define([AC_CONFIG_LIBCONFIG_IN_USEPKGCONFIG], [true])
])dnl
# AC_CONFIG_LIBCONFIG_IN_STATIC
# -----------------------------
# Disable pkgconfig support in libconfig script
AC_DEFUN([AC_CONFIG_LIBCONFIG_IN_STATIC],
[m4_define([AC_CONFIG_LIBCONFIG_IN_USEPKGCONFIG], [false])
])dnl

View File

@ -1,192 +0,0 @@
dnl Available from the GNU Autoconf Macro Archive at:
dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_pthread.html
dnl
AC_DEFUN([ACX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST])
AC_LANG_SAVE
AC_LANG_C
acx_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on True64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
AC_MSG_RESULT($acx_pthread_ok)
if test x"$acx_pthread_ok" = xno; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
fi
# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
# which indicates that we try without any flags at all.
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
# -pthreads: Solaris/gcc
# -mthreads: Mingw32/gcc, Lynx/gcc
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
# pthread: Linux, etcetera
# --thread-safe: KAI C++
case "${host_cpu}-${host_os}" in
*solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (We need to link with -pthread or
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# a function called by this macro, so we could check for that, but
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
;;
esac
if test x"$acx_pthread_ok" = xno; then
for flag in $acx_pthread_flags; do
case $flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $flag])
PTHREAD_CFLAGS="$flag"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$flag])
PTHREAD_LIBS="-l$flag"
;;
esac
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
# need a special flag -Kthread to make this header compile.)
# We check for pthread_join because it is in -lpthread on IRIX
# while pthread_create is in libc. We check for pthread_attr_init
# due to DEC craziness with -lpthreads. We check for
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_TRY_LINK([#include <pthread.h>],
[pthread_t th; pthread_join(th, 0);
pthread_attr_init(0); pthread_cleanup_push(0, 0);
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
[acx_pthread_ok=yes])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT($acx_pthread_ok)
if test "x$acx_pthread_ok" = xyes; then
break;
fi
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
done
fi
# Various other checks:
if test "x$acx_pthread_ok" = xyes; then
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Detect AIX lossage: threads are created detached by default
# and the JOINABLE attribute has a nonstandard name (UNDETACHED).
AC_MSG_CHECKING([for joinable pthread attribute])
AC_TRY_LINK([#include <pthread.h>],
[int attr=PTHREAD_CREATE_JOINABLE;],
ok=PTHREAD_CREATE_JOINABLE, ok=unknown)
if test x"$ok" = xunknown; then
AC_TRY_LINK([#include <pthread.h>],
[int attr=PTHREAD_CREATE_UNDETACHED;],
ok=PTHREAD_CREATE_UNDETACHED, ok=unknown)
fi
if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then
AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok,
[Define to the necessary symbol if this constant
uses a non-standard name on your system.])
fi
AC_MSG_RESULT(${ok})
if test x"$ok" = xunknown; then
AC_MSG_WARN([we do not know how to create joinable pthreads])
fi
AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no
case "${host_cpu}-${host_os}" in
*-aix* | *-freebsd*) flag="-D_THREAD_SAFE";;
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
esac
AC_MSG_RESULT(${flag})
if test "x$flag" != xno; then
PTHREAD_CPPFLAGS="$flag $PTHREAD_CPPFLAGS"
fi
AC_CHECK_TYPES(pthread_rwlock_t,,,[#include <pthread.h>])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
# More AIX lossage: must compile with cc_r
AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
else
PTHREAD_CC="$CC"
fi
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_CPPFLAGS)
AC_SUBST(PTHREAD_CC)
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$acx_pthread_ok" = xyes; then
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
:
else
acx_pthread_ok=no
$2
fi
AC_LANG_RESTORE
])dnl ACX_PTHREAD

View File

@ -1,55 +0,0 @@
# Configure paths for libogg
# updated by Karl Heyes 10-Jun-2003
# Jack Moffitt <jack@icecast.org> 10-21-2000
# Shamelessly stolen from Owen Taylor and Manish Singh
dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for libogg, and define OGG_CFLAGS OGG_LDFLAGS and OGG_LIBS
dnl
AC_DEFUN([XIPH_PATH_OGG],
[dnl
AC_ARG_VAR([OGG_PREFIX],[path to ogg installation])
AC_ARG_WITH(ogg,
[AC_HELP_STRING([--with-ogg=PREFIX],
[Prefix where libogg is installed (optional)])],
ogg_prefix="$withval",
ogg_prefix="$OGG_PREFIX"
)
if test "x$ogg_prefix" = "x"; then
if test "x$prefix" = "xNONE"; then
ogg_prefix=/usr/local
else
ogg_prefix="$prefix"
fi
fi
XIPH_GCC_WARNING([-I$ogg_prefix/include],,
[OGG_CFLAGS="-I$ogg_prefix/include"
OGG_LDFLAGS="-L$ogg_prefix/lib"
])
OGG_LIBS="-logg"
#
# check if the installed Ogg is sufficiently new.
#
AC_MSG_CHECKING([for ogg_sync_init in libogg])
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
ac_save_LDFLAGS="$LDFLAGS"
CFLAGS="$CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $OGG_LIBS"
LDFLAGS="$LDFLAGS $OGG_LDFLAGS"
AC_TRY_LINK_FUNC(ogg_sync_init,
[ifelse([$1],, [AC_MSG_RESULT([ok])], [$1])],
[AC_TRY_LINK([#include <ogg/ogg.h>],,
[ ifelse([$2], ,[AC_MSG_ERROR([found, but needs updating])], [$2])],
[ ifelse([$2], ,[AC_MSG_ERROR([not found, maybe you need to set LD_LIBRARY_PATH or /etc/ld.so.conf])], [$2])])
])
CFLAGS="$ac_save_CFLAGS"
LDFLAGS="$ac_save_LDFLAGS"
LIBS="$ac_save_LIBS"
AC_SUBST(OGG_CFLAGS)
AC_SUBST(OGG_LDFLAGS)
AC_SUBST(OGG_LIBS)
])

View File

@ -1,104 +0,0 @@
# Configure paths for libogg2
# Arc Riley <arc@xiph.org> 03-03-2004
# Shamelessly stolen from Jack Moffitt
# Who shamelessly stole it from Owen Taylor and Manish Singh
# Isn't Free Software awesome?
dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS
dnl
AC_DEFUN(XIPH_PATH_OGG,
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(ogg,[ --with-ogg=PFX Prefix where libogg2 is installed (optional)], ogg_prefix="$withval", ogg_prefix="")
AC_ARG_WITH(ogg-libraries,[ --with-ogg-libraries=DIR Directory where libogg2 library is installed (optional)], ogg_libraries="$withval", ogg_libraries="")
AC_ARG_WITH(ogg-includes,[ --with-ogg-includes=DIR Directory where libogg2 header files are installed (optional)], ogg_includes="$withval", ogg_includes="")
AC_ARG_ENABLE(oggtest, [ --disable-oggtest Do not try to compile and run a test Ogg program],, enable_oggtest=yes)
if test "x$ogg_libraries" != "x" ; then
OGG_LIBS="-L$ogg_libraries"
elif test "x$ogg_prefix" != "x" ; then
OGG_LIBS="-L$ogg_prefix/lib"
elif test "x$prefix" != "xNONE" ; then
OGG_LIBS="-L$prefix/lib"
fi
OGG_LIBS="$OGG_LIBS -logg2"
if test "x$ogg_includes" != "x" ; then
OGG_CFLAGS="-I$ogg_includes"
elif test "x$ogg_prefix" != "x" ; then
OGG_CFLAGS="-I$ogg_prefix/include"
elif test "$prefix" != "xNONE"; then
OGG_CFLAGS="-I$prefix/include"
fi
AC_MSG_CHECKING(for Ogg2)
no_ogg=""
if test "x$enable_oggtest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $OGG_LIBS"
dnl
dnl Now check if the installed Ogg is sufficiently new.
dnl
rm -f conf.oggtest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ogg2/ogg.h>
int main ()
{
system("touch conf.oggtest");
return 0;
}
],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_ogg" = "x" ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
if test -f conf.oggtest ; then
:
else
echo "*** Could not run Ogg test program, checking why..."
CFLAGS="$CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $OGG_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <ogg2/ogg.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding Ogg or finding the wrong"
echo "*** version of Ogg. If it is not finding Ogg, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means Ogg was incorrectly installed"
echo "*** or that you have moved Ogg since it was installed." ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
OGG_CFLAGS=""
OGG_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(OGG_CFLAGS)
AC_SUBST(OGG_LIBS)
rm -f conf.oggtest
])

View File

@ -1,79 +0,0 @@
dnl XIPH_PATH_SHOUT
dnl Jack Moffitt <jack@icecast.org> 08-06-2001
dnl Rewritten for libshout 2
dnl Brendan Cully <brendan@xiph.org> 20030612
dnl
dnl $Id: shout.m4,v 1.12 2003/07/11 01:26:31 brendan Exp $
# XIPH_PATH_SHOUT([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
# Test for libshout, and define SHOUT_CPPFLAGS SHOUT_CFLAGS SHOUT_LIBS, and
# SHOUT_THREADSAFE
AC_DEFUN([XIPH_PATH_SHOUT],
[dnl
xt_have_shout="no"
SHOUT_THREADSAFE="no"
SHOUT_CPPFLAGS=""
SHOUT_CFLAGS=""
SHOUT_LIBS=""
# NB: PKG_CHECK_MODULES exits if pkg-config is unavailable on the targe
# system, so we can't use it.
# seed pkg-config with the default libshout location
PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-/usr/local/lib/pkgconfig}
export PKG_CONFIG_PATH
# Step 1: Use pkg-config if available
AC_PATH_PROG([PKGCONFIG], [pkg-config], [no])
if test "$PKGCONFIG" != "no" && `$PKGCONFIG --exists shout`
then
SHOUT_CFLAGS=`$PKGCONFIG --variable=cflags_only shout`
SHOUT_CPPFLAGS=`$PKGCONFIG --variable=cppflags shout`
SHOUT_LIBS=`$PKGCONFIG --libs shout`
xt_have_shout="maybe"
else
if test "$PKGCONFIG" != "no"
then
AC_MSG_NOTICE([$PKGCONFIG couldn't find libshout. Try adjusting PKG_CONFIG_PATH.])
fi
# pkg-config unavailable, try shout-config
AC_PATH_PROG([SHOUTCONFIG], [shout-config], [no])
if test "$SHOUTCONFIG" != "no" && test `$SHOUTCONFIG --package` = "libshout"
then
SHOUT_CPPFLAGS=`$SHOUTCONFIG --cppflags`
SHOUT_CFLAGS=`$SHOUTCONFIG --cflags-only`
SHOUT_LIBS=`$SHOUTCONFIG --libs`
xt_have_shout="maybe"
fi
fi
# Now try actually using libshout
if test "$xt_have_shout" != "no"
then
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $SHOUT_CPPFLAGS"
CFLAGS="$CFLAGS $SHOUT_CFLAGS"
LIBS="$SHOUT_LIBS $LIBS"
AC_CHECK_HEADERS([shout/shout.h], [
AC_CHECK_FUNC([shout_new], [
ifelse([$1], , :, [$1])
xt_have_shout="yes"
])
AC_EGREP_CPP([yes], [#include <shout/shout.h>
#if SHOUT_THREADSAFE
yes
#endif
], [SHOUT_THREADSAFE="yes"])
])
CPPFLAGS="$ac_save_CPPFLAGS"
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "$xt_have_shout" != "yes"
then
ifelse([$2], , :, [$2])
fi
])dnl XIPH_PATH_SHOUT

View File

@ -1,70 +0,0 @@
# Configure paths for libspeex
# updated by Karl Heyes 02-Feb-2004
dnl XIPH_PATH_SPEEX([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for libspeex, and define SPEEX_CFLAGS SPEEX_LIBS
dnl SPEEX_SPEEXENC_LIBS SPEEX_SPEEXFILE_LIBS SPEEX_LDFLAGS
dnl
AC_DEFUN([XIPH_PATH_SPEEX],
[
XIPH_PATH_OGG([$1],[$2])
dnl Get the cflags and libraries for speex
dnl
AC_ARG_VAR([SPEEX],[path to speex installation])
AC_ARG_WITH(speex,
AC_HELP_STRING([--with-speex=PREFIX],
[Prefix where libspeex is installed (optional)]),
speex_prefix="$withval",
speex_prefix="$SPEEX_PREFIX"
)
if test "x$speex_prefix" = "x"; then
if test "x$prefix" = "xNONE"; then
speex_prefix="/usr/local"
else
speex_prefix="$prefix"
fi
fi
SPEEX_CFLAGS="$OGG_CFLAGS"
SPEEX_LDFLAGS="$OGG_LDFLAGS"
if test "x$speex_prefix" != "x$ogg_prefix"; then
XIPH_GCC_WARNING(-I"$speex_prefix/include",,
[SPEEX_CFLAGS="$SPEEX_CFLAGS -I$speex_prefix/include"
SPEEX_LDFLAGS="-L$speex_prefix/lib $SPEEX_LDFLAGS"
])
fi
SPEEX_LIBS="-lspeex"
ac_save_LIBS="$LIBS"
ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $SPEEX_LDFLAGS"
LIBS="$LIBS $SPEEX_LIBS"
xt_have_speex="yes"
AC_MSG_CHECKING([for libspeex])
AC_TRY_LINK_FUNC(ogg_stream_init, [AC_MSG_RESULT([ok])],
[LIBS="$LIBS $OGG_LIBS"
AC_TRY_LINK_FUNC(ogg_stream_init,
[SPEEX_LIBS="$SPEEX_LIBS $OGG_LIBS"],
[xt_have_speex="no"])
])
LIBS="$ac_save_LIBS"
LDFLAGS="$ac_save_LDFLAGS"
if test "x$xt_have_speex" = "xyes"
then
AC_MSG_RESULT([ok])
AC_DEFINE([HAVE_SPEEX],[1],[Define if Speex support is available])
else
ifelse([$2], , AC_MSG_ERROR([Unable to link to libspeex]), [$2])
SPEEX_CFLAGS=""
SPEEX_LDFLAGS=""
SPEEX_LIBS=""
fi
AC_SUBST(SPEEX_CFLAGS)
AC_SUBST(SPEEX_LDFLAGS)
AC_SUBST(SPEEX_LIBS)
])

View File

@ -1,69 +0,0 @@
# Configure paths for libtheora
# Karl Heyes 02-Feb-2004
dnl XIPH_PATH_THEORA([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for libtheora, and define THEORA_CFLAGS THEORA_LIBS
dnl
AC_DEFUN([XIPH_PATH_THEORA],
[
XIPH_PATH_OGG([$1],[$2])
dnl Get the cflags and libraries for theora
dnl
AC_ARG_VAR([THEORA],[path to theora installation])
AC_ARG_WITH(theora,
AC_HELP_STRING([--with-theora=PREFIX],
[Prefix where libtheora is installed (optional)]),
theora_prefix="$withval",
theora_prefix="$THEORA_PREFIX"
)
if test "x$theora_prefix" = "x"; then
if test "x$prefix" = "xNONE"; then
theora_prefix="/usr/local"
else
theora_prefix="$prefix"
fi
fi
THEORA_CFLAGS="$OGG_CFLAGS"
THEORA_LDFLAGS="$OGG_LDFLAGS"
if test "x$theora_prefix" != "x$ogg_prefix"; then
XIPH_GCC_WARNING(-I"$theora_prefix/include",,
[THEORA_CFLAGS="$THEORA_CFLAGS -I$theora_prefix/include"
THEORA_LDFLAGS="-L$theora_prefix/lib $THEORA_LDFLAGS"
])
fi
THEORA_LIBS="-ltheora"
ac_save_LIBS="$LIBS"
ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $THEORA_LDFLAGS"
LIBS="$LIBS $THEORA_LIBS"
xt_have_theora="yes"
AC_MSG_CHECKING([for libtheora])
AC_TRY_LINK_FUNC(ogg_stream_init, [AC_MSG_RESULT([ok])],
[LIBS="$LIBS $OGG_LIBS"
AC_TRY_LINK_FUNC(ogg_stream_init,
[THEORA_LIBS="$THEORA_LIBS $OGG_LIBS"],
[xt_have_theora="no"])
])
LIBS="$ac_save_LIBS"
LDFLAGS="$ac_save_LDFLAGS"
if test "x$xt_have_theora" = "xyes"
then
AC_MSG_RESULT([ok])
AC_DEFINE([HAVE_THEORA],[1],[Define if Theora support is available])
else
ifelse([$2], , AC_MSG_ERROR([Unable to link to libtheora]), [$2])
THEORA_CFLAGS=""
THEORA_LDFLAGS=""
THEORA_LIBS=""
fi
AC_SUBST(THEORA_CFLAGS)
AC_SUBST(THEORA_LDFLAGS)
AC_SUBST(THEORA_LIBS)
])

View File

@ -1,82 +0,0 @@
# Configure paths for libvorbis
# Jack Moffitt <jack@icecast.org> 10-21-2000
# updated by Karl Heyes 31-Mar-2003
# Shamelessly stolen from Owen Taylor and Manish Singh
dnl XIPH_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for libvorbis, and define VORBIS_CFLAGS VORBIS_LIBS
dnl VORBIS_VORBISENC_LIBS VORBIS_VORBISFILE_LIBS VORBIS_LDFLAGS
dnl
AC_DEFUN([XIPH_PATH_VORBIS],
[
XIPH_PATH_OGG([$1],[$2])
dnl Get the cflags and libraries for vorbis
dnl
AC_ARG_VAR([VORBIS_PREFIX],[path to vorbis installation])
AC_ARG_WITH(vorbis,
AC_HELP_STRING([--with-vorbis=PREFIX],
[Prefix where libvorbis is installed (optional)]),
vorbis_prefix="$withval",
vorbis_prefix="$VORBIS_PREFIX"
)
if test "x$vorbis_prefix" = "x"; then
if test "x$prefix" = "xNONE"; then
vorbis_prefix="/usr/local"
else
vorbis_prefix="$prefix"
fi
fi
VORBIS_CFLAGS="$OGG_CFLAGS"
VORBIS_LDFLAGS="$OGG_LDFLAGS"
if test "x$vorbis_prefix" != "x$ogg_prefix"; then
XIPH_GCC_WARNING(-I"$vorbis_prefix/include",,
[VORBIS_CFLAGS="$VORBIS_CFLAGS -I$vorbis_prefix/include"
VORBIS_LDFLAGS="-L$vorbis_prefix/lib $VORBIS_LDFLAGS"
])
fi
VORBIS_LIBS="-lvorbis"
VORBISFILE_LIBS="-lvorbisfile"
VORBISENC_LIBS="-lvorbisenc"
ac_save_LIBS="$LIBS"
ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $VORBIS_LDFLAGS"
LIBS="$LIBS $VORBIS_LIBS"
AC_MSG_CHECKING([for libvorbis])
AC_TRY_LINK_FUNC(vorbis_info_init, [AC_MSG_RESULT([ok])],
[LIBS="$LIBS $OGG_LIBS -lm"
AC_TRY_LINK_FUNC(vorbis_info_init,
[AC_MSG_RESULT([found, adding extra libs])
VORBIS_LIBS="$VORBIS_LIBS $OGG_LIBS -lm"],
[ifelse([$2], , AC_MSG_ERROR([Unable to link to libvorbis]), [$2])
])
])
LIBS="$ac_save_LIBS"
LDFLAGS="$ac_save_LDFLAGS"
#
# Now check if the installed Vorbis is sufficiently new.
#
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $VORBIS_CFLAGS"
LIBS="$LIBS $VORBIS_LDFLAGS $VORBIS_LIBS"
AC_CHECK_TYPES([struct ovectl_ratemanage_arg],[vorbis_ok=yes],
[ifelse([$2], ,[AC_MSG_ERROR([libvorbis needs updating])], [$2])], [
#include <vorbis/codec.h>
#include <vorbis/vorbisenc.h>
])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
AC_SUBST(VORBIS_CFLAGS)
AC_SUBST(VORBIS_LDFLAGS)
AC_SUBST(VORBIS_LIBS)
AC_SUBST(VORBISFILE_LIBS)
AC_SUBST(VORBISENC_LIBS)
])

View File

@ -1,168 +0,0 @@
dnl xiph_compiler.m4
dnl $Id: xiph_compiler.m4,v 1.5 2003/07/17 09:23:44 karl Exp $
dnl XIPH_FUNC_VA_COPY
dnl Karl Heyes
dnl
# XIPH_FUNC_VA_COPY
# Test for implementation of va_copy, or define appropriately if missing
AC_DEFUN([XIPH_FUNC_VA_COPY],
[dnl
AC_MSG_CHECKING([for va_copy])
AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);],
AC_MSG_RESULT([va_copy]),
[dnl
AH_TEMPLATE([va_copy], [define if va_copy is not available])
AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; __va_copy(ap1, ap2);],
[dnl
AC_DEFINE([va_copy], [__va_copy])
AC_MSG_RESULT([__va_copy])],
[dnl
AC_DEFINE([va_copy(dest,src)], [memcpy(&dest,&src,sizeof(va_list))])
AC_MSG_RESULT([memcpy])
])
])
])
])dnl XIPH_FUNC_VA_COPY
dnl XIPH_C_ATTRIBUTE
dnl Karl Heyes
dnl
# XIPH_C_ATTRIBUTE
# Define __attribute__ to be empty if the compiler does not support it
AC_DEFUN([XIPH_C_ATTRIBUTE],
[dnl
AC_TRY_COMPILE([int func(void) __attribute__((unused));],
[int x __attribute__ ((unused));],,[dnl
AC_DEFINE([__attribute__(x)],, [Define to empty if __attribute__ is not supported])
])
])dnl XIPH_C_ATTRIBUTE
dnl XIPH_GCC_WARNING
dnl Karl Heyes
dnl
# XIPH_GCC_WARNING(flag, action-if-warning, action-if-not)
# Tests whether GCC emits a warning if explicitly asked to use flag.
# Useful for eg system default include paths
AC_DEFUN([XIPH_GCC_WARNING],
[AC_REQUIRE([AC_PROG_CC])
xt_warning=no
if test x"$GCC" = "xyes"
then
save_cflags="$CFLAGS"
CFLAGS="-Werror $1"
AC_TRY_COMPILE(,,,xt_warning=yes)
CFLAGS="$save_cflags"
fi
if test "$xt_warning" = "yes"
then
ifelse([$2],,:,[$2])
else
ifelse([$3],,:,[$3])
fi
])dnl XIPH_GCC_WARNING
dnl XIPH_CLEAN_CCFLAGS
dnl Brendan Cully <brendan@xiph.org> 20030612
dnl
# XIPH_CLEAN_CCFLAGS(flag-list, dest-shell-var-name)
# Filters out duplicate compiler flags, and -I flags if XIPH_GCC_WARNING
# complains about them
# Operates right-to-left on -l flags, left-to-right on everything else
# eg XIPH_CLEAN_CCFLAGS([-L/opt/lib -lfoo -lm -L/opt/lib -lbar -lm], [MY_LDFLAGS])
# => MY_LDFLAGS="-L/opt/lib -lfoo -lbar -lm"
# the cat<<EOF construct makes sure echo doesn't pick, say, -n
AC_DEFUN([XIPH_CLEAN_CCFLAGS],
[AC_REQUIRE([AC_PROG_FGREP])
xt_FLAGS=''
for flag in $1
do
case "$flag" in
-l*)
xt_FLAGS="$flag $xt_FLAGS"
;;
*)
if { cat <<EOF
$xt_FLAGS x
EOF
} | $FGREP -v -e " $flag " > /dev/null
then
xt_FLAGS="$flag $xt_FLAGS"
fi
;;
esac
done
$2=''
for flag in $xt_FLAGS
do
if { cat <<EOF
$$2 x
EOF
} | $FGREP -v -e " $flag " > /dev/null
then
$2="$flag $$2"
fi
done
# Prune -I flags if $CC warns about them
xt_FLAGS=''
for flag in $$2
do
case "$flag" in
-I*)
XIPH_GCC_WARNING([$flag], [], [xt_FLAGS="$xt_FLAGS $flag"])
;;
*)
xt_FLAGS="$xt_FLAGS $flag"
;;
esac
done
$2="$xt_FLAGS"
])dnl XIPH_CLEAN_CCFLAGS
dnl XIPH_VAR_APPEND
dnl Karl Heyes
dnl
# XIPH_VAR_APPEND(shell-var, list)
# Append each item in list to shell-var iff shell-var doesn't already have it
# eg XIPH_VAR_APPEND([CFLAGS], [-O2 -I/opt/packages/include])
AC_DEFUN([XIPH_VAR_APPEND],
[dnl
AC_REQUIRE([AC_PROG_FGREP])
for arg in $2
do
if { cat <<EOF
$$1 x
EOF
} | $FGREP -v -e " $arg " > /dev/null
then
$1="$$1 $arg"
fi
done
])dnl XIPH_VAR_APPEND
dnl XIPH_VAR_PREPEND
dnl Karl Heyes
dnl
# XIPH_VAR_PREPEND(shell-var, list)
# see XIPH_VAR_APPEND
AC_DEFUN([XIPH_VAR_PREPEND],
[dnl
AC_REQUIRE([AC_PROG_FGREP])
xt_compare="$$1"
xt_filtered=""
for arg in $2
do
if { cat <<EOF
$xt_compare x
EOF
} | $FGREP -v -e " $arg " > /dev/null
then
xt_compare="$arg $xt_compare"
xt_filtered="$xt_filtered $arg"
fi
done
$1="$xt_filtered $$1"
])dnl XIPH_VAR_PREPEND

View File

@ -1,67 +0,0 @@
dnl XIPH_PATH_CURL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for libcurl, and define CURL_CFLAGS and CURL_LIBS
dnl
AC_DEFUN(XIPH_PATH_CURL,
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(curl,
AC_HELP_STRING([--with-curl=PFX],[Prefix where libcurl is installed (optional)]),
curl_prefix="$withval", curl_prefix="")
AC_ARG_WITH(curl-config,
AC_HELP_STRING([--with-curl-config=curl-config],[Use curl-config to find libcurl]),
CURL_CONFIG="$withval", [AC_PATH_PROGS(CURL_CONFIG, [curl-config], "")])
if test "x$curl_prefix" != "x"; then
CURL_LIBS="-L$curl_prefix/lib -lcurl"
CURL_CFLAGS="-I$curl_prefix/include"
elif test "x$CURL_CONFIG" != "x"; then
if ! test -x "$CURL_CONFIG"; then
AC_MSG_ERROR([$CURL_CONFIG cannot be executed])
fi
CURL_LIBS="$($CURL_CONFIG --libs)"
CURL_CFLAGS="$($CURL_CONFIG --cflags)"
else
if test "x$prefix" = "xNONE"; then
curl_prefix="/usr/local"
else
curl_prefix="$prefix"
fi
CURL_LIBS="-L$curl_prefix/lib -lcurl"
CURL_CFLAGS="-I$curl_prefix/include"
fi
curl_ok="yes"
xt_curl_CPPFLAGS="$CPPFLAGS"
xt_curl_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $CURL_CFLAGS"
LIBS="$CURL_LIBS $LIBS"
dnl
dnl Now check if the installed libcurl is sufficiently new.
dnl
AC_CHECK_HEADERS([curl/curl.h],, curl_ok="no")
AC_MSG_CHECKING(for libcurl)
if test "$curl_ok" = "yes"
then
AC_RUN_IFELSE(AC_LANG_SOURCE([
#include <curl/curl.h>
int main()
{
return 0;
}
]),,[curl_ok="no"])
fi
if test "$curl_ok" = "yes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_CURL, 1, [Define if you have libcurl.])
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
CURL_LIBS=""
CURL_CFLAGS=""
ifelse([$2], , :, [$2])
fi
CPPFLAGS="$xt_curl_CPPFLAGS"
LIBS="$xt_curl_LIBS"
])

View File

@ -1,26 +0,0 @@
# XIPH_NET
# Perform tests required by the net module
AC_DEFUN([XIPH_NET],
[dnl
AC_REQUIRE([XIPH_TYPE_SOCKLEN_T])
AC_REQUIRE([XIPH_FUNC_VA_COPY])
AC_CHECK_HEADERS([sys/select.h sys/uio.h])
AC_CHECK_HEADER([winsock2.h],
[AC_DEFINE([HAVE_WINSOCK2_H], [1], [Define if you have winsock2.h on MINGW])
LIBS="$LIBS -lwsock32"])
# These tests are ordered based on solaris 8 tests
AC_SEARCH_LIBS([sethostent], [nsl],
[AC_DEFINE([HAVE_SETHOSTENT], [1],
[Define if you have the sethostent function])])
AC_SEARCH_LIBS([getnameinfo], [socket],
[AC_DEFINE([HAVE_GETNAMEINFO], [1],
[Define if you have the getnameinfo function])])
AC_CHECK_FUNCS([endhostent getaddrinfo inet_aton writev])
# Irix defines INET_PTON but not sockaddr_storage!
AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family],
[AC_CHECK_FUNCS([inet_pton])],,
[#include <sys/types.h>
#include <sys/socket.h>])
])

View File

@ -1,73 +0,0 @@
dnl local M4 configure macros
dnl Brendan Cully <brendan@xiph.org>
dnl $Id: xiph_path_python.m4,v 1.1 2003/06/13 19:22:16 brendan Exp $
# XIPH_PATH_PYTHON(PATH)
# Search for python in PATH, or in the path if none is given.
# Defines PYTHON_CPPFLAGS and PYTHON_LIBS if found
AC_DEFUN([XIPH_PATH_PYTHON],
[
m4_pushdef([xpp_path], [$1])
PYTHON="no"
if test "xpp_path" != "yes"
then
AC_MSG_CHECKING([python])
if test -x "xpp_path"
then
PYTHON="xpp_path"
fi
AC_MSG_RESULT([$PYTHON])
else
AC_PATH_PROGS([PYTHON], [python python2 python2.3 python2.2])
fi
m4_popdef([xpp_path])
if test "$PYTHON" != "no"
then
# The library we're linking against
PYTHON_LIB="_XIPH_PYTHON_CFG([$PYTHON], [LIBRARY])"
# if LIBRARY is nonsensical, bail out
if test $? -ne 0 -o -z "$PYTHON_LIB"
then
AC_MSG_WARN([Could not find library for $PYTHON])
break
fi
# make library linker friendly. This is a hack, but I don't know what's better
PYTHON_LIB=`echo "$PYTHON_LIB" | sed 's/lib//;s/\.a.*//;s/\.so.*//;s/\.dylib.*//'`
# LDFLAGS
PYTHON_LDFLAGS="-L[]_XIPH_PYTHON_CFG([$PYTHON], [LIBPL])"
# Extra libraries required by python
PYTHON_EXTRA_LIBS="_XIPH_PYTHON_CFG([$PYTHON], [LIBS])"
PYTHON_EXTRA_LIBS="$PYTHON_EXTRA_LIBS _XIPH_PYTHON_CFG([$PYTHON], [SYSLIBS])"
PYTHON_EXTRA_LIBS="$PYTHON_EXTRA_LIBS _XIPH_PYTHON_CFG([$PYTHON], [SHLIBS])"
PYTHON_CPPFLAGS="-I[]_XIPH_PYTHON_CFG([$PYTHON], [INCLUDEPY])"
# test header and library functionality
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS"
AC_CHECK_HEADER([Python.h],
[
saved_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $PYTHON_LDFLAGS"
AC_CHECK_LIB([$PYTHON_LIB], [Py_Initialize],
[PYTHON_LIBS="-l$PYTHON_LIB $PYTHON_EXTRA_LIBS"],
[AC_MSG_WARN([Could not link to the python library])],
[$PYTHON_EXTRA_LIBS])
LDFLAGS="$saved_LDFLAGS"
],
[AC_MSG_WARN([Python.h doesn't appear to be usable])])
CPPFLAGS="$saved_CPPFLAGS"
fi
])dnl
# _XIPH_PYTHON_CFG(PYTHONPATH, CFGVAR)
# Ask python in PYTHONPATH for the definition of CFGVAR
m4_define([_XIPH_PYTHON_CFG],
[`$1 -c 'from distutils.sysconfig import get_config_var; print get_config_var("$2")' | sed 's/None//'`])

View File

@ -1,59 +0,0 @@
dnl xiph_types.m4
dnl macros for type checks not covered by autoconf
dnl XIPH_C99_INTTYPES
dnl Brendan Cully
dnl
# XIPH_C99_INTTYPES
# Check for C99 integer type definitions, or define if missing
AC_DEFUN([XIPH_C99_INTTYPES],
[dnl
AC_CHECK_HEADERS([inttypes.h])
AC_CHECK_TYPE([uint32_t],
[AC_DEFINE(HAVE_C99_INTTYPES, 1, [Define if you have the C99 integer types])],
[AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)])
AH_VERBATIM([X_HAVE_C99_INTTYPES],
[#ifndef HAVE_C99_INTTYPES
# if SIZEOF_SHORT == 4
typedef unsigned short uint32_t;
# elif SIZEOF_INT == 4
typedef unsigned int uint32_t;
# elif SIZEOF_LONG == 4
typedef unsigned long uint32_t;
# endif
# if SIZEOF_INT == 8
typedef unsigned int uint64_t;
# elif SIZEOF_LONG == 8
typedef unsigned long uint64_t;
# elif SIZEOF_LONG_LONG == 8
typedef unsigned long long uint64_t;
# endif
#endif
])
])
dnl XIPH_TYPE_SOCKLEN_T
dnl Brendan Cully
dnl
# XIPH_TYPE_SOCKLEN_T
# Check for socklen_t, or define as int if missing
AC_DEFUN([XIPH_TYPE_SOCKLEN_T],
[dnl
AC_CHECK_HEADERS([sys/socket.h])
AC_CHECK_TYPES([socklen_t],,,
[#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#if HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
])
AH_VERBATIM([X_HAVE_SOCKLEN_T],
[#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;
#endif
])
])

View File

@ -1,58 +0,0 @@
dnl XIPH_PATH_XML
dnl Populate XML_CFLAGS and XML_LIBS with infomation for
dnl linking with libxml2
AC_DEFUN([XIPH_PATH_XML],
[dnl
AC_MSG_RESULT([checking for XML configuration])
AC_ARG_VAR([XMLCONFIG],[XML configuration program])
AC_ARG_WITH(xml-config,
[AC_HELP_STRING([--with-xml-config=PATH],
[use xml-config in PATH to find libxml])],
[XMLCONFIG="$withval"],
[AC_PATH_PROGS(XMLCONFIG, [xml2-config xml-config], "")]
)
if test "x$XMLCONFIG" = "x"; then
AC_MSG_ERROR([XML configuration could not be found])
fi
if ! test -x "$XMLCONFIG"; then
AC_MSG_ERROR([$XMLCONFIG cannot be executed])
fi
XML_LIBS="$($XMLCONFIG --libs)"
XML_CFLAGS="$($XMLCONFIG --cflags)"
ac_xml_save_LIBS="$LIBS"
ac_xml_save_CFLAGS="$CFLAGS"
LIBS="$XML_LIBS $LIBS"
CFLAGS="$CFLAGS $XML_CFLAGS"
AC_CHECK_FUNC(xmlParseFile,, [AC_MSG_ERROR([Unable to link with libxml])])
CFLAGS="$ac_xml_save_CFLAGS"
LIBS="$ac_xml_save_LIBS"
])
dnl XIPH_PATH_XSLT
dnl Populate XSLT_CFLAGS and XSLT_LIBS with infomation for
dnl linking with libxml2
AC_DEFUN([XIPH_PATH_XSLT],
[dnl
AC_ARG_VAR([XSLTCONFIG],[XSLT configuration program])
AC_ARG_WITH(xslt-config,
[AC_HELP_STRING([--with-xslt-config=PATH],
[use xslt-config in PATH to find libxslt])],
[XSLTCONFIG="$withval"],
[AC_PATH_PROGS(XSLTCONFIG, [xslt-config], "")]
)
if test "x$XSLTCONFIG" = "x"; then
AC_MSG_ERROR([XSLT configuration could not be found])
fi
if ! test -x "$XSLTCONFIG"; then
AC_MSG_ERROR([$XSLTCONFIG cannot be executed])
fi
XSLT_LIBS="$($XSLTCONFIG --libs)"
XSLT_CFLAGS="$($XSLTCONFIG --cflags)"
ac_xslt_save_LIBS="$LIBS"
ac_xslt_save_CFLAGS="$CFLAGS"
LIBS="$XSLT_LIBS $LIBS"
CFLAGS="$CFLAGS $XSLT_CFLAGS"
AC_CHECK_FUNC(xsltParseStylesheetFile,,[AC_MSG_ERROR([Unable to link with libxslt])])
CFLAGS="$ac_xslt_save_CFLAGS"
LIBS="$ac_xslt_save_LIBS"
])

View File

@ -1,6 +0,0 @@
Makefile
Makefile.in
*.o
icecast
.deps
.libs

View File

@ -1,30 +0,0 @@
## Process this with automake to create Makefile.in
AUTOMAKE_OPTIONS = foreign
SUBDIRS = avl thread httpp net log timing
bin_PROGRAMS = icecast
noinst_HEADERS = admin.h cfgfile.h os.h logging.h sighandler.h connection.h global.h\
util.h slave.h source.h stats.h refbuf.h client.h format.h format_vorbis.h\
compat.h format_mp3.h fserve.h xslt.h yp.h event.h auth.h md5.h
icecast_SOURCES = cfgfile.c main.c logging.c sighandler.c connection.c global.c\
util.c slave.c source.c stats.c refbuf.c client.c format.c format_vorbis.c\
format_mp3.c xslt.c fserve.c event.c admin.c auth.c md5.c
EXTRA_icecast_SOURCES = yp.c
icecast_DEPENDENCIES = @ICECAST_OPTIONAL@ net/libicenet.la thread/libicethread.la \
httpp/libicehttpp.la log/libicelog.la avl/libiceavl.la timing/libicetiming.la
icecast_LDADD = $(icecast_DEPENDENCIES) @XIPH_LIBS@
AM_CFLAGS = @XIPH_CFLAGS@
AM_CPPFLAGS = @XIPH_CPPFLAGS@
debug:
$(MAKE) all CFLAGS="@DEBUG@"
profile:
$(MAKE) all CFLAGS="@PROFILE@"

View File

@ -1 +0,0 @@
need a shutdown function in case anything else in the code needs to have icecast gracefully shutdown.

View File

@ -1,877 +0,0 @@
/* Icecast
*
* This program is distributed under the GNU General Public License, version 2.
* A copy of this license is included with this source.
*
* Copyright 2000-2004, Jack Moffitt <jack@xiph.org,
* Michael Smith <msmith@xiph.org>,
* oddsock <oddsock@xiph.org>,
* Karl Heyes <karl@xiph.org>
* and others (see AUTHORS for details).
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <time.h>
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include "cfgfile.h"
#include "connection.h"
#include "refbuf.h"
#include "client.h"
#include "source.h"
#include "global.h"
#include "event.h"
#include "stats.h"
#include "os.h"
#include "xslt.h"
#include "format.h"
#include "format_mp3.h"
#include "logging.h"
#include "auth.h"
#ifdef _WIN32
#define snprintf _snprintf
#endif
#define CATMODULE "admin"
#define COMMAND_ERROR (-1)
/* Mount-specific commands */
#define COMMAND_RAW_FALLBACK 1
#define COMMAND_METADATA_UPDATE 2
#define COMMAND_RAW_SHOW_LISTENERS 3
#define COMMAND_RAW_MOVE_CLIENTS 4
#define COMMAND_RAW_MANAGEAUTH 5
#define COMMAND_TRANSFORMED_FALLBACK 50
#define COMMAND_TRANSFORMED_SHOW_LISTENERS 53
#define COMMAND_TRANSFORMED_MOVE_CLIENTS 54
#define COMMAND_TRANSFORMED_MANAGEAUTH 55
/* Global commands */
#define COMMAND_RAW_LIST_MOUNTS 101
#define COMMAND_RAW_STATS 102
#define COMMAND_RAW_LISTSTREAM 103
#define COMMAND_PLAINTEXT_LISTSTREAM 104
#define COMMAND_TRANSFORMED_LIST_MOUNTS 201
#define COMMAND_TRANSFORMED_STATS 202
#define COMMAND_TRANSFORMED_LISTSTREAM 203
/* Client management commands */
#define COMMAND_RAW_KILL_CLIENT 301
#define COMMAND_RAW_KILL_SOURCE 302
#define COMMAND_TRANSFORMED_KILL_CLIENT 401
#define COMMAND_TRANSFORMED_KILL_SOURCE 402
/* Admin commands requiring no auth */
#define COMMAND_BUILDM3U 501
#define FALLBACK_RAW_REQUEST "fallbacks"
#define FALLBACK_TRANSFORMED_REQUEST "fallbacks.xsl"
#define METADATA_REQUEST "metadata"
#define LISTCLIENTS_RAW_REQUEST "listclients"
#define LISTCLIENTS_TRANSFORMED_REQUEST "listclients.xsl"
#define STATS_RAW_REQUEST "stats"
#define STATS_TRANSFORMED_REQUEST "stats.xsl"
#define LISTMOUNTS_RAW_REQUEST "listmounts"
#define LISTMOUNTS_TRANSFORMED_REQUEST "listmounts.xsl"
#define STREAMLIST_RAW_REQUEST "streamlist"
#define STREAMLIST_TRANSFORMED_REQUEST "streamlist.xsl"
#define STREAMLIST_PLAINTEXT_REQUEST "streamlist.txt"
#define MOVECLIENTS_RAW_REQUEST "moveclients"
#define MOVECLIENTS_TRANSFORMED_REQUEST "moveclients.xsl"
#define KILLCLIENT_RAW_REQUEST "killclient"
#define KILLCLIENT_TRANSFORMED_REQUEST "killclient.xsl"
#define KILLSOURCE_RAW_REQUEST "killsource"
#define KILLSOURCE_TRANSFORMED_REQUEST "killsource.xsl"
#define ADMIN_XSL_RESPONSE "response.xsl"
#define MANAGEAUTH_RAW_REQUEST "manageauth"
#define MANAGEAUTH_TRANSFORMED_REQUEST "manageauth.xsl"
#define DEFAULT_RAW_REQUEST ""
#define DEFAULT_TRANSFORMED_REQUEST ""
#define BUILDM3U_RAW_REQUEST "buildm3u"
#define RAW 1
#define TRANSFORMED 2
#define PLAINTEXT 3
int admin_get_command(char *command)
{
if(!strcmp(command, FALLBACK_RAW_REQUEST))
return COMMAND_RAW_FALLBACK;
else if(!strcmp(command, FALLBACK_TRANSFORMED_REQUEST))
return COMMAND_TRANSFORMED_FALLBACK;
else if(!strcmp(command, METADATA_REQUEST))
return COMMAND_METADATA_UPDATE;
else if(!strcmp(command, LISTCLIENTS_RAW_REQUEST))
return COMMAND_RAW_SHOW_LISTENERS;
else if(!strcmp(command, LISTCLIENTS_TRANSFORMED_REQUEST))
return COMMAND_TRANSFORMED_SHOW_LISTENERS;
else if(!strcmp(command, STATS_RAW_REQUEST))
return COMMAND_RAW_STATS;
else if(!strcmp(command, STATS_TRANSFORMED_REQUEST))
return COMMAND_TRANSFORMED_STATS;
else if(!strcmp(command, "stats.xml")) /* The old way */
return COMMAND_RAW_STATS;
else if(!strcmp(command, LISTMOUNTS_RAW_REQUEST))
return COMMAND_RAW_LIST_MOUNTS;
else if(!strcmp(command, LISTMOUNTS_TRANSFORMED_REQUEST))
return COMMAND_TRANSFORMED_LIST_MOUNTS;
else if(!strcmp(command, STREAMLIST_RAW_REQUEST))
return COMMAND_RAW_LISTSTREAM;
else if(!strcmp(command, STREAMLIST_PLAINTEXT_REQUEST))
return COMMAND_PLAINTEXT_LISTSTREAM;
else if(!strcmp(command, MOVECLIENTS_RAW_REQUEST))
return COMMAND_RAW_MOVE_CLIENTS;
else if(!strcmp(command, MOVECLIENTS_TRANSFORMED_REQUEST))
return COMMAND_TRANSFORMED_MOVE_CLIENTS;
else if(!strcmp(command, KILLCLIENT_RAW_REQUEST))
return COMMAND_RAW_KILL_CLIENT;
else if(!strcmp(command, KILLCLIENT_TRANSFORMED_REQUEST))
return COMMAND_TRANSFORMED_KILL_CLIENT;
else if(!strcmp(command, KILLSOURCE_RAW_REQUEST))
return COMMAND_RAW_KILL_SOURCE;
else if(!strcmp(command, KILLSOURCE_TRANSFORMED_REQUEST))
return COMMAND_TRANSFORMED_KILL_SOURCE;
else if(!strcmp(command, MANAGEAUTH_RAW_REQUEST))
return COMMAND_RAW_MANAGEAUTH;
else if(!strcmp(command, MANAGEAUTH_TRANSFORMED_REQUEST))
return COMMAND_TRANSFORMED_MANAGEAUTH;
else if(!strcmp(command, BUILDM3U_RAW_REQUEST))
return COMMAND_BUILDM3U;
else if(!strcmp(command, DEFAULT_TRANSFORMED_REQUEST))
return COMMAND_TRANSFORMED_STATS;
else if(!strcmp(command, DEFAULT_RAW_REQUEST))
return COMMAND_TRANSFORMED_STATS;
else
return COMMAND_ERROR;
}
static void command_fallback(client_t *client, source_t *source, int response);
static void command_metadata(client_t *client, source_t *source);
static void command_show_listeners(client_t *client, source_t *source,
int response);
static void command_move_clients(client_t *client, source_t *source,
int response);
static void command_stats(client_t *client, int response);
static void command_list_mounts(client_t *client, int response);
static void command_kill_client(client_t *client, source_t *source,
int response);
static void command_manageauth(client_t *client, source_t *source,
int response);
static void command_buildm3u(client_t *client, source_t *source,
int response);
static void command_kill_source(client_t *client, source_t *source,
int response);
static void admin_handle_mount_request(client_t *client, source_t *source,
int command);
static void admin_handle_general_request(client_t *client, int command);
static void admin_send_response(xmlDocPtr doc, client_t *client,
int response, char *xslt_template);
static void html_write(client_t *client, char *fmt, ...);
xmlDocPtr admin_build_sourcelist(char *current_source)
{
avl_node *node;
source_t *source;
xmlNodePtr xmlnode, srcnode;
xmlDocPtr doc;
char buf[22];
time_t now = time(NULL);
doc = xmlNewDoc("1.0");
xmlnode = xmlNewDocNode(doc, NULL, "icestats", NULL);
xmlDocSetRootElement(doc, xmlnode);
if (current_source) {
xmlNewChild(xmlnode, NULL, "current_source", current_source);
}
node = avl_get_first(global.source_tree);
while(node) {
source = (source_t *)node->key;
if (source->running)
{
srcnode = xmlNewChild(xmlnode, NULL, "source", NULL);
xmlSetProp(srcnode, "mount", source->mount);
xmlNewChild(srcnode, NULL, "fallback",
(source->fallback_mount != NULL)?
source->fallback_mount:"");
snprintf(buf, sizeof(buf), "%ld", source->listeners);
xmlNewChild(srcnode, NULL, "listeners", buf);
snprintf(buf, sizeof(buf), "%lu",
(unsigned long)(now - source->con->con_time));
xmlNewChild(srcnode, NULL, "Connected", buf);
xmlNewChild(srcnode, NULL, "Format",
source->format->format_description);
if (source->authenticator) {
xmlNewChild(srcnode, NULL, "authenticator",
source->authenticator->type);
}
}
node = avl_get_next(node);
}
return(doc);
}
void admin_send_response(xmlDocPtr doc, client_t *client,
int response, char *xslt_template)
{
xmlChar *buff = NULL;
int len = 0;
ice_config_t *config;
char *fullpath_xslt_template;
int fullpath_xslt_template_len;
char *adminwebroot;
client->respcode = 200;
if (response == RAW) {
xmlDocDumpMemory(doc, &buff, &len);
html_write(client, "HTTP/1.0 200 OK\r\n"
"Content-Length: %d\r\n"
"Content-Type: text/xml\r\n"
"\r\n", len);
html_write(client, buff);
}
if (response == TRANSFORMED) {
config = config_get_config();
adminwebroot = config->adminroot_dir;
config_release_config();
fullpath_xslt_template_len = strlen(adminwebroot) +
strlen(xslt_template) + 2;
fullpath_xslt_template = malloc(fullpath_xslt_template_len);
memset(fullpath_xslt_template, '\000', fullpath_xslt_template_len);
snprintf(fullpath_xslt_template, fullpath_xslt_template_len, "%s%s%s",
adminwebroot, PATH_SEPARATOR, xslt_template);
html_write(client, "HTTP/1.0 200 OK\r\n"
"Content-Type: text/html\r\n"
"\r\n");
DEBUG1("Sending XSLT (%s)", fullpath_xslt_template);
xslt_transform(doc, fullpath_xslt_template, client);
free(fullpath_xslt_template);
}
if (buff) {
xmlFree(buff);
}
}
void admin_handle_request(client_t *client, char *uri)
{
char *mount, *command_string;
int command;
int noauth = 0;
if(strncmp("/admin/", uri, 7)) {
ERROR0("Internal error: admin request isn't");
client_send_401(client);
return;
}
command_string = uri + 7;
DEBUG1("Got command (%s)", command_string);
command = admin_get_command(command_string);
if(command < 0) {
ERROR1("Error parsing command string or unrecognised command: %s",
command_string);
client_send_400(client, "Unrecognised command");
return;
}
mount = httpp_get_query_param(client->parser, "mount");
if(mount != NULL) {
source_t *source;
if (command == COMMAND_BUILDM3U) {
noauth = 1;
}
/* This is a mount request, handle it as such */
if (!noauth) {
if(!connection_check_admin_pass(client->parser)) {
if(!connection_check_source_pass(client->parser, mount)) {
INFO1("Bad or missing password on mount modification admin "
"request (command: %s)", command_string);
client_send_401(client);
return;
}
}
}
avl_tree_rlock(global.source_tree);
source = source_find_mount_raw(mount);
if (source == NULL)
{
WARN2("Admin command %s on non-existent source %s",
command_string, mount);
avl_tree_unlock(global.source_tree);
client_send_400(client, "Source does not exist");
}
else
{
if (source->running == 0)
{
INFO2("Received admin command %s on unavailable mount \"%s\"",
command_string, mount);
avl_tree_unlock (global.source_tree);
client_send_400 (client, "Source is not available");
return;
}
INFO2("Received admin command %s on mount \"%s\"",
command_string, mount);
admin_handle_mount_request(client, source, command);
avl_tree_unlock(global.source_tree);
}
}
else {
if (command == COMMAND_PLAINTEXT_LISTSTREAM) {
/* this request is used by a slave relay to retrieve
mounts from the master, so handle this request
validating against the relay password */
if(!connection_check_relay_pass(client->parser)) {
INFO1("Bad or missing password on admin command "
"request (command: %s)", command_string);
client_send_401(client);
return;
}
}
else {
if(!connection_check_admin_pass(client->parser)) {
INFO1("Bad or missing password on admin command "
"request (command: %s)", command_string);
client_send_401(client);
return;
}
}
admin_handle_general_request(client, command);
}
}
static void admin_handle_general_request(client_t *client, int command)
{
switch(command) {
case COMMAND_RAW_STATS:
command_stats(client, RAW);
break;
case COMMAND_RAW_LIST_MOUNTS:
command_list_mounts(client, RAW);
break;
case COMMAND_RAW_LISTSTREAM:
command_list_mounts(client, RAW);
break;
case COMMAND_PLAINTEXT_LISTSTREAM:
command_list_mounts(client, PLAINTEXT);
break;
case COMMAND_TRANSFORMED_STATS:
command_stats(client, TRANSFORMED);
break;
case COMMAND_TRANSFORMED_LIST_MOUNTS:
command_list_mounts(client, TRANSFORMED);
break;
case COMMAND_TRANSFORMED_LISTSTREAM:
command_list_mounts(client, TRANSFORMED);
break;
case COMMAND_TRANSFORMED_MOVE_CLIENTS:
command_list_mounts(client, TRANSFORMED);
break;
default:
WARN0("General admin request not recognised");
client_send_400(client, "Unknown admin request");
return;
}
}
static void admin_handle_mount_request(client_t *client, source_t *source,
int command)
{
switch(command) {
case COMMAND_RAW_FALLBACK:
command_fallback(client, source, RAW);
break;
case COMMAND_METADATA_UPDATE:
command_metadata(client, source);
break;
case COMMAND_RAW_SHOW_LISTENERS:
command_show_listeners(client, source, RAW);
break;
case COMMAND_RAW_MOVE_CLIENTS:
command_move_clients(client, source, RAW);
break;
case COMMAND_RAW_KILL_CLIENT:
command_kill_client(client, source, RAW);
break;
case COMMAND_RAW_KILL_SOURCE:
command_kill_source(client, source, RAW);
break;
case COMMAND_TRANSFORMED_FALLBACK:
command_fallback(client, source, RAW);
break;
case COMMAND_TRANSFORMED_SHOW_LISTENERS:
command_show_listeners(client, source, TRANSFORMED);
break;
case COMMAND_TRANSFORMED_MOVE_CLIENTS:
command_move_clients(client, source, TRANSFORMED);
break;
case COMMAND_TRANSFORMED_KILL_CLIENT:
command_kill_client(client, source, TRANSFORMED);
break;
case COMMAND_TRANSFORMED_KILL_SOURCE:
command_kill_source(client, source, TRANSFORMED);
break;
case COMMAND_TRANSFORMED_MANAGEAUTH:
command_manageauth(client, source, TRANSFORMED);
break;
case COMMAND_RAW_MANAGEAUTH:
command_manageauth(client, source, RAW);
break;
case COMMAND_BUILDM3U:
command_buildm3u(client, source, RAW);
break;
default:
WARN0("Mount request not recognised");
client_send_400(client, "Mount request unknown");
break;
}
}
#define COMMAND_REQUIRE(client,name,var) \
do { \
(var) = httpp_get_query_param((client)->parser, (name)); \
if((var) == NULL) { \
client_send_400((client), "Missing parameter"); \
return; \
} \
} while(0);
#define COMMAND_OPTIONAL(client,name,var) \
(var) = httpp_get_query_param((client)->parser, (name))
static void html_success(client_t *client, char *message)
{
int bytes;
client->respcode = 200;
bytes = sock_write(client->con->sock,
"HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n"
"<html><head><title>Admin request successful</title></head>"
"<body><p>%s</p></body></html>", message);
if(bytes > 0) client->con->sent_bytes = bytes;
client_destroy(client);
}
static void html_write(client_t *client, char *fmt, ...)
{
int bytes;
va_list ap;
va_start(ap, fmt);
bytes = sock_write_fmt(client->con->sock, fmt, ap);
va_end(ap);
if(bytes > 0) client->con->sent_bytes = bytes;
}
static void command_move_clients(client_t *client, source_t *source,
int response)
{
char *dest_source;
source_t *dest;
xmlDocPtr doc;
xmlNodePtr node;
char buf[255];
int parameters_passed = 0;
DEBUG0("Doing optional check");
if((COMMAND_OPTIONAL(client, "destination", dest_source))) {
parameters_passed = 1;
}
DEBUG1("Done optional check (%d)", parameters_passed);
if (!parameters_passed) {
doc = admin_build_sourcelist(source->mount);
admin_send_response(doc, client, response,
MOVECLIENTS_TRANSFORMED_REQUEST);
xmlFreeDoc(doc);
client_destroy(client);
return;
}
dest = source_find_mount (dest_source);
if (dest == NULL)
{
client_send_400 (client, "No such destination");
return;
}
if (strcmp (dest->mount, source->mount) == 0)
{
client_send_400 (client, "supplied mountpoints are identical");
return;
}
if (dest->running == 0)
{
client_send_400 (client, "Destination not running");
return;
}
doc = xmlNewDoc("1.0");
node = xmlNewDocNode(doc, NULL, "iceresponse", NULL);
xmlDocSetRootElement(doc, node);
source_move_clients (source, dest);
memset(buf, '\000', sizeof(buf));
snprintf (buf, sizeof(buf), "Clients moved from %s to %s",
source->mount, dest_source);
xmlNewChild(node, NULL, "message", buf);
xmlNewChild(node, NULL, "return", "1");
admin_send_response(doc, client, response,
ADMIN_XSL_RESPONSE);
xmlFreeDoc(doc);
client_destroy(client);
}
static void command_show_listeners(client_t *client, source_t *source,
int response)
{
xmlDocPtr doc;
xmlNodePtr node, srcnode, listenernode;
avl_node *client_node;
client_t *current;
char buf[22];
char *userAgent = NULL;
time_t now = time(NULL);
doc = xmlNewDoc("1.0");
node = xmlNewDocNode(doc, NULL, "icestats", NULL);
srcnode = xmlNewChild(node, NULL, "source", NULL);
xmlSetProp(srcnode, "mount", source->mount);
xmlDocSetRootElement(doc, node);
memset(buf, '\000', sizeof(buf));
snprintf(buf, sizeof(buf)-1, "%ld", source->listeners);
xmlNewChild(srcnode, NULL, "Listeners", buf);
avl_tree_rlock(source->client_tree);
client_node = avl_get_first(source->client_tree);
while(client_node) {
current = (client_t *)client_node->key;
listenernode = xmlNewChild(srcnode, NULL, "listener", NULL);
xmlNewChild(listenernode, NULL, "IP", current->con->ip);
userAgent = httpp_getvar(current->parser, "user-agent");
if (userAgent) {
xmlNewChild(listenernode, NULL, "UserAgent", userAgent);
}
else {
xmlNewChild(listenernode, NULL, "UserAgent", "Unknown");
}
memset(buf, '\000', sizeof(buf));
snprintf(buf, sizeof(buf)-1, "%ld", now - current->con->con_time);
xmlNewChild(listenernode, NULL, "Connected", buf);
memset(buf, '\000', sizeof(buf));
snprintf(buf, sizeof(buf)-1, "%lu", current->con->id);
xmlNewChild(listenernode, NULL, "ID", buf);
if (current->username) {
xmlNewChild(listenernode, NULL, "username", current->username);
}
client_node = avl_get_next(client_node);
}
avl_tree_unlock(source->client_tree);
admin_send_response(doc, client, response,
LISTCLIENTS_TRANSFORMED_REQUEST);
xmlFreeDoc(doc);
client_destroy(client);
}
static void command_buildm3u(client_t *client, source_t *source,
int response)
{
char *username = NULL;
char *password = NULL;
char *host = NULL;
int port = 0;
ice_config_t *config;
COMMAND_REQUIRE(client, "username", username);
COMMAND_REQUIRE(client, "password", password);
config = config_get_config();
host = strdup(config->hostname);
port = config->port;
config_release_config();
client->respcode = 200;
sock_write(client->con->sock,
"HTTP/1.0 200 OK\r\n"
"Content-Type: audio/x-mpegurl\r\n"
"Content-Disposition = attachment; filename=listen.m3u\r\n\r\n"
"http://%s:%s@%s:%d%s\r\n",
username,
password,
host,
port,
source->mount
);
free(host);
client_destroy(client);
}
static void command_manageauth(client_t *client, source_t *source,
int response)
{
xmlDocPtr doc;
xmlNodePtr node, srcnode, msgnode;
char *action = NULL;
char *username = NULL;
char *password = NULL;
char *message = NULL;
int ret = AUTH_OK;
if((COMMAND_OPTIONAL(client, "action", action))) {
if (!strcmp(action, "add")) {
COMMAND_REQUIRE(client, "username", username);
COMMAND_REQUIRE(client, "password", password);
ret = auth_adduser(source, username, password);
if (ret == AUTH_FAILED) {
message = strdup("User add failed - check the icecast error log");
}
if (ret == AUTH_USERADDED) {
message = strdup("User added");
}
if (ret == AUTH_USEREXISTS) {
message = strdup("User already exists - not added");
}
}
if (!strcmp(action, "delete")) {
COMMAND_REQUIRE(client, "username", username);
ret = auth_deleteuser(source, username);
if (ret == AUTH_FAILED) {
message = strdup("User delete failed - check the icecast error log");
}
if (ret == AUTH_USERDELETED) {
message = strdup("User deleted");
}
}
}
doc = xmlNewDoc("1.0");
node = xmlNewDocNode(doc, NULL, "icestats", NULL);
srcnode = xmlNewChild(node, NULL, "source", NULL);
xmlSetProp(srcnode, "mount", source->mount);
if (message) {
msgnode = xmlNewChild(node, NULL, "iceresponse", NULL);
xmlNewChild(msgnode, NULL, "message", message);
}
xmlDocSetRootElement(doc, node);
auth_get_userlist(source, srcnode);
admin_send_response(doc, client, response,
MANAGEAUTH_TRANSFORMED_REQUEST);
if (message) {
free(message);
}
xmlFreeDoc(doc);
client_destroy(client);
}
static void command_kill_source(client_t *client, source_t *source,
int response)
{
xmlDocPtr doc;
xmlNodePtr node;
doc = xmlNewDoc("1.0");
node = xmlNewDocNode(doc, NULL, "iceresponse", NULL);
xmlNewChild(node, NULL, "message", "Source Removed");
xmlNewChild(node, NULL, "return", "1");
xmlDocSetRootElement(doc, node);
source->running = 0;
admin_send_response(doc, client, response,
ADMIN_XSL_RESPONSE);
xmlFreeDoc(doc);
client_destroy(client);
}
static void command_kill_client(client_t *client, source_t *source,
int response)
{
char *idtext;
int id;
client_t *listener;
xmlDocPtr doc;
xmlNodePtr node;
char buf[50] = "";
COMMAND_REQUIRE(client, "id", idtext);
id = atoi(idtext);
listener = source_find_client(source, id);
doc = xmlNewDoc("1.0");
node = xmlNewDocNode(doc, NULL, "iceresponse", NULL);
xmlDocSetRootElement(doc, node);
DEBUG1("Response is %d", response);
if(listener != NULL) {
INFO1("Admin request: client %d removed", id);
/* This tags it for removal on the next iteration of the main source
* loop
*/
listener->con->error = 1;
memset(buf, '\000', sizeof(buf));
snprintf(buf, sizeof(buf)-1, "Client %d removed", id);
xmlNewChild(node, NULL, "message", buf);
xmlNewChild(node, NULL, "return", "1");
}
else {
memset(buf, '\000', sizeof(buf));
snprintf(buf, sizeof(buf)-1, "Client %d not found", id);
xmlNewChild(node, NULL, "message", buf);
xmlNewChild(node, NULL, "return", "0");
}
admin_send_response(doc, client, response,
ADMIN_XSL_RESPONSE);
xmlFreeDoc(doc);
client_destroy(client);
}
static void command_fallback(client_t *client, source_t *source,
int response)
{
char *fallback;
char *old;
DEBUG0("Got fallback request");
COMMAND_REQUIRE(client, "fallback", fallback);
old = source->fallback_mount;
source->fallback_mount = strdup(fallback);
free(old);
html_success(client, "Fallback configured");
}
static void command_metadata(client_t *client, source_t *source)
{
char *action;
char *value;
mp3_state *state;
DEBUG0("Got metadata update request");
COMMAND_REQUIRE(client, "mode", action);
COMMAND_REQUIRE(client, "song", value);
if (source->format->type != FORMAT_TYPE_MP3)
{
client_send_400 (client, "Not mp3, cannot update metadata");
return;
}
if (strcmp (action, "updinfo") != 0)
{
client_send_400 (client, "No such action");
return;
}
state = source->format->_state;
thread_mutex_lock(&(state->lock));
free(state->metadata);
state->metadata = strdup(value);
state->metadata_age++;
thread_mutex_unlock(&(state->lock));
DEBUG2("Metadata on mountpoint %s changed to \"%s\"",
source->mount, value);
stats_event(source->mount, "title", value);
/* If we get an update on the mountpoint, force a
yp touch */
yp_touch (source->mount);
html_success(client, "Metadata update successful");
}
static void command_stats(client_t *client, int response) {
xmlDocPtr doc;
DEBUG0("Stats request, sending xml stats");
stats_get_xml(&doc);
admin_send_response(doc, client, response, STATS_TRANSFORMED_REQUEST);
xmlFreeDoc(doc);
client_destroy(client);
return;
}
static void command_list_mounts(client_t *client, int response)
{
avl_node *node;
source_t *source;
DEBUG0("List mounts request");
avl_tree_rlock (global.source_tree);
if (response == PLAINTEXT)
{
char buffer [4096], *buf = buffer;
unsigned remaining = sizeof (buffer);
int ret = sprintf (buffer,
"HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n");
node = avl_get_first(global.source_tree);
while (node && ret > 0 && ret < remaining)
{
remaining -= ret;
buf += ret;
source = (source_t *)node->key;
ret = snprintf (buf, remaining, "%s\n", source->mount);
node = avl_get_next(node);
}
avl_tree_unlock (global.source_tree);
/* handle last line */
if (ret > 0 && ret < remaining)
{
remaining -= ret;
buf += ret;
}
sock_write_bytes (client->con->sock, buffer, sizeof (buffer)-remaining);
}
else
{
xmlDocPtr doc = admin_build_sourcelist(NULL);
avl_tree_unlock (global.source_tree);
admin_send_response(doc, client, response,
LISTMOUNTS_TRANSFORMED_REQUEST);
xmlFreeDoc(doc);
}
client_destroy(client);
return;
}

View File

@ -1,21 +0,0 @@
/* Icecast
*
* This program is distributed under the GNU General Public License, version 2.
* A copy of this license is included with this source.
*
* Copyright 2000-2004, Jack Moffitt <jack@xiph.org,
* Michael Smith <msmith@xiph.org>,
* oddsock <oddsock@xiph.org>,
* Karl Heyes <karl@xiph.org>
* and others (see AUTHORS for details).
*/
#ifndef __ADMIN_H__
#define __ADMIN_H__
#include "refbuf.h"
#include "client.h"
void admin_handle_request(client_t *client, char *uri);
#endif /* __ADMIN_H__ */

View File

@ -1,496 +0,0 @@
/* Icecast
*
* This program is distributed under the GNU General Public License, version 2.
* A copy of this license is included with this source.
*
* Copyright 2000-2004, Jack Moffitt <jack@xiph.org,
* Michael Smith <msmith@xiph.org>,
* oddsock <oddsock@xiph.org>,
* Karl Heyes <karl@xiph.org>
* and others (see AUTHORS for details).
*/
/**
* Client authentication functions
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include "auth.h"
#include "source.h"
#include "client.h"
#include "cfgfile.h"
#include "httpp/httpp.h"
#include "md5.h"
#include "logging.h"
#define CATMODULE "auth"
int auth_is_listener_connected(source_t *source, char *username)
{
client_t *client;
avl_node *client_node;
avl_tree_rlock(source->client_tree);
client_node = avl_get_first(source->client_tree);
while(client_node) {
client = (client_t *)client_node->key;
if (client->username) {
if (!strcmp(client->username, username)) {
avl_tree_unlock(source->client_tree);
return 1;
}
}
client_node = avl_get_next(client_node);
}
avl_tree_unlock(source->client_tree);
return 0;
}
auth_result auth_check_client(source_t *source, client_t *client)
{
auth_t *authenticator = source->authenticator;
auth_result result;
if(authenticator) {
/* This will look something like "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" */
char *header = httpp_getvar(client->parser, "authorization");
char *userpass, *tmp;
char *username, *password;
if(header == NULL)
return AUTH_FAILED;
if(strncmp(header, "Basic ", 6)) {
INFO0("Authorization not using Basic");
return 0;
}
userpass = util_base64_decode(header+6);
if(userpass == NULL) {
WARN1("Base64 decode of Authorization header \"%s\" failed",
header+6);
return AUTH_FAILED;
}
tmp = strchr(userpass, ':');
if(!tmp) {
free(userpass);
return AUTH_FAILED;
}
*tmp = 0;
username = userpass;
password = tmp+1;
result = authenticator->authenticate(
authenticator, source, username, password);
if(result == AUTH_OK)
client->username = strdup(username);
free(userpass);
return result;
}
else
return AUTH_FAILED;
}
static auth_t *auth_get_htpasswd_auth(config_options_t *options);
auth_t *auth_get_authenticator(char *type, config_options_t *options)
{
auth_t *auth = NULL;
if(!strcmp(type, "htpasswd")) {
auth = auth_get_htpasswd_auth(options);
auth->type = strdup(type);
}
else {
ERROR1("Unrecognised authenticator type: \"%s\"", type);
return NULL;
}
if(!auth)
ERROR1("Couldn't configure authenticator of type \"%s\"", type);
return auth;
}
typedef struct {
char *filename;
int allow_duplicate_users;
rwlock_t file_rwlock;
} htpasswd_auth_state;
static void htpasswd_clear(auth_t *self) {
htpasswd_auth_state *state = self->state;
free(state->filename);
thread_rwlock_destroy(&state->file_rwlock);
free(state);
free(self->type);
free(self);
}
static int get_line(FILE *file, char *buf, int len)
{
if(fgets(buf, len, file)) {
int len = strlen(buf);
if(len > 0 && buf[len-1] == '\n') {
buf[--len] = 0;
if(len > 0 && buf[len-1] == '\r')
buf[--len] = 0;
}
return 1;
}
return 0;
}
/* md5 hash */
static char *get_hash(char *data, int len)
{
struct MD5Context context;
unsigned char digest[16];
MD5Init(&context);
MD5Update(&context, data, len);
MD5Final(digest, &context);
return util_bin_to_hex(digest, 16);
}
#define MAX_LINE_LEN 512
/* Not efficient; opens and scans the entire file for every request */
static auth_result htpasswd_auth(auth_t *auth, source_t *source, char *username, char *password)
{
htpasswd_auth_state *state = auth->state;
FILE *passwdfile = NULL;
char line[MAX_LINE_LEN];
char *sep;
thread_rwlock_rlock(&state->file_rwlock);
if (!state->allow_duplicate_users) {
if (auth_is_listener_connected(source, username)) {
thread_rwlock_unlock(&state->file_rwlock);
return AUTH_FORBIDDEN;
}
}
passwdfile = fopen(state->filename, "rb");
if(passwdfile == NULL) {
WARN2("Failed to open authentication database \"%s\": %s",
state->filename, strerror(errno));
thread_rwlock_unlock(&state->file_rwlock);
return AUTH_FAILED;
}
while(get_line(passwdfile, line, MAX_LINE_LEN)) {
if(!line[0] || line[0] == '#')
continue;
sep = strchr(line, ':');
if(sep == NULL) {
DEBUG0("No seperator in line");
continue;
}
*sep = 0;
if(!strcmp(username, line)) {
/* Found our user, now: does the hash of password match hash? */
char *hash = sep+1;
char *hashed_password = get_hash(password, strlen(password));
if(!strcmp(hash, hashed_password)) {
fclose(passwdfile);
free(hashed_password);
thread_rwlock_unlock(&state->file_rwlock);
return AUTH_OK;
}
free(hashed_password);
/* We don't keep searching through the file */
break;
}
}
fclose(passwdfile);
thread_rwlock_unlock(&state->file_rwlock);
return AUTH_FAILED;
}
static auth_t *auth_get_htpasswd_auth(config_options_t *options)
{
auth_t *authenticator = calloc(1, sizeof(auth_t));
htpasswd_auth_state *state;
authenticator->authenticate = htpasswd_auth;
authenticator->free = htpasswd_clear;
state = calloc(1, sizeof(htpasswd_auth_state));
state->allow_duplicate_users = 1;
while(options) {
if(!strcmp(options->name, "filename"))
state->filename = strdup(options->value);
if(!strcmp(options->name, "allow_duplicate_users"))
state->allow_duplicate_users = atoi(options->value);
options = options->next;
}
if(!state->filename) {
free(state);
free(authenticator);
ERROR0("No filename given in options for authenticator.");
return NULL;
}
authenticator->state = state;
DEBUG1("Configured htpasswd authentication using password file %s",
state->filename);
thread_rwlock_create(&state->file_rwlock);
return authenticator;
}
int auth_htpasswd_existing_user(auth_t *auth, char *username)
{
FILE *passwdfile;
htpasswd_auth_state *state;
int ret = AUTH_OK;
char line[MAX_LINE_LEN];
char *sep;
state = auth->state;
passwdfile = fopen(state->filename, "rb");
if(passwdfile == NULL) {
WARN2("Failed to open authentication database \"%s\": %s",
state->filename, strerror(errno));
return AUTH_FAILED;
}
while(get_line(passwdfile, line, MAX_LINE_LEN)) {
if(!line[0] || line[0] == '#')
continue;
sep = strchr(line, ':');
if(sep == NULL) {
DEBUG0("No seperator in line");
continue;
}
*sep = 0;
if (!strcmp(username, line)) {
/* We found the user, break out of the loop */
ret = AUTH_USEREXISTS;
break;
}
}
fclose(passwdfile);
return ret;
}
int auth_htpasswd_adduser(auth_t *auth, char *username, char *password)
{
FILE *passwdfile;
char *hashed_password = NULL;
htpasswd_auth_state *state;
if (auth_htpasswd_existing_user(auth, username) == AUTH_USEREXISTS) {
return AUTH_USEREXISTS;
}
state = auth->state;
passwdfile = fopen(state->filename, "ab");
if(passwdfile == NULL) {
WARN2("Failed to open authentication database \"%s\": %s",
state->filename, strerror(errno));
return AUTH_FAILED;
}
hashed_password = get_hash(password, strlen(password));
if (hashed_password) {
fprintf(passwdfile, "%s:%s\n", username, hashed_password);
free(hashed_password);
}
fclose(passwdfile);
return AUTH_USERADDED;
}
int auth_adduser(source_t *source, char *username, char *password)
{
int ret = 0;
htpasswd_auth_state *state;
if (source->authenticator) {
if (!strcmp(source->authenticator->type, "htpasswd")) {
state = source->authenticator->state;
thread_rwlock_wlock(&state->file_rwlock);
ret = auth_htpasswd_adduser(source->authenticator, username, password);
thread_rwlock_unlock(&state->file_rwlock);
}
}
return ret;
}
int auth_htpasswd_deleteuser(auth_t *auth, char *username)
{
FILE *passwdfile;
FILE *tmp_passwdfile;
htpasswd_auth_state *state;
char line[MAX_LINE_LEN];
char *sep;
char *tmpfile = NULL;
int tmpfile_len = 0;
state = auth->state;
passwdfile = fopen(state->filename, "rb");
if(passwdfile == NULL) {
WARN2("Failed to open authentication database \"%s\": %s",
state->filename, strerror(errno));
return AUTH_FAILED;
}
tmpfile_len = strlen(state->filename) + 6;
tmpfile = calloc(1, tmpfile_len);
sprintf(tmpfile, ".%s.tmp", state->filename);
tmp_passwdfile = fopen(tmpfile, "wb");
if(tmp_passwdfile == NULL) {
WARN2("Failed to open temporary authentication database \"%s\": %s",
tmpfile, strerror(errno));
fclose(passwdfile);
free(tmpfile);
return AUTH_FAILED;
}
while(get_line(passwdfile, line, MAX_LINE_LEN)) {
if(!line[0] || line[0] == '#')
continue;
sep = strchr(line, ':');
if(sep == NULL) {
DEBUG0("No seperator in line");
continue;
}
*sep = 0;
if (strcmp(username, line)) {
/* We did not match on the user, so copy it to the temp file */
/* and put the : back in */
*sep = ':';
fprintf(tmp_passwdfile, "%s\n", line);
}
}
fclose(tmp_passwdfile);
fclose(passwdfile);
/* Now move the contents of the tmp file to the original */
#ifdef _WIN32
/* Windows won't let us rename a file if the destination file
exists...so, lets remove the original first */
if (remove(state->filename) != 0) {
ERROR3("Problem moving temp authentication file to original \"%s\" - \"%s\": %s",
tmpfile, state->filename, strerror(errno));
}
else {
#endif
if (rename(tmpfile, state->filename) != 0) {
ERROR3("Problem moving temp authentication file to original \"%s\" - \"%s\": %s",
tmpfile, state->filename, strerror(errno));
}
#ifdef _WIN32
}
#endif
free(tmpfile);
return AUTH_USERDELETED;
}
int auth_deleteuser(source_t *source, char *username)
{
htpasswd_auth_state *state;
int ret = 0;
if (source->authenticator) {
if (!strcmp(source->authenticator->type, "htpasswd")) {
state = source->authenticator->state;
thread_rwlock_wlock(&state->file_rwlock);
ret = auth_htpasswd_deleteuser(source->authenticator, username);
thread_rwlock_unlock(&state->file_rwlock);
}
}
return ret;
}
int auth_get_htpasswd_userlist(auth_t *auth, xmlNodePtr srcnode)
{
htpasswd_auth_state *state;
FILE *passwdfile;
char line[MAX_LINE_LEN];
char *sep;
char *passwd;
xmlNodePtr newnode;
state = auth->state;
passwdfile = fopen(state->filename, "rb");
if(passwdfile == NULL) {
WARN2("Failed to open authentication database \"%s\": %s",
state->filename, strerror(errno));
return AUTH_FAILED;
}
while(get_line(passwdfile, line, MAX_LINE_LEN)) {
if(!line[0] || line[0] == '#')
continue;
sep = strchr(line, ':');
if(sep == NULL) {
DEBUG0("No seperator in line");
continue;
}
*sep = 0;
newnode = xmlNewChild(srcnode, NULL, "User", NULL);
xmlNewChild(newnode, NULL, "username", line);
passwd = sep+1;
xmlNewChild(newnode, NULL, "password", passwd);
}
fclose(passwdfile);
return AUTH_OK;
}
int auth_get_userlist(source_t *source, xmlNodePtr srcnode)
{
int ret = 0;
htpasswd_auth_state *state;
if (source->authenticator) {
if (!strcmp(source->authenticator->type, "htpasswd")) {
state = source->authenticator->state;
thread_rwlock_rlock(&state->file_rwlock);
ret = auth_get_htpasswd_userlist(source->authenticator, srcnode);
thread_rwlock_unlock(&state->file_rwlock);
}
}
return ret;
}

View File

@ -1,53 +0,0 @@
/* Icecast
*
* This program is distributed under the GNU General Public License, version 2.
* A copy of this license is included with this source.
*
* Copyright 2000-2004, Jack Moffitt <jack@xiph.org,
* Michael Smith <msmith@xiph.org>,
* oddsock <oddsock@xiph.org>,
* Karl Heyes <karl@xiph.org>
* and others (see AUTHORS for details).
*/
#ifndef __AUTH_H__
#define __AUTH_H__
#include "source.h"
#include "client.h"
#include "config.h"
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
typedef enum
{
AUTH_OK,
AUTH_FAILED,
AUTH_FORBIDDEN,
AUTH_USERADDED,
AUTH_USEREXISTS,
AUTH_USERDELETED,
} auth_result;
typedef struct auth_tag
{
/* Authenticate using the given username and password */
auth_result (*authenticate)(struct auth_tag *self,
source_t *source, char *username, char *password);
void (*free)(struct auth_tag *self);
void *state;
void *type;
} auth_t;
auth_result auth_check_client(source_t *source, client_t *client);
auth_t *auth_get_authenticator(char *type, config_options_t *options);
void *auth_clear(auth_t *authenticator);
int auth_get_userlist(source_t *source, xmlNodePtr srcnode);
int auth_adduser(source_t *source, char *username, char *password);
int auth_deleteuser(source_t *source, char *username);
#endif

View File

@ -1,6 +0,0 @@
Makefile
Makefile.in
.deps
.libs
*.la
*.lo

View File

@ -1,7 +0,0 @@
defines that affect compilation
none
library dependencies
none

View File

@ -1,481 +0,0 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, 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 library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, 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 companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, 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 library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete 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 distribute a copy of this License along with the
Library.
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 Library or any portion
of it, thus forming a work based on the Library, 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) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
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 Library, 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 Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you 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.
If distribution of 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 satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. 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.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library 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.
9. 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 Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
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.
11. 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 Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library 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 Library.
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.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library 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.
13. The Free Software Foundation may publish revised and/or new
versions of the Library 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 Library
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 Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
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
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "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
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. 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 LIBRARY 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
LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. 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 library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@ -1,20 +0,0 @@
## Process this with automake to create Makefile.in
AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = BUILDING COPYING README TODO avl.dsp test.c
noinst_LTLIBRARIES = libiceavl.la
noinst_HEADERS = avl.h
libiceavl_la_SOURCES = avl.c
libiceavl_la_CFLAGS = @XIPH_CFLAGS@
INCLUDES = -I$(srcdir)/..
debug:
$(MAKE) all CFLAGS="@DEBUG@"
profile:
$(MAKE) all CFLAGS="@PROFILE@"

View File

@ -1,6 +0,0 @@
this is the avl tree library.
lgpl
by sam rushing <rushing@nightmare.com>
modified by jack moffitt <jack@icecast.org>

View File

@ -1,2 +0,0 @@
- avl_get_last()
- a little more cleanup probably

File diff suppressed because it is too large Load Diff

View File

@ -1,100 +0,0 @@
# Microsoft Developer Studio Project File - Name="avl" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=avl - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "avl.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "avl.mak" CFG="avl - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "avl - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "avl - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "avl - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "avl - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ENDIF
# Begin Target
# Name "avl - Win32 Release"
# Name "avl - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\avl.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\avl.h
# End Source File
# End Group
# End Target
# End Project

View File

@ -1,203 +0,0 @@
/*
* Copyright (C) 1995 by Sam Rushing <rushing@nightmare.com>
*/
/* $Id: avl.h,v 1.7 2003/07/07 01:10:14 brendan Exp $ */
#ifndef __AVL_H
#define __AVL_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef NO_THREAD
#include <thread/thread.h>
#else
#define thread_rwlock_create(x) do{}while(0)
#define thread_rwlock_destroy(x) do{}while(0)
#define thread_rwlock_rlock(x) do{}while(0)
#define thread_rwlock_wlock(x) do{}while(0)
#define thread_rwlock_unlock(x) do{}while(0)
#endif
typedef struct avl_node_tag {
void * key;
struct avl_node_tag * left;
struct avl_node_tag * right;
struct avl_node_tag * parent;
/*
* The lower 2 bits of <rank_and_balance> specify the balance
* factor: 00==-1, 01==0, 10==+1.
* The rest of the bits are used for <rank>
*/
unsigned long rank_and_balance;
#ifndef NO_THREAD
rwlock_t rwlock;
#endif
} avl_node;
#define AVL_GET_BALANCE(n) ((int)(((n)->rank_and_balance & 3) - 1))
#define AVL_GET_RANK(n) (((n)->rank_and_balance >> 2))
#define AVL_SET_BALANCE(n,b) \
((n)->rank_and_balance) = \
(((n)->rank_and_balance & (~3)) | ((int)((b) + 1)))
#define AVL_SET_RANK(n,r) \
((n)->rank_and_balance) = \
(((n)->rank_and_balance & 3) | (r << 2))
struct _avl_tree;
typedef int (*avl_key_compare_fun_type) (void * compare_arg, void * a, void * b);
typedef int (*avl_iter_fun_type) (void * key, void * iter_arg);
typedef int (*avl_iter_index_fun_type) (unsigned long index, void * key, void * iter_arg);
typedef int (*avl_free_key_fun_type) (void * key);
typedef int (*avl_key_printer_fun_type) (char *, void *);
/*
* <compare_fun> and <compare_arg> let us associate a particular compare
* function with each tree, separately.
*/
#ifdef _mangle
# define avl_tree_new _mangle(avl_tree_new)
# define avl_node_new _mangle(avl_node_new)
# define avl_tree_free _mangle(avl_tree_free)
# define avl_insert _mangle(avl_insert)
# define avl_delete _mangle(avl_delete)
# define avl_get_by_index _mangle(avl_get_by_index)
# define avl_get_by_key _mangle(avl_get_by_key)
# define avl_iterate_inorder _mangle(avl_iterate_inorder)
# define avl_iterate_index_range _mangle(avl_iterate_index_range)
# define avl_tree_rlock _mangle(avl_tree_rlock)
# define avl_tree_wlock _mangle(avl_tree_wlock)
# define avl_tree_wlock _mangle(avl_tree_wlock)
# define avl_tree_unlock _mangle(avl_tree_unlock)
# define avl_node_rlock _mangle(avl_node_rlock)
# define avl_node_wlock _mangle(avl_node_wlock)
# define avl_node_unlock _mangle(avl_node_unlock)
# define avl_get_span_by_key _mangle(avl_get_span_by_key)
# define avl_get_span_by_two_keys _mangle(avl_get_span_by_two_keys)
# define avl_verify _mangle(avl_verify)
# define avl_print_tree _mangle(avl_print_tree)
# define avl_get_first _mangle(avl_get_first)
# define avl_get_prev _mangle(avl_get_prev)
# define avl_get_next _mangle(avl_get_next)
# define avl_get_item_by_key_most _mangle(avl_get_item_by_key_most)
# define avl_get_item_by_key_least _mangle(avl_get_item_by_key_least)
#endif
typedef struct _avl_tree {
avl_node * root;
unsigned long height;
unsigned long length;
avl_key_compare_fun_type compare_fun;
void * compare_arg;
#ifndef NO_THREAD
rwlock_t rwlock;
#endif
} avl_tree;
avl_tree * avl_tree_new (avl_key_compare_fun_type compare_fun, void * compare_arg);
avl_node * avl_node_new (void * key, avl_node * parent);
void avl_tree_free (
avl_tree * tree,
avl_free_key_fun_type free_key_fun
);
int avl_insert (
avl_tree * ob,
void * key
);
int avl_delete (
avl_tree * tree,
void * key,
avl_free_key_fun_type free_key_fun
);
int avl_get_by_index (
avl_tree * tree,
unsigned long index,
void ** value_address
);
int avl_get_by_key (
avl_tree * tree,
void * key,
void ** value_address
);
int avl_iterate_inorder (
avl_tree * tree,
avl_iter_fun_type iter_fun,
void * iter_arg
);
int avl_iterate_index_range (
avl_tree * tree,
avl_iter_index_fun_type iter_fun,
unsigned long low,
unsigned long high,
void * iter_arg
);
int avl_get_span_by_key (
avl_tree * tree,
void * key,
unsigned long * low,
unsigned long * high
);
int avl_get_span_by_two_keys (
avl_tree * tree,
void * key_a,
void * key_b,
unsigned long * low,
unsigned long * high
);
int avl_verify (avl_tree * tree);
void avl_print_tree (
avl_tree * tree,
avl_key_printer_fun_type key_printer
);
avl_node *avl_get_first(avl_tree *tree);
avl_node *avl_get_prev(avl_node * node);
avl_node *avl_get_next(avl_node * node);
/* These two are from David Ascher <david_ascher@brown.edu> */
int avl_get_item_by_key_most (
avl_tree * tree,
void * key,
void ** value_address
);
int avl_get_item_by_key_least (
avl_tree * tree,
void * key,
void ** value_address
);
/* optional locking stuff */
void avl_tree_rlock(avl_tree *tree);
void avl_tree_wlock(avl_tree *tree);
void avl_tree_unlock(avl_tree *tree);
void avl_node_rlock(avl_node *node);
void avl_node_wlock(avl_node *node);
void avl_node_unlock(avl_node *node);
#ifdef __cplusplus
}
#endif
#endif /* __AVL_H */

View File

@ -1,95 +0,0 @@
#include <stdio.h>
#include "avl.h"
#ifdef _WIN32
#define snprintf _snprintf
#endif
int _compare(void *compare_arg, void *a, void *b);
int _free(void *key);
int _printer(char *buff, void *key);
int main(int argc, char **argv)
{
int i, max_nodes;
avl_tree *tree;
avl_node *node;
max_nodes = 25;
if (argc == 2) {
max_nodes = atoi(argv[1]);
if (max_nodes == 0)
max_nodes = 10;
}
printf("avl test... max_nodes = %d...\n", max_nodes);
tree = avl_tree_new(_compare, NULL);
printf("Filling tree...\n");
for (i = 0; i < max_nodes; i++) {
avl_insert(tree, (void *)rand());
}
printf("Traversing tree...\n");
node = avl_get_first(tree);
while (node) {
i = (int)node->key;
printf("...%5d\n", i);
node = avl_get_next(node);
}
printf("Trying to go backwards...\n");
node = tree->root->right;
while (node) {
i = (int)node->key;
printf("...%5d\n", i);
node = avl_get_prev(node);
}
printf("Printing tree...\n");
avl_print_tree(tree, _printer);
avl_tree_free(tree, _free);
return 0;
}
int _compare(void *compare_arg, void *a, void *b)
{
int i, j;
i = (int)a;
j = (int)b;
if (i > j)
return 1;
if (j > i)
return -1;
return 0;
}
int _free(void *key)
{
return 1;
}
int _printer(char *buff, void *key)
{
return snprintf(buff, 25, "%d", (int)key);
}

View File

@ -1,910 +0,0 @@
/* Icecast
*
* This program is distributed under the GNU General Public License, version 2.
* A copy of this license is included with this source.
*
* Copyright 2000-2004, Jack Moffitt <jack@xiph.org,
* Michael Smith <msmith@xiph.org>,
* oddsock <oddsock@xiph.org>,
* Karl Heyes <karl@xiph.org>
* and others (see AUTHORS for details).
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include "thread/thread.h"
#include "cfgfile.h"
#include "refbuf.h"
#include "client.h"
#include "logging.h"
#define CATMODULE "CONFIG"
#define CONFIG_DEFAULT_LOCATION "Earth"
#define CONFIG_DEFAULT_ADMIN "icemaster@localhost"
#define CONFIG_DEFAULT_CLIENT_LIMIT 256
#define CONFIG_DEFAULT_SOURCE_LIMIT 16
#define CONFIG_DEFAULT_QUEUE_SIZE_LIMIT (100*1024)
#define CONFIG_DEFAULT_THREADPOOL_SIZE 4
#define CONFIG_DEFAULT_CLIENT_TIMEOUT 30
#define CONFIG_DEFAULT_HEADER_TIMEOUT 15
#define CONFIG_DEFAULT_SOURCE_TIMEOUT 10
#define CONFIG_DEFAULT_SOURCE_PASSWORD "changeme"
#define CONFIG_DEFAULT_RELAY_PASSWORD "changeme"
#define CONFIG_DEFAULT_ICE_LOGIN 0
#define CONFIG_DEFAULT_FILESERVE 1
#define CONFIG_DEFAULT_TOUCH_FREQ 5
#define CONFIG_DEFAULT_HOSTNAME "localhost"
#define CONFIG_DEFAULT_ACCESS_LOG "access.log"
#define CONFIG_DEFAULT_ERROR_LOG "error.log"
#define CONFIG_DEFAULT_LOG_LEVEL 4
#define CONFIG_DEFAULT_CHROOT 0
#define CONFIG_DEFAULT_CHUID 0
#define CONFIG_DEFAULT_USER NULL
#define CONFIG_DEFAULT_GROUP NULL
#define CONFIG_MASTER_UPDATE_INTERVAL 120
#define CONFIG_YP_URL_TIMEOUT 10
#ifndef _WIN32
#define CONFIG_DEFAULT_BASE_DIR "/usr/local/icecast"
#define CONFIG_DEFAULT_LOG_DIR "/usr/local/icecast/logs"
#define CONFIG_DEFAULT_WEBROOT_DIR "/usr/local/icecast/webroot"
#define CONFIG_DEFAULT_ADMINROOT_DIR "/usr/local/icecast/admin"
#else
#define CONFIG_DEFAULT_BASE_DIR ".\\"
#define CONFIG_DEFAULT_LOG_DIR ".\\logs"
#define CONFIG_DEFAULT_WEBROOT_DIR ".\\webroot"
#define CONFIG_DEFAULT_ADMINROOT_DIR ".\\admin"
#endif
static ice_config_t _current_configuration;
static ice_config_locks _locks;
static void _set_defaults(ice_config_t *c);
static void _parse_root(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
static void _parse_limits(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
static void _parse_directory(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
static void _parse_paths(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
static void _parse_logging(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
static void _parse_security(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
static void _parse_authentication(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *c);
static void _parse_relay(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
static void _parse_mount(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
static void _parse_listen_socket(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *c);
static void _add_server(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
static void create_locks() {
thread_mutex_create(&_locks.relay_lock);
thread_mutex_create(&_locks.mounts_lock);
thread_mutex_create(&_locks.config_lock);
}
static void release_locks() {
thread_mutex_destroy(&_locks.relay_lock);
thread_mutex_destroy(&_locks.mounts_lock);
thread_mutex_destroy(&_locks.config_lock);
}
void config_initialize(void) {
create_locks();
}
void config_shutdown(void) {
config_get_config();
config_clear(&_current_configuration);
config_release_config();
release_locks();
}
void config_init_configuration(ice_config_t *configuration)
{
memset(configuration, 0, sizeof(ice_config_t));
_set_defaults(configuration);
}
void config_clear(ice_config_t *c)
{
ice_config_dir_t *dirnode, *nextdirnode;
relay_server *relay, *nextrelay;
mount_proxy *mount, *nextmount;
aliases *alias, *nextalias;
int i;
config_options_t *option;
if (c->config_filename)
free(c->config_filename);
if (c->location && c->location != CONFIG_DEFAULT_LOCATION)
xmlFree(c->location);
if (c->admin && c->admin != CONFIG_DEFAULT_ADMIN)
xmlFree(c->admin);
if (c->source_password && c->source_password != CONFIG_DEFAULT_SOURCE_PASSWORD)
xmlFree(c->source_password);
if (c->admin_username)
xmlFree(c->admin_username);
if (c->admin_password)
xmlFree(c->admin_password);
if (c->relay_username)
xmlFree(c->relay_username);
if (c->relay_password)
xmlFree(c->relay_password);
if (c->hostname && c->hostname != CONFIG_DEFAULT_HOSTNAME)
xmlFree(c->hostname);
if (c->base_dir && c->base_dir != CONFIG_DEFAULT_BASE_DIR)
xmlFree(c->base_dir);
if (c->log_dir && c->log_dir != CONFIG_DEFAULT_LOG_DIR)
xmlFree(c->log_dir);
if (c->webroot_dir && c->webroot_dir != CONFIG_DEFAULT_WEBROOT_DIR)
xmlFree(c->webroot_dir);
if (c->adminroot_dir && c->adminroot_dir != CONFIG_DEFAULT_ADMINROOT_DIR)
xmlFree(c->adminroot_dir);
if (c->pidfile)
xmlFree(c->pidfile);
if (c->access_log && c->access_log != CONFIG_DEFAULT_ACCESS_LOG)
xmlFree(c->access_log);
if (c->error_log && c->error_log != CONFIG_DEFAULT_ERROR_LOG)
xmlFree(c->error_log);
for(i=0; i < MAX_LISTEN_SOCKETS; i++) {
if (c->listeners[i].bind_address) xmlFree(c->listeners[i].bind_address);
}
if (c->master_server) xmlFree(c->master_server);
if (c->master_password) xmlFree(c->master_password);
if (c->user) xmlFree(c->user);
if (c->group) xmlFree(c->group);
thread_mutex_lock(&(_locks.relay_lock));
relay = c->relay;
while(relay) {
nextrelay = relay->next;
xmlFree(relay->server);
xmlFree(relay->mount);
xmlFree(relay->localmount);
free(relay);
relay = nextrelay;
}
thread_mutex_unlock(&(_locks.relay_lock));
thread_mutex_lock(&(_locks.mounts_lock));
mount = c->mounts;
while(mount) {
nextmount = mount->next;
xmlFree(mount->mountname);
xmlFree(mount->username);
xmlFree(mount->password);
xmlFree(mount->dumpfile);
xmlFree(mount->fallback_mount);
xmlFree(mount->auth_type);
option = mount->auth_options;
while(option) {
config_options_t *nextopt = option->next;
xmlFree(option->name);
xmlFree(option->value);
free(option);
option = nextopt;
}
free(mount);
mount = nextmount;
}
thread_mutex_unlock(&(_locks.mounts_lock));
alias = c->aliases;
while(alias) {
nextalias = alias->next;
xmlFree(alias->source);
xmlFree(alias->destination);
xmlFree(alias->bind_address);
free(alias);
alias = nextalias;
}
dirnode = c->dir_list;
while(dirnode) {
nextdirnode = dirnode->next;
xmlFree(dirnode->host);
free(dirnode);
dirnode = nextdirnode;
}
#ifdef HAVE_YP
i = 0;
while (i < c->num_yp_directories)
{
xmlFree (c->yp_url[i]);
i++;
}
#endif
memset(c, 0, sizeof(ice_config_t));
}
int config_initial_parse_file(const char *filename)
{
/* Since we're already pointing at it, we don't need to copy it in place */
return config_parse_file(filename, &_current_configuration);
}
int config_parse_file(const char *filename, ice_config_t *configuration)
{
xmlDocPtr doc;
xmlNodePtr node;
if (filename == NULL || strcmp(filename, "") == 0) return CONFIG_EINSANE;
xmlInitParser();
doc = xmlParseFile(filename);
if (doc == NULL) {
return CONFIG_EPARSE;
}
node = xmlDocGetRootElement(doc);
if (node == NULL) {
xmlFreeDoc(doc);
xmlCleanupParser();
return CONFIG_ENOROOT;
}
if (strcmp(node->name, "icecast") != 0) {
xmlFreeDoc(doc);
xmlCleanupParser();
return CONFIG_EBADROOT;
}
config_init_configuration(configuration);
configuration->config_filename = (char *)strdup(filename);
_parse_root(doc, node->xmlChildrenNode, configuration);
xmlFreeDoc(doc);
return 0;
}
int config_parse_cmdline(int arg, char **argv)
{
return 0;
}
ice_config_locks *config_locks(void)
{
return &_locks;
}
void config_release_config(void)
{
thread_mutex_unlock(&(_locks.config_lock));
}
ice_config_t *config_get_config(void)
{
thread_mutex_lock(&(_locks.config_lock));
return &_current_configuration;
}
/* MUST be called with the lock held! */
void config_set_config(ice_config_t *config) {
memcpy(&_current_configuration, config, sizeof(ice_config_t));
}
ice_config_t *config_get_config_unlocked(void)
{
return &_current_configuration;
}
static void _set_defaults(ice_config_t *configuration)
{
configuration->location = CONFIG_DEFAULT_LOCATION;
configuration->admin = CONFIG_DEFAULT_ADMIN;
configuration->client_limit = CONFIG_DEFAULT_CLIENT_LIMIT;
configuration->source_limit = CONFIG_DEFAULT_SOURCE_LIMIT;
configuration->queue_size_limit = CONFIG_DEFAULT_QUEUE_SIZE_LIMIT;
configuration->threadpool_size = CONFIG_DEFAULT_THREADPOOL_SIZE;
configuration->client_timeout = CONFIG_DEFAULT_CLIENT_TIMEOUT;
configuration->header_timeout = CONFIG_DEFAULT_HEADER_TIMEOUT;
configuration->source_timeout = CONFIG_DEFAULT_SOURCE_TIMEOUT;
configuration->source_password = CONFIG_DEFAULT_SOURCE_PASSWORD;
configuration->ice_login = CONFIG_DEFAULT_ICE_LOGIN;
configuration->fileserve = CONFIG_DEFAULT_FILESERVE;
configuration->touch_interval = CONFIG_DEFAULT_TOUCH_FREQ;
configuration->dir_list = NULL;
configuration->hostname = CONFIG_DEFAULT_HOSTNAME;
configuration->port = 0;
configuration->listeners[0].port = 0;
configuration->listeners[0].bind_address = NULL;
configuration->master_server = NULL;
configuration->master_server_port = 0;
configuration->master_update_interval = CONFIG_MASTER_UPDATE_INTERVAL;
configuration->master_password = NULL;
configuration->base_dir = CONFIG_DEFAULT_BASE_DIR;
configuration->log_dir = CONFIG_DEFAULT_LOG_DIR;
configuration->webroot_dir = CONFIG_DEFAULT_WEBROOT_DIR;
configuration->adminroot_dir = CONFIG_DEFAULT_ADMINROOT_DIR;
configuration->access_log = CONFIG_DEFAULT_ACCESS_LOG;
configuration->error_log = CONFIG_DEFAULT_ERROR_LOG;
configuration->loglevel = CONFIG_DEFAULT_LOG_LEVEL;
configuration->chroot = CONFIG_DEFAULT_CHROOT;
configuration->chuid = CONFIG_DEFAULT_CHUID;
configuration->user = CONFIG_DEFAULT_USER;
configuration->group = CONFIG_DEFAULT_GROUP;
configuration->num_yp_directories = 0;
configuration->relay_username = NULL;
configuration->relay_password = NULL;
configuration->burst_on_connect = 0;
}
static void _parse_root(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *configuration)
{
char *tmp;
do {
if (node == NULL) break;
if (xmlIsBlankNode(node)) continue;
if (strcmp(node->name, "location") == 0) {
if (configuration->location && configuration->location != CONFIG_DEFAULT_LOCATION) xmlFree(configuration->location);
configuration->location = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (strcmp(node->name, "admin") == 0) {
if (configuration->admin && configuration->admin != CONFIG_DEFAULT_ADMIN) xmlFree(configuration->admin);
configuration->admin = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if(strcmp(node->name, "authentication") == 0) {
_parse_authentication(doc, node->xmlChildrenNode, configuration);
} else if (strcmp(node->name, "source-password") == 0) {
/* TODO: This is the backwards-compatibility location */
char *mount, *pass;
if ((mount = (char *)xmlGetProp(node, "mount")) != NULL) {
pass = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
/* FIXME: This is a placeholder for per-mount passwords */
}
else {
if (configuration->source_password && configuration->source_password != CONFIG_DEFAULT_SOURCE_PASSWORD) xmlFree(configuration->source_password);
configuration->source_password = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
}
} else if (strcmp(node->name, "icelogin") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->ice_login = atoi(tmp);
if (tmp) xmlFree(tmp);
} else if (strcmp(node->name, "fileserve") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->fileserve = atoi(tmp);
if (tmp) xmlFree(tmp);
} else if (strcmp(node->name, "hostname") == 0) {
if (configuration->hostname && configuration->hostname != CONFIG_DEFAULT_HOSTNAME) xmlFree(configuration->hostname);
configuration->hostname = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (strcmp(node->name, "listen-socket") == 0) {
_parse_listen_socket(doc, node->xmlChildrenNode, configuration);
} else if (strcmp(node->name, "port") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->port = atoi(tmp);
configuration->listeners[0].port = atoi(tmp);
if (tmp) xmlFree(tmp);
} else if (strcmp(node->name, "bind-address") == 0) {
if (configuration->listeners[0].bind_address)
xmlFree(configuration->listeners[0].bind_address);
configuration->listeners[0].bind_address = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (strcmp(node->name, "master-server") == 0) {
if (configuration->master_server) xmlFree(configuration->master_server);
configuration->master_server = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (strcmp(node->name, "master-password") == 0) {
if (configuration->master_password) xmlFree(configuration->master_password);
configuration->master_password = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (strcmp(node->name, "master-server-port") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->master_server_port = atoi(tmp);
xmlFree (tmp);
} else if (strcmp(node->name, "master-update-interval") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->master_update_interval = atoi(tmp);
xmlFree (tmp);
} else if (strcmp(node->name, "limits") == 0) {
_parse_limits(doc, node->xmlChildrenNode, configuration);
} else if (strcmp(node->name, "relay") == 0) {
_parse_relay(doc, node->xmlChildrenNode, configuration);
} else if (strcmp(node->name, "mount") == 0) {
_parse_mount(doc, node->xmlChildrenNode, configuration);
} else if (strcmp(node->name, "directory") == 0) {
_parse_directory(doc, node->xmlChildrenNode, configuration);
} else if (strcmp(node->name, "paths") == 0) {
_parse_paths(doc, node->xmlChildrenNode, configuration);
} else if (strcmp(node->name, "logging") == 0) {
_parse_logging(doc, node->xmlChildrenNode, configuration);
} else if (strcmp(node->name, "security") == 0) {
_parse_security(doc, node->xmlChildrenNode, configuration);
}
} while ((node = node->next));
}
static void _parse_limits(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *configuration)
{
char *tmp;
do {
if (node == NULL) break;
if (xmlIsBlankNode(node)) continue;
if (strcmp(node->name, "clients") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->client_limit = atoi(tmp);
if (tmp) xmlFree(tmp);
} else if (strcmp(node->name, "sources") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->source_limit = atoi(tmp);
if (tmp) xmlFree(tmp);
} else if (strcmp(node->name, "queue-size") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->queue_size_limit = atoi(tmp);
if (tmp) xmlFree(tmp);
} else if (strcmp(node->name, "threadpool") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->threadpool_size = atoi(tmp);
if (tmp) xmlFree(tmp);
} else if (strcmp(node->name, "client-timeout") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->client_timeout = atoi(tmp);
if (tmp) xmlFree(tmp);
} else if (strcmp(node->name, "header-timeout") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->header_timeout = atoi(tmp);
if (tmp) xmlFree(tmp);
} else if (strcmp(node->name, "source-timeout") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->source_timeout = atoi(tmp);
if (tmp) xmlFree(tmp);
} else if (strcmp(node->name, "burst-on-connect") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->burst_on_connect = atoi(tmp);
if (tmp) xmlFree(tmp);
}
} while ((node = node->next));
}
static void _parse_mount(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *configuration)
{
char *tmp;
mount_proxy *mount = calloc(1, sizeof(mount_proxy));
mount_proxy *current = configuration->mounts;
mount_proxy *last=NULL;
xmlNodePtr option;
config_options_t *last_option;
while(current) {
last = current;
current = current->next;
}
if(last)
last->next = mount;
else
configuration->mounts = mount;
mount->max_listeners = -1;
mount->next = NULL;
do {
if (node == NULL) break;
if (xmlIsBlankNode(node)) continue;
if (strcmp(node->name, "mount-name") == 0) {
mount->mountname = (char *)xmlNodeListGetString(
doc, node->xmlChildrenNode, 1);
}
else if (strcmp(node->name, "username") == 0) {
mount->username = (char *)xmlNodeListGetString(
doc, node->xmlChildrenNode, 1);
}
else if (strcmp(node->name, "password") == 0) {
mount->password = (char *)xmlNodeListGetString(
doc, node->xmlChildrenNode, 1);
}
else if (strcmp(node->name, "dump-file") == 0) {
mount->dumpfile = (char *)xmlNodeListGetString(
doc, node->xmlChildrenNode, 1);
}
else if (strcmp(node->name, "fallback-mount") == 0) {
mount->fallback_mount = (char *)xmlNodeListGetString(
doc, node->xmlChildrenNode, 1);
}
else if (strcmp(node->name, "max-listeners") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
mount->max_listeners = atoi(tmp);
if(tmp) xmlFree(tmp);
}
else if (strcmp(node->name, "fallback-override") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
mount->fallback_override = atoi(tmp);
if(tmp) xmlFree(tmp);
}
else if (strcmp(node->name, "no-mount") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
mount->no_mount = atoi(tmp);
if(tmp) xmlFree(tmp);
}
else if (strcmp(node->name, "authentication") == 0) {
mount->auth_type = xmlGetProp(node, "type");
option = node->xmlChildrenNode;
last_option = NULL;
while(option != NULL) {
if(strcmp(option->name, "option") == 0) {
config_options_t *opt = malloc(sizeof(config_options_t));
opt->name = xmlGetProp(option, "name");
if(!opt->name) {
free(opt);
option = option->next;
continue;
}
opt->value = xmlGetProp(option, "value");
if(!opt->value) {
free(opt->name);
free(opt);
option = option->next;
continue;
}
opt->next = NULL;
if(last_option)
last_option->next = opt;
else
mount->auth_options = opt;
last_option = opt;
}
option = option->next;
}
}
else if (strcmp(node->name, "queue-size") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
mount->queue_size_limit = atoi (tmp);
if(tmp) xmlFree(tmp);
}
else if (strcmp(node->name, "source-timeout") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
if (tmp)
{
mount->source_timeout = atoi (tmp);
xmlFree(tmp);
}
}
} while ((node = node->next));
}
static void _parse_relay(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *configuration)
{
char *tmp;
relay_server *relay = calloc(1, sizeof(relay_server));
relay_server *current = configuration->relay;
relay_server *last=NULL;
while(current) {
last = current;
current = current->next;
}
if(last)
last->next = relay;
else
configuration->relay = relay;
relay->next = NULL;
relay->mp3metadata = 1;
do {
if (node == NULL) break;
if (xmlIsBlankNode(node)) continue;
if (strcmp(node->name, "server") == 0) {
relay->server = (char *)xmlNodeListGetString(
doc, node->xmlChildrenNode, 1);
}
else if (strcmp(node->name, "port") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
relay->port = atoi(tmp);
if(tmp) xmlFree(tmp);
}
else if (strcmp(node->name, "mount") == 0) {
relay->mount = (char *)xmlNodeListGetString(
doc, node->xmlChildrenNode, 1);
}
else if (strcmp(node->name, "local-mount") == 0) {
relay->localmount = (char *)xmlNodeListGetString(
doc, node->xmlChildrenNode, 1);
}
else if (strcmp(node->name, "relay-shoutcast-metadata") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
relay->mp3metadata = atoi(tmp);
if(tmp) xmlFree(tmp);
}
} while ((node = node->next));
if (relay->localmount == NULL)
relay->localmount = xmlStrdup (relay->mount);
}
static void _parse_listen_socket(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *configuration)
{
listener_t *listener = NULL;
int i;
char *tmp;
for(i=0; i < MAX_LISTEN_SOCKETS; i++) {
if(configuration->listeners[i].port <= 0) {
listener = &(configuration->listeners[i]);
break;
}
}
do {
if (node == NULL) break;
if (xmlIsBlankNode(node)) continue;
if (strcmp(node->name, "port") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
if(configuration->port == 0)
configuration->port = atoi(tmp);
listener->port = atoi(tmp);
if(tmp) xmlFree(tmp);
}
else if (strcmp(node->name, "bind-address") == 0) {
listener->bind_address = (char *)xmlNodeListGetString(doc,
node->xmlChildrenNode, 1);
}
} while ((node = node->next));
}
static void _parse_authentication(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *configuration)
{
do {
if (node == NULL) break;
if (xmlIsBlankNode(node)) continue;
if (strcmp(node->name, "source-password") == 0) {
char *mount, *pass;
if ((mount = (char *)xmlGetProp(node, "mount")) != NULL) {
pass = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
/* FIXME: This is a placeholder for per-mount passwords */
}
else {
if (configuration->source_password &&
configuration->source_password !=
CONFIG_DEFAULT_SOURCE_PASSWORD)
xmlFree(configuration->source_password);
configuration->source_password =
(char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
}
} else if (strcmp(node->name, "admin-password") == 0) {
if(configuration->admin_password)
xmlFree(configuration->admin_password);
configuration->admin_password =
(char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (strcmp(node->name, "admin-user") == 0) {
if(configuration->admin_username)
xmlFree(configuration->admin_username);
configuration->admin_username =
(char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (strcmp(node->name, "relay-password") == 0) {
if(configuration->relay_password)
xmlFree(configuration->relay_password);
configuration->relay_password =
(char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (strcmp(node->name, "relay-user") == 0) {
if(configuration->relay_username)
xmlFree(configuration->relay_username);
configuration->relay_username =
(char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
}
} while ((node = node->next));
}
static void _parse_directory(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *configuration)
{
char *tmp;
if (configuration->num_yp_directories >= MAX_YP_DIRECTORIES) {
ERROR0("Maximum number of yp directories exceeded!");
return;
}
do {
if (node == NULL) break;
if (xmlIsBlankNode(node)) continue;
if (strcmp(node->name, "yp-url") == 0) {
if (configuration->yp_url[configuration->num_yp_directories])
xmlFree(configuration->yp_url[configuration->num_yp_directories]);
configuration->yp_url[configuration->num_yp_directories] =
(char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (strcmp(node->name, "yp-url-timeout") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->yp_url_timeout[configuration->num_yp_directories] =
atoi(tmp);
if (tmp) xmlFree(tmp);
} else if (strcmp(node->name, "server") == 0) {
_add_server(doc, node->xmlChildrenNode, configuration);
} else if (strcmp(node->name, "touch-interval") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->touch_interval = atoi(tmp);
if (tmp) xmlFree(tmp);
}
} while ((node = node->next));
configuration->num_yp_directories++;
}
static void _parse_paths(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *configuration)
{
char *temp;
aliases *alias, *current, *last;
do {
if (node == NULL) break;
if (xmlIsBlankNode(node)) continue;
if (strcmp(node->name, "basedir") == 0) {
if (configuration->base_dir && configuration->base_dir != CONFIG_DEFAULT_BASE_DIR) xmlFree(configuration->base_dir);
configuration->base_dir = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (strcmp(node->name, "logdir") == 0) {
if (configuration->log_dir && configuration->log_dir != CONFIG_DEFAULT_LOG_DIR) xmlFree(configuration->log_dir);
configuration->log_dir = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (strcmp(node->name, "pidfile") == 0) {
if (configuration->pidfile) xmlFree(configuration->pidfile);
configuration->pidfile = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (strcmp(node->name, "webroot") == 0) {
if (configuration->webroot_dir && configuration->webroot_dir != CONFIG_DEFAULT_WEBROOT_DIR) xmlFree(configuration->webroot_dir);
configuration->webroot_dir = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
if(configuration->webroot_dir[strlen(configuration->webroot_dir)-1] == '/')
configuration->webroot_dir[strlen(configuration->webroot_dir)-1] = 0;
} else if (strcmp(node->name, "adminroot") == 0) {
if (configuration->adminroot_dir && configuration->adminroot_dir != CONFIG_DEFAULT_ADMINROOT_DIR)
xmlFree(configuration->adminroot_dir);
configuration->adminroot_dir = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
if(configuration->adminroot_dir[strlen(configuration->adminroot_dir)-1] == '/')
configuration->adminroot_dir[strlen(configuration->adminroot_dir)-1] = 0;
} else if (strcmp(node->name, "alias") == 0) {
alias = malloc(sizeof(aliases));
alias->next = NULL;
alias->source = xmlGetProp(node, "source");
if(alias->source == NULL) {
free(alias);
continue;
}
alias->destination = xmlGetProp(node, "dest");
if(alias->destination == NULL) {
xmlFree(alias->source);
free(alias);
continue;
}
temp = NULL;
temp = xmlGetProp(node, "port");
if(temp != NULL) {
alias->port = atoi(temp);
xmlFree(temp);
}
else
alias->port = -1;
alias->bind_address = xmlGetProp(node, "bind-address");
current = configuration->aliases;
last = NULL;
while(current) {
last = current;
current = current->next;
}
if(last)
last->next = alias;
else
configuration->aliases = alias;
}
} while ((node = node->next));
}
static void _parse_logging(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *configuration)
{
do {
if (node == NULL) break;
if (xmlIsBlankNode(node)) continue;
if (strcmp(node->name, "accesslog") == 0) {
if (configuration->access_log && configuration->access_log != CONFIG_DEFAULT_ACCESS_LOG) xmlFree(configuration->access_log);
configuration->access_log = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (strcmp(node->name, "errorlog") == 0) {
if (configuration->error_log && configuration->error_log != CONFIG_DEFAULT_ERROR_LOG) xmlFree(configuration->error_log);
configuration->error_log = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (strcmp(node->name, "loglevel") == 0) {
char *tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->loglevel = atoi(tmp);
if (tmp) xmlFree(tmp);
}
} while ((node = node->next));
}
static void _parse_security(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *configuration)
{
char *tmp;
xmlNodePtr oldnode;
do {
if (node == NULL) break;
if (xmlIsBlankNode(node)) continue;
if (strcmp(node->name, "chroot") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->chroot = atoi(tmp);
if (tmp) xmlFree(tmp);
} else if (strcmp(node->name, "changeowner") == 0) {
configuration->chuid = 1;
oldnode = node;
node = node->xmlChildrenNode;
do {
if(node == NULL) break;
if(xmlIsBlankNode(node)) continue;
if(strcmp(node->name, "user") == 0) {
if(configuration->user) xmlFree(configuration->user);
configuration->user = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if(strcmp(node->name, "group") == 0) {
if(configuration->group) xmlFree(configuration->group);
configuration->group = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
}
} while((node = node->next));
node = oldnode;
}
} while ((node = node->next));
}
static void _add_server(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *configuration)
{
ice_config_dir_t *dirnode, *server;
int addnode;
char *tmp;
server = (ice_config_dir_t *)malloc(sizeof(ice_config_dir_t));
server->touch_interval = configuration->touch_interval;
server->host = NULL;
addnode = 0;
do {
if (node == NULL) break;
if (xmlIsBlankNode(node)) continue;
if (strcmp(node->name, "host") == 0) {
server->host = (char *)xmlNodeListGetString(doc,
node->xmlChildrenNode, 1);
addnode = 1;
} else if (strcmp(node->name, "touch-interval") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
server->touch_interval = atoi(tmp);
if (tmp) xmlFree(tmp);
}
server->next = NULL;
} while ((node = node->next));
if (addnode) {
dirnode = configuration->dir_list;
if (dirnode == NULL) {
configuration->dir_list = server;
} else {
while (dirnode->next) dirnode = dirnode->next;
dirnode->next = server;
}
server = NULL;
addnode = 0;
}
}

View File

@ -1,167 +0,0 @@
/* Icecast
*
* This program is distributed under the GNU General Public License, version 2.
* A copy of this license is included with this source.
*
* Copyright 2000-2004, Jack Moffitt <jack@xiph.org,
* Michael Smith <msmith@xiph.org>,
* oddsock <oddsock@xiph.org>,
* Karl Heyes <karl@xiph.org>
* and others (see AUTHORS for details).
*/
#ifndef __CFGFILE_H__
#define __CFGFILE_H__
#define CONFIG_EINSANE -1
#define CONFIG_ENOROOT -2
#define CONFIG_EBADROOT -3
#define CONFIG_EPARSE -4
#define MAX_YP_DIRECTORIES 25
#include "thread/thread.h"
#include "avl/avl.h"
#include "global.h"
typedef struct ice_config_dir_tag
{
char *host;
int touch_interval;
struct ice_config_dir_tag *next;
} ice_config_dir_t;
typedef struct _config_options {
char *name;
char *value;
struct _config_options *next;
} config_options_t;
typedef struct _mount_proxy {
char *mountname; /* The mountpoint this proxy is used for */
char *username; /* Username and password for this mountpoint. If unset, */
char *password; /* falls back to global source password */
char *dumpfile; /* Filename to dump this stream to (will be appended). NULL
to not dump. */
int max_listeners; /* Max listeners for this mountpoint only. -1 to not
limit here (i.e. only use the global limit) */
char *fallback_mount; /* Fallback mountname */
int fallback_override; /* When this source arrives, do we steal back
clients from the fallback? */
int no_mount; /* Do we permit direct requests of this mountpoint? (or only
indirect, through fallbacks) */
unsigned queue_size_limit;
unsigned source_timeout; /* source timeout in seconds */
char *auth_type; /* Authentication type */
config_options_t *auth_options; /* Options for this type */
struct _mount_proxy *next;
} mount_proxy;
typedef struct _aliases {
char *source;
char *destination;
int port;
char *bind_address;
struct _aliases *next;
}aliases;
typedef struct {
int port;
char *bind_address;
} listener_t;
typedef struct ice_config_tag
{
char *config_filename;
char *location;
char *admin;
int client_limit;
int source_limit;
unsigned queue_size_limit;
int threadpool_size;
int client_timeout;
int header_timeout;
int source_timeout;
int ice_login;
int fileserve;
char *source_password;
char *admin_username;
char *admin_password;
char *relay_username;
char *relay_password;
int touch_interval;
ice_config_dir_t *dir_list;
char *hostname;
int port;
listener_t listeners[MAX_LISTEN_SOCKETS];
char *master_server;
int master_server_port;
int master_update_interval;
char *master_password;
relay_server *relay;
mount_proxy *mounts;
char *base_dir;
char *log_dir;
char *pidfile;
char *webroot_dir;
char *adminroot_dir;
aliases *aliases;
char *access_log;
char *error_log;
int loglevel;
int chroot;
int chuid;
char *user;
char *group;
char *yp_url[MAX_YP_DIRECTORIES];
int yp_url_timeout[MAX_YP_DIRECTORIES];
int num_yp_directories;
int burst_on_connect;
} ice_config_t;
typedef struct {
mutex_t config_lock;
mutex_t relay_lock;
mutex_t mounts_lock;
} ice_config_locks;
void config_initialize(void);
void config_shutdown(void);
int config_parse_file(const char *filename, ice_config_t *configuration);
int config_initial_parse_file(const char *filename);
int config_parse_cmdline(int arg, char **argv);
void config_set_config(ice_config_t *config);
void config_clear(ice_config_t *config);
int config_rehash(void);
ice_config_locks *config_locks(void);
ice_config_t *config_get_config(void);
void config_release_config(void);
/* To be used ONLY in one-time startup code */
ice_config_t *config_get_config_unlocked(void);
#endif /* __CFGFILE_H__ */

View File

@ -1,127 +0,0 @@
/* Icecast
*
* This program is distributed under the GNU General Public License, version 2.
* A copy of this license is included with this source.
*
* Copyright 2000-2004, Jack Moffitt <jack@xiph.org,
* Michael Smith <msmith@xiph.org>,
* oddsock <oddsock@xiph.org>,
* Karl Heyes <karl@xiph.org>
* and others (see AUTHORS for details).
*/
/* client.c
**
** client interface implementation
**
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdlib.h>
#include <string.h>
#include "thread/thread.h"
#include "avl/avl.h"
#include "httpp/httpp.h"
#include "connection.h"
#include "refbuf.h"
#include "client.h"
#include "logging.h"
client_t *client_create(connection_t *con, http_parser_t *parser)
{
client_t *client = (client_t *)calloc(1, sizeof(client_t));
client->con = con;
client->parser = parser;
client->queue = NULL;
client->pos = 0;
client->burst_sent = 0;
return client;
}
void client_destroy(client_t *client)
{
refbuf_t *refbuf;
if (client == NULL)
return;
/* write log entry if ip is set (some things don't set it, like outgoing
* slave requests
*/
if(client->con->ip)
logging_access(client);
connection_close(client->con);
httpp_destroy(client->parser);
while ((refbuf = refbuf_queue_remove(&client->queue)))
refbuf_release(refbuf);
/* we need to free client specific format data (if any) */
if (client->free_client_data)
client->free_client_data (client);
free(client->username);
free(client);
}
void client_send_400(client_t *client, char *message) {
int bytes;
bytes = sock_write(client->con->sock, "HTTP/1.0 400 Bad Request\r\n"
"Content-Type: text/html\r\n\r\n"
"<b>%s</b>\r\n", message);
if(bytes > 0) client->con->sent_bytes = bytes;
client->respcode = 400;
client_destroy(client);
}
void client_send_404(client_t *client, char *message) {
int bytes;
bytes = sock_write(client->con->sock, "HTTP/1.0 404 File Not Found\r\n"
"Content-Type: text/html\r\n\r\n"
"<b>%s</b>\r\n", message);
if(bytes > 0) client->con->sent_bytes = bytes;
client->respcode = 404;
client_destroy(client);
}
void client_send_504(client_t *client, char *message) {
int bytes;
client->respcode = 504;
bytes = sock_write(client->con->sock,
"HTTP/1.0 504 Server Full\r\n"
"Content-Type: text/html\r\n\r\n"
"<b>%s</b>\r\n", message);
if (bytes > 0) client->con->sent_bytes = bytes;
client_destroy(client);
}
void client_send_401(client_t *client) {
int bytes = sock_write(client->con->sock,
"HTTP/1.0 401 Authentication Required\r\n"
"WWW-Authenticate: Basic realm=\"Icecast2 Server\"\r\n"
"\r\n"
"You need to authenticate\r\n");
if(bytes > 0) client->con->sent_bytes = bytes;
client->respcode = 401;
client_destroy(client);
}
void client_send_403(client_t *client) {
int bytes = sock_write(client->con->sock,
"HTTP/1.0 403 Forbidden\r\n"
"\r\n"
"Access restricted.\r\n");
if(bytes > 0) client->con->sent_bytes = bytes;
client->respcode = 403;
client_destroy(client);
}

Some files were not shown because too many files have changed in this diff Show More