pax_global_header 0000666 0000000 0000000 00000000064 12723545033 0014516 g ustar 00root root 0000000 0000000 52 comment=dff16271476c50df32b54ea73f596c6a35b83495
captagent-6.1.0.20/ 0000775 0000000 0000000 00000000000 12723545033 0013710 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/.gitattributes 0000664 0000000 0000000 00000000055 12723545033 0016603 0 ustar 00root root 0000000 0000000 captagent/autom4te.cache/* linguist-vendored
captagent-6.1.0.20/.gitignore 0000664 0000000 0000000 00000001104 12723545033 0015674 0 ustar 00root root 0000000 0000000 INSTALL
Makefile
Makefile.in
aclocal.m4
config.guess
src/config.h
src/config.h.in
src/config.h.in~
src/capplan.c
src/capplan.h
config.log
config.status
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
missing
stamp-h1
*.o
*.lo
*.a
*.la
*.Po
*.Plo
.*.swp
.deps
.libs
autom4te.cache
libtool.m4
lt~obsolete.m4
ltoptions.m4
ltsugar.m4
ltversion.m4
capplan.tab.h
lex.yy.c
ylwrap
captagent.spec
conf/captagent.xml
pkg/debian/*.substvars
pkg/debian/*.debhelper
pkg/debian/*.debhelper.log
pkg/debian/files
pkg/debian/captagent/
pkg/debian/captagent.init
src/captagent
*.dh-orig
captagent-6.1.0.20/.travis.yml 0000664 0000000 0000000 00000000476 12723545033 0016030 0 ustar 00root root 0000000 0000000 language: c
compiler:
- gcc
install:
- sudo apt-get update || true
- sudo apt-get install build-essential
- sudo apt-get install libpcap-dev libexpat-dev libjson0-dev bison flex libtool autoconf automake autogen
script:
- ./build.sh
- ./configure
- make
- ./src/captagent -h
- ./src/captagent -v
captagent-6.1.0.20/AUTHORS 0000664 0000000 0000000 00000000023 12723545033 0014753 0 ustar 00root root 0000000 0000000 Alexandr Dubovikov
captagent-6.1.0.20/COPYING 0000664 0000000 0000000 00000104513 12723545033 0014747 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. 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
them 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 prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. 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.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey 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;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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 that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
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.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
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.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
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
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
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 3 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, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program 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, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU 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 Lesser General
Public License instead of this License. But first, please read
.
captagent-6.1.0.20/ChangeLog 0000664 0000000 0000000 00000000043 12723545033 0015457 0 ustar 00root root 0000000 0000000
10.07.2015 captagent 6.0.0 beta 1
captagent-6.1.0.20/LICENSE 0000664 0000000 0000000 00000104460 12723545033 0014722 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. 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
them 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 prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. 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.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey 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;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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 that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
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.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
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.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
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
state 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 3 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, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program 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, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU 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 Lesser General
Public License instead of this License. But first, please read
. captagent-6.1.0.20/Makefile.am 0000664 0000000 0000000 00000000236 12723545033 0015745 0 ustar 00root root 0000000 0000000 include common.am
SUBDIRS = \
src \
include
EXTRA_DIST = \
conf \
@PACKAGE_NAME@.spec
ACLOCAL_AMFLAGS = -I m4
distclean-local:
rm -rf autom4te.cache
captagent-6.1.0.20/NEWS 0000664 0000000 0000000 00000000041 12723545033 0014402 0 ustar 00root root 0000000 0000000 NEWS file for captagent project.
captagent-6.1.0.20/README 0000664 0000000 0000000 00000000052 12723545033 0014565 0 ustar 00root root 0000000 0000000 Sample readme file for captagent project.
captagent-6.1.0.20/README.md 0000664 0000000 0000000 00000003644 12723545033 0015176 0 ustar 00root root 0000000 0000000 
CaptAgent 6 Project
=========
#####The Next-Generation capture agent for Sipcapture's [Homer](https://github.com/sipcapture/homer) Project
-------------
Download the latest code from our repository and compile it on your system.
Capagent requires: *libexpat, libpcap, libtool, automake* to compile.
```
cd /usr/src
git clone https://github.com/sipcapture/captagent.git captagent
cd captagent
./build.sh
./configure
make && make install
```
Captagent should be now ready to be configured.
## Configuration
Captagent 6 provides a modular configuration structure supporting includes.
To get familiar with the new configuration please use the projects [wiki](https://github.com/sipcapture/captagent/wiki)
-------------
### Support
If you found a bug or issue with the code, please raise an Issue on the project tracker.
If you have specific questions or require professional support please contact us at support@sipcapture.org

### Developers
Contributions to our project are always welcome! If you intend to participate and help us improve CAPTANGENT, we kindly ask you to sign a [CLA (Contributor License Agreement)](http://cla.qxip.net) and coordinate at best with the existing team via the [homer-dev](http://groups.google.com/group/homer-dev) mailing list.
----------
##### If you use CAPTAGENT in production, please consider supporting us with a [donation](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donation%40sipcapture%2eorg&lc=US&item_name=SIPCAPTURE&no_note=0¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest)
[](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donation%40sipcapture%2eorg&lc=US&item_name=SIPCAPTURE&no_note=0¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest)
captagent-6.1.0.20/build.sh 0000775 0000000 0000000 00000001060 12723545033 0015343 0 ustar 00root root 0000000 0000000 #!/bin/sh
echo "You need to have m4, automake, autoconf, libtool...";
#aclocal
list_of_config_files="./src/modules";
#
list_of_config_files_pro="./src/modules_pro";
#echo adding modules
#for file in $list_of_config_files; do
# echo "AC_CONFIG_FILES([${list_of_config_files}/${file}])"
#done > modules_makefiles.m4
autoreconf --force --install
automake --add-missing
autoconf
#./configure --enable-pcre --enable-redis
#FreeBSD has libexpat in /usr/local/lib (ports installation)
#./configure CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib"
captagent-6.1.0.20/captagent.spec.in 0000664 0000000 0000000 00000035037 12723545033 0017147 0 ustar 00root root 0000000 0000000 Name: @PACKAGE_NAME@
Version: @PACKAGE_VERSION@
Release: %{BUILD_NUMBER}
Summary: SIP capture server
Group: Applications/Communications
License: GPLv3
URL: http://www.sipcapture.org/
Source0: %name-%version.tar.gz
Buildrequires: json-c-devel expat-devel libpcap-devel flex-devel
Requires: json-c expat libpcap
%description
HOMER5 a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
########### module packages ###########################
%package database-hash
Requires: %name = %version
Summary: database hash module for sipcapture HOMER5
%description database-hash
hash database module for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%package database-redis
Requires: %name = %version
Summary: database redis module for sipcapture HOMER5
%description database-redis
redis database module for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%package protocol-sip
Requires: %name = %version
Summary: protocol sip module for sipcapture HOMER5
%description protocol-sip
sip protocol module for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%package protocol-rtcp
Requires: %name = %version
Summary: protocol rtcp module for sipcapture HOMER5
%description protocol-rtcp
rtcp protocol module for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%package socket-pcap
Requires: %name = %version
Summary: socket pcap module for sipcapture HOMER5
%description socket-pcap
pcap socket module for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%package socket-raw
Requires: %name = %version
Summary: socket raw module for sipcapture HOMER5
%description socket-raw
raw socket module for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%package socket-rtcpxr
Requires: %name = %version
Summary: socket rtcpxr module for sipcapture HOMER5
%description socket-rtcpxr
rtcpxr socket module for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%package transport-hep
Requires: %name = %version
Summary: transport hep module for sipcapture HOMER5
%description transport-hep
hep transport module for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%package transport-json
Requires: %name = %version
Summary: transport json module for sipcapture HOMER5
%description transport-json
json transport module for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%package interface-http
Requires: %name = %version
Summary: interface http module for sipcapture HOMER5
%description interface-http
http interface module for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
########### module development packages ###########################
%package database-hash-devel
Requires: %name = %version
Requires: database-hash
Summary: database hash module development package for sipcapture HOMER5
%description database-hash-devel
hash database module development package for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%package database-redis-devel
Requires: %name = %version
Requires: database-redis
Summary: database redis module development package for sipcapture HOMER5
%description database-redis-devel
redis database module development package for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%package protocol-sip-devel
Requires: %name = %version
Requires: protocol-sip
Summary: protocol sip module development package for sipcapture HOMER5
%description protocol-sip-devel
sip protocol module development package for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%package protocol-rtcp-devel
Requires: %name = %version
Requires: protocol-rtcp
Summary: protocol rtcp module development package for sipcapture HOMER5
%description protocol-rtcp-devel
rtcp protocol module development package for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%package socket-pcap-devel
Requires: %name = %version
Requires: socket-pcap
Summary: socket pcap module development package for sipcapture HOMER5
%description socket-pcap-devel
pcap socket module development package for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%package socket-raw-devel
Requires: %name = %version
Requires: socket-raw
Summary: socket raw module development package for sipcapture HOMER5
%description socket-raw-devel
raw socket module development package for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%package socket-rtcpxr-devel
Requires: %name = %version
Requires: socket-rtcpxr
Summary: socket rtcpxr module development package for sipcapture HOMER5
%description socket-rtcpxr-devel
rtcpxr socket module development package for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%package transport-hep-devel
Requires: %name = %version
Requires: transport-hep
Summary: transport hep module development package for sipcapture HOMER5
%description transport-hep-devel
hep transport module development package for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%package transport-json-devel
Requires: %name = %version
Requires: transport-json
Summary: transport json module development package for sipcapture HOMER5
%description transport-json-devel
json transport module development package for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%package interface-http-devel
Requires: %name = %version
Requires: interface-http
Summary: interface http module development package for sipcapture HOMER5
%description interface-http-devel
http interface module development package for a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
%prep
%setup -b0 -q
%build
autoreconf -if
%configure -C \
--prefix=%{_prefix}
%{__make}
%install
%{__make} DESTDIR=%{buildroot} install
%files
%defattr(644,root,root,755)
%config(noreplace) %{_sysconfdir}/%name/%name.xml
%attr(755,root,root) %{_bindir}/%name
%files database-hash
%config(noreplace) %{_sysconfdir}/%name/database_hash.xml
%{_libdir}/%name/modules/database_hash.so
%files database-redis
%config(noreplace) %{_sysconfdir}/%name/database_redis.xml
%{_libdir}/%name/modules/database_redis.so
%files protocol-sip
%config(noreplace) %{_sysconfdir}/%name/protocol_sip.xml
%config(noreplace) %{_sysconfdir}/%name/captureplans/sip_capture_plan.cfg
%{_libdir}/%name/modules/protocol_sip.so
%files protocol-rtcp
%config(noreplace) %{_sysconfdir}/%name/protocol_rtcp.xml
%config(noreplace) %{_sysconfdir}/%name/captureplans/rtcp_capture_plan.cfg
%{_libdir}/%name/modules/protocol_rtcp.so
%files socket-pcap
%config(noreplace) %{_sysconfdir}/%name/socket_pcap.xml
%{_libdir}/%name/modules/socket_pcap.so
%files socket-raw
%config(noreplace) %{_sysconfdir}/%name/socket_raw.xml
%{_libdir}/%name/modules/socket_raw.so
%files socket-rtcpxr
%config(noreplace) %{_sysconfdir}/%name/socket_rtcpxr.xml
%config(noreplace) %{_sysconfdir}/%name/captureplans/rtcpxr_capture_plan.cfg
%{_libdir}/%name/modules/socket_rtcpxr.so
%files transport-hep
%config(noreplace) %{_sysconfdir}/%name/transport_hep.xml
%{_libdir}/%name/modules/transport_hep.so
%files transport-json
%config(noreplace) %{_sysconfdir}/%name/transport_json.xml
%{_libdir}/%name/modules/transport_json.so
%files interface-http
%{_libdir}/%name/modules/interface_http.so
####################################################
%files database-hash-devel
%{_libdir}/%name/modules/database_hash.la
%{_libdir}/%name/modules/database_hash.a
%files protocol-sip-devel
%{_libdir}/%name/modules/protocol_sip.la
%{_libdir}/%name/modules/protocol_sip.a
%files protocol-rtcp-devel
%{_libdir}/%name/modules/protocol_rtcp.la
%{_libdir}/%name/modules/protocol_rtcp.a
%files socket-pcap-devel
%{_libdir}/%name/modules/socket_pcap.la
%{_libdir}/%name/modules/socket_pcap.a
%files socket-raw-devel
%{_libdir}/%name/modules/socket_raw.la
%{_libdir}/%name/modules/socket_raw.a
%files socket-rtcpxr-devel
%{_libdir}/%name/modules/socket_rtcpxr.la
%{_libdir}/%name/modules/socket_rtcpxr.a
%files transport-hep-devel
%{_libdir}/%name/modules/transport_hep.la
%{_libdir}/%name/modules/transport_hep.a
%files transport-json-devel
%{_libdir}/%name/modules/transport_json.la
%{_libdir}/%name/modules/transport_json.a
%files interface-http-devel
%{_libdir}/%name/modules/interface_http.la
%{_libdir}/%name/modules/interface_http.a
####################################################
captagent-6.1.0.20/captagent/ 0000775 0000000 0000000 00000000000 12723545033 0015656 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/captagent/conf/ 0000775 0000000 0000000 00000000000 12723545033 0016603 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/captagent/conf/captagent.xml 0000664 0000000 0000000 00000006520 12723545033 0021276 0 ustar 00root root 0000000 0000000
captagent-6.1.0.20/captagent/mod/ 0000775 0000000 0000000 00000000000 12723545033 0016435 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/captagent/mod/core_hep/ 0000775 0000000 0000000 00000000000 12723545033 0020221 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/captagent/mod/core_hep/core_hep.c 0000664 0000000 0000000 00000066341 12723545033 0022163 0 ustar 00root root 0000000 0000000 /*
* $Id$
*
* captagent - Homer capture agent. Modular
* Duplicate SIP messages in Homer Encapulate Protocol [HEP] [ipv6 version]
*
* Author: Alexandr Dubovikov
* (C) Homer Project 2012 (http://www.sipcapture.org)
*
* Homer capture agent 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 3 of the License, or
* (at your option) any later version
*
* Homer capture agent is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#ifndef __FAVOR_BSD
#define __FAVOR_BSD
#endif /* __FAVOR_BSD */
#include
#include
#include
#include
#ifdef USE_IPV6
#include
#endif /* USE_IPV6 */
#include
#include "src/api.h"
#include "src/log.h"
#include "core_hep.h"
pthread_t call_thread;
pthread_mutex_t lock;
#ifdef USE_ZLIB
z_stream strm;
#endif /* USE_ZLIB */
int send_hep_basic (rc_info_t *rcinfo, unsigned char *data, unsigned int len) {
unsigned char *zipData = NULL;
int sendzip = 0;
#ifdef USE_ZLIB
int status = 0;
unsigned long dlen;
if(pl_compress && hep_version == 3) {
//dlen = len/1000+len*len+13;
dlen = compressBound(len);
zipData = malloc(dlen); /* give a little bit memmory */
/* do compress */
status = compress( zipData, &dlen, data, len );
if( status != Z_OK ){
LERR( "data couldn't be compressed\n");
sendzip = 0;
if(zipData) free(zipData); /* release */
}
else {
sendzip = 1;
len = dlen;
}
}
#endif /* USE_ZLIB */
switch(hep_version) {
case 3:
return send_hepv3(rcinfo, sendzip ? zipData : data , len, sendzip);
break;
case 2:
case 1:
return send_hepv2(rcinfo, data, len);
break;
default:
LERR( "Unsupported HEP version [%d]\n", hep_version);
break;
}
if(zipData) free(zipData);
return 0;
}
int send_hepv3 (rc_info_t *rcinfo, unsigned char *data, unsigned int len, unsigned int sendzip) {
struct hep_generic *hg=NULL;
void* buffer;
unsigned int buflen=0, iplen=0,tlen=0;
hep_chunk_ip4_t src_ip4, dst_ip4;
#ifdef USE_IPV6
hep_chunk_ip6_t src_ip6, dst_ip6;
#endif
hep_chunk_t payload_chunk;
hep_chunk_t authkey_chunk;
hep_chunk_t correlation_chunk;
static int errors = 0;
hg = malloc(sizeof(struct hep_generic));
memset(hg, 0, sizeof(struct hep_generic));
/* header set */
memcpy(hg->header.id, "\x48\x45\x50\x33", 4);
/* IP proto */
hg->ip_family.chunk.vendor_id = htons(0x0000);
hg->ip_family.chunk.type_id = htons(0x0001);
hg->ip_family.data = rcinfo->ip_family;
hg->ip_family.chunk.length = htons(sizeof(hg->ip_family));
/* Proto ID */
hg->ip_proto.chunk.vendor_id = htons(0x0000);
hg->ip_proto.chunk.type_id = htons(0x0002);
hg->ip_proto.data = rcinfo->ip_proto;
hg->ip_proto.chunk.length = htons(sizeof(hg->ip_proto));
/* IPv4 */
if(rcinfo->ip_family == AF_INET) {
/* SRC IP */
src_ip4.chunk.vendor_id = htons(0x0000);
src_ip4.chunk.type_id = htons(0x0003);
inet_pton(AF_INET, rcinfo->src_ip, &src_ip4.data);
src_ip4.chunk.length = htons(sizeof(src_ip4));
/* DST IP */
dst_ip4.chunk.vendor_id = htons(0x0000);
dst_ip4.chunk.type_id = htons(0x0004);
inet_pton(AF_INET, rcinfo->dst_ip, &dst_ip4.data);
dst_ip4.chunk.length = htons(sizeof(dst_ip4));
iplen = sizeof(dst_ip4) + sizeof(src_ip4);
}
#ifdef USE_IPV6
/* IPv6 */
else if(rcinfo->ip_family == AF_INET6) {
/* SRC IPv6 */
src_ip6.chunk.vendor_id = htons(0x0000);
src_ip6.chunk.type_id = htons(0x0005);
inet_pton(AF_INET6, rcinfo->src_ip, &src_ip6.data);
src_ip6.chunk.length = htonl(sizeof(src_ip6));
/* DST IPv6 */
dst_ip6.chunk.vendor_id = htons(0x0000);
dst_ip6.chunk.type_id = htons(0x0006);
inet_pton(AF_INET6, rcinfo->dst_ip, &dst_ip6.data);
dst_ip6.chunk.length = htonl(sizeof(dst_ip6));
iplen = sizeof(dst_ip6) + sizeof(src_ip6);
}
#endif
/* SRC PORT */
hg->src_port.chunk.vendor_id = htons(0x0000);
hg->src_port.chunk.type_id = htons(0x0007);
hg->src_port.data = htons(rcinfo->src_port);
hg->src_port.chunk.length = htons(sizeof(hg->src_port));
/* DST PORT */
hg->dst_port.chunk.vendor_id = htons(0x0000);
hg->dst_port.chunk.type_id = htons(0x0008);
hg->dst_port.data = htons(rcinfo->dst_port);
hg->dst_port.chunk.length = htons(sizeof(hg->dst_port));
/* TIMESTAMP SEC */
hg->time_sec.chunk.vendor_id = htons(0x0000);
hg->time_sec.chunk.type_id = htons(0x0009);
hg->time_sec.data = htonl(rcinfo->time_sec);
hg->time_sec.chunk.length = htons(sizeof(hg->time_sec));
/* TIMESTAMP USEC */
hg->time_usec.chunk.vendor_id = htons(0x0000);
hg->time_usec.chunk.type_id = htons(0x000a);
hg->time_usec.data = htonl(rcinfo->time_usec);
hg->time_usec.chunk.length = htons(sizeof(hg->time_usec));
/* Protocol TYPE */
hg->proto_t.chunk.vendor_id = htons(0x0000);
hg->proto_t.chunk.type_id = htons(0x000b);
hg->proto_t.data = rcinfo->proto_type;
hg->proto_t.chunk.length = htons(sizeof(hg->proto_t));
/* Capture ID */
hg->capt_id.chunk.vendor_id = htons(0x0000);
hg->capt_id.chunk.type_id = htons(0x000c);
hg->capt_id.data = htons(capt_id);
hg->capt_id.chunk.length = htons(sizeof(hg->capt_id));
/* Payload */
payload_chunk.vendor_id = htons(0x0000);
payload_chunk.type_id = sendzip ? htons(0x0010) : htons(0x000f);
payload_chunk.length = htons(sizeof(payload_chunk) + len);
tlen = sizeof(struct hep_generic) + len + iplen + sizeof(hep_chunk_t);
/* auth key */
if(capt_password != NULL) {
tlen += sizeof(hep_chunk_t);
/* Auth key */
authkey_chunk.vendor_id = htons(0x0000);
authkey_chunk.type_id = htons(0x000e);
authkey_chunk.length = htons(sizeof(authkey_chunk) + strlen(capt_password));
tlen += strlen(capt_password);
}
/* correlation key */
if(rcinfo->correlation_id.s && rcinfo->correlation_id.len > 0) {
tlen += sizeof(hep_chunk_t);
/* Correlation key */
correlation_chunk.vendor_id = htons(0x0000);
correlation_chunk.type_id = htons(0x0011);
correlation_chunk.length = htons(sizeof(correlation_chunk) + rcinfo->correlation_id.len);
tlen += rcinfo->correlation_id.len;
}
/* total */
hg->header.length = htons(tlen);
//LERR( "LEN: [%d] vs [%d] = IPLEN:[%d] LEN:[%d] CH:[%d]\n", hg->header.length, ntohs(hg->header.length), iplen, len, sizeof(struct hep_chunk));
buffer = (void*)malloc(tlen);
if (buffer==0){
LERR("ERROR: out of memory\n");
free(hg);
return 1;
}
memcpy((void*) buffer, hg, sizeof(struct hep_generic));
buflen = sizeof(struct hep_generic);
/* IPv4 */
if(rcinfo->ip_family == AF_INET) {
/* SRC IP */
memcpy((void*) buffer+buflen, &src_ip4, sizeof(struct hep_chunk_ip4));
buflen += sizeof(struct hep_chunk_ip4);
memcpy((void*) buffer+buflen, &dst_ip4, sizeof(struct hep_chunk_ip4));
buflen += sizeof(struct hep_chunk_ip4);
}
#ifdef USE_IPV6
/* IPv6 */
else if(rcinfo->ip_family == AF_INET6) {
/* SRC IPv6 */
memcpy((void*) buffer+buflen, &src_ip4, sizeof(struct hep_chunk_ip6));
buflen += sizeof(struct hep_chunk_ip6);
memcpy((void*) buffer+buflen, &dst_ip6, sizeof(struct hep_chunk_ip6));
buflen += sizeof(struct hep_chunk_ip6);
}
#endif
/* AUTH KEY CHUNK */
if(capt_password != NULL) {
memcpy((void*) buffer+buflen, &authkey_chunk, sizeof(struct hep_chunk));
buflen += sizeof(struct hep_chunk);
/* Now copying payload self */
memcpy((void*) buffer+buflen, capt_password, strlen(capt_password));
buflen+=strlen(capt_password);
}
/* Correlation KEY CHUNK */
if(rcinfo->correlation_id.s && rcinfo->correlation_id.len > 0) {
memcpy((void*) buffer+buflen, &correlation_chunk, sizeof(struct hep_chunk));
buflen += sizeof(struct hep_chunk);
/* Now copying payload self */
memcpy((void*) buffer+buflen, rcinfo->correlation_id.s, rcinfo->correlation_id.len);
buflen+= rcinfo->correlation_id.len;
}
/* PAYLOAD CHUNK */
memcpy((void*) buffer+buflen, &payload_chunk, sizeof(struct hep_chunk));
buflen += sizeof(struct hep_chunk);
if(!data) {
LERR( "the captured data is empty....\n");
goto error;
}
/* Now copying payload self */
memcpy((void*) buffer+buflen, data, len);
buflen+=len;
/* make sleep after 100 errors */
if(errors > 50) {
LERR( "HEP server is down... retrying after sleep...\n");
if(!usessl) {
sleep(2);
if(init_hepsocket_blocking()) {
initfails++;
}
errors=0;
}
#ifdef USE_SSL
else {
sleep(2);
if(initSSL()) {
initfails++;
}
errors=0;
}
#endif /* USE SSL */
}
/* send this packet out of our socket */
if(send_data(buffer, buflen)) {
errors++;
}
/* FREE */
if(buffer) free(buffer);
if(hg) free(hg);
return 1;
error:
if(buffer) free(buffer);
if(hg) free(hg);
return 0;
}
int send_hepv2 (rc_info_t *rcinfo, unsigned char *data, unsigned int len) {
void* buffer;
struct hep_hdr hdr;
struct hep_timehdr hep_time;
struct hep_iphdr hep_ipheader;
unsigned int totlen=0, buflen=0;
static int errors=0;
#ifdef USE_IPV6
struct hep_ip6hdr hep_ip6header;
#endif /* USE IPV6 */
/* Version && proto */
hdr.hp_v = hep_version;
hdr.hp_f = rcinfo->ip_family;
hdr.hp_p = rcinfo->ip_proto;
hdr.hp_sport = htons(rcinfo->src_port); /* src port */
hdr.hp_dport = htons(rcinfo->dst_port); /* dst port */
/* IP version */
switch (hdr.hp_f) {
case AF_INET:
totlen = sizeof(struct hep_iphdr);
break;
#ifdef USE_IPV6
case AF_INET6:
totlen = sizeof(struct hep_ip6hdr);
break;
#endif /* USE IPV6 */
}
hdr.hp_l = totlen + sizeof(struct hep_hdr);
/* COMPLETE LEN */
totlen += sizeof(struct hep_hdr);
totlen += len;
if(hep_version == 2) {
totlen += sizeof(struct hep_timehdr);
hep_time.tv_sec = rcinfo->time_sec;
hep_time.tv_usec = rcinfo->time_usec;
hep_time.captid = capt_id;
}
/*buffer for ethernet frame*/
buffer = (void*)malloc(totlen);
if (buffer==0){
LERR("ERROR: out of memory\n");
goto error;
}
/* copy hep_hdr */
memcpy((void*) buffer, &hdr, sizeof(struct hep_hdr));
buflen = sizeof(struct hep_hdr);
switch (hdr.hp_f) {
case AF_INET:
/* Source && Destination ipaddresses*/
inet_pton(AF_INET, rcinfo->src_ip, &hep_ipheader.hp_src);
inet_pton(AF_INET, rcinfo->dst_ip, &hep_ipheader.hp_dst);
/* copy hep ipheader */
memcpy((void*)buffer + buflen, &hep_ipheader, sizeof(struct hep_iphdr));
buflen += sizeof(struct hep_iphdr);
break;
#ifdef USE_IPV6
case AF_INET6:
inet_pton(AF_INET6, rcinfo->src_ip, &hep_ip6header.hp6_src);
inet_pton(AF_INET6, rcinfo->dst_ip, &hep_ip6header.hp6_dst);
/* copy hep6 ipheader */
memcpy((void*)buffer + buflen, &hep_ip6header, sizeof(struct hep_ip6hdr));
buflen += sizeof(struct hep_ip6hdr);
break;
#endif /* USE_IPV6 */
}
/* Version 2 has timestamp, captnode ID */
if(hep_version == 2) {
/* TIMING */
memcpy((void*)buffer + buflen, &hep_time, sizeof(struct hep_timehdr));
buflen += sizeof(struct hep_timehdr);
}
if(!data) {
LERR( "the captured data is empty....\n");
goto error;
}
memcpy((void *)(buffer + buflen) , (void*)(data), len);
buflen +=len;
/* make sleep after 100 errors*/
if(errors > 50) {
LERR( "HEP server is down... retrying after sleep...\n");
if(!usessl) {
sleep(2);
if(init_hepsocket_blocking()) {
initfails++;
}
errors=0;
}
#ifdef USE_SSL
else {
sleep(2);
if(initSSL()) {
initfails++;
}
errors=0;
}
#endif /* USE SSL */
}
/* send this packet out of our socket */
if(send_data(buffer, buflen)) {
errors++;
}
/* FREE */
if(buffer) free(buffer);
return 1;
error:
if(buffer) free(buffer);
return 0;
}
int send_data (void *buf, unsigned int len) {
/* send this packet out of our socket */
int r = 0;
void * p = buf;
int sentbytes = 0;
if(!usessl) {
/*
size_t sendlen = send(sock, p, len, 0);
if(sendlen == -1) {
LDEBUG("send error\n");
return -1;
}
sendPacketsCount++;
*/
/*
size_t sendlen = len < 1024 ? len : 1024;
size_t remlen = len;
const void *curpos = buf;
LDEBUG("SENDING!!!!!!!!!!!\n");
while (remlen > 0)
{
ssize_t len = send(sock, curpos, sendlen, MSG_NOSIGNAL);
if (len == -1) return -1;
curpos += len;
remlen -= len;
sendlen = (remlen < 1024) ? remlen : 1024;
}
*/
while (sentbytes < len){
if( (r = send(sock, p, len - sentbytes, MSG_NOSIGNAL )) == -1) {
LERR("send error\n");
return -1;
}
if (r != len - sentbytes)
LDEBUG("send:multiple calls: %d\n", r);
sentbytes += r;
p += r;
}
sendPacketsCount++;
}
#ifdef USE_SSL
else {
if(SSL_write(ssl, buf, len) < 0) {
LERR("capture: couldn't re-init ssl socket\r\n");
return -1;
}
sendPacketsCount++;
}
#endif
/* RESET ERRORS COUNTER */
return 0;
}
int unload_module(void)
{
LNOTICE("unloaded module core_hep\n");
LNOTICE("count sends:[%d]\n", sendPacketsCount);
/* Close socket */
if(sock) close(sock);
#ifdef USE_SSL
if(ssl) SSL_free(ssl);
if(ctx) SSL_CTX_free(ctx);
#endif /* use SSL */
pthread_mutex_destroy(&lock);
return 0;
}
void select_loop (void)
{
int n = 0;
int initfails = 0;
fd_set readfd;
time_t prevtime = time(NULL);
FD_ZERO(&readfd);
FD_SET(sock, &readfd);
while (1){
if (select(sock+1, &readfd, 0, 0, NULL) < 0){
LERR("select failed\n");
handler(1);
}
if (FD_ISSET(sock, &readfd)){
ioctl(sock, FIONREAD, &n);
if (n == 0){
/* server disconnected*/
if(!usessl) {
if(init_hepsocket()) initfails++;
}
#ifdef USE_SSL
else {
if(initSSL()) initfails++;
}
#endif /* USE_SSL */
if (initfails > 10)
{
time_t curtime = time (NULL);
if (curtime - prevtime < 2){
pthread_mutex_lock(&lock);
LERR( "HEP server is down... retrying after sleep...\n");
sleep(2);
pthread_mutex_unlock(&lock);
}
initfails=0;
prevtime = curtime;
}
}
}
}
}
int load_module(xml_node *config)
{
xml_node *modules;
char *key, *value;
//int s;
/* READ CONFIG */
modules = config;
while(1) {
if(modules == NULL) break;
modules = xml_get("param", modules, 1 );
if(modules->attr[0] != NULL && modules->attr[2] != NULL) {
/* bad parser */
if(strncmp(modules->attr[2], "value", 5) || strncmp(modules->attr[0], "name", 4)) {
LERR( "bad keys in the config\n");
goto next;
}
key = modules->attr[1];
value = modules->attr[3];
if(key == NULL || value == NULL) {
LERR( "bad values in the config\n");
goto next;
}
if(!strncmp(key, "capture-host", 10)) capt_host = value;
else if(!strncmp(key, "capture-port", 13)) capt_port = value;
else if(!strncmp(key, "capture-proto", 14)) capt_proto = value;
else if(!strncmp(key, "capture-password", 17)) capt_password = value;
else if(!strncmp(key, "capture-id", 11)) capt_id = atoi(value);
else if(!strncmp(key, "payload-compression", 19) && !strncmp(value, "true", 5)) pl_compress = 1;
else if(!strncmp(key, "version", 7)) hep_version = atoi(value);
}
next:
modules = modules->next;
}
#ifndef USE_ZLIB
if(pl_compress) LDEBUG("The captagent has not compiled with zlib. Please reconfigure with --enable-compression\n");
#endif /* USE_ZLIB */
LNOTICE("Loaded core_hep\n");
hints->ai_flags = AI_NUMERICSERV;
hints->ai_family = AF_UNSPEC;
if(!strncmp(capt_proto, "udp", 3)) {
hints->ai_socktype = SOCK_DGRAM;
hints->ai_protocol = IPPROTO_UDP;
}
else if(!strncmp(capt_proto, "tcp", 3) || !strncmp(capt_proto, "ssl", 3)) {
hints->ai_socktype = SOCK_STREAM;
hints->ai_protocol = IPPROTO_TCP;
/*TLS || SSL*/
if(!strncmp(capt_proto, "ssl", 3)) {
#ifdef USE_SSL
usessl = 1;
/* init SSL library */
SSL_library_init();
#else
LERR("The captagent has not compiled with ssl support. Please reconfigure with --enable-ssl\n");
#endif /* end USE_SSL */
}
}
else {
LERR("Unsupported protocol\n");
return -1;
}
/* if ((s = getaddrinfo(capt_host, capt_port, hints, &ai)) != 0) {
LERR( "capture: getaddrinfo: %s\n", gai_strerror(s));
return 2;
}
*/
if(!usessl) {
if(init_hepsocket_blocking()) {
LERR("capture: couldn't init socket\r\n");
return 2;
}
}
#ifdef USE_SSL
else {
if(initSSL()) {
LERR("capture: couldn't init SSL socket\r\n");
handler(1);
return 2;
}
// start select thread
/* pthread_create(&call_thread, NULL, (void *)select_loop, NULL);
if (pthread_mutex_init(&lock, NULL) != 0)
{
LERR("mutex init failed\n");
return 3;
}
*/
}
#endif /* use SSL */
sigPipe();
return 0;
}
int init_hepsocket (void) {
struct timeval tv;
socklen_t lon;
long arg;
fd_set myset;
int valopt, res, ret = 0, s;
if(sock) close(sock);
if ((s = getaddrinfo(capt_host, capt_port, hints, &ai)) != 0) {
LERR( "capture: getaddrinfo: %s\n", gai_strerror(s));
return 2;
}
if((sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol)) < 0) {
LERR("Sender socket creation failed: %s\n", strerror(errno));
return 1;
}
// Set non-blocking
if((arg = fcntl(sock, F_GETFL, NULL)) < 0) {
LERR( "Error fcntl(..., F_GETFL) (%s)\n", strerror(errno));
close(sock);
return 1;
}
arg |= O_NONBLOCK;
if( fcntl(sock, F_SETFL, arg) < 0) {
LERR( "Error fcntl(..., F_SETFL) (%s)\n", strerror(errno));
close(sock);
return 1;
}
if((res = connect(sock, ai->ai_addr, (socklen_t)(ai->ai_addrlen))) < 0) {
if (errno == EINPROGRESS) {
do {
tv.tv_sec = 5;
tv.tv_usec = 0;
FD_ZERO(&myset);
FD_SET(sock, &myset);
res = select(sock + 1 , NULL, &myset, NULL, &tv);
if (res < 0 && errno != EINTR) {
LERR( "Error connecting %d - %s\n", errno, strerror(errno));
close(sock);
ret = 1;
break;
}
else if (res > 0) {
// Socket selected for write
lon = sizeof(int);
if (getsockopt(sock, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon) < 0) {
close(sock);
LERR( "Error in getsockopt() %d - %s\n", errno, strerror(errno));
ret = 2;
}
// Check the value returned...
if (valopt) {
close(sock);
LERR( "Error in delayed connection() %d - %s\n", valopt, strerror(valopt));
ret = 3;
}
break;
}
else {
close(sock);
LERR( "Timeout in select() - Cancelling!\n");
ret = 4;
break;
}
} while (1);
}
}
return ret;
}
int init_hepsocket_blocking (void) {
int s;
struct timeval tv;
fd_set myset;
if(sock) close(sock);
if ((s = getaddrinfo(capt_host, capt_port, hints, &ai)) != 0) {
LERR( "capture: getaddrinfo: %s\n", gai_strerror(s));
return 2;
}
if((sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol)) < 0) {
LERR("Sender socket creation failed: %s\n", strerror(errno));
return 1;
}
if (connect(sock, ai->ai_addr, (socklen_t)(ai->ai_addrlen)) == -1) {
select(sock + 1 , NULL, &myset, NULL, &tv);
if (errno != EINPROGRESS) {
LERR("Sender socket creation failed: %s\n", strerror(errno));
return 1;
}
}
return 0;
}
#ifdef USE_SSL
SSL_CTX* initCTX(void) {
SSL_METHOD *method;
SSL_CTX *ctx;
OpenSSL_add_all_algorithms(); /* Load cryptos, et.al. */
SSL_load_error_strings(); /* Bring in and register error messages */
/* we use SSLv3 OBSOLETE */
// method = SSLv3_client_method(); /* Create new client-method instance */
/* tls v1 */
method = TLSv1_method();
ctx = SSL_CTX_new(method); /* Create new context */
if ( ctx == NULL ) {
ERR_print_errors_fp(stderr);
abort();
}
return ctx;
}
void showCerts(SSL* ssl) {
X509 *cert;
char *line;
cert = SSL_get_peer_certificate(ssl); /* get the server's certificate */
if ( cert != NULL ) {
LERR("Server certificates:\n");
line = X509_NAME_oneline(X509_get_subject_name(cert), 0, 0);
LERR("Subject: %s\n", line);
free(line); /* free the malloc'ed string */
line = X509_NAME_oneline(X509_get_issuer_name(cert), 0, 0);
LERR("Issuer: %s\n", line);
free(line); /* free the malloc'ed string */
X509_free(cert); /* free the malloc'ed certificate copy */
}
else
LERR("No certificates.\n");
}
int initSSL(void) {
long ctx_options;
/* if(ssl) SSL_free(ssl);
if(ctx) SSL_CTX_free(ctx);
*/
if(init_hepsocket_blocking()) {
LERR("capture: couldn't init hep socket\r\n");
return 1;
}
ctx = initCTX();
/* workaround bug openssl */
ctx_options = SSL_OP_ALL;
ctx_options |= SSL_OP_NO_SSLv2;
ctx_options |= SSL_OP_NO_SSLv3;
SSL_CTX_set_options(ctx, ctx_options);
/*extra*/
SSL_CTX_ctrl(ctx, BIO_C_SET_NBIO, 1, NULL);
/* create new SSL connection state */
ssl = SSL_new(ctx);
SSL_set_connect_state(ssl);
/* attach socket */
SSL_set_fd(ssl, sock); /* attach the socket descriptor */
/* perform the connection */
if ( SSL_connect(ssl) == -1 ) {
ERR_print_errors_fp(stderr);
return 1;
}
showCerts(ssl);
return 0;
}
#endif /* use SSL */
char *description(void)
{
LNOTICE("Loaded description\n");
char *description = "test description";
return description;
}
int statistic(char *buf)
{
snprintf(buf, 1024, "Statistic of CORE_HEP module:\r\nSend packets: [%i]\r\n", sendPacketsCount);
return 1;
}
int handlerPipe(void) {
LERR("SIGPIPE... trying to reconnect...\n");
return 1;
}
int sigPipe(void)
{
struct sigaction new_action;
/* sigation structure */
new_action.sa_handler = handlerPipe;
sigemptyset (&new_action.sa_mask);
new_action.sa_flags = 0;
if( sigaction (SIGPIPE, &new_action, NULL) == -1) {
perror("Failed to set new Handle");
return -1;
}
}
captagent-6.1.0.20/captagent/mod/proto_rtcp/ 0000775 0000000 0000000 00000000000 12723545033 0020630 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/captagent/mod/proto_rtcp/proto_rtcp.c 0000664 0000000 0000000 00000033725 12723545033 0023201 0 ustar 00root root 0000000 0000000 /*
* $Id$
*
* captagent - Homer capture agent. Modular
* Duplicate SIP messages in Homer Encapulate Protocol [HEP] [ipv6 version]
*
* Author: Alexandr Dubovikov
* (C) Homer Project 2012-2014 (http://www.sipcapture.org)
*
* Homer capture agent 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 3 of the License, or
* (at your option) any later version
*
* Homer capture agent is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#ifndef __FAVOR_BSD
#define __FAVOR_BSD
#endif /* __FAVOR_BSD */
#include
#include
#include
#include
#ifdef USE_IPV6
#include
#endif /* USE_IPV6 */
#include
#include "../../src/api.h"
#include "../../src/log.h"
#include "proto_rtcp.h"
#include "../proto_uni/capthash.h"
#include "rtcp_parser.h"
static uint8_t rtcp_link_offset = 14;
uint8_t hdr_offset = 0;
pcap_t *sniffer_rtp;
pthread_t rtp_thread;
unsigned char* ethaddr = NULL;
unsigned char* mplsaddr = NULL;
/* Callback function that is passed to pcap_loop() */
void rtcpback_proto(u_char *useless, struct pcap_pkthdr *pkthdr, u_char *packet)
{
/* Pat Callahan's patch for MPLS */
memcpy(ðaddr, (packet + 12), 2);
memcpy(&mplsaddr, (packet + 16), 2);
if (ntohs((uint16_t)*(ðaddr)) == 0x8100) {
if (ntohs((uint16_t)*(&mplsaddr)) == 0x8847) {
hdr_offset = 8;
} else {
hdr_offset = 4;
}
}
struct ip *ip4_pkt = (struct ip *) (packet + rtcp_link_offset + hdr_offset);
#if USE_IPv6
struct ip6_hdr *ip6_pkt = (struct ip6_hdr*)(packet + rtcp_link_offset + ((ntohs((uint16_t)*(packet + 12)) == 0x8100)? 4: 0) );
#endif
uint32_t ip_ver;
uint8_t ip_proto = 0;
uint32_t ip_hl = 0;
uint32_t ip_off = 0;
uint8_t fragmented = 0;
uint16_t frag_offset = 0;
uint32_t frag_id = 0;
char ip_src[INET6_ADDRSTRLEN + 1],
ip_dst[INET6_ADDRSTRLEN + 1];
unsigned char *data;
uint32_t len = pkthdr->caplen;
ip_ver = ip4_pkt->ip_v;
switch (ip_ver) {
case 4: {
#if defined(AIX)
#undef ip_hl
ip_hl = ip4_pkt->ip_ff.ip_fhl * 4;
#else
ip_hl = ip4_pkt->ip_hl * 4;
#endif
ip_proto = ip4_pkt->ip_p;
ip_off = ntohs(ip4_pkt->ip_off);
fragmented = ip_off & (IP_MF | IP_OFFMASK);
frag_offset = (fragmented) ? (ip_off & IP_OFFMASK) * 8 : 0;
frag_id = ntohs(ip4_pkt->ip_id);
inet_ntop(AF_INET, (const void *)&ip4_pkt->ip_src, ip_src, sizeof(ip_src));
inet_ntop(AF_INET, (const void *)&ip4_pkt->ip_dst, ip_dst, sizeof(ip_dst));
} break;
#if USE_IPv6
case 6: {
ip_hl = sizeof(struct ip6_hdr);
ip_proto = ip6_pkt->ip6_nxt;
if (ip_proto == IPPROTO_FRAGMENT) {
struct ip6_frag *ip6_fraghdr;
ip6_fraghdr = (struct ip6_frag *)((unsigned char *)(ip6_pkt) + ip_hl);
ip_hl += sizeof(struct ip6_frag);
ip_proto = ip6_fraghdr->ip6f_nxt;
fragmented = 1;
frag_offset = ntohs(ip6_fraghdr->ip6f_offlg & IP6F_OFF_MASK);
frag_id = ntohl(ip6_fraghdr->ip6f_ident);
}
inet_ntop(AF_INET6, (const void *)&ip6_pkt->ip6_src, ip_src, sizeof(ip_src));
inet_ntop(AF_INET6, (const void *)&ip6_pkt->ip6_dst, ip_dst, sizeof(ip_dst));
} break;
#endif
}
switch (ip_proto) {
case IPPROTO_UDP: {
struct udphdr *udp_pkt = (struct udphdr *)((unsigned char *)(ip4_pkt) + ip_hl);
uint16_t udphdr_offset = (frag_offset) ? 0 : sizeof(*udp_pkt);
data = (unsigned char *)(udp_pkt) + udphdr_offset;
len -= rtcp_link_offset + ip_hl + udphdr_offset + hdr_offset;
#if USE_IPv6
if (ip_ver == 6)
len -= ntohs(ip6_pkt->ip6_plen);
#endif
if ((int32_t)len < 0) len = 0;
dump_rtp_packet(pkthdr, packet, ip_proto, data, len, ip_src, ip_dst,
ntohs(udp_pkt->uh_sport), ntohs(udp_pkt->uh_dport), 0,
udphdr_offset, fragmented, frag_offset, frag_id, ip_ver);
} break;
default:
break;
}
}
int dump_rtp_packet(struct pcap_pkthdr *pkthdr, u_char *packet, uint8_t proto, unsigned char *data, uint32_t len,
const char *ip_src, const char *ip_dst, uint16_t sport, uint16_t dport, uint8_t flags,
uint16_t hdr_offset, uint8_t frag, uint16_t frag_offset, uint32_t frag_id, uint32_t ip_ver) {
struct timeval tv;
time_t curtime;
char timebuffer[30];
rc_info_t *rcinfo = NULL;
unsigned char *senddata;
int json_len;
gettimeofday(&tv,NULL);
sendPacketsCount++;
curtime = tv.tv_sec;
strftime(timebuffer,30,"%m-%d-%Y %T.",localtime(&curtime));
if(len < 5) {
LERR("rtcp the message is too small: %d\n", len);
return -1;
}
LDEBUG("GOT RTCP %s:%d -> %s:%d. LEN: %d\n", ip_src, sport, ip_dst, dport, len);
if(find_and_update(sip_callid, ip_src, sport, ip_dst, dport) == 0) {
return 0;
}
if(rtcp_as_json) {
json_rtcp_buffer[0] = '\0';
if((json_len = capt_parse_rtcp((char *)data, len, json_rtcp_buffer, sizeof(json_rtcp_buffer))) > 0) {
senddata = json_rtcp_buffer;
len = strlen(json_rtcp_buffer);
}
else {
LDEBUG("GOODBYE or APP MESSAGE. Ignore!\n");
return 0;
}
LDEBUG("JSON RTCP %s\n", json_rtcp_buffer);
}
else senddata = data;
rcinfo = malloc(sizeof(rc_info_t));
memset(rcinfo, 0, sizeof(rc_info_t));
LDEBUG("CALLID RTCP %s\n", sip_callid);
rcinfo->src_port = sport;
rcinfo->dst_port = dport;
rcinfo->src_ip = ip_src;
rcinfo->dst_ip = ip_dst;
rcinfo->ip_family = ip_ver = 4 ? AF_INET : AF_INET6 ;
rcinfo->ip_proto = proto;
rcinfo->time_sec = pkthdr->ts.tv_sec;
rcinfo->time_usec = pkthdr->ts.tv_usec;
rcinfo->proto_type = rtcp_proto_type;
/* correlation stuff */
rcinfo->correlation_id.len = strlen(sip_callid);
rcinfo->correlation_id.s = &sip_callid;
if(debug_proto_rtcp_enable)
LDEBUG("SENDING PACKET: Len: [%d]\n", len);
/* Duplcate */
if(!send_message(rcinfo, senddata, (unsigned int) len)) {
LERR("Not duplicated\n");
}
if(rcinfo) free(rcinfo);
return 1;
}
void* rtp_collect( void* device ) {
struct bpf_program filter;
char errbuf[PCAP_ERRBUF_SIZE];
char *filter_expr;
uint16_t snaplen = 65535, timeout = 100, len = 300, ret = 0;
if(device) {
if((sniffer_rtp = pcap_open_live((char *)device, snaplen, rtcp_promisc, timeout, errbuf)) == NULL) {
LERR("Failed to open packet sniffer on %s: pcap_open_live(): %s\n", (char *)device, errbuf);
return NULL;
}
} else {
if((sniffer_rtp = pcap_open_offline(usefile, errbuf)) == NULL) {
LERR("Failed to open packet sniffer rtp on %s: pcap_open_offline(): %s\n", usefile, errbuf);
return NULL;
}
}
len += (rtcp_portrange != NULL) ? strlen(rtcp_portrange) : 10;
len += (rtcp_userfilter != NULL) ? strlen(rtcp_userfilter) : 0;
filter_expr = malloc(sizeof(char) * len);
ret += snprintf(filter_expr, len, RTCP_FILTER);
/* FILTER */
if(rtcp_portrange != NULL) ret += snprintf(filter_expr+ret, (len - ret), "%s portrange %s ", ret ? " and": "", rtcp_portrange);
/* CUSTOM FILTER */
if(rtcp_userfilter != NULL) ret += snprintf(filter_expr+ret, (len - ret), " %s", rtcp_userfilter);
/* compile filter expression (global constant, see above) */
if (pcap_compile(sniffer_rtp, &filter, filter_expr, 1, 0) == -1) {
LERR("Failed to compile filter \"%s\": %s\n", filter_expr, pcap_geterr(sniffer_rtp));
if(filter_expr) free(filter_expr);
return NULL;
}
/* install filter on sniffer session */
if (pcap_setfilter(sniffer_rtp, &filter)) {
LERR("Failed to install filter: %s\n", pcap_geterr(sniffer_rtp));
if(filter_expr) free(filter_expr);
return NULL;
}
if(filter_expr) free(filter_expr);
/* detect rtcp_link_offset. Thanks ngrep for this. */
switch(pcap_datalink(sniffer_rtp)) {
case DLT_EN10MB:
rtcp_link_offset = ETHHDR_SIZE;
break;
case DLT_IEEE802:
rtcp_link_offset = TOKENRING_SIZE;
break;
case DLT_FDDI:
rtcp_link_offset = FDDIHDR_SIZE;
break;
case DLT_SLIP:
rtcp_link_offset = SLIPHDR_SIZE;
break;
case DLT_PPP:
rtcp_link_offset = PPPHDR_SIZE;
break;
case DLT_LOOP:
case DLT_NULL:
rtcp_link_offset = LOOPHDR_SIZE;
break;
case DLT_RAW:
rtcp_link_offset = RAWHDR_SIZE;
break;
case DLT_LINUX_SLL:
rtcp_link_offset = ISDNHDR_SIZE;
break;
case DLT_IEEE802_11:
rtcp_link_offset = IEEE80211HDR_SIZE;
break;
default:
LERR( "fatal: unsupported interface type %u\n", pcap_datalink(sniffer_rtp));
exit(-1);
}
while (pcap_loop(sniffer_rtp, 0, (pcap_handler)rtcpback_proto, 0));
/* terminate from here */
handler(1);
return NULL;
}
int unload_module(void)
{
LNOTICE("unloaded module proto_rtcp\n");
/* Close socket */
pcap_close(sniffer_rtp);
return 0;
}
int load_module(xml_node *config)
{
char *dev = NULL, *usedev = NULL;
char errbuf[PCAP_ERRBUF_SIZE];
xml_node *modules;
char *key, *value = NULL;
LNOTICE("Loaded proto_rtcp\n");
/* READ CONFIG */
modules = config;
while(1) {
if(modules == NULL) break;
modules = xml_get("param", modules, 1 );
if(modules->attr[0] != NULL && modules->attr[2] != NULL) {
/* bad parser */
if(strncmp(modules->attr[2], "value", 5) || strncmp(modules->attr[0], "name", 4)) {
LERR( "bad keys in the config\n");
goto next;
}
key = modules->attr[1];
value = modules->attr[3];
if(key == NULL || value == NULL) {
LERR( "bad values in the config\n");
goto next;
}
if(!strncmp(key, "dev", 3)) usedev = value;
else if(!strncmp(key, "portrange", 9)) rtcp_portrange = value;
else if(!strncmp(key, "promisc", 7) && !strncmp(value, "false", 5)) rtcp_promisc = 0;
else if(!strncmp(key, "filter", 6)) rtcp_userfilter = value;
else if(!strncmp(key, "rtcp-json", 9) && !strncmp(value, "false", 5) ) rtcp_as_json = 0;
else if(!strncmp(key, "send-sdes", 9) && !strncmp(value, "false", 5) ) send_sdes = 0;
else if(!strncmp(key, "vlan", 4) && !strncmp(value, "true", 4)) rtcp_vlan = 1;
else if(!strncmp(key, "debug", 5) && !strncmp(value, "true", 4)) debug_proto_rtcp_enable = 1;
}
next:
modules = modules->next;
}
/* DEV || FILE */
if(!usefile) {
dev = usedev ? usedev : pcap_lookupdev(errbuf);
if (!dev) {
perror(errbuf);
exit(-1);
}
}
// start thread
pthread_create(&rtp_thread, NULL, rtp_collect, (void *)dev);
return 0;
}
char *description(void)
{
LNOTICE("Loaded description\n");
char *description = "test description";
return description;
}
int statistic(char *buf)
{
snprintf(buf, 1024, "Statistic of PROTO_RTCP module:\r\nSend packets: [%i]\r\n", sendPacketsCount);
return 1;
}
captagent-6.1.0.20/captagent/mod/proto_uni/ 0000775 0000000 0000000 00000000000 12723545033 0020453 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/captagent/mod/proto_uni/proto_uni.c 0000664 0000000 0000000 00000066247 12723545033 0022654 0 ustar 00root root 0000000 0000000 /*
* $Id$
*
* captagent - Homer capture agent. Modular
* Duplicate SIP messages in Homer Encapulate Protocol [HEP] [ipv6 version]
*
* Author: Alexandr Dubovikov
* (C) Homer Project 2012 (http://www.sipcapture.org)
*
* Homer capture agent 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 3 of the License, or
* (at your option) any later version
*
* Homer capture agent is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#ifndef __FAVOR_BSD
#define __FAVOR_BSD
#endif /* __FAVOR_BSD */
#include
#include
#include
#include
#ifdef USE_IPV6
#include
#endif /* USE_IPV6 */
#include
/* reasambling */
#include "ipreasm.h"
#include "tcpreasm.h"
#include "src/api.h"
#include "src/log.h"
#include "proto_uni.h"
#include "sipparse.h"
#include "captarray.h"
#include "capthash.h"
static uint8_t link_offset = 14;
pcap_t *sniffer_proto;
pthread_t call_thread;
unsigned char* ethaddr = NULL;
unsigned char* mplsaddr = NULL;
/* Callback function that is passed to pcap_loop() */
void callback_proto(u_char *useless, struct pcap_pkthdr *pkthdr, u_char *packet)
{
uint8_t hdr_offset = 0;
/* Pat Callahan's patch for MPLS */
memcpy(ðaddr, (packet + 12), 2);
memcpy(&mplsaddr, (packet + 16), 2);
if (ntohs((uint16_t)*(ðaddr)) == 0x8100) {
if (ntohs((uint16_t)*(&mplsaddr)) == 0x8847) {
hdr_offset = 8;
} else {
hdr_offset = 4;
}
}
struct ip *ip4_pkt = (struct ip *) (packet + link_offset + hdr_offset);
#if USE_IPv6
struct ip6_hdr *ip6_pkt = (struct ip6_hdr*)(packet + link_offset + ((ntohs((uint16_t)*(packet + 12)) == 0x8100)? 4: 0) );
#endif
uint32_t ip_ver;
uint8_t ip_proto = 0;
uint32_t ip_hl = 0;
uint32_t ip_off = 0;
uint8_t fragmented = 0;
uint16_t frag_offset = 0;
uint32_t frag_id = 0;
char ip_src[INET6_ADDRSTRLEN + 1],
ip_dst[INET6_ADDRSTRLEN + 1];
unsigned char *data, *datatcp;
u_char *pack = NULL;
uint32_t len = pkthdr->caplen;
uint8_t psh = 0;
int ret = 0;
if(debug_proto_uni_enable) LDEBUG("GOT Message: LEN:[%d]\n", len);
if (reasm != NULL && reasm_enable) {
unsigned new_len;
u_char *new_p = malloc(len - link_offset - ((ntohs((uint16_t)*(packet + 12)) == 0x8100)? 4:0));
memcpy(new_p, ip4_pkt, len - link_offset - ((ntohs((uint16_t)*(packet + 12)) == 0x8100)? 4:0));
pack = reasm_ip_next(reasm, new_p, len - link_offset - ((ntohs((uint16_t)*(packet + 12)) == 0x8100)? 4:0), (reasm_time_t) 1000000UL * pkthdr->ts.tv_sec + pkthdr->ts.tv_usec, &new_len);
if (pack == NULL) return;
len = new_len + link_offset + ((ntohs((uint16_t)*(pack + 12)) == 0x8100)? 4:0);
pkthdr->len = new_len;
pkthdr->caplen = new_len;
ip4_pkt = (struct ip *) pack;
#if USE_IPv6
ip6_pkt = (struct ip6_hdr*)pack;
#endif
}
ip_ver = ip4_pkt->ip_v;
switch (ip_ver) {
case 4: {
#if defined(AIX)
#undef ip_hl
ip_hl = ip4_pkt->ip_ff.ip_fhl * 4;
#else
ip_hl = ip4_pkt->ip_hl * 4;
#endif
ip_proto = ip4_pkt->ip_p;
ip_off = ntohs(ip4_pkt->ip_off);
fragmented = ip_off & (IP_MF | IP_OFFMASK);
frag_offset = (fragmented) ? (ip_off & IP_OFFMASK) * 8 : 0;
frag_id = ntohs(ip4_pkt->ip_id);
if(debug_proto_uni_enable) LDEBUG("Message IPV4: LEN:[%d]\n", len);
inet_ntop(AF_INET, (const void *)&ip4_pkt->ip_src, ip_src, sizeof(ip_src));
inet_ntop(AF_INET, (const void *)&ip4_pkt->ip_dst, ip_dst, sizeof(ip_dst));
} break;
#if USE_IPv6
case 6: {
ip_hl = sizeof(struct ip6_hdr);
ip_proto = ip6_pkt->ip6_nxt;
if (ip_proto == IPPROTO_FRAGMENT) {
struct ip6_frag *ip6_fraghdr;
ip6_fraghdr = (struct ip6_frag *)((unsigned char *)(ip6_pkt) + ip_hl);
ip_hl += sizeof(struct ip6_frag);
ip_proto = ip6_fraghdr->ip6f_nxt;
fragmented = 1;
frag_offset = ntohs(ip6_fraghdr->ip6f_offlg & IP6F_OFF_MASK);
frag_id = ntohl(ip6_fraghdr->ip6f_ident);
}
if(debug_proto_uni_enable) LDEBUG("Message IPV6: LEN:[%d]\n", len);
inet_ntop(AF_INET6, (const void *)&ip6_pkt->ip6_src, ip_src, sizeof(ip_src));
inet_ntop(AF_INET6, (const void *)&ip6_pkt->ip6_dst, ip_dst, sizeof(ip_dst));
} break;
#endif
}
switch (ip_proto) {
case IPPROTO_TCP: {
struct tcphdr *tcp_pkt = (struct tcphdr *)((unsigned char *)(ip4_pkt) + ip_hl);
//uint16_t tcphdr_offset = (frag_offset) ? 0 : (tcp_pkt->th_off * 4);
uint16_t tcphdr_offset = frag_offset ? 0 : (uint16_t) (tcp_pkt->th_off * 4);
data = (unsigned char *)(tcp_pkt) + tcphdr_offset;
len -= link_offset + ip_hl + tcphdr_offset + hdr_offset;
#if USE_IPv6
if (ip_ver == 6)
len -= ntohs(ip6_pkt->ip6_plen);
#endif
if ((int32_t)len < 0)
len = 0;
if(debug_proto_uni_enable) LDEBUG("TCP Message: LEN:[%d], [%.*s]\n", len, len, data);
if(tcpreasm != NULL && tcpdefrag_enable && (len > 0) && (tcp_pkt->th_flags & TH_ACK)) {
unsigned new_len;
u_char *new_p_2 = malloc(len+10);
memcpy(new_p_2, data, len);
if((tcp_pkt->th_flags & TH_PUSH)) psh = 1;
if(debug_proto_uni_enable)
LDEBUG("DEFRAG TCP process: EN:[%d], LEN:[%d], ACK:[%d], PSH[%d]\n",
tcpdefrag_enable, len, (tcp_pkt->th_flags & TH_ACK), psh);
datatcp = tcpreasm_ip_next_tcp(tcpreasm, new_p_2, len , (tcpreasm_time_t) 1000000UL * pkthdr->ts.tv_sec + pkthdr->ts.tv_usec, &new_len, &ip4_pkt->ip_src, &ip4_pkt->ip_dst, ntohs(tcp_pkt->th_sport), ntohs(tcp_pkt->th_dport), psh);
if (datatcp == NULL) return;
len = new_len;
if(debug_proto_uni_enable)
LDEBUG("COMPLETE TCP DEFRAG: LEN[%d], PACKET:[%s]\n", len, datatcp);
dump_proto_packet(pkthdr, packet, ip_proto, datatcp, len,
ip_src, ip_dst, ntohs(tcp_pkt->th_sport), ntohs(tcp_pkt->th_dport), tcp_pkt->th_flags,
tcphdr_offset, fragmented, frag_offset, frag_id, ip_ver);
/* clear datatcp */
free(datatcp);
}
else {
if(debug_proto_uni_enable)
LDEBUG("NORMAL TCP PACKET: LEN[%d], ACK: [%d], PACKET: [%s]\n", len, (tcp_pkt->th_flags & TH_ACK), data);
ret = dump_proto_packet(pkthdr, packet, ip_proto, data, len, ip_src, ip_dst,
ntohs(tcp_pkt->th_sport), ntohs(tcp_pkt->th_dport), tcp_pkt->th_flags,
tcphdr_offset, fragmented, frag_offset, frag_id, ip_ver);
}
} break;
case IPPROTO_UDP: {
struct udphdr *udp_pkt = (struct udphdr *)((unsigned char *)(ip4_pkt) + ip_hl);
uint16_t udphdr_offset = (frag_offset) ? 0 : sizeof(*udp_pkt);
data = (unsigned char *)(udp_pkt) + udphdr_offset;
len -= link_offset + ip_hl + udphdr_offset + hdr_offset;
if(debug_proto_uni_enable) LDEBUG("UDP Message: LEN:[%d] [.*s]\n", len, len, data);
#if USE_IPv6
if (ip_ver == 6)
len -= ntohs(ip6_pkt->ip6_plen);
#endif
if ((int32_t)len < 0) len = 0;
ret = dump_proto_packet(pkthdr, packet, ip_proto, data, len, ip_src, ip_dst,
ntohs(udp_pkt->uh_sport), ntohs(udp_pkt->uh_dport), 0,
udphdr_offset, fragmented, frag_offset, frag_id, ip_ver);
} break;
default:
break;
}
if(pack != NULL) free(pack);
}
int dump_proto_packet(struct pcap_pkthdr *pkthdr, u_char *packet, uint8_t proto, unsigned char *data, uint32_t len,
const char *ip_src, const char *ip_dst, uint16_t sport, uint16_t dport, uint8_t flags,
uint16_t hdr_offset, uint8_t frag, uint16_t frag_offset, uint32_t frag_id, uint32_t ip_ver) {
struct timeval tv;
time_t curtime;
char timebuffer[30];
//rc_info_t *rcinfo = NULL;
rc_info_t rcinfo;
preparsed_sip_t psip;
miprtcp_t *mp = NULL;
int i = 0;
char ipptmp[256];
uint32_t bytes_parsed = 0;
uint32_t newlen;
int skip_len = 0;
int loop = 1;
int count_loop = 0;
gettimeofday(&tv,NULL);
sendPacketsCount++;
curtime = tv.tv_sec;
strftime(timebuffer,30,"%m-%d-%Y %T.",localtime(&curtime));
if(len <= 172) {
//LDEBUG("SIP the message is too small: %d\n", len);
return -1;
}
/* SIP must have alpha */
if((proto_type == PROTO_SIP && !isalpha(data[0])) || !strncmp((char *)data, "HEP3", 4)) {
return -1;
}
/* gingle XMPP */
else if(proto_type == PROTO_XMPP && memcmp(" 5) {
LERR("TOO MANY LOOP LEN [%d] vs NEWLEN: [%"PRIu32"] vs SKIP: [%d] vs PARSED: [%"PRIu32"]\n", len, newlen, skip_len, bytes_parsed);
LERR("PACKET [%s]\n", data);
loop = 0;
break;
}
/* we can have more SIP message in one buffer */
if(proto == IPPROTO_TCP && len > 1300)
{
if(light_parse_message((char*) data+skip_len, (len-skip_len), &bytes_parsed, &psip) == 1) {
newlen = psip.len;
}
else newlen = len-skip_len;
}
//if (proto_type == PROTO_SIP && sip_method){
if (proto_type == PROTO_SIP && sip_parse == 1){
//if ((sip_method_not == 1) ? (!sip_is_method((const char*)data, len,sip_method+1)): (sip_is_method ((const char*) data, len,sip_method))){
//LDEBUG("method not matched\n");
//return -1;
//}
memset(&psip, 0, sizeof(struct preparsed_sip));
psip.mrp_size = 0;
psip.has_sdp = 0;
bytes_parsed = 0;
//LDEBUG("MESSAGE: [%.*s]\n", len, data);
if(parse_message((char*) data+skip_len, newlen, &bytes_parsed, &psip) == 1) {
if(rtcp_tracking == 1 && psip.has_sdp == 1) {
if(psip.mrp_size > 10) {
LERR("Bad MRP size [%d]\n", psip.mrp_size);
psip.mrp_size = 0;
}
for(i=0; i < psip.mrp_size; i++) {
mp = &psip.mrp[i];
if(mp->media_ip.len > 0 && mp->media_ip.s) {
if(mp->rtcp_port == 0 ) mp->rtcp_port = mp->media_port+1;
if(mp->rtcp_ip.len == 0) {
mp->rtcp_ip.len = mp->media_ip.len;
mp->rtcp_ip.s = mp->media_ip.s;
}
if(mp->rtcp_ip.len > 0 && mp->rtcp_ip.s) {
/* our correlation index */
snprintf(ipptmp,sizeof(ipptmp), "%.*s:%d", mp->rtcp_ip.len, mp->rtcp_ip.s, mp->rtcp_port);
/* put data to hash */
if(!find_ipport(ipptmp)) {
add_ipport(ipptmp, &psip.callid);
add_timer(ipptmp);
}
}
}
}
}
}
else {
LDEBUG("Not Parsed\n");
}
}
//LDEBUG("SIP: [%.*s]\n", len, data);
if(newlen <= 172) {
//LDEBUG("SIP the message is too small: %d\n", len);
loop = 0;
return -1;
}
/* SIP must have alpha */
if((proto_type == PROTO_SIP && !isalpha((data+skip_len)[0])) || !strncmp((char *)(data+skip_len), "HEP3", 4)) {
loop = 0;
return -1;
}
rcinfo.src_port = sport;
rcinfo.dst_port = dport;
rcinfo.src_ip = ip_src;
rcinfo.dst_ip = ip_dst;
rcinfo.ip_family = ip_ver = 4 ? AF_INET : AF_INET6 ;
rcinfo.ip_proto = proto;
rcinfo.time_sec = pkthdr->ts.tv_sec;
rcinfo.time_usec = pkthdr->ts.tv_usec;
rcinfo.proto_type = proto_type;
rcinfo.correlation_id.len = 0;
rcinfo.correlation_id.s = NULL;
if(debug_proto_uni_enable)
LDEBUG("SENDING PACKET: Len: [%d]\n", newlen);
if(validate_len == 1 && check_len_message(data+skip_len, (unsigned int) newlen) == 0)
{
LDEBUG("BAD LEN: [%d], SKIP: [%d]\n", newlen, skip_len);
loop = 0;
return -1;
}
if(validate_sip == 1 && check_sip_message(data+skip_len, (unsigned int) newlen) == 0)
{
LDEBUG("BAD SIP MESSAGE: Len: [%d], SKIP: [%d]\n", newlen, skip_len);
loop = 0;
return -1;
}
/* Duplcate */
if(send_enable) {
if(!send_message(&rcinfo, data+skip_len, (unsigned int) newlen)) {
LDEBUG("Not duplicated\n");
}
}
skip_len += newlen;
if(skip_len >= len || newlen >= len || newlen == 0 || bytes_parsed == 0 ) {
loop = 0;
break;
}
}
return 1;
}
void* proto_collect( void* device ) {
struct bpf_program filter;
char errbuf[PCAP_ERRBUF_SIZE];
char *filter_expr;
uint16_t snaplen = 65535, timeout = 100, len = 200, ret = 0;
if(device) {
if((sniffer_proto = pcap_open_live((char *)device, snaplen, promisc, timeout, errbuf)) == NULL) {
LERR("Failed to open packet sniffer on %s: pcap_open_live(): %s\n", (char *)device, errbuf);
return NULL;
}
} else {
if((sniffer_proto = pcap_open_offline(usefile, errbuf)) == NULL) {
LERR("Failed to open packet sniffer on %s: pcap_open_offline(): %s\n", usefile, errbuf);
return NULL;
}
}
len += (portrange != NULL) ? strlen(portrange) : 10;
len += (ip_proto != NULL) ? strlen(ip_proto) : 0;
len += (userfilter != NULL) ? strlen(userfilter) : 0;
len += (reasm_enable && buildin_reasm_filter) ? strlen(BPF_DEFRAGMENTION_FILTER) : 0;
filter_expr = malloc(sizeof(char) * len);
/* REASM */
if(reasm_enable && buildin_reasm_filter) ret += snprintf(filter_expr, len, BPF_DEFRAGMENTION_FILTER);
/* FILTER VLAN */
if(vlan) {
ret += snprintf(filter_expr+ret, (len - ret), ret ? " or (vlan " : "(vlan ");
if(portrange != NULL) ret += snprintf(filter_expr+ret, (len - ret), "and portrange %s ) ", portrange);
else if(port > 0) ret += snprintf(filter_expr+ret, (len - ret), "and port %d ) ", port);
}
else {
/* FILTER */
if(portrange != NULL) ret += snprintf(filter_expr+ret, (len - ret), "%s portrange %s ", ret ? " or": "", portrange);
else if(port > 0) ret += snprintf(filter_expr+ret, (len - ret), "%s port %d ", ret ? " or": "", port);
}
/* PROTO */
if(ip_proto != NULL) ret += snprintf(filter_expr+ret, (len - ret), "%s %s ", ret ? " and": "", ip_proto);
/* CUSTOM FILTER */
if(userfilter != NULL) ret += snprintf(filter_expr+ret, (len - ret), " %s", userfilter);
/* create filter string */
//((ip[6:2] & 0x3fff != 0))
LDEBUG("FILTER: [%s]\n", filter_expr);
/* compile filter expression (global constant, see above) */
if (pcap_compile(sniffer_proto, &filter, filter_expr, 1, 0) == -1) {
LERR("Failed to compile filter \"%s\": %s\n", filter_expr, pcap_geterr(sniffer_proto));
if(filter_expr) free(filter_expr);
return NULL;
}
/* install filter on sniffer session */
if (pcap_setfilter(sniffer_proto, &filter)) {
LERR("Failed to install filter: %s\n", pcap_geterr(sniffer_proto));
if(filter_expr) free(filter_expr);
return NULL;
}
if(filter_expr) free(filter_expr);
/* detect link_offset. Thanks ngrep for this. */
switch(pcap_datalink(sniffer_proto)) {
case DLT_EN10MB:
link_offset = ETHHDR_SIZE;
break;
case DLT_IEEE802:
link_offset = TOKENRING_SIZE;
break;
case DLT_FDDI:
link_offset = FDDIHDR_SIZE;
break;
case DLT_SLIP:
link_offset = SLIPHDR_SIZE;
break;
case DLT_PPP:
link_offset = PPPHDR_SIZE;
break;
case DLT_LOOP:
case DLT_NULL:
link_offset = LOOPHDR_SIZE;
break;
case DLT_RAW:
link_offset = RAWHDR_SIZE;
break;
case DLT_LINUX_SLL:
link_offset = ISDNHDR_SIZE;
break;
case DLT_IEEE802_11:
link_offset = IEEE80211HDR_SIZE;
break;
default:
LERR( "fatal: unsupported interface type %u\n", pcap_datalink(sniffer_proto));
exit(-1);
}
/* REASM */
if(reasm_enable) {
reasm = reasm_ip_new ();
reasm_ip_set_timeout (reasm, 30000000);
}
if(tcpdefrag_enable) {
tcpreasm = tcpreasm_ip_new ();
tcpreasm_ip_set_timeout (tcpreasm, 30000000);
}
while (pcap_loop(sniffer_proto, 0, (pcap_handler)callback_proto, 0));
/* terminate from here */
handler(1);
return NULL;
}
int unload_module(void)
{
LNOTICE("unloaded module proto_uni\n");
if (reasm != NULL) reasm_ip_free(reasm);
if (tcpreasm != NULL) tcpreasm_ip_free(tcpreasm);
timer_loop_stop = 0;
/* Close socket */
pcap_close(sniffer_proto);
return 0;
}
int load_module(xml_node *config)
{
char *dev = NULL, *usedev = NULL;
char errbuf[PCAP_ERRBUF_SIZE];
xml_node *modules;
char *key, *value = NULL, *local_pt = NULL;
LNOTICE("Loaded proto_uni\n");
/* READ CONFIG */
modules = config;
while(1) {
if(modules == NULL) break;
modules = xml_get("param", modules, 1 );
if(modules->attr[0] != NULL && modules->attr[2] != NULL) {
/* bad parser */
if(strncmp(modules->attr[2], "value", 5) || strncmp(modules->attr[0], "name", 4)) {
LERR( "bad keys in the config\n");
goto next;
}
key = modules->attr[1];
value = modules->attr[3];
if(key == NULL || value == NULL) {
LERR( "bad values in the config\n");
goto next;
}
if(!strncmp(key, "dev", 3)) usedev = value;
else if(!strncmp(key, "ip-proto", 8)) ip_proto = value;
else if(!strncmp(key, "proto-type", 10)) local_pt = value;
else if(!strncmp(key, "portrange", 9)) portrange = value;
else if(!strncmp(key, "promisc", 7) && !strncmp(value, "false", 5)) promisc = 0;
else if(!strncmp(key, "validate-len", 12) && !strncmp(value, "true", 4)) validate_len = 1;
else if(!strncmp(key, "validate-sip", 12) && !strncmp(value, "true", 4)) validate_sip = 1;
else if(!strncmp(key, "expire-timer", 12)) {
expire_timer_array = atoi(value);
if(expire_timer_array <= 10) expire_timer_array = EXPIRE_TIMER_ARRAY;
}
else if(!strncmp(key, "expire-rtcp", 11)) {
expire_hash_value = atoi(value);
if(expire_hash_value <= 10) expire_hash_value = EXPIRE_RTCP_HASH;
}
else if(!strncmp(key, "filter", 6)) userfilter = value;
else if(!strncmp(key, "port", 4)) port = atoi(value);
else if(!strncmp(key, "sip-parse", 9) && !strncmp(value, "true", 4)) sip_parse = 1;
else if(!strncmp(key, "rtcp-tracking", 13) && !strncmp(value, "true", 4)) rtcp_tracking = 1;
else if(!strncmp(key, "vlan", 4) && !strncmp(value, "true", 4)) vlan = 1;
else if(!strncmp(key, "reasm", 5) && !strncmp(value, "true", 4)) reasm_enable = 1;
else if(!strncmp(key, "debug", 5) && !strncmp(value, "true", 4)) debug_proto_uni_enable = 1;
else if(!strncmp(key, "buildin-reasm-filter", 20) && !strncmp(value, "true", 4)) buildin_reasm_filter = 1;
else if(!strncmp(key, "tcpdefrag", 9) && !strncmp(value, "true", 4)) tcpdefrag_enable = 1;
else if(!strncmp(key, "send-message", 9) && !strncmp(value, "false", 5)) send_enable = 0;
else if (!strncmp(key, "sip_method", 10)) sip_method = value;
}
next:
modules = modules->next;
}
/* DEV || FILE */
if(!usefile) {
dev = usedev ? usedev : pcap_lookupdev(errbuf);
if (!dev) {
perror(errbuf);
exit(-1);
}
}
/*
if(port == 0 && portrange == NULL) {
LERR( "bad port or portranges in the config\n");
return -1;
}
*/
/* CHECK PROTO */
if(!strncmp(local_pt, "sip", 3)) proto_type = PROTO_SIP;
else if(!strncmp(local_pt, "xmpp", 4)) proto_type = PROTO_XMPP;
else {
LERR( "Unsupported protocol. Switched to SIP\n");
proto_type = PROTO_SIP;
}
/* check sip method */
if (proto_type == PROTO_SIP && sip_method )
{
if (sip_method[0] == '!'){
sip_method_not = 1;
}
}
/* start timer */
if(sip_parse && rtcp_tracking) timer_init ();
// start thread
pthread_create(&call_thread, NULL, proto_collect, (void *)dev);
return 0;
}
char *description(void)
{
LNOTICE("Loaded description\n");
char *description = "test description";
return description;
}
int statistic(char *buf)
{
snprintf(buf, 1024, "Statistic of PROTO_UNI module:\r\nSend packets: [%i]\r\n", sendPacketsCount);
return 1;
}
captagent-6.1.0.20/common.am 0000664 0000000 0000000 00000000665 12723545033 0015526 0 ustar 00root root 0000000 0000000 DISTCLEANFILES = \
INSTALL \
Makefile \
Makefile.in \
configure \
config \
aclocal.m4 \
config.guess \
config.h.in \
config.h.in~ \
config.log \
config.status \
config.sub \
depcomp \
install-sh \
ltmain.sh \
missing \
capplan.tab.h \
capplan.tab.c \
capplan.c \
m4/libtool.m4 \
m4/lt~obsolete.m4 \
m4/ltoptions.m4 \
m4/ltsugar.m4 \
m4/ltversion.m4 \
ylwrap
SUFFIXES = .c .h .y .l
AM_YFLAGS = -d
AM_LFLAGS = -i
captagent-6.1.0.20/compile 0000775 0000000 0000000 00000016245 12723545033 0015276 0 ustar 00root root 0000000 0000000 #! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Written by Tom Tromey .
#
# 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, 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, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to or send patches to
# .
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to .
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
captagent-6.1.0.20/conf/ 0000775 0000000 0000000 00000000000 12723545033 0014635 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/conf/captagent.xml.in 0000664 0000000 0000000 00000003203 12723545033 0017730 0 ustar 00root root 0000000 0000000
captagent-6.1.0.20/conf/captureplans/ 0000775 0000000 0000000 00000000000 12723545033 0017336 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/conf/captureplans/rtcp_capture_plan.cfg 0000664 0000000 0000000 00000001116 12723545033 0023523 0 ustar 00root root 0000000 0000000 capture[pcap] {
# here we can check source/destination IP/port, message size
if(msg_check("size", "30")) {
if(is_rtcp()) {
#Only for redis!
if(is_rtcp_exist()) {
#Convert to JSON if needed.
if(parse_rtcp_to_json()) {
#Can be defined many profiles in transport_hep.xml
if(!send_hep("hepsocket")) {
clog("ERROR", "Error sending HEP!!!!");
}
} else {
clog("ERROR", "couldn't parse RTCP to json");
}
} else {
clog("ERROR", "Couldnot find this call");
}
} else {
clog("ERROR", "This is not RTCP");
}
}
drop;
}
captagent-6.1.0.20/conf/captureplans/rtcpxr_capture_plan.cfg 0000664 0000000 0000000 00000001015 12723545033 0024073 0 ustar 00root root 0000000 0000000 capture[rtcpxr] {
# here we can check source/destination IP/port, message size
if(msg_check("size", "100")) {
#Do parsing
if(parse_full_sip()) {
#check if our methos is PUBLISH
if(sip_is_method() && sip_check("method","PUBLISH")) {
send_reply("200", "OK");
#Can be defined many profiles in transport_hep.xml
if(!send_hep_proto("hepsocket", "99")) {
clog("ERROR", "Error sending HEP!!!!");
}
} else {
send_reply("503", "Server internal error");
}
}
}
drop;
}
captagent-6.1.0.20/conf/captureplans/sip_capture_plan.cfg 0000664 0000000 0000000 00000001313 12723545033 0023345 0 ustar 00root root 0000000 0000000 capture[pcap] {
# here we can check source/destination IP/port, message size
if(msg_check("size", "100")) {
#Do parsing
if(parse_sip()) {
#Can be defined many profiles in transport_hep.xml
if(!send_hep("hepsocket")) {
clog("ERROR", "Error sending HEP!!!!");
}
# if(sip_has_sdp())
# {
# #Activate it for RTCP checks
# if(!check_rtcp_ipport())
# {
# clog("ERROR", "ALREADY EXIST");
# }
# }
#Duplicate all INVITEs to JSON transport
# if(sip_is_method() && sip_check("method","INVITE")) {
# #Can be defined many profiles in transport_json.xml
# if(!send_json("jsonsocket")) {
# clog("ERROR", "Error sending JSON!!!");
# }
# }
}
}
drop;
}
captagent-6.1.0.20/conf/database_hash.xml 0000664 0000000 0000000 00000000533 12723545033 0020127 0 ustar 00root root 0000000 0000000
captagent-6.1.0.20/conf/database_redis.xml 0000664 0000000 0000000 00000001054 12723545033 0020311 0 ustar 00root root 0000000 0000000
captagent-6.1.0.20/conf/protocol_rtcp.xml 0000664 0000000 0000000 00000000527 12723545033 0020254 0 ustar 00root root 0000000 0000000
captagent-6.1.0.20/conf/protocol_sip.xml 0000664 0000000 0000000 00000000577 12723545033 0020104 0 ustar 00root root 0000000 0000000
captagent-6.1.0.20/conf/socket_pcap.xml 0000664 0000000 0000000 00000002214 12723545033 0017651 0 ustar 00root root 0000000 0000000
portrange 5060-5091portrange 5060-50000
captagent-6.1.0.20/conf/socket_raw.xml 0000664 0000000 0000000 00000000776 12723545033 0017532 0 ustar 00root root 0000000 0000000
udp and port 5060
captagent-6.1.0.20/conf/socket_rtcpxr.xml 0000664 0000000 0000000 00000001072 12723545033 0020251 0 ustar 00root root 0000000 0000000
captagent-6.1.0.20/conf/transport_hep.xml 0000664 0000000 0000000 00000001153 12723545033 0020247 0 ustar 00root root 0000000 0000000
captagent-6.1.0.20/conf/transport_json.xml 0000664 0000000 0000000 00000001076 12723545033 0020450 0 ustar 00root root 0000000 0000000
captagent-6.1.0.20/configure.ac 0000664 0000000 0000000 00000022075 12723545033 0016204 0 ustar 00root root 0000000 0000000 AC_PREREQ(2.61)
AC_INIT(captagent,6.1.0.20,support@sipcapture.org,,[http://www.sipcapture.org])
AC_COPYRIGHT("SIP Capture Solution")
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE(foreign tar-ustar)
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_SRCDIR([src/captagent.c])
AC_MSG_CHECKING([whether to use compression])
AC_PREFIX_DEFAULT(/usr/local/captagent)
if test "$prefix" = "NONE"; then
prefix=$ac_default_prefix
fi
AS_AC_EXPAND(agent_config_dir, "$sysconfdir/captagent/")
AS_AC_EXPAND(agent_plan_dir, "$sysconfdir/captagent/")
AS_AC_EXPAND(module_dir, "$libdir/captagent/modules")
AC_DEFINE_UNQUOTED(AGENT_PREFIX, ["$prefix"], [our system prefix])
AC_DEFINE_UNQUOTED(AGENT_CONFIG_DIR, ["$agent_config_dir"], [captagent config dir])
AC_DEFINE_UNQUOTED(AGENT_PLAN_DIR, ["$agent_plan_dir"], [capture plans dir])
AC_DEFINE_UNQUOTED(MODULE_DIR, ["$module_dir"], [directory that modules will be installed to])
enableCompression=no
AC_ARG_ENABLE(compression,
[ --enable-compression Enable compression support)],
[ZLIB="$enableval"]
enableCompression=yes,
[ZLIB="no"]
)
AC_MSG_RESULT([$ZLIB])
AC_SUBST([ZLIB])
AC_MSG_CHECKING([whether to use ssl])
enableSSL=no
AC_ARG_ENABLE(ssl,
[ --enable-ssl Enable SSL support],
[SSL="$enableval"]
enableSSL=yes,
[SSL="no"]
)
AC_MSG_RESULT([$SSL])
AC_SUBST([SSL])
useMysql=no
AC_MSG_CHECKING([whether to use mysql])
AC_ARG_ENABLE(mysql,
[ --enable-mysql Enable mysql support],
[MYSQL="$enableval"]
useMysql=yes,
[MYSQL="no"]
)
AC_MSG_RESULT([$MYSQL])
AC_SUBST([MYSQL])
usePCRE=no
AC_MSG_CHECKING([whether to use pcre])
AC_ARG_ENABLE(pcre,
[ --enable-pcre Enable pcre support],
[PCRE="$enableval"]
usePCRE=yes,
[PCRE="no"]
)
AC_MSG_RESULT([$PCRE])
AC_SUBST([PCRE])
useRedis=no
AC_MSG_CHECKING([whether to use redis])
AC_ARG_ENABLE(redis,
[ --enable-redis Enable redis support],
[REDIS="$enableval"]
useRedis=yes,
[REDIS="no"]
)
AC_MSG_RESULT([$REDIS])
AC_SUBST([REDIS])
useLIBUV=no
AC_MSG_CHECKING([whether to use libuv])
AC_ARG_ENABLE(libuv,
[ --enable-libuv Enable libuv support],
[LIBUV="$enableval"]
useLIBUV=yes,
[LIBUV="no"]
)
AC_MSG_RESULT([$LIBUV])
AC_SUBST([LIBUV])
enableExtraModules=no
AC_ARG_ENABLE(extramodules,
[ --enable-extramodules Enable extra modules],
[EXTRAMODULES="$enableval"]
enableExtraModules=yes,
[EXTRAMODULES="no"]
)
AC_MSG_RESULT([$EXTRAMODULES])
AC_SUBST([EXTRAMODULES])
CONFIG_CFLAGS="${CFLAGS}"
CONFIG_LDFLAGS="${LDFLAGS}"
MODULES='$$(grep -v "\#" $(captagent_builddir)/modules.list | sed -e "s|^.*/||" | sort | uniq )'
AM_MAKEFLAGS='"OUR_MODULES=$(MODULESS)" `test -n "$(VERBOSE)" || echo -s`'
AC_SUBST(OUR_MODS)
#AC_ENABLE_SHARED(yes)
#AC_ENABLE_STATIC(no)
#AC_CANONICAL_SYSTEM
#AM_INIT_AUTOMAKE()
LT_INIT
AC_CANONICAL_HOST
case "${host}" in
*-*-darwin*)
AC_DEFINE([OS_DARWIN], [1], [Define to 1 if Operating System is Darwin])
AC_SUBST(OS_DARWIN, 1)
;;
*-*-freebsd*)
AC_DEFINE([OS_FREEBSD], [1], [Define to 1 if Operating System is FreeBSD])
AC_SUBST(OS_FREEBSD, 1)
;;
*-*-linux*)
AC_DEFINE([OS_LINUX], [1], [Define to 1 if Operating System is Linux])
AC_SUBST(OS_LINUX, 1)
;;
*-*-netbsd*)
AC_DEFINE([OS_NETBSD], [1], [Define to 1 if Operating System is NETBSD])
AC_SUBST(OS_NETBSD, 1)
;;
*-*-solaris2*)
AC_DEFINE([OS_SOLARIS], [1], [Define to 1 if Operating System is SOLARIS])
AC_SUBST(OS_SOLARIS, 1)
;;
*)
AC_MSG_RESULT([Unsupported operating system: ${host}])
;;
esac
# Checks for programs
AC_PROG_CC
# AC_PROG_CC([gcc cc])
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
AC_PROG_LEX
if test "$LEX" != "flex"; then
AC_MSG_ERROR([flex not found. Please install flex])
fi
if test -z "`echo %%|$LEX -t|grep yypop_buffer_state`"; then
AC_MSG_ERROR([flex missing yypop_buffer_state - upgrade to version 2.5.33 or later])
fi
AC_PROG_YACC
if test "$YACC" != "bison -y"; then
AC_MSG_ERROR([bison not found. Please install bison])
fi
# Checks for libraries.
AC_CHECK_LIB(pthread, pthread_create, , [AC_MSG_ERROR([captagent requires but cannot find pthread])])
if test "$OS_LINUX" = 1 ; then
AC_CHECK_LIB(dl, dlopen, , [AC_MSG_ERROR([captagent requires but cannot find libdl])])
fi
AC_CHECK_LIB(expat, XML_ParserCreate, , [AC_MSG_ERROR([captagent requires but cannot find libexpat])])
AC_CHECK_LIB(pcap, pcap_open_live, ,[AC_CHECK_LIB(wpcap, pcap_open_live, ,[AC_MSG_ERROR([captagent requires but cannot find libpcap])])])
AC_CHECK_LIB(json, json_object_get,[ JSON_LIBS="-ljson" ],[
AC_CHECK_LIB(json-c, json_object_get,[ JSON_LIBS="-ljson-c" ],[
echo "ERROR: You need libjson to build CaptAgent API module.";
echo " Verify that you have libjson.a or libjson.so installed";
echo " If it is in a different directory, try using";
echo " the LDFLAGS to set its proper path.";
AC_MSG_ERROR([Fatal: libjson not found.])])])
AC_CHECK_LIB(fl, yywrap, [ FLEX_LIBS="-lfl" ] , [AC_MSG_ERROR([captagent requires but cannot find libfl])])
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(DL_LIBS)
AC_SUBST(EXPAT_LIBS)
AC_SUBST(PCAP_LIBS)
AC_SUBST(JSON_LIBS)
AC_SUBST(PCRE_LIBS)
AC_SUBST(HIREDIS_LIBS)
AC_SUBST(FLEX_LIBS)
dnl
dnl check for pcre library
dnl
# Checks for libpcre
if test "$PCRE" = "yes"; then
AC_CHECKING([for pcre Library and Header files])
AC_CHECK_HEADER([pcre.h], ,AC_MSG_ERROR([Could not find pcre headers !]))
AC_CHECK_LIB([pcre], [pcre_compile], [PCRE_LIBS="-lpcre"], [AC_MSG_ERROR([libpcre required])])
AC_DEFINE(USE_PCRE, 1, [Use PCRE library])
AC_SUBST(PCRE_LIBS)
fi
dnl
dnl check for compression library
dnl
if test "$ZLIB" = "yes"; then
AC_CHECKING([for zip Library and Header files])
AC_CHECK_HEADER(zlib.h,,[AC_MSG_ERROR([zlib.h headers not found.])])
AC_CHECK_LIB(z, inflate, [ LIBS="${LIBS} -lz" ], [AC_MSG_ERROR([captagent requires but cannot find lz])])
AC_DEFINE(USE_ZLIB, 1, [Use ZIP library])
fi
dnl
dnl check for redis library
dnl
dnl
dnl check for MYSQL library
dnl
if test "$MYSQL" = "yes"; then
AC_CHECKING([for MYSQL Library and Header files])
AC_CHECK_HEADER([mysql/mysql.h], ,AC_MSG_ERROR([Could not find mysql headers !]))
AC_CHECK_LIB(mysqlclient, mysql_init, [ MYSQL_LIBS="-lmysqlclient" ], [AC_MSG_ERROR([captagent requires but cannot find mysqlclient])])
AC_DEFINE(USE_MYSQL, 1, [Use MYSQL library])
AC_SUBST(MYSQL_LIBS)
fi
dnl
dnl check for redis library
dnl
if test "$REDIS" = "yes"; then
AC_CHECKING([for redis Library and Header files])
AC_CHECK_HEADER(hiredis/hiredis.h,,[AC_MSG_ERROR([hiredis/hiredis.h headers not found.])])
AC_CHECK_LIB(hiredis, redisCommand, [ HIREDIS_LIBS="-lhiredis" ], [AC_MSG_ERROR([captagent requires but cannot find lhiredis])])
AC_DEFINE(USE_REDIS, 1, [Use REDIS library])
AC_SUBST(HIREDIS_LIBS)
fi
dnl
dnl check for extra modules
dnl
if test "$EXTRAMODULES" = "yes"; then
AC_CHECKING([for extra modules files])
AC_DEFINE(HAVE_EXTRA_MODULES, 1, [We have extra modules])
fi
dnl
dnl check for libuv library
dnl
if test "$LIBUV" = "yes"; then
AC_CHECKING([for LiBUV and Header files])
AC_CHECK_HEADER(uv.h,,[AC_MSG_ERROR([uv.h headers not found.])])
AC_CHECK_LIB(uv, uv_now, [ UV_LIBS="-luv" ], [AC_MSG_ERROR([captagent requires but cannot find libuv])])
AC_DEFINE(USE_LIBUV, 1, [Use lib UV])
AC_SUBST(UV_LIBS)
fi
dnl
dnl check for OpenSSL-SSL library
dnl
if test "$SSL" = "yes"; then
AC_CHECKING([for OpenSSL SSL Library and Header files])
AC_CHECK_HEADER(openssl/ssl.h,, [AC_MSG_ERROR([OpenSSL SSL headers not found.])])
AC_CHECK_LIB(ssl, SSL_accept, [ LIBS="${LIBS} -lssl" ], [AC_MSG_ERROR([captagent requires but cannot find ssl])])
AC_DEFINE(USE_SSL, 1, [Use OpenSSL SSL library])
fi
# Checks for header files.
AC_CHECK_HEADER(pcap.h,,[AC_MSG_ERROR([captagent cannot find pcap.h])])
AC_CHECK_HEADERS([json-c/json.h json/json.h json.h])
# check JSON
AM_CONDITIONAL([HAVE_JSON_JSON_H],[test "$ac_cv_header_json_json_h" = 'yes'])
AM_CONDITIONAL([HAVE_JSON_C_JSON_H],[test "$ac_cv_header_json_c_json_h" = 'yes'])
AM_CONDITIONAL([HAVE_JSON_H],[test "$ac_cv_header_json_h" = 'yes'])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_INT32_T
AC_TYPE_INT8_T
AC_TYPE_PID_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_FORK
#AC_FUNC_MALLOC
AC_CHECK_FUNCS([gettimeofday memset select socket strdup strerror strndup])
AC_CONFIG_FILES([
Makefile
captagent.spec
include/Makefile
src/Makefile
conf/captagent.xml
pkg/debian/captagent.init
])
m4_include([m4/modules_makefiles.m4])
AC_OUTPUT
echo
echo $PACKAGE $VERSION
echo
echo Build directory............. : $captagent_builddir
echo Installation prefix......... : $prefix
echo HEP Compression............. : $enableCompression
echo HEP SSL/TLS................. : $enableSSL
echo Flex........................ : ${LEX:-NONE}
echo Bison....................... : ${YACC:-NONE}
echo
echo Build with REDIS............ : $useRedis
echo Build with MySQL............ : $useMysql
echo Build with PCRE............. : $usePCRE
echo Build with LibUV............ : $useLIBUV
echo
captagent-6.1.0.20/include/ 0000775 0000000 0000000 00000000000 12723545033 0015333 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/include/Makefile.am 0000664 0000000 0000000 00000000441 12723545033 0017366 0 ustar 00root root 0000000 0000000 include $(top_srcdir)/common.am
noinst_HEADERS = \
captagent/api.h \
captagent/capture.h \
captagent/export_function.h \
captagent/globals.h \
captagent/log.h \
captagent/modules_api.h \
captagent/modules.h \
captagent/proto_sip.h \
captagent/structure.h \
captagent/xmlread.h
captagent-6.1.0.20/include/captagent/ 0000775 0000000 0000000 00000000000 12723545033 0017301 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/include/captagent/action.h 0000664 0000000 0000000 00000001147 12723545033 0020732 0 ustar 00root root 0000000 0000000 #ifndef action_h
#define action_h
struct action{
int type; /* forward, drop, log, send ...*/
int index;
int p1_type;
int p2_type;
int p3_type;
union {
int number;
char* string;
void* data;
}p1, p2, p3;
struct action* next;
};
struct run_act_ctx{
int rec_lev;
int run_flags;
int last_retcode; /* return from last route */
};
int do_action(struct run_act_ctx* c, struct action* a, msg_t *msg);
int run_actions(struct run_act_ctx* c, struct action* a, msg_t* msg);
#endif
captagent-6.1.0.20/include/captagent/api.h 0000664 0000000 0000000 00000010047 12723545033 0020225 0 ustar 00root root 0000000 0000000 /*
* $Id$
*
* captagent - Homer capture agent. Modular
* Duplicate SIP messages in Homer Encapulate Protocol [HEP] [ipv6 version]
*
* Author: Alexandr Dubovikov
* (C) Homer Project 2012-2015 (http://www.sipcapture.org)
*
* Homer capture agent 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 3 of the License, or
* (at your option) any later version
*
* Homer capture agent 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
*
*/
#ifndef API_H_
#define API_H_
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "config.h"
#ifndef AGENT_CONFIG_DIR
#define AGENT_CONFIG_DIR "/usr/local/etc/captagent/"
#endif //DEF_CONF
#ifndef AGENT_PLAN_DIR
#define AGENT_PLAN_DIR "/usr/local/etc/captagent/captureplans"
#endif
#ifdef OS_LINUX
#include
#endif /* OS_LINUX */
typedef struct xml_node {
char *key;
char *value;
char **attr;
struct xml_node *child;
struct xml_node *parent;
struct xml_node *next;
} xml_node;
typedef struct _str {
char* s;
int len;
} str;
struct rc_info {
uint8_t ip_family; /* IP family IPv6 IPv4 */
uint8_t ip_proto; /* IP protocol ID : tcp/udp */
uint8_t proto_type; /* SIP: 0x001, SDP: 0x03*/
char *src_mac;
char *dst_mac;
char *src_ip;
char *dst_ip;
uint16_t src_port;
uint16_t dst_port;
uint32_t time_sec;
uint32_t time_usec;
uint32_t liid;
uint32_t cval1;
uint32_t cval2;
uint16_t sessionid;
uint8_t direction;
char *uuid;
str correlation_id;
int *socket;
} ;
typedef struct rc_info rc_info_t;
typedef enum msg_body_type {
MSG_BODY_UNKNOWN = 0,
MSG_BODY_SDP
} msg_body_type_t;
typedef struct stats_object {
unsigned int total_req;
unsigned int curr_req;
unsigned int total_x2;
unsigned int failed_x2;
unsigned long total_x3;
unsigned long failed_x3;
unsigned int curr_calls;
unsigned int total_calls;
} stats_object_t;
extern struct stats_object stats_obj;
struct hep_module *hepmod;
extern int send_message (rc_info_t *rcinfo, unsigned char *data, unsigned int len);
extern int get_basestat(char *module, char *stats, size_t len);
struct module *module_list;
typedef unsigned int bool;
#ifndef TRUE
#define TRUE 1
#endif /* TRUE */
#ifndef FALSE
#define FALSE 0
#endif /* FALSE */
typedef enum {
DB_INT, /* Integer number */
DB_DOUBLE, /* Decimal number */
DB_STRING, /* String */
DB_STR, /* str structure */
DB_DATETIME, /* Date and time */
DB_BLOB /* Binary large object */
} db_type_t;
typedef struct db_value {
str key;
db_type_t type; /* Type of the value */
int nul; /* NULL flag */
union {
int int_val; /* Integer value */
double double_val; /* Double value */
time_t time_val; /* Unix time_t value */
const char* string_val; /* Zero terminated string */
str str_val; /* str structure */
str blob_val; /* Structure describing blob */
} val;
} db_value_t;
#define SAFE_FREE(pt) \
assert(pt!=NULL); \
free(pt); \
pt = NULL;
#define SAFE_PTR(pt) assert(pt!=NULL); pt
#endif /* API_H_ */
captagent-6.1.0.20/include/captagent/capture.h 0000664 0000000 0000000 00000003023 12723545033 0021113 0 ustar 00root root 0000000 0000000 /*
* $Id$
*
* captagent - Homer capture agent. Modular
* Duplicate SIP messages in Homer Encapulate Protocol [HEP] [ipv6 version]
*
* Author: Alexandr Dubovikov
* (C) Homer Project 2012-2015 (http://www.sipcapture.org)
*
* Homer capture agent 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 3 of the License, or
* (at your option) any later version
*
* Homer capture agent 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
*
*/
#ifndef CAPTURE_H_
#define CAPTURE_H_
struct capture_list{
struct action* clist[20];
int idx;
int entries;
char names[20][100];
};
#define FILTER_LEN 4080
/* our payload range between 0 - 191 */
#define RTP_FILTER "(ip and ip[6] & 0x2 = 0 and ip[6:2] & 0x1fff = 0 and udp and udp[8] & 0xc0 = 0x80 )"
/* our payload range between 200 and 204 */
#define RTCP_FILTER "(ip and ip[6] & 0x2 = 0 and ip[6:2] & 0x1fff = 0 and udp and udp[8] & 0xc0 = 0x80 and udp[9] >= 0xc8 && udp[9] <= 0xcc)"
#endif /* CAPTURE_H_ */
captagent-6.1.0.20/include/captagent/export_function.h 0000664 0000000 0000000 00000002510 12723545033 0022676 0 ustar 00root root 0000000 0000000 /*
* $Id$
*
* captagent - Homer capture agent. Modular
* Duplicate SIP messages in Homer Encapulate Protocol [HEP] [ipv6 version]
*
* Author: Alexandr Dubovikov
* (C) Homer Project 2012-2015 (http://www.sipcapture.org)
*
* Homer capture agent 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 3 of the License, or
* (at your option) any later version
*
* Homer capture agent 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
*
*/
#ifndef EXPORT_FUNC_H_
#define EXPORT_FUNC_H_
/* new */
cmd_function find_export(char* name, int param_no, int flags);
cmd_export_t* find_mod_export_record(char* mod, char* name, int param_no, int flags, unsigned* mod_if_ver);
cmd_export_t* find_export_record(char* name, int param_no, int flags, unsigned* mod_if_ver);
#endif /* EXPORT_FUNC_H_ */
captagent-6.1.0.20/include/captagent/globals.h 0000664 0000000 0000000 00000003237 12723545033 0021102 0 ustar 00root root 0000000 0000000 /*
* $Id$
*
* captagent - Homer capture agent. Modular
* Duplicate SIP messages in Homer Encapulate Protocol [HEP] [ipv6 version]
*
* Author: Alexandr Dubovikov
* (C) Homer Project 2012-2015 (http://www.sipcapture.org)
*
* Homer capture agent 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 3 of the License, or
* (at your option) any later version
*
* Homer capture agent 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
*
*/
#ifndef GLOBALS_H_
#define GLOBALS_H_
#define CT_NO 10 /* capture tables number */
#define DEFAULT_CT 0 /* default capture table */
#ifndef NULL
#define NULL ((void *)0)
#endif
extern int cfg_errors;
extern int debug;
extern int nofork;
extern int foreground;
extern int debug_level;
extern char *usefile;
extern char *global_license;
extern char *global_chroot;
extern char *global_config_path;
extern char *global_capture_plan_path;
extern char *global_uuid;
extern char *backup_dir;
extern char *global_node_name;
extern int timestart;
extern int serial;
extern const char *captagent_config;
extern struct capture_list main_ct;
extern struct action* clist[20];
#endif /* GLOBALS_H_ */
captagent-6.1.0.20/include/captagent/log.h 0000664 0000000 0000000 00000004035 12723545033 0020235 0 ustar 00root root 0000000 0000000 /*
* $Id$
*
* captagent - Homer capture agent. Modular
* Duplicate SIP messages in Homer Encapulate Protocol [HEP] [ipv6 version]
*
* Author: Alexandr Dubovikov
* (C) Homer Project 2012-2015 (http://www.sipcapture.org)
*
* Homer capture agent 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 3 of the License, or
* (at your option) any later version
*
* Homer capture agent 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
*
*/
#ifndef LOG_H_
#define LOG_H_
#include
void init_log(char *_prgname, int _use_syslog);
void set_log_level(int level);
void destroy_log(void);
void data_log(int priority, const char * fmt, ...);
#define PA_GCC_PRINTF_ATTR(a,b) __attribute__ ((format (printf, a, b)));
#define LEMERG(fmt, args...) data_log(LOG_EMERG, "[DEBUG] %s:%d " fmt, __FILE__, __LINE__, ## args)
#define LALERT(fmt, args...) data_log(LOG_ALERT, "[ALERT] %s:%d " fmt, __FILE__, __LINE__, ## args)
#define LCRIT(fmt, args...) data_log(LOG_CRIT, "[CRIT] %s:%d " fmt, __FILE__, __LINE__, ## args)
#define LERR(fmt, args...) data_log(LOG_ERR, "[ERR] %s:%d " fmt, __FILE__, __LINE__, ## args)
#define LWARNING(fmt, args...) data_log(LOG_WARNING, "[WARNING] %s:%d " fmt, __FILE__, __LINE__, ## args)
#define LNOTICE(fmt, args...) data_log(LOG_NOTICE, "[NOTICE] " fmt, ## args)
#define LINFO(fmt, args...) data_log(LOG_INFO, "[INFO] %s:%d " fmt, __FILE__, __LINE__, ## args)
#define LDEBUG(fmt, args...) data_log(LOG_DEBUG, "[DEBUG] %s:%d " fmt, __FILE__, __LINE__, ## args)
#endif /* LOG_H_ */
captagent-6.1.0.20/include/captagent/md5.h 0000664 0000000 0000000 00000006750 12723545033 0020147 0 ustar 00root root 0000000 0000000 /*
* $Id$
*
* captagent - Homer capture agent. Modular
* Duplicate SIP messages in Homer Encapulate Protocol [HEP] [ipv6 version]
*
* Author: Alexandr Dubovikov
* (C) Homer Project 2012-2015 (http://www.sipcapture.org)
*
* Homer capture agent 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 3 of the License, or
* (at your option) any later version
*
* Homer capture agent 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
*
*/
#ifndef MD5_H_
#define MD5_H_
/*
* This an amalgamation of md5.c and md5.h into a single file
* with all static declaration to reduce linker conflicts
* in Civetweb.
*
* The MD5_STATIC declaration was added to facilitate static
* inclusion.
* No Face Press, LLC
*/
/* $Id: md5.h,v 1.4 2002/04/13 19:20:28 lpd Exp $ */
/*
Independent implementation of MD5 (RFC 1321).
This code implements the MD5 Algorithm defined in RFC 1321, whose
text is available at
http://www.ietf.org/rfc/rfc1321.txt
The code is derived from the text of the RFC, including the test suite
(section A.5) but excluding the rest of Appendix A. It does not include
any code or documentation that is identified in the RFC as being
copyrighted.
The original and principal author of md5.h is L. Peter Deutsch
. Other authors are noted in the change history
that follows (in reverse chronological order):
2002-04-13 lpd Removed support for non-ANSI compilers; removed
references to Ghostscript; clarified derivation from RFC 1321;
now handles byte order either statically or dynamically.
1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5);
added conditionalization for C++ compilation from Martin
Purschke .
1999-05-03 lpd Original version.
*/
/*
* This package supports both compile-time and run-time determination of CPU
* byte order. If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be
* compiled to run only on little-endian CPUs; if ARCH_IS_BIG_ENDIAN is
* defined as non-zero, the code will be compiled to run only on big-endian
* CPUs; if ARCH_IS_BIG_ENDIAN is not defined, the code will be compiled to
* run on either big- or little-endian CPUs, but will run slightly less
* efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined.
*/
typedef unsigned char md5_byte_t; /* 8-bit byte */
typedef unsigned int md5_word_t; /* 32-bit word */
/* Define the state of the MD5 Algorithm. */
typedef struct md5_state_s {
md5_word_t count[2]; /* message length in bits, lsw first */
md5_word_t abcd[4]; /* digest buffer */
md5_byte_t buf[64]; /* accumulate block */
} md5_state_t;
/* Initialize the algorithm. */
void md5_init(md5_state_t *pms);
/* Append a string to the message. */
void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes);
/* Finish the message and return the digest. */
void md5_finish(md5_state_t *pms, md5_byte_t digest[16]);
#endif /* MD5_H_ */
captagent-6.1.0.20/include/captagent/modules.h 0000664 0000000 0000000 00000006205 12723545033 0021125 0 ustar 00root root 0000000 0000000 /*
* $Id$
*
* captagent - Homer capture agent. Modular
* Duplicate SIP messages in Homer Encapulate Protocol [HEP] [ipv6 version]
*
* Author: Alexandr Dubovikov
* (C) Homer Project 2012-2015 (http://www.sipcapture.org)
*
* Homer capture agent 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 3 of the License, or
* (at your option) any later version
*
* Homer capture agent 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
*
*/
#ifndef MODULES_H_
#define MODULES_H_
char *module_path;
#define VAR_PARAM_NO -128
struct rc_info;
typedef struct hep_module {
int (*send_hep_basic)(struct rc_info *rcinfo, unsigned char *data, unsigned int len);
int (*send_hep_advance)(void);
} hep_module_t;
typedef int (*init_function)(xml_node *config);
typedef int (*destroy_function)(void);
typedef int (*description_function)(char *descr);
typedef int (*statistic_function)(char *stats, size_t len);
typedef void (*onbreak_function)(msg_t* msg);
typedef uint64_t (*serial_function)(void);
typedef struct module {
init_function load_f;
destroy_function unload_f;
description_function description_f;
statistic_function stats_f;
serial_function serial_f;
onbreak_function onbreak_f;
cmd_export_t* cmds;
void *lib;
char *path;
char name[256];
struct module *next;
} module_t;
typedef struct module_exports {
char* name;
cmd_export_t* cmds;
init_function load_f;
destroy_function unload_f;
description_function description_f;
statistic_function stats_f;
serial_function serial_f;
onbreak_function onbreak_f;
char** param_names; /* parameter names registered by this modules */
char** cmd_names; /* cmd names registered by this modules */
int cmd_no; /* number of registered commands */
int par_no; /* number of registered parameters */
int* param_no; /* number of parameters used*/
cmd_function* cmd_pointers; /* pointers to the corresponding functions */
modparam_t* param_types; /* Type of parameters */
void** param_pointers; /* Pointers to the corresponding memory locations */
} module_exports_t;
int register_module(char *resource_name, xml_node *config, bool global);
int register_modules(xml_node *tree);
int unregister_modules(void);
int usecount(void);
/* How many channels provided by this module are in use? */
//char *description(void); /* Description of this module */
//int *statistic(char *stats, size_t len); /* Statistic of this module */
#endif /* MODULES_H_ */
captagent-6.1.0.20/include/captagent/modules_api.h 0000664 0000000 0000000 00000016536 12723545033 0021766 0 ustar 00root root 0000000 0000000 /*
* $Id$
*
* captagent - Homer capture agent. Modular
* Duplicate SIP messages in Homer Encapulate Protocol [HEP] [ipv6 version]
*
* Author: Alexandr Dubovikov
* (C) Homer Project 2012-2015 (http://www.sipcapture.org)
*
* Homer capture agent 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 3 of the License, or
* (at your option) any later version
*
* Homer capture agent 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
*
*/
#ifndef MODULES_API_H_
#define MODULES_API_H_
typedef struct module_exports* (*module_register)(void);
typedef int (*cmd_function)(msg_t*, char* param1, char* param2);
typedef int (*fixup_function)(void** param, int param_no);
typedef struct cmd_export_ {
char* name; /**< null terminated command name */
cmd_function function; /**< pointer to the corresponding function */
int param_no; /**< number of parameters used by the function */
int flags; /**< Function flags */
int fixup_flags;
void* module_exports; /**< pointer to module structure */
} cmd_export_t;
typedef enum {
STR_PARAM, /* String parameter type */
INT_PARAM, /* Integer parameter type */
} modparam_t; /* Allowed types of parameters */
/* modules API */
typedef int (*ul_set_keepalive_timeout_t)(int _to);
typedef int (*parse_message_t)(msg_t *msg);
typedef int (*parse_only_message_t)(msg_t *msg, void* packet);
typedef int (*send_message_t)(msg_t *msg);
typedef int (*send_stats_t)(stats_msg_t *stats_msg);
typedef int (*reload_t)(char *erbuf, int len);
typedef int (*apply_filter_t)(filter_msg_t *filter);
typedef int (*update_db_t)(const db_msg_t *msg, const db_value_t* _v, const int _n);
typedef int (*delete_db_t)(const db_msg_t *msg, const db_value_t* _v, const int _n);
typedef int (*insert_db_t)(const db_msg_t *msg, const db_value_t* _v, const int _n);
typedef int (*select_db_t)(const db_msg_t* msg, db_value_t* _v, const int _n);
typedef int (*query_db_t)(char *query, const db_msg_t *msg, db_value_t* _v, const int _n);
typedef int (*count_db_t)(char *query, const db_msg_t *msg);
/* socket module API export structure */
typedef struct socket_module_api {
int use_domain; /*! use_domain module parameter */
char *module_name;
int db_mode; /*! db_mode module parameter */
unsigned int nat_flag; /*! nat_flag module parameter */
reload_t reload_f;
apply_filter_t apply_filter_f;
ul_set_keepalive_timeout_t set_keepalive_timeout;
} socket_module_api_t;
typedef struct protocol_module_api {
int use_domain; /*! use_domain module parameter */
char *module_name;
int db_mode; /*! db_mode module parameter */
unsigned int nat_flag; /*! nat_flag module parameter */
parse_message_t parse_f;
parse_only_message_t parse_only_f;
reload_t reload_f;
ul_set_keepalive_timeout_t set_keepalive_timeout;
} protocol_module_api_t;
typedef struct transport_module_api {
int use_domain; /*! use_domain module parameter */
char *module_name;
int db_mode; /*! db_mode module parameter */
unsigned int nat_flag; /*! nat_flag module parameter */
send_message_t send_f;
reload_t reload_f;
ul_set_keepalive_timeout_t set_keepalive_timeout;
} transport_module_api_t;
typedef struct statistic_module_api {
int use_domain; /*! use_domain module parameter */
char *module_name;
int db_mode; /*! db_mode module parameter */
unsigned int nat_flag; /*! nat_flag module parameter */
send_stats_t send_stats_f;
reload_t reload_f;
} statistic_module_api_t;
typedef struct database_module_api {
int db_mode; /*! db_mode module parameter */
char *module_name;
update_db_t update;
delete_db_t delete;
insert_db_t insert;
select_db_t select;
count_db_t count;
query_db_t raw_query;
reload_t reload_f;
} database_module_api_t;
typedef int (*bind_socket_module_api_t)(socket_module_api_t* api);
typedef int (*bind_command_api_t)(msg_t *_m, char *param1, char *param2);
typedef int (*bind_protocol_module_api_t)(protocol_module_api_t* api);
typedef int (*bind_transport_module_api_t)(transport_module_api_t* api);
typedef int (*bind_statistic_module_api_t)(statistic_module_api_t* api);
typedef int (*bind_database_module_api_t)(database_module_api_t* api);
#define MAX_FILTER_LEN 8000
#define MAX_API 10
/* profile socket */
typedef struct profile_socket {
char *name;
char *description;
char *device;
char *host;
char *port;
uint32_t serial;
uint8_t reasm;
uint8_t promisc;
int socket;
char *capture_plan;
char *filter;
int action;
int protocol;
char *capture_filter;
uint32_t ring_buffer;
uint32_t snap_len;
uint32_t link_type;
uint32_t timeout;
uint8_t full_packet;
struct profile_socket *next;
void *reasm_t;
} profile_socket_t;
/* profile protocol */
typedef struct profile_protocol {
char *name;
char *description;
uint32_t serial;
uint16_t dialog_timeout;
uint8_t dialog_type;
uint8_t rtcp_tracking;
uint8_t type;
int action;
char *ignore;
struct profile_protocol *next;
} profile_protocol_t;
/* profile transport */
typedef struct profile_transport {
char *name;
char *description;
int socket;
unsigned int usessl;
#ifdef USE_SSL
SSL *ssl;
SSL_CTX *ctx;
#endif /* USE_SSL */
unsigned int initfails;
int serial;
int version;
char *capt_host;
char *capt_port;
char *capt_proto;
unsigned int capt_id;
char *capt_password;
int compression;
char *statistic_pipe;
char *statistic_profile;
int action;
struct profile_transport *next;
unsigned int flag;
} profile_transport_t;
/* database profile */
typedef struct profile_database {
char *name;
char *description;
int serial;
int type;
char *host;
char *port;
char *db_name;
char *user;
char *password;
char *statistic_pipe;
char *statistic_profile;
struct profile_database *next;
} profile_database_t;
/* interface profile */
typedef struct profile_interface {
char *name;
char *description;
int serial;
int type;
int server_type;
char *server_host;
char *server_port;
char *remote_host;
char *remote_port;
int remote_timeout;
int remote_ssl;
int server_auth;
char *server_realm;
char *server_auth_file;
char *server_worker;
char *server_directory;
char *server_index;
char *database_pipe;
char *statistic_pipe;
char *database_profile;
char *statistic_profile;
struct profile_interface *next;
} profile_interface_t;
#endif /* MODULES_API_H_ */
captagent-6.1.0.20/include/captagent/proto_sip.h 0000664 0000000 0000000 00000012060 12723545033 0021467 0 ustar 00root root 0000000 0000000 /*
* $Id$
*
* captagent - Homer capture agent. Modular
* Duplicate SIP messages in Homer Encapulate Protocol [HEP] [ipv6 version]
*
* Author: Alexandr Dubovikov
* (C) Homer Project 2012-2015 (http://www.sipcapture.org)
*
* Homer capture agent 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 3 of the License, or
* (at your option) any later version
*
* Homer capture agent 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
*
*/
#ifndef PROTO_SIP_H_
#define PROTO_SIP_H_
#define SIP_REQUEST 1
#define SIP_REPLY 2
#define INVITE_METHOD "INVITE"
#define ACK_METHOD "ACK"
#define CANCEL_METHOD "CANCEL"
#define BYE_METHOD "BYE"
#define INFO_METHOD "INFO"
#define REGISTER_METHOD "REGISTER"
#define SUBSCRIBE_METHOD "SUBSCRIBE"
#define NOTIFY_METHOD "NOTIFY"
#define MESSAGE_METHOD "MESSAGE"
#define OPTIONS_METHOD "OPTIONS"
#define PRACK_METHOD "PRACK"
#define UPDATE_METHOD "UPDATE"
#define REFER_METHOD "REFER"
#define PUBLISH_METHOD "PUBLISH"
#define NOTIFY_METHOD "NOTIFY"
#define OPTIONS_METHOD "OPTIONS"
#define ACK_METHOD "ACK"
#define UNKNOWN_METHOD "UNKNOWN"
#define RESPONSE_METHOD "RESPONSE"
#define SERVICE_METHOD "SERVICE"
#define SIP_VERSION "SIP/2.0"
#define SIP_VERSION_LEN 7
#define INVITE_LEN 6
#define CANCEL_LEN 6
#define ACK_LEN 3
#define BYE_LEN 3
#define INFO_LEN 4
#define REGISTER_LEN 8
#define SUBSCRIBE_LEN 9
#define NOTIFY_LEN 6
#define MESSAGE_LEN 7
#define OPTIONS_LEN 7
#define PRACK_LEN 5
#define UPDATE_LEN 6
#define REFER_LEN 5
#define PUBLISH_LEN 7
#define UAC_LEN 10
#define RESPONSE_LEN 8
#define SERVICE_LEN 7
#define TO_LEN 2
#define PAI_LEN 19
#define FROM_LEN 4
#define EXPIRE_LEN 6
#define CALLID_LEN 7
#define CSEQ_LEN 4
#define VIA_LEN 3
#define PROXY_AUTH_LEN 19
#define WWW_AUTH_LEN 16
#define CONTACT_LEN 7
#define CONTENTLENGTH_LEN 14
#define CONTENTTYPE_LEN 12
#define USERAGENT_LEN 10
#define AUTHORIZATION_LEN 13
#define PPREFERREDIDENTITY_LEN 20
#define PASSERTEDIDENTITY_LEN 19
#define P_NGCP_CALLER_INFO_LEN 18
#define P_NGCP_CALLEE_INFO_LEN 18
#define XOIP_LEN 5
#define PRTPSTAT_LEN 10
#define XRTPSTAT_LEN 10
#define XRTPSTATISTICS_LEN 16
#define XSIEMENSRTPSTAT_LEN 19
#define XNGRTPSTAT_LEN 15
#define RTPRXTXSTAT_LEN 10
/* define for rtp stats type */
#define XRTPSTAT_TYPE 1
#define XRTPSTATISTICS_TYPE 2
#define PRTPSTAT_TYPE 3
#define RTPRXSTAT_TYPE 4
#define RTPTXSTAT_TYPE 5
#define XSIEMENSRTPSTATS_TYPE 6
#define XNGRTPSTATS_TYPE 7
#define MAX_MEDIA_HOSTS 20
#define RTCPXR_VQSESSIONREPORT_LEN 15
#define RTCPXR_CALLID_LEN 6
#define RTCPXR_SESSIONDESC_LEN 11
#define RTCPXR_JITTERBUFFER_LEN 12
#define RTCPXR_PACKETLOSS_LEN 10
#define RTCPXR_BURSTGAPLOSS_LEN 12
#define RTCPXR_DELAY_LEN 5
#define RTCPXR_QUALITYEST_LEN 10
#define CALL_CANCEL_TERMINATION 1
#define CALL_BYE_TERMINATION 2
#define CALL_MOVED_TERMINATION 3
#define CALL_BUSY_TERMINATION 4
#define CALL_AUTH_TERMINATION 5
#define CALL_4XX_TERMINATION 5
#define CALL_5XX_TERMINATION 6
#define CALL_6XX_TERMINATION 7
#define REGISTRATION_200_TERMINATION 1
#define REGISTRATION_AUTH_TERMINATION 2
#define REGISTRATION_4XX_TERMINATION 3
#define REGISTRATION_5XX_TERMINATION 4
#define REGISTRATION_6XX_TERMINATION 5
typedef enum
{
UNKNOWN = 0,
CANCEL = 1,
ACK = 2,
INVITE = 3,
BYE = 4,
INFO = 5,
REGISTER = 6,
SUBSCRIBE = 7,
NOTIFY = 8,
MESSAGE = 9,
OPTIONS = 10,
PRACK = 11,
UPDATE = 12,
REFER = 13,
PUBLISH = 14,
RESPONSE = 15,
SERVICE = 16
} method_t;
typedef struct _miprtcp {
str media_ip;
int media_port;
str rtcp_ip;
int rtcp_port;
int prio_codec;
} miprtcp_t;
struct _codecmap;
typedef struct _codecmap {
char name[120];
int id;
int rate;
struct _codecmap* next;
} codecmap_t;
typedef struct sip_msg {
unsigned int responseCode;
bool isRequest;
method_t methodType;
str methodString;
int method_len;
str callId;
str reason;
bool hasSdp;
codecmap_t cdm[MAX_MEDIA_HOSTS];
miprtcp_t mrp[MAX_MEDIA_HOSTS];
int cdm_count;
unsigned int mrp_size;
unsigned int contentLength;
unsigned int len;
unsigned int cSeqNumber;
bool hasVqRtcpXR;
str rtcpxr_callid;
str cSeqMethodString;
method_t cSeqMethod;
str cSeq;
str via;
str contactURI;
/* extra */
str ruriUser;
str ruriDomain;
str fromUser;
str fromDomain;
str toUser;
str toDomain;
str paiUser;
str paiDomain;
str requestURI;
str pidURI;
bool hasPid;
str fromURI;
bool hasFrom;
str toURI;
bool hasTo;
str ruriURI;
bool hasRuri;
str toTag;
bool hasToTag;
str fromTag;
bool hasFromTag;
} sip_msg_t;
#endif /* PROTO_SIP_H_ */
captagent-6.1.0.20/include/captagent/structure.h 0000664 0000000 0000000 00000003434 12723545033 0021516 0 ustar 00root root 0000000 0000000 /*
* $Id$
*
* captagent - Homer capture agent. Modular
* Duplicate SIP messages in Homer Encapulate Protocol [HEP] [ipv6 version]
*
* Author: Alexandr Dubovikov
* (C) Homer Project 2012-2015 (http://www.sipcapture.org)
*
* Homer capture agent 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 3 of the License, or
* (at your option) any later version
*
* Homer capture agent 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
*
*/
#ifndef STRUCTURE_H_
#define STRUCTURE_H_
#include "proto_sip.h"
typedef struct msg {
void *data;
char *profile_name;
uint32_t len;
uint16_t hdr_len;
uint8_t tcpflag;
rc_info_t rcinfo;
uint8_t parse_it;
void *parsed_data;
sip_msg_t sip;
void *cap_packet;
void *cap_header;
void *var;
char *corrdata;
uint8_t mfree;
int flag[10];
} msg_t;
typedef struct stats_msg {
char *mod_name;
uint32_t value;
} stats_msg_t;
typedef struct filter_msg {
char *data;
uint32_t value;
} filter_msg_t;
typedef struct db_msg {
str key_name;
str profile_name;
uint16_t expire;
uint32_t len;
uint8_t batch;
} db_msg_t;
#endif /* STRUCTURE_H_ */
captagent-6.1.0.20/include/captagent/xmlread.h 0000664 0000000 0000000 00000002501 12723545033 0021104 0 ustar 00root root 0000000 0000000 /*
* $Id$
*
* captagent - Homer capture agent. Modular
* Duplicate SIP messages in Homer Encapulate Protocol [HEP] [ipv6 version]
*
* Author: Alexandr Dubovikov
* (C) Homer Project 2012-2015 (http://www.sipcapture.org)
*
* Homer capture agent 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 3 of the License, or
* (at your option) any later version
*
* Homer capture agent 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
*
*/
#ifndef XMLREAD_H_
#define XMLREAD_H_
xml_node *xml_parse( const char *filename );
int xml_parse_with_report(const char *filename, char *erbuf, int erlen);
xml_node *xml_get( const char *key, xml_node *ref, int recurs );
xml_node *xml_node_str(char *str, int len);
void xml_free(xml_node *node);
#define BUFSIZE 8192
#endif /* XMLREAD_H_ */
captagent-6.1.0.20/init/ 0000775 0000000 0000000 00000000000 12723545033 0014653 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/init/deb/ 0000775 0000000 0000000 00000000000 12723545033 0015405 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/init/deb/debian/ 0000775 0000000 0000000 00000000000 12723545033 0016627 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/init/deb/debian/captagent.default 0000664 0000000 0000000 00000001155 12723545033 0022145 0 ustar 00root root 0000000 0000000 #
# Captagent startup options
#
# Set to yes to enable captagent, once configured properly.
RUN_CAPTAGENT=yes
# Config file
CFGFILE=/usr/local/captagent/etc/captagent/captagent.xml
# Enable the server to leave a core file when it crashes.
# Set this to 'yes' to enable Captagent to leave a core file when it crashes
# or 'no' to disable this feature. This option is case sensitive and only
# accepts 'yes' and 'no' and only in lowercase letters.
# On some systems it is necessary to specify a directory for the core files
# to get a dump. Look into the captagent init file for an example configuration.
#DUMP_CORE=yes
captagent-6.1.0.20/init/deb/debian/captagent.init 0000664 0000000 0000000 00000004133 12723545033 0021463 0 ustar 00root root 0000000 0000000 #! /bin/sh
#
### BEGIN INIT INFO
# Provides: captagent
# Required-Start: $syslog $network $local_fs $remote_fs $time
# Should-Start: $named slapd mysql postgresql snmpd radiusd
# Should-Stop: $named slapd mysql postgresql snmpd radiusd
# Required-Stop: $syslog $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the Captagent
# Description: Start the Captagent
### END INIT INFO
. /lib/lsb/init-functions
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/captagent/bin/captagent
NAME=`basename "$0"`
DESC="Captagent"
HOMEDIR=/var/run/$NAME
PIDFILE=/var/run/$NAME.pid
DEFAULTS=/etc/default/$NAME
CFGFILE=/usr/local/captagent/etc/captagent/captagent.xml
RUN_CAPTAGENT=no
USER=captagent
GROUP=captagent
DUMP_CORE=no
test -f $DAEMON || exit 0
# Load startup options if available
if [ -f $DEFAULTS ]; then
. $DEFAULTS || true
fi
if [ "$RUN_CAPTAGENT" != "yes" ]; then
log_failure_msg "Captagent not yet configured. Edit /etc/default/$NAME first."
exit 0
fi
set -e
if test "$DUMP_CORE" = "yes" ; then
# set proper ulimit
ulimit -c unlimited
# directory for the core dump files
# COREDIR=/home/corefiles
# [ -d $COREDIR ] || mkdir $COREDIR
# chmod 777 $COREDIR
# echo "$COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
fi
# /var/run can be a tmpfs
if [ ! -d $HOMEDIR ]; then
mkdir -p $HOMEDIR
chown ${USER}:${GROUP} $HOMEDIR
fi
OPTIONS="-d -f $CFGFILE"
case "$1" in
start|debug)
log_daemon_msg "Starting $DESC: $NAME"
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--exec $DAEMON -- $OPTIONS || log_failure_msg " already running"
log_end_msg 0
;;
stop)
log_daemon_msg "Stopping $DESC: $NAME"
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
--exec $DAEMON
log_end_msg 0
;;
restart|force-reload)
$0 stop
sleep 1
$0 start
;;
status)
log_daemon_msg "Status of $DESC: "
status_of_proc -p"$PIDFILE" $NAME $NAME
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload|status|debug}" >&2
exit 1
;;
esac
exit 0
captagent-6.1.0.20/init/deb/debian/captagent.service 0000664 0000000 0000000 00000000733 12723545033 0022162 0 ustar 00root root 0000000 0000000 [Unit]
Description=Captagent - monitoring system
After=network.target
[Service]
Type=forking
Environment='CFGFILE=/usr/local/captagent/etc/captagent/captagent.xml'
EnvironmentFile=-/etc/default/captagent
EnvironmentFile=-/etc/default/captagent.d/*
# PIDFile requires a full absolute path
PIDFile=/var/run/captagent.pid
# ExecStart requires a full absolute path
ExecStart=/usr/local/captagent/bin/captagent -f $CFGFILE -d
Restart=always
[Install]
WantedBy=multi-user.target
captagent-6.1.0.20/init/deb/jessie/ 0000775 0000000 0000000 00000000000 12723545033 0016667 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/init/deb/jessie/captagent.default 0000664 0000000 0000000 00000001155 12723545033 0022205 0 ustar 00root root 0000000 0000000 #
# Captagent startup options
#
# Set to yes to enable captagent, once configured properly.
RUN_CAPTAGENT=yes
# Config file
CFGFILE=/usr/local/captagent/etc/captagent/captagent.xml
# Enable the server to leave a core file when it crashes.
# Set this to 'yes' to enable Captagent to leave a core file when it crashes
# or 'no' to disable this feature. This option is case sensitive and only
# accepts 'yes' and 'no' and only in lowercase letters.
# On some systems it is necessary to specify a directory for the core files
# to get a dump. Look into the captagent init file for an example configuration.
#DUMP_CORE=yes
captagent-6.1.0.20/init/deb/jessie/captagent.init 0000664 0000000 0000000 00000004133 12723545033 0021523 0 ustar 00root root 0000000 0000000 #! /bin/sh
#
### BEGIN INIT INFO
# Provides: captagent
# Required-Start: $syslog $network $local_fs $remote_fs $time
# Should-Start: $named slapd mysql postgresql snmpd radiusd
# Should-Stop: $named slapd mysql postgresql snmpd radiusd
# Required-Stop: $syslog $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the Captagent
# Description: Start the Captagent
### END INIT INFO
. /lib/lsb/init-functions
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/captagent/bin/captagent
NAME=`basename "$0"`
DESC="Captagent"
HOMEDIR=/var/run/$NAME
PIDFILE=/var/run/$NAME.pid
DEFAULTS=/etc/default/$NAME
CFGFILE=/usr/local/captagent/etc/captagent/captagent.xml
RUN_CAPTAGENT=no
USER=captagent
GROUP=captagent
DUMP_CORE=no
test -f $DAEMON || exit 0
# Load startup options if available
if [ -f $DEFAULTS ]; then
. $DEFAULTS || true
fi
if [ "$RUN_CAPTAGENT" != "yes" ]; then
log_failure_msg "Captagent not yet configured. Edit /etc/default/$NAME first."
exit 0
fi
set -e
if test "$DUMP_CORE" = "yes" ; then
# set proper ulimit
ulimit -c unlimited
# directory for the core dump files
# COREDIR=/home/corefiles
# [ -d $COREDIR ] || mkdir $COREDIR
# chmod 777 $COREDIR
# echo "$COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
fi
# /var/run can be a tmpfs
if [ ! -d $HOMEDIR ]; then
mkdir -p $HOMEDIR
chown ${USER}:${GROUP} $HOMEDIR
fi
OPTIONS="-d -f $CFGFILE"
case "$1" in
start|debug)
log_daemon_msg "Starting $DESC: $NAME"
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--exec $DAEMON -- $OPTIONS || log_failure_msg " already running"
log_end_msg 0
;;
stop)
log_daemon_msg "Stopping $DESC: $NAME"
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
--exec $DAEMON
log_end_msg 0
;;
restart|force-reload)
$0 stop
sleep 1
$0 start
;;
status)
log_daemon_msg "Status of $DESC: "
status_of_proc -p"$PIDFILE" $NAME $NAME
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload|status|debug}" >&2
exit 1
;;
esac
exit 0
captagent-6.1.0.20/init/deb/jessie/captagent.service 0000664 0000000 0000000 00000000733 12723545033 0022222 0 ustar 00root root 0000000 0000000 [Unit]
Description=Captagent - monitoring system
After=network.target
[Service]
Type=forking
Environment='CFGFILE=/usr/local/captagent/etc/captagent/captagent.xml'
EnvironmentFile=-/etc/default/captagent
EnvironmentFile=-/etc/default/captagent.d/*
# PIDFile requires a full absolute path
PIDFile=/var/run/captagent.pid
# ExecStart requires a full absolute path
ExecStart=/usr/local/captagent/bin/captagent -f $CFGFILE -d
Restart=always
[Install]
WantedBy=multi-user.target
captagent-6.1.0.20/init/deb/squeeze/ 0000775 0000000 0000000 00000000000 12723545033 0017066 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/init/deb/squeeze/captagent.default 0000664 0000000 0000000 00000001155 12723545033 0022404 0 ustar 00root root 0000000 0000000 #
# Captagent startup options
#
# Set to yes to enable captagent, once configured properly.
RUN_CAPTAGENT=yes
# Config file
CFGFILE=/usr/local/captagent/etc/captagent/captagent.xml
# Enable the server to leave a core file when it crashes.
# Set this to 'yes' to enable Captagent to leave a core file when it crashes
# or 'no' to disable this feature. This option is case sensitive and only
# accepts 'yes' and 'no' and only in lowercase letters.
# On some systems it is necessary to specify a directory for the core files
# to get a dump. Look into the captagent init file for an example configuration.
#DUMP_CORE=yes
captagent-6.1.0.20/init/deb/squeeze/captagent.init 0000664 0000000 0000000 00000004133 12723545033 0021722 0 ustar 00root root 0000000 0000000 #! /bin/sh
#
### BEGIN INIT INFO
# Provides: captagent
# Required-Start: $syslog $network $local_fs $remote_fs $time
# Should-Start: $named slapd mysql postgresql snmpd radiusd
# Should-Stop: $named slapd mysql postgresql snmpd radiusd
# Required-Stop: $syslog $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the Captagent
# Description: Start the Captagent
### END INIT INFO
. /lib/lsb/init-functions
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/captagent/bin/captagent
NAME=`basename "$0"`
DESC="Captagent"
HOMEDIR=/var/run/$NAME
PIDFILE=/var/run/$NAME.pid
DEFAULTS=/etc/default/$NAME
CFGFILE=/usr/local/captagent/etc/captagent/captagent.xml
RUN_CAPTAGENT=no
USER=captagent
GROUP=captagent
DUMP_CORE=no
test -f $DAEMON || exit 0
# Load startup options if available
if [ -f $DEFAULTS ]; then
. $DEFAULTS || true
fi
if [ "$RUN_CAPTAGENT" != "yes" ]; then
log_failure_msg "Captagent not yet configured. Edit /etc/default/$NAME first."
exit 0
fi
set -e
if test "$DUMP_CORE" = "yes" ; then
# set proper ulimit
ulimit -c unlimited
# directory for the core dump files
# COREDIR=/home/corefiles
# [ -d $COREDIR ] || mkdir $COREDIR
# chmod 777 $COREDIR
# echo "$COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
fi
# /var/run can be a tmpfs
if [ ! -d $HOMEDIR ]; then
mkdir -p $HOMEDIR
chown ${USER}:${GROUP} $HOMEDIR
fi
OPTIONS="-d -f $CFGFILE"
case "$1" in
start|debug)
log_daemon_msg "Starting $DESC: $NAME"
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--exec $DAEMON -- $OPTIONS || log_failure_msg " already running"
log_end_msg 0
;;
stop)
log_daemon_msg "Stopping $DESC: $NAME"
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
--exec $DAEMON
log_end_msg 0
;;
restart|force-reload)
$0 stop
sleep 1
$0 start
;;
status)
log_daemon_msg "Status of $DESC: "
status_of_proc -p"$PIDFILE" $NAME $NAME
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload|status|debug}" >&2
exit 1
;;
esac
exit 0
captagent-6.1.0.20/init/deb/wheezy/ 0000775 0000000 0000000 00000000000 12723545033 0016720 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/init/deb/wheezy/captagent.default 0000664 0000000 0000000 00000001155 12723545033 0022236 0 ustar 00root root 0000000 0000000 #
# Captagent startup options
#
# Set to yes to enable captagent, once configured properly.
RUN_CAPTAGENT=yes
# Config file
CFGFILE=/usr/local/captagent/etc/captagent/captagent.xml
# Enable the server to leave a core file when it crashes.
# Set this to 'yes' to enable Captagent to leave a core file when it crashes
# or 'no' to disable this feature. This option is case sensitive and only
# accepts 'yes' and 'no' and only in lowercase letters.
# On some systems it is necessary to specify a directory for the core files
# to get a dump. Look into the captagent init file for an example configuration.
#DUMP_CORE=yes
captagent-6.1.0.20/init/deb/wheezy/captagent.init 0000664 0000000 0000000 00000004133 12723545033 0021554 0 ustar 00root root 0000000 0000000 #! /bin/sh
#
### BEGIN INIT INFO
# Provides: captagent
# Required-Start: $syslog $network $local_fs $remote_fs $time
# Should-Start: $named slapd mysql postgresql snmpd radiusd
# Should-Stop: $named slapd mysql postgresql snmpd radiusd
# Required-Stop: $syslog $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the Captagent
# Description: Start the Captagent
### END INIT INFO
. /lib/lsb/init-functions
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/captagent/bin/captagent
NAME=`basename "$0"`
DESC="Captagent"
HOMEDIR=/var/run/$NAME
PIDFILE=/var/run/$NAME.pid
DEFAULTS=/etc/default/$NAME
CFGFILE=/usr/local/captagent/etc/captagent/captagent.xml
RUN_CAPTAGENT=no
USER=captagent
GROUP=captagent
DUMP_CORE=no
test -f $DAEMON || exit 0
# Load startup options if available
if [ -f $DEFAULTS ]; then
. $DEFAULTS || true
fi
if [ "$RUN_CAPTAGENT" != "yes" ]; then
log_failure_msg "Captagent not yet configured. Edit /etc/default/$NAME first."
exit 0
fi
set -e
if test "$DUMP_CORE" = "yes" ; then
# set proper ulimit
ulimit -c unlimited
# directory for the core dump files
# COREDIR=/home/corefiles
# [ -d $COREDIR ] || mkdir $COREDIR
# chmod 777 $COREDIR
# echo "$COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
fi
# /var/run can be a tmpfs
if [ ! -d $HOMEDIR ]; then
mkdir -p $HOMEDIR
chown ${USER}:${GROUP} $HOMEDIR
fi
OPTIONS="-d -f $CFGFILE"
case "$1" in
start|debug)
log_daemon_msg "Starting $DESC: $NAME"
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--exec $DAEMON -- $OPTIONS || log_failure_msg " already running"
log_end_msg 0
;;
stop)
log_daemon_msg "Stopping $DESC: $NAME"
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
--exec $DAEMON
log_end_msg 0
;;
restart|force-reload)
$0 stop
sleep 1
$0 start
;;
status)
log_daemon_msg "Status of $DESC: "
status_of_proc -p"$PIDFILE" $NAME $NAME
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload|status|debug}" >&2
exit 1
;;
esac
exit 0
captagent-6.1.0.20/init/el/ 0000775 0000000 0000000 00000000000 12723545033 0015253 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/init/el/6/ 0000775 0000000 0000000 00000000000 12723545033 0015420 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/init/el/6/captagent.init 0000664 0000000 0000000 00000003702 12723545033 0020255 0 ustar 00root root 0000000 0000000 #!/bin/bash
#
# Startup script for captagent
#
# chkconfig: 345 85 15
# description: captagent - the Open Source Homer Capture Agent
#
# processname: captagent
# pidfile: /var/run/captagent.pid
# config: /usr/local/etc/captagent/captagent.xml
#
### BEGIN INIT INFO
# Provides: captagent
# Required-Start: $local_fs $network
# Short-Description: captagent - the Open Source Homer Capture Agent
# Description: Homer captagent is an Open Source Capture Programm released
# under GPLv3, able to handle thousands of call setups per second.
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
prog=captagent
APP_FILE=/usr/local/captagent/bin/$prog
PID_FILE=/var/run/$prog.pid
LOCK_FILE=/var/lock/subsys/$prog
RETVAL=0
[ -z "$CFG_FILE" ] && CFG_FILE=/usr/local/captagent/etc/captagent/captagent.xml
OPTIONS="-f $CFG_FILE -d"
[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
start() {
if [ -e $PID_FILE ]; then
echo "[FAILED] Captagent is already running with PID: `cat $PID_FILE`"
else
echo -n $"Starting $prog: "
# there is something at end of this output which is needed to
# report proper [ OK ] status in CentOS scripts
$APP_FILE $OPTIONS && success || failure
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch $LOCK_FILE
fi
}
stop() {
echo -n $"Stopping $prog: "
killproc $APP_FILE
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f $LOCK_FILE $PID_FILE
}
status() {
if [ -e $PID_FILE ]; then
echo "[OK] Captagent is running with PID: `cat $PID_FILE`"
else
echo "[FAILED] $PID_FILE does not exist"
RETVAL=1
fi
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
stop
start
;;
condrestart)
if [ -f $PID_FILE ] ; then
stop
start
fi
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|status|help}"
exit 1
esac
exit $RETVAL
captagent-6.1.0.20/init/el/7/ 0000775 0000000 0000000 00000000000 12723545033 0015421 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/init/el/7/captagent.service 0000664 0000000 0000000 00000000470 12723545033 0020752 0 ustar 00root root 0000000 0000000 [Unit]
Description=SIP capture agent server daemon
After=syslog.target network.target auditd.service
[Service]
EnvironmentFile=/etc/sysconfig/captagent
ExecStart=/usr/local/captagent/bin/captagent -f $CFG_FILE -d
KillMode=process
Restart=Always
RestartSec=42s
Type=forking
[Install]
WantedBy=multi-user.target
captagent-6.1.0.20/init/el/captagent.sysconfig 0000664 0000000 0000000 00000000132 12723545033 0021143 0 ustar 00root root 0000000 0000000 #
# captagent startup options
#
CFG_FILE=/usr/local/captagent/etc/captagent/captagent.xml
captagent-6.1.0.20/init/freebsd/ 0000775 0000000 0000000 00000000000 12723545033 0016265 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/init/freebsd/captagent 0000664 0000000 0000000 00000001273 12723545033 0020161 0 ustar 00root root 0000000 0000000 #!/bin/sh
# PROVIDE: captagent
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable captagent:
#
# captagent_enable="YES"
#
. /etc/rc.subr
name="captagent"
rcvar=`set_rcvar`
load_rc_config $name
: ${captagent_enable="NO"}
: ${captagent_pidfile="/var/run/captagent.pid"}
start_cmd=${name}_start
stop_cmd=${name}_stop
pidfile=${captagent_pidfile}
captagent_start() {
/usr/local/bin/captagent -d
}
captagent_stop() {
kill `cat ${captagent_pidfile}`
}
#command="/usr/local/bin/captagent -P /var/run/captagent.pid"
pidfile=${captagent_pidfile:-"/var/run/captagent.pid"}
#captagent_enable=${captagent_enable:-"NO"}
run_rc_command "$1"
captagent-6.1.0.20/m4/ 0000775 0000000 0000000 00000000000 12723545033 0014230 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/m4/as-ac-expand.m4 0000664 0000000 0000000 00000002553 12723545033 0016740 0 ustar 00root root 0000000 0000000 dnl as-ac-expand.m4 0.2.0 -*- autoconf -*-
dnl autostars m4 macro for expanding directories using configure's prefix
dnl (C) 2003, 2004, 2005 Thomas Vander Stichele
dnl Copying and distribution of this file, with or without modification,
dnl are permitted in any medium without royalty provided the copyright
dnl notice and this notice are preserved.
dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
dnl example:
dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
AC_DEFUN([AS_AC_EXPAND],
[
EXP_VAR=[$1]
FROM_VAR=[$2]
dnl first expand prefix and exec_prefix if necessary
prefix_save=$prefix
exec_prefix_save=$exec_prefix
dnl if no prefix given, then use /usr/local, the default prefix
if test "x$prefix" = "xNONE"; then
prefix="$ac_default_prefix"
fi
dnl if no exec_prefix given, then use prefix
if test "x$exec_prefix" = "xNONE"; then
exec_prefix=$prefix
fi
full_var="$FROM_VAR"
dnl loop until it doesn't change anymore
while true; do
new_full_var="`eval echo $full_var`"
if test "x$new_full_var" = "x$full_var"; then break; fi
full_var=$new_full_var
done
dnl clean up
full_var=$new_full_var
AC_SUBST([$1], "$full_var")
dnl restore prefix and exec_prefix
prefix=$prefix_save
exec_prefix=$exec_prefix_save
])
captagent-6.1.0.20/m4/modules_makefiles.m4 0000664 0000000 0000000 00000001012 12723545033 0020154 0 ustar 00root root 0000000 0000000 AC_CONFIG_FILES([
src/modules/database/hash/Makefile
src/modules/protocol/sip/Makefile
src/modules/protocol/sip/captureplan/Makefile
src/modules/protocol/rtcp/Makefile
src/modules/protocol/rtcp/captureplan/Makefile
src/modules/socket/pcap/Makefile
src/modules/socket/raw/Makefile
src/modules/socket/rtcpxr/Makefile
src/modules/socket/rtcpxr/captureplan/Makefile
src/modules/transport/hep/Makefile
src/modules/transport/json/Makefile
src/modules/interface/http/Makefile
src/modules/database/redis/Makefile
])
captagent-6.1.0.20/modules.am 0000664 0000000 0000000 00000000422 12723545033 0015675 0 ustar 00root root 0000000 0000000 moddir = $(libdir)/@PACKAGE_NAME@/modules
confdir = $(sysconfdir)/@PACKAGE_NAME@
AM_CPPFLAGS = ${AM_INCLUDES} -I$(top_srcdir)/include
AM_CFLAGS = ${AM_CFLAGS} -I$(top_srcdir)/include
CLEANFILES = *.la *.lo *.o *.so *.slo
distclean-local:
rm -rf .deps .libs Makefile.in
captagent-6.1.0.20/pkg/ 0000775 0000000 0000000 00000000000 12723545033 0014471 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/pkg/debian/ 0000775 0000000 0000000 00000000000 12723545033 0015713 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/pkg/debian/captagent.cron.d.ex 0000664 0000000 0000000 00000000212 12723545033 0021374 0 ustar 00root root 0000000 0000000 #
# Regular cron jobs for the captagent package
#
#0 4 * * * root [ -x /usr/bin/captagent_maintenance ] && /usr/bin/captagent_maintenance
captagent-6.1.0.20/pkg/debian/captagent.default.ex 0000664 0000000 0000000 00000000361 12723545033 0021642 0 ustar 00root root 0000000 0000000 # Defaults for captagent initscript
# sourced by /etc/init.d/captagent
# installed at /etc/default/captagent by the maintainer scripts
#
# This is a POSIX shell fragment
#
# Additional options that are passed to the Daemon.
DAEMON_OPTS=""
captagent-6.1.0.20/pkg/debian/captagent.init.in 0000664 0000000 0000000 00000003706 12723545033 0021161 0 ustar 00root root 0000000 0000000 #! /bin/sh
#
### BEGIN INIT INFO
# Provides: captagent
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Required-Start: $local_fs $network
# Required-Stop:
# Short-Description: captagent - the Open Source Homer Capture Agent
# Description: Homer captagent is an Open Source Capture Programm released
# under GPLv3, able to handle thousands of call setups per second.
### END INIT INFO
cap=/usr/bin/captagent
prog=captagent
pidfile=/var/run/$prog.pid
lockfile=/var/lock/$prog
RETVAL=0
start() {
if [ -e $pidfile ]; then
echo "[FAILED] Captagent is already running with PID: `cat $pidfile`"
else
echo -n "Starting $prog: "
# there is something at end of this output which is needed to
# report proper [ OK ] status in CentOS scripts
start-stop-daemon --start --quiet --pidfile $pidfile --exec $cap -- $OPTIONS || echo "Failed"
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch $lockfile
fi
}
stop() {
echo -n "Stopping $prog: "
#killproc $cap
if [ -e $pidfile ]; then
start-stop-daemon --oknodo --stop --quiet --pidfile $pidfile --signal 9 || echo "Failed"
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f $lockfile $pidfile
else
RETVAL=1
echo
[ $RETVAL = 1 ] && rm -f $lockfile $pidfile
echo "[FAILED] Captagent is not running"
fi
}
status() {
RETVAL=0
if [ -e $pidfile ]; then
echo "[OK] Captagent is running with PID: `cat $pidfile`"
else
echo "[FAILED] Captagent is not running"
RETVAL=1
fi
return $RETVAL
}
[ -z "$CONFIG" ] && CONFIG=@sysconfdir@/captagent/captagent.xml
OPTIONS="-d -f $CONFIG"
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
stop
start
;;
condrestart)
if [ -f $pidfile ] ; then
stop
start
fi
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|status|help}"
exit 1
esac
exit $RETVAL
captagent-6.1.0.20/pkg/debian/changelog 0000664 0000000 0000000 00000000521 12723545033 0017563 0 ustar 00root root 0000000 0000000 captagent (6.0.1) unstable; urgency=low
* Fixed some DEB packaging issues
-- Konstantin S. Vishnivetsky Fri, 18 Sep 2015 14:27:00 +0600
captagent (6.0.1) unstable; urgency=low
* Initial DEB packaging
-- Konstantin S. Vishnivetsky Wed, 16 Sep 2015 21:52:10 +0600
captagent-6.1.0.20/pkg/debian/compat 0000664 0000000 0000000 00000000002 12723545033 0017111 0 ustar 00root root 0000000 0000000 9
captagent-6.1.0.20/pkg/debian/control 0000664 0000000 0000000 00000002045 12723545033 0017317 0 ustar 00root root 0000000 0000000 Source: captagent
Section: comm
Priority: optional
Maintainer: Konstantin S. Vishnivetsky
Build-Depends: debhelper (>= 8.0.0),
debconf,
autotools-dev,
dh-autoreconf,
bison,
flex,
libexpat-dev,
libjson0-dev,
libmysqlclient-dev,
libpcap0.8-dev
Standards-Version: 6.0.1
Homepage: http://sipcapture.org
Vcs-Git: git://github.com/sipcapture/captagent/tree/captagent6
Package: captagent
Architecture: linux-any
Depends: ${shlibs:Depends}, ${misc:Depends}, libpcap0.8, libexpat1
Description: SIP capture server
HOMER5 a robust, carrier-grade, scalable SIP Capture system and Monitoring Application with HEP/HEP2, IP Proto4 (IPIP) encapsulation & port mirroring/monitoring support right out of the box, ready to process & store insane amounts of signaling with instant search, end-to-end analysis and drill-down capabilities for ITSPs, VoIP Providers and Trunk Suppliers using SIP signaling
#
#Package: captagent-doc
#Architecture: all
#Description: documentation for captagent
#
captagent-6.1.0.20/pkg/debian/copyright 0000664 0000000 0000000 00000104513 12723545033 0017652 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. 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
them 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 prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. 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.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey 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;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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 that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
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.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
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.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
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
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
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 3 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, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program 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, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU 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 Lesser General
Public License instead of this License. But first, please read
.
captagent-6.1.0.20/pkg/debian/docs 0000664 0000000 0000000 00000000056 12723545033 0016567 0 ustar 00root root 0000000 0000000 AUTHORS
COPYING
LICENSE
NEWS
README
README.md
captagent-6.1.0.20/pkg/debian/manpage.1.ex 0000664 0000000 0000000 00000003207 12723545033 0020022 0 ustar 00root root 0000000 0000000 .\" Hey, EMACS: -*- nroff -*-
.\" (C) Copyright 2015 Konstantin S. Vishnivetsky ,
.\"
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH CAPTAGENT SECTION "September 16, 2015"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
captagent \- program to do something
.SH SYNOPSIS
.B captagent
.RI [ options ] " files" ...
.br
.B bar
.RI [ options ] " files" ...
.SH DESCRIPTION
This manual page documents briefly the
.B captagent
and
.B bar
commands.
.PP
.\" TeX users may be more comfortable with the \fB\fP and
.\" \fI\fP escape sequences to invode bold face and italics,
.\" respectively.
\fBcaptagent\fP is a program that...
.SH OPTIONS
These programs follow the usual GNU command line syntax, with long
options starting with two dashes (`-').
A summary of options is included below.
For a complete description, see the Info files.
.TP
.B \-h, \-\-help
Show summary of options.
.TP
.B \-v, \-\-version
Show version of program.
.SH SEE ALSO
.BR bar (1),
.BR baz (1).
.br
The programs are documented fully by
.IR "The Rise and Fall of a Fooish Bar" ,
available via the Info system.
captagent-6.1.0.20/pkg/debian/manpage.sgml.ex 0000664 0000000 0000000 00000011115 12723545033 0020621 0 ustar 00root root 0000000 0000000 manpage.1'. You may view
the manual page with: `docbook-to-man manpage.sgml | nroff -man |
less'. A typical entry in a Makefile or Makefile.am is:
manpage.1: manpage.sgml
docbook-to-man $< > $@
The docbook-to-man binary is found in the docbook-to-man package.
Please remember that if you create the nroff version in one of the
debian/rules file targets (such as build), you will need to include
docbook-to-man in your Build-Depends control field.
-->
FIRSTNAME">
SURNAME">
September 16, 2015">
SECTION">
kvishnivetsky@sipcapture.org">
CAPTAGENT">
Debian">
GNU">
GPL">
]>
&dhemail;
&dhfirstname;
&dhsurname;
2003&dhusername;
&dhdate;
&dhucpackage;
&dhsection;
&dhpackage;program to do something&dhpackage;DESCRIPTIONThis manual page documents briefly the
&dhpackage; and bar
commands.This manual page was written for the &debian; distribution
because the original program does not have a manual page.
Instead, it has documentation in the &gnu;
Info format; see below.&dhpackage; is a program that...OPTIONSThese programs follow the usual &gnu; command line syntax,
with long options starting with two dashes (`-'). A summary of
options is included below. For a complete description, see the
Info files.Show summary of options.Show version of program.SEE ALSObar (1), baz (1).The programs are documented fully by The Rise and
Fall of a Fooish Bar available via the
Info system.AUTHORThis manual page was written by &dhusername; &dhemail; for
the &debian; system (and may be used by others). Permission is
granted to copy, distribute and/or modify this document under
the terms of the &gnu; General Public License, Version 2 any
later version published by the Free Software Foundation.
On Debian systems, the complete text of the GNU General Public
License can be found in /usr/share/common-licenses/GPL.
captagent-6.1.0.20/pkg/debian/manpage.xml.ex 0000664 0000000 0000000 00000025440 12723545033 0020465 0 ustar 00root root 0000000 0000000
. will be generated. You may view the
manual page with: nroff -man . | less'. A typical entry
in a Makefile or Makefile.am is:
DB2MAN = /usr/share/sgml/docbook/stylesheet/xsl/docbook-xsl/manpages/docbook.xsl
XP = xsltproc -''-nonet -''-param man.charmap.use.subset "0"
manpage.1: manpage.xml
$(XP) $(DB2MAN) $<
The xsltproc binary is found in the xsltproc package. The XSL files are in
docbook-xsl. A description of the parameters you can use can be found in the
docbook-xsl-doc-* packages. Please remember that if you create the nroff
version in one of the debian/rules file targets (such as build), you will need
to include xsltproc and docbook-xsl in your Build-Depends control field.
Alternatively use the xmlto command/package. That will also automatically
pull in xsltproc and docbook-xsl.
Notes for using docbook2x: docbook2x-man does not automatically create the
AUTHOR(S) and COPYRIGHT sections. In this case, please add them manually as
... .
To disable the automatic creation of the AUTHOR(S) and COPYRIGHT sections
read /usr/share/doc/docbook-xsl/doc/manpages/authors.html. This file can be
found in the docbook-xsl-doc-html package.
Validation can be done using: `xmllint -''-noout -''-valid manpage.xml`
General documentation about man-pages and man-page-formatting:
man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
-->
]>
&dhtitle;&dhpackage;&dhfirstname;&dhsurname;Wrote this manpage for the Debian system.&dhemail;2007&dhusername;This manual page was written for the Debian system
(and may be used by others).Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU General Public License,
Version 2 or (at your option) any later version published by
the Free Software Foundation.On Debian systems, the complete text of the GNU General Public
License can be found in
/usr/share/common-licenses/GPL.&dhucpackage;&dhsection;&dhpackage;program to do something&dhpackage;thisthisthat&dhpackage;DESCRIPTIONThis manual page documents briefly the
&dhpackage; and bar
commands.This manual page was written for the Debian distribution
because the original program does not have a manual page.
Instead, it has documentation in the GNU info1 format; see below.&dhpackage; is a program that...OPTIONSThe program follows the usual GNU command line syntax,
with long options starting with two dashes (`-'). A summary of
options is included below. For a complete description, see the
info1 files.Does this and that.Show summary of options.Show version of program.FILES/etc/foo.confThe system-wide configuration file to control the
behaviour of &dhpackage;. See
foo.conf5 for further details.${HOME}/.foo.confThe per-user configuration file to control the
behaviour of &dhpackage;. See
foo.conf5 for further details.ENVIRONMENTFOO_CONFIf used, the defined file is used as configuration
file (see also ).DIAGNOSTICSThe following diagnostics may be issued
on stderr:Bad configuration file. Exiting.The configuration file seems to contain a broken configuration
line. Use the option, to get more info.
&dhpackage; provides some return codes, that can
be used in scripts:CodeDiagnostic0Program exited successfully.1The configuration file seems to be broken.BUGSThe program is currently limited to only work
with the foobar library.The upstreams BTS can be found
at .SEE ALSObar1, baz1, foo.conf5The programs are documented fully by The Rise and
Fall of a Fooish Bar available via the info1 system.
captagent-6.1.0.20/pkg/debian/menu.ex 0000664 0000000 0000000 00000000171 12723545033 0017214 0 ustar 00root root 0000000 0000000 ?package(captagent):needs="X11|text|vc|wm" section="Applications/comm"\
title="captagent" command="/usr/bin/captagent"
captagent-6.1.0.20/pkg/debian/postinst.ex 0000664 0000000 0000000 00000001677 12723545033 0020147 0 ustar 00root root 0000000 0000000 #!/bin/sh
# postinst script for captagent
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * `configure'
# * `abort-upgrade'
# * `abort-remove' `in-favour'
#
# * `abort-remove'
# * `abort-deconfigure' `in-favour'
# `removing'
#
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
configure)
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
captagent-6.1.0.20/pkg/debian/postrm.ex 0000664 0000000 0000000 00000001644 12723545033 0017602 0 ustar 00root root 0000000 0000000 #!/bin/sh
# postrm script for captagent
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * `remove'
# * `purge'
# * `upgrade'
# * `failed-upgrade'
# * `abort-install'
# * `abort-install'
# * `abort-upgrade'
# * `disappear'
#
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
captagent-6.1.0.20/pkg/debian/preinst.ex 0000664 0000000 0000000 00000001264 12723545033 0017740 0 ustar 00root root 0000000 0000000 #!/bin/sh
# preinst script for captagent
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * `install'
# * `install'
# * `upgrade'
# * `abort-upgrade'
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
install|upgrade)
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
captagent-6.1.0.20/pkg/debian/prerm.ex 0000664 0000000 0000000 00000001557 12723545033 0017406 0 ustar 00root root 0000000 0000000 #!/bin/sh
# prerm script for captagent
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * `remove'
# * `upgrade'
# * `failed-upgrade'
# * `remove' `in-favour'
# * `deconfigure' `in-favour'
# `removing'
#
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
remove|upgrade|deconfigure)
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
captagent-6.1.0.20/pkg/debian/rules 0000775 0000000 0000000 00000000571 12723545033 0016776 0 ustar 00root root 0000000 0000000 #!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
# This has to be exported to make some magic below work.
export DH_OPTIONS
build:
autoreconf -if
./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
make
binary-arch:
dh_install
%:
dh $@ --with autotools-dev
captagent-6.1.0.20/pkg/debian/source/ 0000775 0000000 0000000 00000000000 12723545033 0017213 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/pkg/debian/source/format 0000664 0000000 0000000 00000000015 12723545033 0020422 0 ustar 00root root 0000000 0000000 3.0 (native)
captagent-6.1.0.20/pkg/debian/source/options 0000664 0000000 0000000 00000000025 12723545033 0020626 0 ustar 00root root 0000000 0000000 compression = "gzip"
captagent-6.1.0.20/pkg/debian/watch.ex 0000664 0000000 0000000 00000001431 12723545033 0017356 0 ustar 00root root 0000000 0000000 # Example watch control file for uscan
# Rename this file to "watch" and then you can run the "uscan" command
# to check for upstream updates and more.
# See uscan(1) for format
# Compulsory line, this is a version 3 file
version=3
# Uncomment to examine a Webpage
#
#http://www.example.com/downloads.php captagent-(.*)\.tar\.gz
# Uncomment to examine a Webserver directory
#http://www.example.com/pub/captagent-(.*)\.tar\.gz
# Uncommment to examine a FTP server
#ftp://ftp.example.com/pub/captagent-(.*)\.tar\.gz debian uupdate
# Uncomment to find new files on sourceforge, for devscripts >= 2.9
# http://sf.net/captagent/captagent-(.*)\.tar\.gz
# Uncomment to find new files on GooglePages
# http://example.googlepages.com/foo.html captagent-(.*)\.tar\.gz
captagent-6.1.0.20/pkg/el/ 0000775 0000000 0000000 00000000000 12723545033 0015071 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/pkg/el/6/ 0000775 0000000 0000000 00000000000 12723545033 0015236 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/pkg/el/6/captagent.init 0000664 0000000 0000000 00000003665 12723545033 0020103 0 ustar 00root root 0000000 0000000 #!/bin/bash
#
# Startup script for captagent
#
# chkconfig: 345 85 15
# description: captagent - the Open Source Homer Capture Agent
#
# processname: captagent
# pidfile: /var/run/captagent.pid
# config: /usr/local/etc/captagent/captagent.xml
#
### BEGIN INIT INFO
# Provides: captagent
# Required-Start: $local_fs $network
# Short-Description: captagent - the Open Source Homer Capture Agent
# Description: Homer captagent is an Open Source Capture Programm released
# under GPLv3, able to handle thousands of call setups per second.
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
prog=captagent
APP_FILE=/usr/local/bin/$prog
PID_FILE=/var/run/$prog.pid
LOCK_FILE=/var/lock/subsys/$prog
RETVAL=0
[ -z "$CFG_FILE" ] && CFG_FILE=/usr/local/captagent/etc/captagent/captagent.xml
OPTIONS="-f $CFG_FILE"
[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
start() {
if [ -e $PID_FILE ]; then
echo "[FAILED] Captagent is already running with PID: `cat $PID_FILE`"
else
echo -n $"Starting $prog: "
# there is something at end of this output which is needed to
# report proper [ OK ] status in CentOS scripts
$APP_FILE $OPTIONS && success || failure
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch $LOCK_FILE
fi
}
stop() {
echo -n $"Stopping $prog: "
killproc $APP_FILE
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f $LOCK_FILE $PID_FILE
}
status() {
if [ -e $PID_FILE ]; then
echo "[OK] Captagent is running with PID: `cat $PID_FILE`"
else
echo "[FAILED] $PID_FILE does not exist"
RETVAL=1
fi
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
stop
start
;;
condrestart)
if [ -f $PID_FILE ] ; then
stop
start
fi
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|status|help}"
exit 1
esac
exit $RETVAL
captagent-6.1.0.20/pkg/el/7/ 0000775 0000000 0000000 00000000000 12723545033 0015237 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/pkg/el/7/captagent.service 0000664 0000000 0000000 00000000453 12723545033 0020571 0 ustar 00root root 0000000 0000000 [Unit]
Description=SIP capture agent server daemon
After=syslog.target network.target auditd.service
[Service]
EnvironmentFile=/etc/sysconfig/captagent
ExecStart=/opt/sbin/sipcapture -f $CFG_FILE
KillMode=process
Restart=on-failure
RestartSec=42s
Type=forking
[Install]
WantedBy=multi-user.target
captagent-6.1.0.20/pkg/el/captagent.sysconfig 0000664 0000000 0000000 00000000132 12723545033 0020761 0 ustar 00root root 0000000 0000000 #
# captagent startup options
#
CFG_FILE=/usr/local/captagent/etc/captagent/captagent.xml
captagent-6.1.0.20/pkg/fpm/ 0000775 0000000 0000000 00000000000 12723545033 0015253 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/pkg/fpm/deb/ 0000775 0000000 0000000 00000000000 12723545033 0016005 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/pkg/fpm/deb/README.txt 0000664 0000000 0000000 00000000212 12723545033 0017476 0 ustar 00root root 0000000 0000000 # Syntax
docker run --rm -v $(pwd)/:/tmp/build -v $(pwd)/:/scripts --entrypoint=/scripts/builder.sh alanfranz/fwd-debian-jessie:latest
captagent-6.1.0.20/pkg/fpm/deb/build.sh 0000775 0000000 0000000 00000001425 12723545033 0017445 0 ustar 00root root 0000000 0000000 #!/bin/bash
# CaptAgent 6 - Debian Builder
export VERSION=$(date +%Y%m%d%H%M)
export TMP_DIR=/tmp
cd $TMP_DIR
apt-get -y update && apt-get -y install git libexpat-dev libpcap-dev libjson0-dev libtool automake flex bison
git clone https://github.com/sipcapture/captagent captagent
cd captagent/
git checkout 6.1
./build.sh
./configure
make
mkdir -p $TMP_DIR/captagent
make DESTDIR=$TMP_DIR/captagent_install install
export CODEVERSION=$(./src/captagent -v | cut -c10-)
fpm -s dir -t deb -C $TMP_DIR/captagent_install --name captagent --version $CODEVERSION --iteration 1 --deb-no-default-config-files --depends libpcap,json-c,expat --description "captagent" .
ls -alF *.deb
cp -v *.deb ${TMP_DIR}/
# Clean up temp files
cd $TMP_DIR; rm -rf ./captagent ./captagent_install
echo "done!"
captagent-6.1.0.20/pkg/fpm/rpm/ 0000775 0000000 0000000 00000000000 12723545033 0016051 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/pkg/fpm/rpm/README.txt 0000664 0000000 0000000 00000000204 12723545033 0017543 0 ustar 00root root 0000000 0000000 # Syntax
docker run --rm -v $(pwd)/:/tmp/build -v $(pwd)/:/scripts --entrypoint=/scripts/builder.sh alanfranz/fwd-centos-7:latest
captagent-6.1.0.20/pkg/fpm/rpm/build.sh 0000775 0000000 0000000 00000001314 12723545033 0017506 0 ustar 00root root 0000000 0000000 #!/bin/bash
# CaptAgent 6 - CentOS Builder
export VERSION=$(date +%Y%m%d%H%M)
export TMP_DIR=/tmp
cd $TMP_DIR
yum -y install json-c-devel expat-devel libpcap-devel flex-devel automake libtool bison
git clone https://github.com/sipcapture/captagent captagent
cd captagent/
git checkout 6.1
./build.sh
./configure
make
mkdir -p $TMP_DIR/captagent
make DESTDIR=$TMP_DIR/captagent_install install
export CODEVERSION=$(./src/captagent -v | cut -c10-)
fpm -s dir -t rpm -C $TMP_DIR/captagent_install --name captagent --version $CODEVERSION --iteration 1 --depends json-c,expat,libpcap --description "captagent" .
ls -alF *.rpm
cp -v *.rpm ${TMP_DIR}
cd $TMP_DIR; rm -rf ./captagent ./captagent-installer
echo "done!"
captagent-6.1.0.20/pkg/freebsd/ 0000775 0000000 0000000 00000000000 12723545033 0016103 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/pkg/freebsd/captagent 0000664 0000000 0000000 00000001273 12723545033 0017777 0 ustar 00root root 0000000 0000000 #!/bin/sh
# PROVIDE: captagent
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable captagent:
#
# captagent_enable="YES"
#
. /etc/rc.subr
name="captagent"
rcvar=`set_rcvar`
load_rc_config $name
: ${captagent_enable="NO"}
: ${captagent_pidfile="/var/run/captagent.pid"}
start_cmd=${name}_start
stop_cmd=${name}_stop
pidfile=${captagent_pidfile}
captagent_start() {
/usr/local/bin/captagent -d
}
captagent_stop() {
kill `cat ${captagent_pidfile}`
}
#command="/usr/local/bin/captagent -P /var/run/captagent.pid"
pidfile=${captagent_pidfile:-"/var/run/captagent.pid"}
#captagent_enable=${captagent_enable:-"NO"}
run_rc_command "$1"
captagent-6.1.0.20/src/ 0000775 0000000 0000000 00000000000 12723545033 0014477 5 ustar 00root root 0000000 0000000 captagent-6.1.0.20/src/Makefile.am 0000664 0000000 0000000 00000001453 12723545033 0016536 0 ustar 00root root 0000000 0000000 include $(top_srcdir)/common.am
SUBDIRS = \
. \
modules/socket/pcap \
modules/socket/raw \
modules/socket/rtcpxr \
modules/protocol/sip \
modules/protocol/rtcp \
modules/transport/hep \
modules/transport/json \
modules/database/hash \
modules/database/redis \
modules/interface/http
bin_PROGRAMS = captagent
AM_CFLAGS = -g -fPIC -rdynamic -I$(top_srcdir)/include
AM_CPPFLAGS = -DSYSCONFDIR='"$(sysconfdir)"' -I$(top_srcdir)/include
BUILT_SOURCES = capplan.tab.h
noinst_HEADERS = md5.h captagent.h conf_function.h
captagent_SOURCES = captagent.c conf_function.c log.c md5.c modules.c xmlread.c capplan.l capplan.tab.y
captagent_LDADD = ${PTHREAD_LIBS} ${EXPAT_LIBS} ${DL_LIBS} ${FLEX_LIBS}
captagentconfdir = $(sysconfdir)/$(bin_PROGRAMS)
captagentconf_DATA = $(top_srcdir)/conf/$(bin_PROGRAMS).xml
captagent-6.1.0.20/src/capplan.l 0000664 0000000 0000000 00000014563 12723545033 0016303 0 ustar 00root root 0000000 0000000 /*
*
*/
%{
#include "capplan.tab.h"
#include
#include
#include
#include
#include
#include
#include "conf_function.h"
#include
#include
#include
/* states */
#define INITIAL_S 0
#define COMMENT_S 1
#define COMMENT_LN_S 2
#define STRING_S 3
static int comment_nest=0;
static int state=0;
static char* tstr=0;
int line=1;
int column=1;
int startcolumn=1;
char *capturename = 0;
static char* addstr(char*, char**);
static void count();
%}
/* start conditions */
%x STRING1 STRING2 COMMENT COMMENT_LN
/* action keywords */
FORWARD forward
DROP "drop"|"break"
SEND send
LOG log
ERROR error
CAPTURE capture
REPLY_CAPTURE reply_capture
LEN_GT len_gt
APPEND_BRANCH "append_branch"
IF "if"
ELSE "else"
/* condition keywords */
METHOD method
URI uri
SRCIP src_ip
DSTIP dst_ip
MYSELF myself
/* operators */
EQUAL =
EQUAL_T ==
MATCH =~
NOT !|"not"
AND "and"|"&&"|"&"
OR "or"|"||"|"|"
/* config vars. */
DEBUG debug
FORK fork
LOGSTDERROR log_stderror
LISTEN listen
ALIAS alias
DNS dns
REV_DNS rev_dns
PORT port
STAT statistics
MAXBUFFER maxbuffer
CHILDREN children
CHECK_VIA check_via
SYN_BRANCH syn_branch
MEMLOG memlog
SIP_WARNING sip_warning
FIFO fifo
FIFO_MODE fifo_mode
SERVER_SIGNATURE server_signature
REPLY_TO_VIA reply_to_via
USER "user"|"uid"
GROUP "group"|"gid"
LOADMODULE loadmodule
MODPARAM modparam
/* values */
YES "yes"|"true"|"on"|"enable"
NO "no"|"false"|"off"|"disable"
LETTER [a-zA-Z]
DIGIT [0-9]
ALPHANUM {LETTER}|{DIGIT}|[_]
NUMBER {DIGIT}+
ID {LETTER}{ALPHANUM}*
HEX [0-9a-fA-F]
HEX4 {HEX}{1,4}
IPV6ADDR ({HEX4}":"){7}{HEX4}|({HEX4}":"){1,7}(":"{HEX4}){1,7}|":"(":"{HEX4}){1,7}|({HEX4}":"){1,7}":"|"::"
QUOTES \"
TICK \'
SLASH "/"
SEMICOLON ;
RPAREN \)
LPAREN \(
LBRACE \{
RBRACE \}
LBRACK \[
RBRACK \]
COMMA ","
DOT \.
CR \n
COM_LINE #
COM_START "/\*"
COM_END "\*/"
EAT_ABLE [\ \t\b\r]
%%
{EAT_ABLE} { count(); }
{FORWARD} {count(); yylval.strval=yytext; return FORWARD; }
{DROP} { count(); yylval.strval=yytext; return DROP; }
{SEND} { count(); yylval.strval=yytext; return SEND; }
{CAPTURE} { count(); yylval.strval=yytext; return CAPTURE; }
{IF} { count(); yylval.strval=yytext; return IF; }
{ELSE} { count(); yylval.strval=yytext; return ELSE; }
{METHOD} { count(); yylval.strval=yytext; return METHOD; }
{DEBUG} { count(); yylval.strval=yytext; return DEBUG; }
{EQUAL} { count(); return EQUAL; }
{EQUAL_T} { count(); return EQUAL_T; }
{MATCH} { count(); return MATCH; }
{NOT} { count(); return NOT; }
{AND} { count(); return AND; }
{OR} { count(); return OR; }
{IPV6ADDR} { count(); yylval.strval=yytext; return IPV6ADDR; }
{NUMBER} { count(); yylval.intval=atoi(yytext);return NUMBER; }
{YES} { count(); yylval.intval=1; return NUMBER; }
{NO} { count(); yylval.intval=0; return NUMBER; }
{COMMA} { count(); return COMMA; }
{SEMICOLON} { count(); return SEMICOLON; }
{RPAREN} { count(); return RPAREN; }
{LPAREN} { count(); return LPAREN; }
{LBRACE} { count(); return LBRACE; }
{RBRACE} { count(); return RBRACE; }
{LBRACK} { count(); return LBRACK; }
{RBRACK} { count(); return RBRACK; }
{SLASH} { count(); return SLASH; }
{DOT} { count(); return DOT; }
\\{CR} {count(); } /* eat the escaped CR */
{CR} { count();/* return CR;*/ }
{QUOTES} { count(); state=STRING_S; BEGIN(STRING1); }
{TICK} { count(); state=STRING_S; BEGIN(STRING2); }
{QUOTES} { count(); state=INITIAL_S; BEGIN(INITIAL);
yytext[yyleng-1]=0; yyleng--;
addstr(yytext, &tstr);
yylval.strval=tstr; tstr=0;
return STRING;
}
{TICK} { count(); state=INITIAL_S; BEGIN(INITIAL);
yytext[yyleng-1]=0; yyleng--;
addstr(yytext, &tstr);
yylval.strval=tstr;
tstr=0;
return STRING;
}
.|{EAT_ABLE}|{CR} { yymore(); }
\\n { count(); yytext[yyleng-2]='\n';yytext[yyleng-1]=0;
yyleng--; addstr(yytext, &tstr); }
\\r { count(); yytext[yyleng-2]='\r';yytext[yyleng-1]=0;
yyleng--; addstr(yytext, &tstr); }
\\a { count(); yytext[yyleng-2]='\a';yytext[yyleng-1]=0;
yyleng--; addstr(yytext, &tstr); }
\\t { count(); yytext[yyleng-2]='\t';yytext[yyleng-1]=0;
yyleng--; addstr(yytext, &tstr); }
\\\\ { count(); yytext[yyleng-2]='\\';yytext[yyleng-1]=0;
yyleng--; addstr(yytext, &tstr); }
.|{EAT_ABLE}|{CR} { yymore(); }
{COM_START} { count(); comment_nest++; state=COMMENT_S;
BEGIN(COMMENT); }
{COM_END} { count(); comment_nest--;
if (comment_nest==0){
state=INITIAL_S;
BEGIN(INITIAL);
}
}
.|{EAT_ABLE}|{CR} { count(); };
{COM_LINE}.*{CR} { count(); }
{ID} { count(); addstr(yytext, &tstr);
yylval.strval=tstr; tstr=0; return ID; }
<> {
switch(state){
case STRING_S:
printf( "ERROR: cfg. parser: unexpected EOF in"
" unclosed string\n");
if (tstr) {free(tstr); tstr=0;}
break;
case COMMENT_S:
printf( "ERROR: cfg. parser: unexpected EOF:"
" %d comments open\n", comment_nest);
break;
case COMMENT_LN_S:
printf( "ERROR: unexpected EOF:"
"comment line open\n");
break;
}
return 0;
}
%%
static char* addstr(char * src, char ** dest)
{
char *tmp;
unsigned len1, len2;
if (*dest==0){
*dest=strdup(src);
}else{
len1=strlen(*dest);
len2=strlen(src);
tmp=malloc(len1+len2+1);
if (tmp==0) goto error;
memcpy(tmp, *dest, len1);
memcpy(tmp+len1, src, len2);
tmp[len1+len2]=0;
free(*dest);
*dest=tmp;
}
return *dest;
error:
printf("ERROR:lex:addstr: memory allocation error\n");
return 0;
}
static void count()
{
int i;
startcolumn=column;
for (i=0; i