Commit 45093a6a authored by Lionel Gauthier's avatar Lionel Gauthier

Clean


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7380 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent d428222d
Archives in this directory contain static binaries, so any kind
of run-time linkage error is not expected. Please let me know
if you experience such an error, or any kind of unexpected behaviour.
LZMA archives can be extracted as follows,
tar xvfa SCOREF-MGMT-v1.0.4.tar.lzma
Not for all versions a binary is created when the change is
subtle and/or documentation related. So please follow OpenAirInterface
SVN for most up-to-date version.
Note: Name has changed from IF.MGMT to SCOREF-MGMT from version 1.1.0 on.
- Baris Demiray <baris.demiray@eurecom.fr>
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
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 <http://www.gnu.org/licenses/>.
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:
<program> Copyright (C) <year> <name of author>
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
<http://www.gnu.org/licenses/>.
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
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
~ SCOREF Management Module Design (SCOREF-MGMT) ~
SCOREF-MGMT is a server application currently having the interfaces to
GN (GeoNetworking) and FAC (Facilities) modules. Herein this directory
design documents corresponding to critical sections of MGMT-CORE will reside.
.xmi files are for Umbrello. Please see http://uml.sourceforge.net/
- Baris Demiray <baris.demiray@eurecom.fr>
<?xml version="1.0" encoding="UTF-8"?>
<XMI verified="false" xmi.version="1.2" timestamp="2012-12-03T17:29:43" xmlns:UML="http://schema.omg.org/spec/UML/1.3">
<XMI.header>
<XMI.documentation>
<XMI.exporter>umbrello uml modeller http://uml.sf.net</XMI.exporter>
<XMI.exporterVersion>1.5.8</XMI.exporterVersion>
<XMI.exporterEncoding>UnicodeUTF8</XMI.exporterEncoding>
</XMI.documentation>
<XMI.metamodel xmi.version="1.3" href="UML.xml" xmi.name="UML"/>
</XMI.header>
<XMI.content>
<UML:Model isSpecification="false" isAbstract="false" isLeaf="false" xmi.id="m1" isRoot="false" name="UML Model">
<UML:Namespace.ownedElement>
<UML:Stereotype visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="folder" name="folder"/>
<UML:Stereotype visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="datatype" name="datatype"/>
<UML:Model stereotype="folder" visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Logical View" name="Logical View">
<UML:Namespace.ownedElement>
<UML:Package stereotype="folder" visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Datatypes" name="Datatypes">
<UML:Namespace.ownedElement>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="A8WiKgyJCayx" name="int"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="ig2vnF8xohCP" name="char"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="SfVgAhhIpE08" name="bool"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="uwR4XN2D248p" name="float"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="HHk3wwTOZw5h" name="double"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="emzRyxXsuxxP" name="short"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="KxcMzj9E0tIu" name="long"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="pjINfL4J64j4" name="unsigned int"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="1GvtDqIWntsk" name="unsigned short"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="c2yavGSjzk6d" name="unsigned long"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="4AuACdCEs753" name="string"/>
</UML:Namespace.ownedElement>
</UML:Package>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="fp2dX8GbH8jT" name="main()"/>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="d875XUOAJRlo" name="Util"/>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="c70hKf1xl80G" name="Configuration"/>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="BKABBeColCV6" name="ManagementInformationBase"/>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="RhUblYtxs362" name="ManagementServer"/>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="jNpyCZ6vSurm" name="InquiryThread"/>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Dy2pjQabnnTg" name="PacketHandler"/>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="YjQfDsrfoylV" name="ManagementClientManager"/>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="WJnn914hqHAk" name="Packet"/>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="7zGxf72LspN9" name="CommunicationProfileManager"/>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Lsx9BreRIssY" name="ItsKeyManager"/>
</UML:Namespace.ownedElement>
<XMI.extension xmi.extender="umbrello">
<diagrams>
<diagram showopsig="1" linecolor="#ff0000" snapx="10" showattribassocs="1" snapy="10" linewidth="0" showattsig="1" isopen="0" showpackage="1" showpubliconly="1" showstereotype="1" name="class diagram" font="Sans Serif,10,-1,5,50,0,0,0,0,0" canvasheight="873" canvaswidth="1663" localid="-1" snapcsgrid="0" showgrid="0" showops="1" griddotcolor="#a0a0a4" backgroundcolor="#c3c3c3" usefillcolor="1" fillcolor="#ffff00" zoom="100" xmi.id="FCaYFbnT8EWC" documentation="" showscope="1" snapgrid="0" showatts="1" type="1">
<widgets/>
<messages/>
<associations/>
</diagram>
<diagram showopsig="1" linecolor="#ff0000" snapx="10" showattribassocs="1" snapy="10" linewidth="0" showattsig="1" isopen="1" showpackage="1" showpubliconly="1" showstereotype="1" name="Main Flow" font="Sans Serif,10,-1,5,50,0,0,0,0,0" canvasheight="873" canvaswidth="1663" localid="hIqQSJUFoWoQ" snapcsgrid="0" showgrid="0" showops="1" griddotcolor="#a0a0a4" backgroundcolor="#c3c3c3" usefillcolor="1" fillcolor="#ffff00" zoom="100" xmi.id="xMZiFQSpSRNL" documentation="" showscope="1" snapgrid="0" showatts="1" type="3">
<widgets>
<objectwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" usesdiagramusefillcolor="1" instancename="" x="131" decon="0" showstereotype="1" y="48" font="Sans Serif,10,-1,5,50,0,1,0,0,0" localid="mwfc1lfz7DfK" width="64" isinstance="0" multipleinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="fp2dX8GbH8jT" height="32" drawasactor="0"/>
<objectwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" usesdiagramusefillcolor="1" instancename="" x="329" decon="0" showstereotype="1" y="48" font="Sans Serif,10,-1,5,50,0,1,0,0,0" localid="XzQm87Gs1tU3" width="50" isinstance="0" multipleinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="d875XUOAJRlo" height="32" drawasactor="0"/>
<objectwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" usesdiagramusefillcolor="1" instancename="" x="502" decon="0" showstereotype="1" y="48" font="Sans Serif,10,-1,5,50,0,1,0,0,0" localid="aPRroCgJC46K" width="107" isinstance="0" multipleinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="c70hKf1xl80G" height="32" drawasactor="0"/>
<objectwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" usesdiagramusefillcolor="1" instancename="" x="689" decon="0" showstereotype="1" y="48" font="Sans Serif,10,-1,5,50,0,1,0,0,0" localid="pV1Zb2pCPE3B" width="212" isinstance="0" multipleinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="BKABBeColCV6" height="32" drawasactor="0"/>
<objectwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" usesdiagramusefillcolor="1" instancename="" x="995" decon="0" showstereotype="1" y="48" font="Sans Serif,10,-1,5,50,0,1,0,0,0" localid="hIqQSJUFoWoQ" width="149" isinstance="0" multipleinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="RhUblYtxs362" height="32" drawasactor="0"/>
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="348" showstereotype="1" y="535" text="Get the list of files reside in configuration/ directory" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="700" width="332" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="fqnLGJut09Xh" height="20"/>
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="455" showstereotype="1" y="571" text="Parse all the valid configuration files found" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="700" width="275" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="FWO0b0p7vZHS" height="20"/>
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="489" showstereotype="1" y="521" text="Initialize MIB with the configuration information" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="700" width="304" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="dM9pGMuuAfDQ" height="20"/>
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="466" showstereotype="1" y="730" text="Instantiate a ManagementServer and pass the control to it for further actions and client handling" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="700" width="625" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="y7HwFndSJ0Su" height="20"/>
</widgets>
<messages>
<messagewidget linecolor="none" usesdiagramfillcolor="1" widgetbid="XzQm87Gs1tU3" textid="jzxk5zPNpqn9" operation="Util::getListOfFiles()" linewidth="none" seqnum="1" usesdiagramusefillcolor="1" x="163" showstereotype="1" y="136" widgetaid="mwfc1lfz7DfK" font="Sans Serif,10,-1,5,50,0,0,0,0,0" width="199" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="cavqb6FJYq47" height="32" sequencemessagetype="1000">
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="168" showstereotype="1" y="109" text="1: Util::getListOfFiles()" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="704" width="147" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="jzxk5zPNpqn9" height="20"/>
</messagewidget>
<messagewidget linecolor="none" usesdiagramfillcolor="1" widgetbid="aPRroCgJC46K" textid="JZmsOoz5mwqr" operation="Configuration::parseConfigurationFiles()" linewidth="none" seqnum="2" usesdiagramusefillcolor="1" x="163" showstereotype="1" y="243" widgetaid="mwfc1lfz7DfK" font="Sans Serif,10,-1,5,50,0,0,0,0,0" width="400" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="I3vorJKTtFKT" height="32" sequencemessagetype="1000">
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="168" showstereotype="1" y="223" text="2: Configuration::parseConfigurationFiles()" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="704" width="275" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="JZmsOoz5mwqr" height="20"/>
</messagewidget>
<messagewidget linecolor="none" usesdiagramfillcolor="1" widgetbid="pV1Zb2pCPE3B" textid="3RKvecOyA8oY" operation="ManagementInformationBase::initialize()" linewidth="none" seqnum="3" usesdiagramusefillcolor="1" x="163" showstereotype="1" y="291" widgetaid="mwfc1lfz7DfK" font="Sans Serif,10,-1,5,50,0,0,0,0,0" width="640" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="uDDh30oK3k8t" height="32" sequencemessagetype="1000">
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="168" showstereotype="1" y="334" text="3: ManagementInformationBase::initialize()" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="704" width="283" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="3RKvecOyA8oY" height="20"/>
</messagewidget>
<messagewidget linecolor="none" usesdiagramfillcolor="1" widgetbid="hIqQSJUFoWoQ" textid="7cpWwkAX66hC" operation="ManagementServer::readData()" linewidth="none" seqnum="4" usesdiagramusefillcolor="1" x="164" showstereotype="1" y="328" widgetaid="mwfc1lfz7DfK" font="Sans Serif,10,-1,5,50,0,0,0,0,0" width="904" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="RWZfjHgh50jn" height="8" sequencemessagetype="1001">
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="169" showstereotype="1" y="446" text="4: ManagementServer::readData()" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="704" width="229" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="7cpWwkAX66hC" height="20"/>
</messagewidget>
</messages>
<associations/>
</diagram>
<diagram showopsig="1" linecolor="#ff0000" snapx="10" showattribassocs="1" snapy="10" linewidth="0" showattsig="1" isopen="1" showpackage="1" showpubliconly="1" showstereotype="1" name="Client Handling" font="Sans Serif,10,-1,5,50,0,0,0,0,0" canvasheight="873" canvaswidth="1663" localid="hnCrqHEjCEP3" snapcsgrid="0" showgrid="0" showops="1" griddotcolor="#a0a0a4" backgroundcolor="#c3c3c3" usefillcolor="1" fillcolor="#ffff00" zoom="100" xmi.id="jvnwJj3ZfGMH" documentation="" showscope="1" snapgrid="0" showatts="1" type="3">
<widgets>
<objectwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" usesdiagramusefillcolor="1" instancename="" x="133" decon="0" showstereotype="1" y="48" font="Sans Serif,10,-1,5,50,0,1,0,0,0" localid="ifHBXFTW7ImQ" width="149" isinstance="0" multipleinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="RhUblYtxs362" height="32" drawasactor="0"/>
<objectwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" usesdiagramusefillcolor="1" instancename="" x="570" decon="0" showstereotype="1" y="48" font="Sans Serif,10,-1,5,50,0,1,0,0,0" localid="bsJH9fYrIn2p" width="108" isinstance="0" multipleinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="jNpyCZ6vSurm" height="32" drawasactor="0"/>
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="212" showstereotype="1" y="160" text="Start thread for repetitive sending of WirelessStateRequest" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="700" width="383" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="3mHJZK6cnPjZ" height="20"/>
<objectwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" usesdiagramusefillcolor="1" instancename="" x="873" decon="0" showstereotype="1" y="48" font="Sans Serif,10,-1,5,50,0,1,0,0,0" localid="sFVPCURH7VSD" width="114" isinstance="0" multipleinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="Dy2pjQabnnTg" height="32" drawasactor="0"/>
<objectwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" usesdiagramusefillcolor="1" instancename="" x="1038" decon="0" showstereotype="1" y="48" font="Sans Serif,10,-1,5,50,0,1,0,0,0" localid="yULuE2bLGpGJ" width="199" isinstance="0" multipleinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="YjQfDsrfoylV" height="32" drawasactor="0"/>
<objectwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" usesdiagramusefillcolor="1" instancename="" x="1301" decon="0" showstereotype="1" y="48" font="Sans Serif,10,-1,5,50,0,1,0,0,0" localid="hnCrqHEjCEP3" width="64" isinstance="0" multipleinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="WJnn914hqHAk" height="32" drawasactor="0"/>
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="222" showstereotype="1" y="245" text="InquiryThread calls for ManagementServer functionality repetitively" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="700" width="433" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="fxTICgmf7zIk" height="20"/>
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="220" showstereotype="1" y="291" text="Read data from asynchronous UDP socket" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="700" width="277" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="ZyQkTJwcvgd0" height="20"/>
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="214" showstereotype="1" y="356" text="There is some data to be received, callback is called by Boost" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="700" width="400" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="nfaGRTO4OsLZ" height="20"/>
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="214" showstereotype="1" y="427" text="Received data is passed into this function to be processed" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="700" width="378" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="W7Eb6VLfRjOu" height="20"/>
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="213" showstereotype="1" y="503" text="Received byte stream is passed to PacketHandler to be parsed and processed further" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="700" width="553" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="3IUyy5wjkUzA" height="20"/>
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="212" showstereotype="1" y="591" text="Client state is updated according to the received data" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="700" width="351" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="vMCKCXtie5Ji" height="20"/>
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="214" showstereotype="1" y="667" text="A response is ready and here it is serialized into a byte stream to be written onto the socket" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="700" width="595" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="aeM2MiuP0PLy" height="20"/>
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="212" showstereotype="1" y="740" text="There is some data we sent so Boost calls our callback for final actions for this transmission" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="700" width="591" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="UFiDjfNe1ZwD" height="20"/>
</widgets>
<messages>
<messagewidget linecolor="none" usesdiagramfillcolor="1" widgetbid="bsJH9fYrIn2p" textid="uWXLOO5zHOGQ" operation="InquiryThread::operator()()" linewidth="none" seqnum="1" usesdiagramusefillcolor="1" x="208" showstereotype="1" y="151" widgetaid="ifHBXFTW7ImQ" font="Sans Serif,10,-1,5,50,0,0,0,0,0" width="415" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="2VJ9m5YTQLRc" height="8" sequencemessagetype="1001">
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="213" showstereotype="1" y="131" text="1: InquiryThread::operator()()" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="704" width="193" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="uWXLOO5zHOGQ" height="20"/>
</messagewidget>
<messagewidget linecolor="none" usesdiagramfillcolor="1" widgetbid="bsJH9fYrIn2p" textid="PvKeHa2ILKbu" operation="Send WirelessStateRequest repetitively" linewidth="none" seqnum="" usesdiagramusefillcolor="1" x="625" showstereotype="1" y="187" widgetaid="bsJH9fYrIn2p" font="Sans Serif,10,-1,5,50,0,0,0,0,0" width="48" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="SH3tcSVVy1qM" height="41" sequencemessagetype="1001">
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="630" showstereotype="1" y="167" text=": Send WirelessStateRequest repetitively" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="705" width="265" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="PvKeHa2ILKbu" height="20"/>
</messagewidget>
<messagewidget linecolor="none" usesdiagramfillcolor="1" widgetbid="ifHBXFTW7ImQ" textid="OvZLuNfJGzwX" operation="ManagementServer::sendWirelessStateRequest()" linewidth="none" seqnum="" usesdiagramusefillcolor="1" x="208" showstereotype="1" y="237" widgetaid="bsJH9fYrIn2p" font="Sans Serif,10,-1,5,50,0,0,0,0,0" width="415" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="chUP6ExYTyR4" height="8" sequencemessagetype="1001">
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="213" showstereotype="1" y="217" text=": ManagementServer::sendWirelessStateRequest()" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="704" width="330" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="OvZLuNfJGzwX" height="20"/>
</messagewidget>
<messagewidget linecolor="none" usesdiagramfillcolor="1" widgetbid="ifHBXFTW7ImQ" textid="UBhx771V0Yqu" operation="this->readData()" linewidth="none" seqnum="2" usesdiagramusefillcolor="1" x="208" showstereotype="1" y="288" widgetaid="ifHBXFTW7ImQ" font="Sans Serif,10,-1,5,50,0,0,0,0,0" width="48" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="YyptIQns5IGB" height="32" sequencemessagetype="1001">
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="213" showstereotype="1" y="268" text="2: this->readData()" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="705" width="133" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="UBhx771V0Yqu" height="20"/>
</messagewidget>
<messagewidget linecolor="none" usesdiagramfillcolor="1" widgetbid="ifHBXFTW7ImQ" textid="riFwyT5SenNl" operation="this->handleReceive()" linewidth="none" seqnum="3" usesdiagramusefillcolor="1" x="208" showstereotype="1" y="351" widgetaid="ifHBXFTW7ImQ" font="Sans Serif,10,-1,5,50,0,0,0,0,0" width="48" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="vWD9V7g36TuM" height="32" sequencemessagetype="1001">
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="213" showstereotype="1" y="331" text="3: this->handleReceive()" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="705" width="164" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="riFwyT5SenNl" height="20"/>
</messagewidget>
<messagewidget linecolor="none" usesdiagramfillcolor="1" widgetbid="ifHBXFTW7ImQ" textid="5d4B6yXyeksc" operation="this->handleClientData()" linewidth="none" seqnum="4" usesdiagramusefillcolor="1" x="208" showstereotype="1" y="424" widgetaid="ifHBXFTW7ImQ" font="Sans Serif,10,-1,5,50,0,0,0,0,0" width="48" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="uNEuv5mpZzy2" height="32" sequencemessagetype="1001">
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="213" showstereotype="1" y="404" text="4: this->handleClientData()" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="705" width="183" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="5d4B6yXyeksc" height="20"/>
</messagewidget>
<messagewidget linecolor="none" usesdiagramfillcolor="1" widgetbid="sFVPCURH7VSD" textid="9GGu3jbty6IA" operation="PacketHandler::handle()" linewidth="none" seqnum="5" usesdiagramusefillcolor="1" x="207" showstereotype="1" y="497" widgetaid="ifHBXFTW7ImQ" font="Sans Serif,10,-1,5,50,0,0,0,0,0" width="731" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="Uy98g2jsylhh" height="32" sequencemessagetype="1000">
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="215" showstereotype="1" y="477" text="5: PacketHandler::handle()" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="704" width="177" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="9GGu3jbty6IA" height="20"/>
</messagewidget>
<messagewidget linecolor="none" usesdiagramfillcolor="1" widgetbid="yULuE2bLGpGJ" textid="tu2itnBpGWkS" operation="ManagementClientManager::updateClientState()" linewidth="none" seqnum="6" usesdiagramusefillcolor="1" x="207" showstereotype="1" y="584" widgetaid="ifHBXFTW7ImQ" font="Sans Serif,10,-1,5,50,0,0,0,0,0" width="938" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="YpCUtSdSC35N" height="32" sequencemessagetype="1000">
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="212" showstereotype="1" y="564" text="6: ManagementClientManager::updateClientState()" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="704" width="335" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="tu2itnBpGWkS" height="20"/>
</messagewidget>
<messagewidget linecolor="none" usesdiagramfillcolor="1" widgetbid="hnCrqHEjCEP3" textid="VQiLfs3NfFCV" operation="GeonetPacket::serialize()" linewidth="none" seqnum="7" usesdiagramusefillcolor="1" x="207" showstereotype="1" y="660" widgetaid="ifHBXFTW7ImQ" font="Sans Serif,10,-1,5,50,0,0,0,0,0" width="1134" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="2YsG4ciZuTM3" height="32" sequencemessagetype="1000">
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="212" showstereotype="1" y="640" text="7: GeonetPacket::serialize()" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="704" width="183" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="VQiLfs3NfFCV" height="20"/>
</messagewidget>
<messagewidget linecolor="none" usesdiagramfillcolor="1" widgetbid="ifHBXFTW7ImQ" textid="9bm3564aVmt8" operation="this->handleSend()" linewidth="none" seqnum="8" usesdiagramusefillcolor="1" x="208" showstereotype="1" y="735" widgetaid="ifHBXFTW7ImQ" font="Sans Serif,10,-1,5,50,0,0,0,0,0" width="48" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="VRDffcgfBWvD" height="32" sequencemessagetype="1001">
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="213" showstereotype="1" y="715" text="8: this->handleSend()" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="705" width="149" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="9bm3564aVmt8" height="20"/>
</messagewidget>
</messages>
<associations/>
</diagram>
<diagram showopsig="1" linecolor="#ff0000" snapx="10" showattribassocs="1" snapy="10" linewidth="0" showattsig="1" isopen="1" showpackage="1" showpubliconly="1" showstereotype="1" name="Configuration" font="Sans Serif,10,-1,5,50,0,0,0,0,0" canvasheight="873" canvaswidth="1663" localid="tVvsNDVLWSAe" snapcsgrid="0" showgrid="0" showops="1" griddotcolor="#a0a0a4" backgroundcolor="#c3c3c3" usefillcolor="1" fillcolor="#ffff00" zoom="100" xmi.id="5ptjvCQTpmT9" documentation="" showscope="1" snapgrid="0" showatts="1" type="3">
<widgets>
<objectwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" usesdiagramusefillcolor="1" instancename="" x="449" decon="0" showstereotype="1" y="48" font="Sans Serif,10,-1,5,50,0,1,0,0,0" localid="UOYUlrQF68Qp" width="107" isinstance="0" multipleinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="c70hKf1xl80G" height="32" drawasactor="0"/>
<objectwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" usesdiagramusefillcolor="1" instancename="" x="125" decon="0" showstereotype="1" y="48" font="Sans Serif,10,-1,5,50,0,1,0,0,0" localid="mnRnLMzQBq74" width="64" isinstance="0" multipleinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="fp2dX8GbH8jT" height="32" drawasactor="0"/>
<objectwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" usesdiagramusefillcolor="1" instancename="" x="754" decon="0" showstereotype="1" y="48" font="Sans Serif,10,-1,5,50,0,1,0,0,0" localid="yDF83KA4qis5" width="212" isinstance="0" multipleinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="BKABBeColCV6" height="32" drawasactor="0"/>
<objectwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" usesdiagramusefillcolor="1" instancename="" x="1008" decon="0" showstereotype="1" y="48" font="Sans Serif,10,-1,5,50,0,1,0,0,0" localid="oVhMzgbBnLuX" width="218" isinstance="0" multipleinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="7zGxf72LspN9" height="32" drawasactor="0"/>
<objectwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" usesdiagramusefillcolor="1" instancename="" x="1275" decon="0" showstereotype="1" y="48" font="Sans Serif,10,-1,5,50,0,1,0,0,0" localid="tVvsNDVLWSAe" width="115" isinstance="0" multipleinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="Lsx9BreRIssY" height="32" drawasactor="0"/>
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="509" showstereotype="1" y="246" text="Reset the default values of configuration parameters with parsed values" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="700" width="465" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="3wHXOQ9AWfiK" height="20"/>
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="507" showstereotype="1" y="363" text="Insert the parsed communication profiles into the communication profile table" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="700" width="505" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="S3Q4KcqRT3pD" height="20"/>
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="509" showstereotype="1" y="486" text="Insert the configuration item definitions (parsed from configuration/ directory) into the ItsKeyManager's table" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="700" width="697" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="8mnhcEdd9vBV" height="20"/>
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="162" showstereotype="1" y="137" text="Call for Configuration class' functionality to parse the configuration files" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="700" width="459" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="JKfp0L8QPYSh" height="20"/>
</widgets>
<messages>
<messagewidget linecolor="none" usesdiagramfillcolor="1" widgetbid="UOYUlrQF68Qp" textid="KcMQikDUYcGr" operation="Configuration::parseConfigurationFiles()" linewidth="none" seqnum="1" usesdiagramusefillcolor="1" x="158" showstereotype="1" y="127" widgetaid="mnRnLMzQBq74" font="Sans Serif,10,-1,5,50,0,0,0,0,0" width="343" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="1VYoHzxjNTB8" height="8" sequencemessagetype="1001">
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="163" showstereotype="1" y="107" text="1: Configuration::parseConfigurationFiles()" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="704" width="275" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="KcMQikDUYcGr" height="20"/>
</messagewidget>
<messagewidget linecolor="none" usesdiagramfillcolor="1" widgetbid="yDF83KA4qis5" textid="E9jkkxZiAooC" operation="ManagementInformationBase::setValue()" linewidth="none" seqnum="2" usesdiagramusefillcolor="1" x="503" showstereotype="1" y="237" widgetaid="UOYUlrQF68Qp" font="Sans Serif,10,-1,5,50,0,0,0,0,0" width="356" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="gnp3GyAaaUyH" height="8" sequencemessagetype="1001">
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="508" showstereotype="1" y="217" text="2: ManagementInformationBase::setValue()" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="704" width="287" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="E9jkkxZiAooC" height="20"/>
</messagewidget>
<messagewidget linecolor="none" usesdiagramfillcolor="1" widgetbid="oVhMzgbBnLuX" textid="yKyr8LywofGl" operation="CommunicationProfileManager::insert()" linewidth="none" seqnum="3" usesdiagramusefillcolor="1" x="503" showstereotype="1" y="354" widgetaid="UOYUlrQF68Qp" font="Sans Serif,10,-1,5,50,0,0,0,0,0" width="613" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="ITERG2dNztKf" height="8" sequencemessagetype="1001">
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="508" showstereotype="1" y="334" text="3: CommunicationProfileManager::insert()" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="704" width="274" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="yKyr8LywofGl" height="20"/>
</messagewidget>
<messagewidget linecolor="none" usesdiagramfillcolor="1" widgetbid="tVvsNDVLWSAe" textid="7tDQj5wabsTy" operation="ItsKeyManager::addKey()" linewidth="none" seqnum="4" usesdiagramusefillcolor="1" x="503" showstereotype="1" y="473" widgetaid="UOYUlrQF68Qp" font="Sans Serif,10,-1,5,50,0,0,0,0,0" width="828" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="l8YaomL7cIEn" height="8" sequencemessagetype="1001">
<floatingtext linecolor="none" usesdiagramfillcolor="1" linewidth="none" usesdiagramusefillcolor="1" x="508" showstereotype="1" y="453" text="4: ItsKeyManager::addKey()" font="Sans Serif,10,-1,5,50,0,0,0,0,0" pretext="" role="704" width="181" isinstance="0" posttext="" usefillcolor="1" fillcolor="none" xmi.id="7tDQj5wabsTy" height="20"/>
</messagewidget>
</messages>
<associations/>
</diagram>
</diagrams>
</XMI.extension>
</UML:Model>
<UML:Model stereotype="folder" visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Use Case View" name="Use Case View">
<UML:Namespace.ownedElement/>
</UML:Model>
<UML:Model stereotype="folder" visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Component View" name="Component View">
<UML:Namespace.ownedElement/>
</UML:Model>
<UML:Model stereotype="folder" visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Deployment View" name="Deployment View">
<UML:Namespace.ownedElement/>
</UML:Model>
<UML:Model stereotype="folder" visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Entity Relationship Model" name="Entity Relationship Model">
<UML:Namespace.ownedElement/>
</UML:Model>
</UML:Namespace.ownedElement>
</UML:Model>
</XMI.content>
<XMI.extensions xmi.extender="umbrello">
<docsettings viewid="5ptjvCQTpmT9" uniqueid="JKfp0L8QPYSh" documentation=""/>
<listview>
<listitem open="1" type="800" id="Views">
<listitem open="1" type="801" id="Logical View">
<listitem open="0" type="807" id="FCaYFbnT8EWC" label="class diagram"/>
<listitem open="0" type="810" id="jvnwJj3ZfGMH" label="Client Handling"/>
<listitem open="0" type="810" id="5ptjvCQTpmT9" label="Configuration"/>
<listitem open="0" type="810" id="xMZiFQSpSRNL" label="Main Flow"/>
<listitem open="1" type="813" id="7zGxf72LspN9"/>
<listitem open="1" type="813" id="c70hKf1xl80G"/>
<listitem open="1" type="813" id="jNpyCZ6vSurm"/>
<listitem open="1" type="813" id="Lsx9BreRIssY"/>
<listitem open="1" type="813" id="YjQfDsrfoylV"/>
<listitem open="1" type="813" id="BKABBeColCV6"/>
<listitem open="1" type="813" id="RhUblYtxs362"/>
<listitem open="1" type="813" id="WJnn914hqHAk"/>
<listitem open="1" type="813" id="Dy2pjQabnnTg"/>
<listitem open="1" type="813" id="d875XUOAJRlo"/>
<listitem open="1" type="813" id="fp2dX8GbH8jT"/>
<listitem open="0" type="830" id="Datatypes">
<listitem open="1" type="829" id="SfVgAhhIpE08"/>
<listitem open="1" type="829" id="ig2vnF8xohCP"/>
<listitem open="1" type="829" id="HHk3wwTOZw5h"/>
<listitem open="1" type="829" id="uwR4XN2D248p"/>
<listitem open="1" type="829" id="A8WiKgyJCayx"/>
<listitem open="1" type="829" id="KxcMzj9E0tIu"/>
<listitem open="1" type="829" id="emzRyxXsuxxP"/>
<listitem open="1" type="829" id="4AuACdCEs753"/>
<listitem open="1" type="829" id="pjINfL4J64j4"/>
<listitem open="1" type="829" id="c2yavGSjzk6d"/>
<listitem open="1" type="829" id="1GvtDqIWntsk"/>
</listitem>
</listitem>
<listitem open="1" type="802" id="Use Case View"/>
<listitem open="1" type="821" id="Component View"/>
<listitem open="1" type="827" id="Deployment View"/>
<listitem open="1" type="836" id="Entity Relationship Model"/>
</listitem>
</listview>
<codegeneration>
<codegenerator language="C++"/>
</codegeneration>
</XMI.extensions>
</XMI>
Herein there are Lot 3 documents on messages exchanged among
SCOREF Management and Geonetworking modules, and with FACilities,
and big picture of these (and other) modules.
For the Doxygen documentation of the code please see
../Software/README.DOCUMENTATION.
- Baris Demiray <baris.demiray@eurecom.fr>
~ SCOREF Management Module Implementation (SCOREF-MGMT) ~
SCOREF-MGMT is a server application currently having the interfaces to
GN (GeoNetworking) and FAC (Facilities) modules. Further developments
such as OpenAirInterface integration are scheduled.
For MGMT-GN interface all the packets defined in "CM-GN Interface Definition
" (currently v4) are implemented and used,
100 LOCATION_UPDATE (supported/implemented but not used)
101 LOCATION_TABLE_REQ
102 LOCATION_TABLE_RES
300 CONFIGURATION_UPDATE_AVAILABLE
301 CONFIGURATION_REQ
302 CONFIGURATION_RES_CONT
303 CONFIGURATION_RES_BULK
304 COMM_PROF_REQ
305 COMM_PROF_REP
402 WIRELESS_STATE_REQ
403 WIRELESS_STATE_RES
404 NETWORK_STATE
For MGMT-FAC interface, following packets defined in "FAC-CM to MGMT Interface
description" (currently v4) are implemented and/or used,
110 LOCATION_UPDATE (supported/implemented but not used)
300 CONFIGURATION_UPDATE_AVAILABLE
311 CONFIGURATION_REQUEST
312 CONFIGURATION_RES_CONT
313 CONFIGURATION_RES_BULK
314 CONFIGURATION_NOTIFICATION
315 COMM_PROF_REQ
316 COMM_PROF_REP
317 COMM_PROF_SELECTION_REQ (supported/implemented but not used)
318 COMM_PROF_SELECTION_RES (supported/implemented but not used)
Please refer to following files for further information, directories given in parenthesis
belong to SCOREF SVN,
- (Software/SoftwareComponents/MGMT/CORE/Documentation/)CM-GN Interface Definition_v4.pdf
- (Software/SoftwareComponents/MGMT/CORE/Documentation/)FAC-CM Interface Definition.pdf
- (Software/SoftwareComponents/MGMT/CORE/Documentation/)ITS Station Management Core - Low Level Description.pdf
- (Software/SoftwareComponents/MGMT/CORE/Documentation/)SCOREF-MGMT_Configuration.pdf
- README.BUILD (not available in releases, check OpenAirInterface SVN)
- README.DOCUMENTATION (not available in releases check OpenAirInterface SVN)
- README.RUNNING
- Baris Demiray <baris.demiray@eurecom.fr>
SCOREF-MGMT has three build configurations which are all ready to be used
through the Makefile. These are,
1) Debug Configuration
Definition: Debug flags are on, optimisation is off, to be
run inside GDB, etc.
Command: Define make variable `BUILD_DEBUG' as
$ make BUILD_DEBUG=1
and relevant binary will be created in bin/
2) Dynamic Configuration
Definition: Optimisation flags are on, dynamic linkage, for
deployment (along with necessary libraries) or local use
Command: Define make variable `BUILD_DYNAMIC' as
$ make BUILD_DYNAMIC=1
and binary will be created in bin/
3) Static Configuration
Definition: Static linkage, to be sent to other people
and/or companies whom may not have necessary libraries
installed
Command: Define make variable `BUILD_STATIC' as
$ make BUILD_STATIC=1
and binary will be created in bin/
For Dynamic and Static configurations the make target `strip' may be used
to save space by removing symbols in the binary as follows,
$ make strip
For Eclipse development see README.BUILD.ECLIPSE file.
Please let me know in case of a build error sending relevant library
versions, platform, etc. information.
- Baris Demiray <baris.demiray@eurecom.fr>
For Eclipse development, import the directory as "Existing code as Makefile
Project" and from "C/C++ General"/Paths and Symbols define those include
paths listed in README.BUILD.ECLIPSE.PATHS (those may change according to
installed libraries, etc. use Index/Search for 'Unresolved Includes' menu
item to find out directories for your own system. A sample path list is given
in README.BUILD.ECLIPSE.PATHS.xml file.
Coding style is given in README.BUILD.ECLIPSE.CODING_STYLE.xml file and may
be imported through Eclipse's Project Properties/C/C++ General/Coding Style
configuration window.
- Baris Demiray <baris.demiray@eurecom.fr>
\ No newline at end of file
Please find .doxygen file in the root directory of the project.
Following command will generate source code documentation in ./doc/
directory.
$ doxygen SCOREF-MGMT.doxygen
More documentation, especially on control & data flow, will be added
over time. Class diagrams may be reached through Doxygen documentation.
- Baris Demiray <baris.demiray@eurecom.fr>
~ SCOREF Management Module Release ~
SCOREF-MGMT module releases involve statically-built binaries,
configuration files and relevant documentation. There is a script
in the root of Software/ (same with this document) directory named
make-release.sh and it can be used as follows.
Firstly, one has to ensure that there are no build errors as the
script doesn't check for these.
Then you can run the script giving the version name as follows,
demiray@sud:~/workspace/SCOREF-MGMT/Software$ ./make-release.sh v1.8.0
Building the version v1.8.0
Preparing the release...
Copying binary...
Copying configuration files...
Copying documentation...
Preparing the compressed archive...
Removing temporary directory...
Release is ready
The compressed archive of the release will be ready in the same directory,
demiray@sud:~/workspace/SCOREF-MGMT/Software$ ls -l SCOREF-MGMT-v1.8.0.tar.bz2
-rw-r--r-- 1 demiray umts 705692 Jan 11 16:34 SCOREF-MGMT-v1.8.0.tar.bz2
In this archive file there are the documents listed below,
demiray@sud:~/workspace/SCOREF-MGMT/Software$ tar jtf SCOREF-MGMT-v1.8.0.tar.bz2
SCOREF-MGMT-v1.8.0/
SCOREF-MGMT-v1.8.0/MGMT.conf
SCOREF-MGMT-v1.8.0/SCOREF-MGMT
SCOREF-MGMT-v1.8.0/configuration/
SCOREF-MGMT-v1.8.0/configuration/MGMT.IHM.conf
SCOREF-MGMT-v1.8.0/README.RUNNING
SCOREF-MGMT-v1.8.0/README
This file is ready to be put on SVN or to be sent to project partners.
- Baris Demiray <baris.demiray@eurecom.fr>
~ SCOREF Management Module Implementation ~
SCOREF-MGMT is a server application that handles messages sent from
GN (GeoNetworking) and FAC (Facilities) modules. Since SCOREF-MGMT is
the server it has to be started before these modules. SCOREF-MGMT
expects two command-line arguments having one optional, and they are
configuration file and optional log file name, respectively. If there
already is a log file with the same name it will be renamed (appending
date and time to its current name) and a new file will be created.
All the output is directed to this file and to standard output only for
debugging purposes. Further versions will write to the log file only.
[demiray@leynes test]$ ./SCOREF-MGMT MGMT.conf [LogFileName]
After SCOREF-MGMT is started it'll read given configuration file along
with those it finds under configuration/ directory (see Section 2.
Configuration File for FACilities in Software/SoftwareComponents/ \
MGMT/CORE/Documentation/SCOREF-MGMT_Configuration.pdf) and update local
configuration (such as UDP server port) and MIB (Management Information
Base) parameters, then it'll start listening for incoming connections on
UDP port defined by CONF_SERVER_PORT parameter in the configuration file.
Output of a sample run is given below:
demiray@sud:~/workspace/SCOREF-MGMT/Software/bin$ ./SCOREF-MGMT MGMT.conf
2012/11/23-16:06:24 INFO: Management Information Base has been created
2012/11/23-16:06:24 INFO: Following 3 file(s) have been found (only those with .conf extension will be parsed): .svn, MGMT.IHM.conf, MGMT.conf
2012/11/23-16:06:24WARNING: There is a file named '.svn' without .conf extension in given list
2012/11/23-16:06:24 INFO: Parsing configuration file 'configuration/MGMT.IHM.conf'
2012/11/23-16:06:24 INFO: Adding IHM integer parameter [name:MIB_MC002_GROUPNUM, id:49408, value:0]
2012/11/23-16:06:24 INFO: Adding IHM string parameter [name:MIB_MC002_GROUP1, id:49409, value:NULL]
...
At this point GN and FAC can be started. Please refer to relevant documentation
on how to do it and let me know about errors if you encounter any.
- Baris Demiray <baris.demiray@eurecom.fr>
Google C++ Testing Framework is used for SCOREF-MGMT, relevant
code and documentation can be found under test/ directory.
Unit tests can be compiled from root directory as well. To do so
issue following command,
$ make test
- Baris Demiray <baris.demiray@eurecom.fr>
0. Introduction
This directory involves the simulation of GN and FAC to test these interfaces.
1. Dependencies
Python packages should be installed.
2. Building
There is no build for this tool, it's plain Python which is interpreted rather
than to be built, see section 3. Running.
3. Commands
Following commands are supported.
3.1. DEFINE Command Family
3.1.1. DEFINE SERVER_ADDRESS <address>
Defines the destination address (i.e. the MGMT-CORE's address)
3.1.2. DEFINE SERVER_PORT <port>
Defines the destination port (i.e. the MGMT-CORE's port)
3.1.3. DEFINE CLIENT_PORT <port>
Defines the client's port (i.e. source port that is used to send the packets to MGMT-CORE from)
3.1.4. DEFINE CLIENT_TYPE <clientType>
Defines client type and can be 'GN', 'FAC', or 'LTE'
Packets sent will have relevant event types and sub-types based on this client type
3.2. SEND Command Family
3.2.1. SEND COMMUNICATION_PROFILE_REQUEST
Sends a COMMUNICATION_PROFILE_REQUEST packet to MGMT-CORE's given port
NOTICE: Client type has to be defined in advance for this command since event sub-type
changes from client to client for this packet
3.2.2. SEND NETWORK_STATE
Sends a NETWORK_STATE packet to MGMT-CORE's given port
3.2.3. SEND WIRELESS_STATE
Sends a WIRELESS_STATE_RESPONSE packet to MGMT-CORE's given port
NOTICE: Client type has to be defined in advance for this command since event sub-type
changes from client to client for this packet
3.2.4. SEND LOCATION_UPDATE
Sends a LOCATION_UPDATE to MGMT-CORE's given port
3.2.5. SEND CONFIGURATION_NOTIFICATION
Sends a CONFIGURATION_NOTIFICATION to MGMT-CORE's given port
3.2.6. SEND GET_CONFIGURATION
Sends a GET_CONFIGURATION to MGMT-CORE's given port
NOTICE: Client type has to be defined in advance for this command since event sub-type
changes from client to client for this packet
3.3. Util Command Family
3.2.1. WAIT Command
Makes the simulator wait for the specified amount of seconds
4. Running
Since this simulator has been written in Python you need to have the Python interpreter.
In order to run first scenario file, for example, issue the following command,
$ python main.py scenarios/01.sce
5. References
- Baris Demiray <baris.demiray@eurecom.fr>
0. Introduction
Google C++ Testing Framework is used for SCOREF-MGMT module's
test code.
1. Dependencies
On Ubuntu, libgtest-dev and libgtest0 packages are necessary
to link this code against Google's library. Refer to relevant
documentation on other systems.
On Ubuntu 12.04, though, you cannot find binary libraries and
you have to build them yourself. Do following in order to build
the binary (this directory is installed by libgtest-dev package)
$ cd /usr/src/gtest
# sudo cmake .
# sudo make
# sudo mv libg* /usr/lib/
2. Building
In this directory, running make is enough. Please let me know
if you encounter any compile-time or run-time errors.
$ make
Be informed that you may have to do 'make clean' before you
have an up-to-date binary since test_* files are designated as
header files and a change in them would not trigger a re-build
3. Running
In this directory, running the binary created by the compilation
process is enough. There are no command-line parameters currently.
$ ./TEST-SCOREF-MGMT
4. References
See Google documentation for further details regarding the test
framework,
http://code.google.com/p/googletest/
- Baris Demiray <baris.demiray@eurecom.fr>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?>
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="0.1691293236">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.1691293236" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="SCOREF-MGMT" buildProperties="" description="" id="0.1691293236" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
<folderInfo id="0.1691293236." name="/" resourcePath="">
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.1329950294" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
<targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.1329950294.880574658" name=""/>
<builder arguments="BUILD_DEBUG=1" command="make" id="org.eclipse.cdt.build.core.settings.default.builder.1499652288" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="-1" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.138388770" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.1825568501" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.565634738" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<listOptionValue builtIn="false" value="/usr/include"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/SCOREF-MGMT/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/SCOREF-MGMT/src/packets}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/SCOREF-MGMT/src/util}&quot;"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.4"/>
<listOptionValue builtIn="false" value="/usr/include/linux"/>
<listOptionValue builtIn="false" value="/usr/lib/gcc/i486-linux-gnu/4.4/include"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.4/i486-linux-gnu/"/>
<listOptionValue builtIn="false" value="/usr/include/boost"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.6/"/>
<listOptionValue builtIn="false" value="/usr/include/x86_64-linux-gnu/"/>
<listOptionValue builtIn="false" value="/usr/lib/gcc/x86_64-linux-gnu/4.6/include/"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.6/x86_64-linux-gnu/"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/IF.MGMT/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/IF.MGMT/src/packets}&quot;"/>
<listOptionValue builtIn="false" value="/usr/include/i386-linux-gnu/"/>
<listOptionValue builtIn="false" value="/usr/lib/gcc/i686-linux-gnu/4.6/include/"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.6/i686-linux-gnu/"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.6/ext/"/>
</option>
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1522413688" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
<tool id="org.eclipse.cdt.build.core.settings.holder.1069615162" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1813440655" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<listOptionValue builtIn="false" value="/usr/include"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/SCOREF-MGMT/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/SCOREF-MGMT/src/packets}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/SCOREF-MGMT/src/util}&quot;"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.4"/>
<listOptionValue builtIn="false" value="/usr/include/linux"/>
<listOptionValue builtIn="false" value="/usr/lib/gcc/i486-linux-gnu/4.4/include"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.4/i486-linux-gnu/"/>
<listOptionValue builtIn="false" value="/usr/include/boost"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.6/"/>
<listOptionValue builtIn="false" value="/usr/include/x86_64-linux-gnu/"/>
<listOptionValue builtIn="false" value="/usr/lib/gcc/x86_64-linux-gnu/4.6/include/"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.6/x86_64-linux-gnu/"/>
<listOptionValue builtIn="false" value="/usr/include/i386-linux-gnu/"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/IF.MGMT/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/IF.MGMT/src/packets}&quot;"/>
<listOptionValue builtIn="false" value="/usr/lib/gcc/i686-linux-gnu/4.6/include/"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.6/i686-linux-gnu/"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.6/ext/"/>
</option>
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.982448758" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
<tool id="org.eclipse.cdt.build.core.settings.holder.1854207819" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1738041884" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<listOptionValue builtIn="false" value="/usr/include"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/SCOREF-MGMT/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/SCOREF-MGMT/src/packets}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/SCOREF-MGMT/src/util}&quot;"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.4"/>
<listOptionValue builtIn="false" value="/usr/include/linux"/>
<listOptionValue builtIn="false" value="/usr/lib/gcc/i486-linux-gnu/4.4/include"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.4/i486-linux-gnu/"/>
<listOptionValue builtIn="false" value="/usr/include/boost"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.6/"/>
<listOptionValue builtIn="false" value="/usr/include/x86_64-linux-gnu/"/>
<listOptionValue builtIn="false" value="/usr/lib/gcc/x86_64-linux-gnu/4.6/include/"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.6/x86_64-linux-gnu/"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/IF.MGMT/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/IF.MGMT/src/packets}&quot;"/>
<listOptionValue builtIn="false" value="/usr/include/i386-linux-gnu/"/>
<listOptionValue builtIn="false" value="/usr/lib/gcc/i686-linux-gnu/4.6/include/"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.6/i686-linux-gnu/"/>
<listOptionValue builtIn="false" value="/usr/include/c++/4.6/ext/"/>
</option>
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1126765345" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="SCOREF-MGMT.null.1756841027" name="SCOREF-MGMT"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="0.1695373966">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.881925981">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1268694268">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.1691293236">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="refreshScope" versionNumber="1">
<resource resourceType="PROJECT" workspacePath="/SCOREF-MGMT"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
<target name="all" path="test" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
</buildTargets>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cproject>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Software</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value>BUILD_DEBUG=1 -j</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>false</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?>
<pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
</pydev_project>
eclipse.preferences.version=1
org.eclipse.cdt.codan.checkers.errnoreturn=Warning
org.eclipse.cdt.codan.checkers.errnoreturn.params={implicit\=>false}
org.eclipse.cdt.codan.checkers.errreturnvalue=Error
org.eclipse.cdt.codan.checkers.errreturnvalue.params={}
org.eclipse.cdt.codan.checkers.noreturn=Error
org.eclipse.cdt.codan.checkers.noreturn.params={implicit\=>false}
org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=Error
org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=Error
org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=Warning
org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={}
org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=Error
org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={}
org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=Warning
org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={no_break_comment\=>"no break",last_case_param\=>true,empty_case_param\=>false}
org.eclipse.cdt.codan.internal.checkers.CatchByReference=Warning
org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={unknown\=>false,exceptions\=>()}
org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=Error
org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=Error
org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=Error
org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
org.eclipse.cdt.codan.internal.checkers.InvalidArguments=Error
org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=Error
org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=Error
org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=Error
org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=Error
org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=Info
org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={pattern\=>"^[a-z]",macro\=>true,exceptions\=>()}
org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=Warning
org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={}
org.eclipse.cdt.codan.internal.checkers.OverloadProblem=Error
org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=Error
org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=Error
org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning
org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={}
org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=Warning
org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={}
org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=Warning
org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={macro\=>true,exceptions\=>()}
org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=Warning
org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={paramNot\=>false}
org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=Warning
org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={else\=>false,afterelse\=>false}
org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=Error
org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=Warning
org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={macro\=>true}
org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=Warning
org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={macro\=>true}
org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=Warning
org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={macro\=>true,exceptions\=>("@(\#)","$Id")}
org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=Error
org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
eclipse.preferences.version=1
org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.cdt.core.formatter.alignment_for_assignment=16
org.eclipse.cdt.core.formatter.alignment_for_base_clause_in_type_declaration=80
org.eclipse.cdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.cdt.core.formatter.alignment_for_compact_if=0
org.eclipse.cdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.cdt.core.formatter.alignment_for_conditional_expression_chain=18
org.eclipse.cdt.core.formatter.alignment_for_constructor_initializer_list=0
org.eclipse.cdt.core.formatter.alignment_for_declarator_list=16
org.eclipse.cdt.core.formatter.alignment_for_enumerator_list=48
org.eclipse.cdt.core.formatter.alignment_for_expression_list=0
org.eclipse.cdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.cdt.core.formatter.alignment_for_member_access=0
org.eclipse.cdt.core.formatter.alignment_for_overloaded_left_shift_chain=16
org.eclipse.cdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.cdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
org.eclipse.cdt.core.formatter.brace_position_for_array_initializer=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_block=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_namespace_declaration=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_type_declaration=end_of_line
org.eclipse.cdt.core.formatter.comment.min_distance_between_code_and_line_comment=1
org.eclipse.cdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
org.eclipse.cdt.core.formatter.compact_else_if=true
org.eclipse.cdt.core.formatter.continuation_indentation=2
org.eclipse.cdt.core.formatter.continuation_indentation_for_array_initializer=2
org.eclipse.cdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.cdt.core.formatter.indent_access_specifier_compare_to_type_header=true
org.eclipse.cdt.core.formatter.indent_access_specifier_extra_spaces=0
org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_access_specifier=true
org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_namespace_header=true
org.eclipse.cdt.core.formatter.indent_breaks_compare_to_cases=true
org.eclipse.cdt.core.formatter.indent_declaration_compare_to_template_header=false
org.eclipse.cdt.core.formatter.indent_empty_lines=false
org.eclipse.cdt.core.formatter.indent_statements_compare_to_block=true
org.eclipse.cdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_switch=true
org.eclipse.cdt.core.formatter.indentation.size=4
org.eclipse.cdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_after_template_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_colon_in_constructor_initializer_list=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_identifier_in_function_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_in_empty_block=insert
org.eclipse.cdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.cdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_arguments=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_parameters=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_brace_in_block=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_base_clause=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_case=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_base_types=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_declarator_list=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_expression_list=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_arguments=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_parameters=insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_exception_specification=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.cdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.cdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_exception_specification=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_base_clause=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_case=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_default=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_base_types=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_declarator_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_expression_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_block=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_namespace_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_exception_specification=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_for=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_if=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_while=insert
org.eclipse.cdt.core.formatter.insert_space_before_postfix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_brackets=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_exception_specification=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.join_wrapped_lines=true
org.eclipse.cdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.cdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.cdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.cdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.cdt.core.formatter.lineSplit=120
org.eclipse.cdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.cdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.cdt.core.formatter.tabulation.char=tab
org.eclipse.cdt.core.formatter.tabulation.size=4
org.eclipse.cdt.core.formatter.use_tabs_only_for_leading_indentations=false
eclipse.preferences.version=1
formatter_profile=_EURECOM
formatter_settings_version=1
v1.9.0 (released on February 5, 2013)
* SCOREF-MGMT.doxyfile has been updated
* Doxygen documentation as a single PDF file has been added
v1.8.1
* CONF_LOG_LEVEL parameter added to MGMT.conf file with levels from 0 to 4
* ManagementServer::send() method added to add a boost::lock_guard easier
* Bugfix Logger::log() was not checking against log levels before printing out given message
v1.8.0 (released on January 23, 2013)
* No changes on anything but version number
v1.7.5
* Bugfix LOCATION_UPDATE scenario should be for FAC, not for GN
* Location updates are now not generated but `relayed' as we receive it from FAC-CM
* A new task PacketHandlerResult::RELAY_TO_GN added
* Now Communication Profile 3 is not offered to anybody (CP1 took over)
v1.7.4
* Communication profile selection document (by Michelle) has been added under Documents/
* CONF_IPV6_ENABLED configuration file parameter has been added
* CommunicationProfileManager::selectProfile() method is now implemented
v1.7.3
* ../Documentation/SCOREF\ Integration\ Test\ Specification added
* Scenario for CONFIGURATION_NOTIFICATION is now for FAC as it should be
v1.7.2
* README.RELEASE file added
* make-release.sh now removes temporary files
v1.7.1
* make-release.sh file added
v1.7.0 (released on January 8, 2013)
* Version 7 of the document CM-GN to MGMT-CORE Interface Definition added
* Version 7 of the document FAC-CM to MGMT-CORE Interface Definition added
* Sequence number added into GeonetCommunicationProfileRequestPacket and
GeonetCommunicationProfileResponsePacket as requested by INRIA
* Simulator now sends COMM_PROF_SEL_REQ with new sequence number feature
* Bugfix A very stupid bitwise error fixed in GeonetPacket
v1.6.2
* Sequence number added into FacCommunicationProfileSelectionRequestPacket and
FacCommunicationProfileSelectionResponsePacket
* Bugfix Faulty Event Type/Subtype values are corrected for FAC packets
* Scenario files of the simulator have been given 'human-readable' names
v1.6.1
* LteWirelessStateResponse updated and InterfaceID & Status fields added
* Simulator updated accordingly
* Initial version of LTE-CM to MGMT Interface Description added to ../Documentation
v1.6.0 (released on 21 Dec 2012)
* Release version
v1.5.4
* New scenarios added for the simulator
* Wireless Status packet sent by the simulator updated according to the new LTE Wireless Status
* LteWirelessStateResponseEventPacket class added for the new LTE Wireless Status
* Bugfix Mutex control added for Logger class to prevent log messages from intermingling
* Network Status message now has a `timestamp' field as HITACHI asked
v1.5.3
* LTE client type and event type/subtype for Wireless State Response added
* Bugfix Wireless interface ID is now displayed correctly
* Bugfix Update error for already-present interface IDs in MIB::updateWirelessState() is fixed
* Simulator is now able to send unsolicited WIRELESS_STATE_RESPONSE
v1.5.2
* Simulator updated to make it send custom messages based on the client type
(for CONF_REQ and COMM_PROF_REQ packages)
* START and END commands removed from the command set of the simulator
* ../Documentation/FAC-CM... file's 5th version added
v1.5.1
* ../Design/UML/ directory added with sequence diagrams
* Another state control mechanism added for Wireless State Requests
* Network State information (received from GN) is now printed
* ../Documentation/SCOREF-Progress updated to 1.3
v1.5.0 (released on 30 Nov 2012)
* Bugfix Error with exception handling of boost ioservice handlers fixed
* Bugfix Parsing error with Extended and Valid fields of MessageHeader fixed
v1.4.1
* ../Documentation/SCOREF-MGMT\ Progress.{doc|pdf} file updated to v1.2
v1.4.0 (released on 28 Nov 2012)
* FAC-CM and MGMT-CORE interface documents' older versions have been added
* GN and MGMT-CORE interface documents' older versions have been added
* TODO.cppcheck file updated after fixes done to remove warnings
* Intelligent code's place (for profile selection) clarified
* ITS key data type handling now handles string and float types correctly
* Bugfix ManagementServer exceptions are now handled
* Bugfix FAC messages are now recognized to mark a client as 'ONLINE'
* Util::getDateAndTime() is now shorter and smarter
v1.3.5
* Client state CONNECTED removed, now there are ONLINE and OFFLINE only
* test/simulation/README update with scenario file information
* ../Documentation/SCOREF-MGMT Progress.pdf file added
v1.3.4
* These documentation files have been updated: README.RUNNING, README.HEADER_TEMPLATE, README.BUILD, README
v1.3.3
* CONF_LOCATION_UPDATE_INTERVAL removed from the configuration file, functionality is kept, though
* Bugfix Incoming buffer size is now validated in GeonetWirelessStateRequestEventPacket::serialize()
* InquiryThread's interface has been changed a little, now it receives ManagementServer functionality
as a IManagementPacketSender interface not to expose everything to the thread
v1.3.2
* ItsKeyManager error code has been changed to 0xDEAD from 0xEEEE
* GN addresses are now printed the same way HITACHI does
* ManagementClient does not have anything to do with neither UdpSocket nor
boost::thread anymore, they're handled by ManagementServer now
* InquiryThread doesn't play with UdpSocket anymore either, it merely notifies
ManagementServer to do what is necessary
* Bugfix Size check in FacConfigurationNotificationPacket::parse() doesn't
discard valid packets anymore
v1.3.1
* CONFIGURATION_NOTIFICATION packet of FACilities added to simulator
* A new scenario file 04.sce has been added for CONFIGURATION_NOTIFICATION
* CONFIGURATION_NOTIFICATION packet is now handled correctly and GN is being notified by a
CONFIGURATION_AVAILABLE packet
* ManagementClientManager::updateManagementClientState() doesn't handle packets anymore
and LOCATION_TABLE_REQUEST is now sent by ManagementServer upon the connection of a GN client
* Bugfix ConfigurationAvailable now resizes the serialized buffer correctly
v1.3.0 (released on 19 Nov 2012)
* Now simulator can send LOCATION_UPDATE
* Bugfix GeonetPacket::serialise() now validates incoming buffer size
* ManagementServer class introduced and caused intensive changes in main.cpp
* Client type is now recognized better according to the event type/subtypes
v1.2.2
* test/simulation/README updated
* test/simulation/packet.py's communication profile request code updated with Andrea's sample
* Bugfix Communication Profile filtering is now handled correctly
v1.2.1
* Simulator can now send COMMUNICATION_PROFILE_REQUEST
* A new scenerio file named 02.sce added for Communication Profile tests
* Bugfix Rx buffer resize error, now it's set to RX_BUFFER_SIZE correctly
* `extended', `valid', `version', and `priority' fields of packet header are now parsed
* Bugfix Local variable reference error mgmt_comm_prof_manager.cpp
* Bugfix Communication profile pass-by-value in mgmt_comm_prof_manager.cpp
* Bugfix Location table response is now parsed correctly
* Incoming Location Update is now parsed and MIB is updated
* Incoming filter sent thru COMM_PROF_REQ is now used to filter Communication Profiles
* -v and --version parameters are now recognized
v1.2.0 (released on 5 Nov 2012)
* UdpServer class renamed as UdpSocket
* ManagementClient class has its own socket now (currently not in use, though)
* README.RUNNING updated with FACilities configuration files directory
v1.1.13
* Bugfix erase/remove idiom error is fixed in mgmt_configuration.cpp
* PacketHandlerResult class is created to carry the result and the response packet if there's one
* PacketHandler does not have access to the socket anymore
v1.1.12
* Bugfix Invalid iterator in Communication Profile Response code
* PacketHandler now returns relevant task
* Bugfix Erase-remove idiom fixed in Configuration code
* Initial code for CONFIGURATION UPDATE AVAILABLE sending
v1.1.11
* Cppcheck corrections made
v1.1.10
* Bugfix for sample configuration lines given inside comments in a .conf file
* Bugfix Simulator now binds on a port to keep source port constant
* DEFINE_CLIENT_PORT command added for scenario files
* Bugfix Address copying error causing creation of bogus client objects in ManagementClient fixed
* Bugfix State comparison inside ManagementClient::setState() fixed
* Bugfix Stupid increment operator usage has been fixed for ManagementClientManager::updateMan...
v1.1.9
* Documentation/SCOREF-MGMT_Configuration.{odt|pdf} files have been updated according
to the new scheme introduced by FACilities configuration files
* bin/IF.MGMT.conf file renamed as bin/MGMT.conf
* New header and instructions have been added into bin/configuration/MGMT.IHM.conf file
* README.RUNNING and bin/valgrind.sh files updated according to configuration file name change
* Now Configuration class is able to parse any .conf extensioned file under some certain directory
* Exceptions thrown by unit test methods handled
* Unit tests written for new Util methods
* EURECOM's address has been updated in every file's header
* Bugfix for Exception::printStackTrace() code causing SIGSEGV
v1.1.8
* test/ directory reorganised and simulation/ and unittest/ directories have been added
* A basic simulator reading files under simulation/scenarios and doing what's written
has been added
v1.1.7
* TODO.cppcheck file added for static analysis (currently empty since all the notifications
have been fixed)
* Bugfix:cppcheck: Unnecessary copy creation for exceptions
* Bugfix:cppcheck: Inefficient vector size check
* Bugfix:cppcheck: Uninitialised members
* Bugfix:cppcheck: Redundant wide scopes of some variables have been reduced
* New include path has been added for sys/types.h and README.BUILD.ECLIPSE.PATHS.xml updated
v1.1.6
* Logger::LOG_OUTPUT_CHANNEL enumeration added to control log output channel as
FILE, STDOUT, BOTH, or NONE
* Unit tests for all Configuration class methods have been added
* Number of all the ITS keys is now calculated correctly in ItsKeyManager::getNumberOfKeys()
* Configuration::parseConfigurationFiles() now verifies if there's any configuration file to parse
* Configuration::setServerPort() now checks incoming port number against the real max value
* Bugfix in Util::unsetBit()
* Bugfix in Util::encodeBits()
* Bugfix in Util::trim()
* test/test_configuration_util.hpp added for utility methods of Configuration class' test
* test/data directory and test configuration files have been added
* OO code in test/main.cpp moved to test/main.hpp
* test/README updated according to new installation of Google C++ Testing Framework on Ubuntu 12.04
v1.1.5
* GeonetPacketFactory class has been renamed as ManagementPacketFactory
* Google C++ Testing Framework has been utilised
- test/ directory and test codes added
- README.TEST has been added
* Util::resetBuffer()'s and copyBuffer()'s parameters has been changed to
unsigned char* since size parameter is given in "bytes" and this could lead
to errors if resetBuffer() is given an array with elements greater than byte in size
* In Util class, boundary check errors have been fixed in encode8byteInteger(),
encode4byteInteger(), and encode2byteInteger() methods
* Redundant comment block has been removed from mgmt_util.hpp
* Software/Makefile has been modified after adding test/main.cpp to skip test
code's main() method
v1.1.4
* Communication Profile ID field of Communication Profile Selection Response packet
has been resized to 4 bytes and a 1-byte reserved field has been added to keep the alignment
* FacCommunicationProfileSelectionResponsePacket::serialize() updated accordingly
v1.1.3
* FacConfigurationNotification class has been added to get configuration updates from
FACilities thru UDP socket
* ItsKeyValue become a struct to support float and string values
* ItsKeyManager now can handle float and string values
* Configuration class now can parse float and string values (given with quotes)
* mgmt_types.hpp file's symbolic constants have been fixed
* VariableSizeConfigurationItem is introduced to support string-type configuration values
v1.1.2
* Configuration class now can handle more than one configuration file
* IF.IHM.conf file added for PCVE IHM parameters
* <parameterName|parameterId> format parsing has been added for IHM parameters
* ItsKey can also hold string values of configuration items
* Configuration file name is hardcoded now, the only parameter there is optional log file name
v1.1.1
* Util::printHexRepresentation() off-by-one index error fixed
* FAC message type & subtypes have been added
* Now both BTP_A and BTP_B flags are set upon finding BTP in a communication profile definition
* mgmt_gn_datatypes.h file has been renamed as mgmt_types.h
* Type property added for management clients (now they also may be Facilities client)
* FacCommunicationProfileSelectionRequestPacket and FacCommunicationProfileSelectionResponsePacket
packets have been added
v1.1.0 (released on 13 Aug 2012)
* README.* files have been updated and version elevated to 1.1.0
v1.0.23
* OpenDocument format of configuration manual has been added
* Location Update (0x100) packet and a corresponding configuration parameter has been added
Now both Wireless State Update and Location Update can be sent on different time intervals
v1.0.22
* Eclipse project file updated to use multiple g++ instances to build faster
* Communication profile parsing error fixed (NULL at the end is now trimmed to match std::map key)
* Communication profile off-by-one error fixed (profile item indexes were calculated as +1)
* Location Table Request is now sent by ManagementClient in its constructor
* State changes has been revised to make one more state valid
* Incoming packets are now passed to ManagementClientManager to update its state
* Util::getBinaryRepresentation() and Util::trim() methods added
* Makefile now compiles each file separately, which makes build faster for re-compilation
* Makefile parameters has been updated and README.BUILD file has been updated accordingly
* Makefile.sources file is no more used, files are found by shell command in Makefile
v1.0.21
* Location Table Request is now handled by ManagementClient
* State changes are now verified in ManagementClient
v1.0.20
* ManagementClient objects are now managed by ManagementClientManager
* ManagementClient now has InquiryThread and ManagementClientState
* Packet handler now sends replies itself
* InquiryThread is now aware of UDP connection
* Util::printHexRepresentation() is now in line with log format
* TRACE level has been added as a log level
v1.0.19
* Bugfix for string + integer concatenation using boost::lexical_cast
* util/Exception class has been added and utilised for stack trace printing
* Min/max values are defined for ITS keys and checked using try/catch with new Exception class
* c2x_update_gn_address_event structure has been removed since it's no more used
* More doxygen comments have been added and more debug messages have been removed
v1.0.18
* InquiryThread class has been added for sending repetitive Wireless State Request
* Doxygen file has been renamed to SCOREF-MGMT.doxygen
* README.BUILD.ECLIPSE.PATHS.xml file has been updated with new versions of used libraries
* Standard I/O is no more used anywhere, instead Logger class has been utilised
* Command-line parameter parser has been added but #ifdef'ed out to wait version 1.50.0 of Boost
v1.0.17
* SCOREF-MGMT_Configuration.pdf file has been added under Documentation/
v1.0.16
* Openair source file template has been prepended to every source file
* README.HEADER_TEMPLATE file has been added
* 'CM-GN Interface Definition_v4.pdf' and
'ITS Station Management Core - Low Level Description.pdf' files has been
added under Documentation/ and Documentation/README file has been updated
* Doxygen documentation has been added for mgmt_its_key_manager.hpp file
v1.0.15
* README.BUILD.ECLIPSE.PATHS.xml file updated with Boost path
* Communication profiles defined in L221-4.1.3 are entered into conf. file
* Communication profiles are now parsed from configuration file
* UdpServer and Util classes are moved into util/ directory
* A primitive Log class has been added
v1.0.14
* Wireless State response/request is now separate (not tested)
v1.0.13
* Compilation error fixed in main.cpp
* Doxygen comments for UdpServer class has been added
v1.0.12
* Forgotten UDP server class committed and version numbers are corrected
v1.0.11
* Missing Doxygen tags added
v1.0.10
* ManagementClient added and client state is now kept per-client basis
v1.0.9
* Communication profile request and response packets added
* README.BUILD.ECLISE and README.BUILD.ECLIPSE.CODING_STYLE.xml
files added for Eclipse development instructions
* GeonetMessageHandler now keeps client state and sends bulk configuration
if corresponding request has been lost
v1.0.8
* ITS parameters are now classified and processed accordingly
* ItsKeyManager class added to split ITS configuration code
* Linkage parameters are re-ordered in Makefile
v1.0.7
* UdpServer.{cpp|hpp} updated and main() code clarified
v1.0.6
* Parameter parsing error fixed
* FAC_ parameters added into configuration file
* Wireless State response parser added (not tested)
* README.BUILD.ECLIPSE file added
v1.0.5
* Makefile (and Makefile.sources) file added to remove development ties with
Eclipse and README.BUILD file updated accordingly
v1.0.4 (released on 23 May 2012)
* ITS key values are updated and classified as FAC and NET
* Wireless state and network state packets added
* Location table is now asked and response is parsed
v1.0.3
* Doxygen file added (IF.MGMT.doxyfile)
v1.0.2
* Configuration file added
* Configuration file is no more hard-coded but read as a command-line parameter
* UDP server port number is no more hard-coded but read from configuration file
* All 22 parameters are encoded into Set Configuration bulk message
* Comment lines written for most header files/classes/methods
* Faulty `key count' field encode fixed
v1.0.1
* `Get Configuration' message is parsed and replied with a "partial"
bulk Set Configuration message
v1.0.0
* Initial version
* Mostly structural code, almost nothing functional
- Baris Demiray <baris.demiray@eurecom.fr>
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
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 <http://www.gnu.org/licenses/>.
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:
<program> Copyright (C) <year> <name of author>
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
<http://www.gnu.org/licenses/>.
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
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
CPP=g++
RM=rm
ECHO=echo
STRIP=strip
CPP_FILES:=$(shell find ./src/ -iname '*.cpp')
OBJ_FILES=$(CPP_FILES:.cpp=.o)
EXE_FILE=bin/SCOREF-MGMT
CPPFLAGS=-Wall
LDFLAGS=-lboost_system -lboost_filesystem -lboost_thread -lboost_program_options
INCLUDE=-Isrc/ -Isrc/packets/ -Isrc/util/
TEST_DIR=test/
TEST_EXE=TEST-SCOREF-MGMT
OPT_FLAGS=-O3
DEBUG_FLAGS=-O0 -g3
STATIC_FLAGS=-static
# Default is dynamic build
BUILD_FLAGS=$(OPT_FLAGS)
ifdef BUILD_DEBUG
BUILD_FLAGS=$(DEBUG_FLAGS)
endif
ifdef BUILD_STATIC
BUILD_FLAGS=$(STATIC_FLAGS)
LDFLAGS=-static -lboost_system -lboost_filesystem -lboost_thread -pthread
endif
ifdef BUILD_DYNAMIC
BUILD_FLAGS=$(OPT_FLAGS)
endif
all: $(CPP_FILES) binary
binary: $(CPP_FILES) $(OBJ_FILES)
$(CPP) $(OBJ_FILES) -o $(EXE_FILE) $(LDFLAGS)
strip:
$(STRIP) $(EXE_FILE) &> /dev/null
test: binary
echo "Building test code..."
cd $(TEST_DIR)
make -f Makefile
cd -
echo "Unit tests are ready to be run under test/ directory"
clean:
$(RM) -fv $(EXE_FILE)
$(RM) -fv $(TEST_DIR)/$(TEST_EXE)
find . -iname "*.o" -exec rm -fv {} \;
.cpp.o:
$(CPP) -c $(BUILD_FLAGS) $(CPPFLAGS) $< -o $@
~ SCOREF Management Module Implementation (SCOREF-MGMT) ~
SCOREF-MGMT is a server application currently having the interfaces to
GN (GeoNetworking) and FAC (Facilities) modules. Further developments
such as OpenAirInterface integration are scheduled.
For MGMT-GN interface all the packets defined in "CM-GN Interface Definition
" (currently v4) are implemented and used,
100 LOCATION_UPDATE (supported/implemented but not used)
101 LOCATION_TABLE_REQ
102 LOCATION_TABLE_RES
300 CONFIGURATION_UPDATE_AVAILABLE
301 CONFIGURATION_REQ
302 CONFIGURATION_RES_CONT
303 CONFIGURATION_RES_BULK
304 COMM_PROF_REQ
305 COMM_PROF_REP
402 WIRELESS_STATE_REQ
403 WIRELESS_STATE_RES
404 NETWORK_STATE
For MGMT-FAC interface, following packets defined in "FAC-CM to MGMT Interface
description" (currently v4) are implemented and/or used,
110 LOCATION_UPDATE (supported/implemented but not used)
300 CONFIGURATION_UPDATE_AVAILABLE
311 CONFIGURATION_REQUEST
312 CONFIGURATION_RES_CONT
313 CONFIGURATION_RES_BULK
314 CONFIGURATION_NOTIFICATION
315 COMM_PROF_REQ
316 COMM_PROF_REP
317 COMM_PROF_SELECTION_REQ (supported/implemented but not used)
318 COMM_PROF_SELECTION_RES (supported/implemented but not used)
Please refer to following files for further information, directories given in parenthesis
belong to SCOREF SVN,
- (Software/SoftwareComponents/MGMT/CORE/Documentation/)CM-GN Interface Definition_v4.pdf
- (Software/SoftwareComponents/MGMT/CORE/Documentation/)FAC-CM Interface Definition.pdf
- (Software/SoftwareComponents/MGMT/CORE/Documentation/)ITS Station Management Core - Low Level Description.pdf
- (Software/SoftwareComponents/MGMT/CORE/Documentation/)SCOREF-MGMT_Configuration.pdf
- README.BUILD (not available in releases, check OpenAirInterface SVN)
- README.DOCUMENTATION (not available in releases check OpenAirInterface SVN)
- README.RUNNING
- Baris Demiray <baris.demiray@eurecom.fr>
SCOREF-MGMT has three build configurations which are all ready to be used
through the Makefile. These are,
1) Debug Configuration
Definition: Debug flags are on, optimisation is off, to be
run inside GDB, etc.
Command: Define make variable `BUILD_DEBUG' as
$ make BUILD_DEBUG=1
and relevant binary will be created in bin/
2) Dynamic Configuration
Definition: Optimisation flags are on, dynamic linkage, for
deployment (along with necessary libraries) or local use
Command: Define make variable `BUILD_DYNAMIC' as
$ make BUILD_DYNAMIC=1
and binary will be created in bin/
3) Static Configuration
Definition: Static linkage, to be sent to other people
and/or companies whom may not have necessary libraries
installed
Command: Define make variable `BUILD_STATIC' as
$ make BUILD_STATIC=1
and binary will be created in bin/
For Dynamic and Static configurations the make target `strip' may be used
to save space by removing symbols in the binary as follows,
$ make strip
For Eclipse development see README.BUILD.ECLIPSE file.
Please let me know in case of a build error sending relevant library
versions, platform, etc. information.
- Baris Demiray <baris.demiray@eurecom.fr>
For Eclipse development, import the directory as "Existing code as Makefile
Project" and from "C/C++ General"/Paths and Symbols define those include
paths listed in README.BUILD.ECLIPSE.PATHS (those may change according to
installed libraries, etc. use Index/Search for 'Unresolved Includes' menu
item to find out directories for your own system. A sample path list is given
in README.BUILD.ECLIPSE.PATHS.xml file.
Coding style is given in README.BUILD.ECLIPSE.CODING_STYLE.xml file and may
be imported through Eclipse's Project Properties/C/C++ General/Coding Style
configuration window.
- Baris Demiray <baris.demiray@eurecom.fr>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="1">
<profile kind="CodeFormatterProfile" name="EURECOM" version="1">
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.lineSplit" value="120"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_base_types" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
<setting id="org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_exception_specification" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_base_types" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_access_specifier" value="true"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_exception_specification" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_arguments" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_declarator_list" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.tabulation.size" value="4"/>
<setting id="org.eclipse.cdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.alignment_for_enumerator_list" value="48"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.alignment_for_declarator_list" value="16"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.indent_empty_lines" value="false"/>
<setting id="org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
<setting id="org.eclipse.cdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_arguments" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_colon_in_base_clause" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_declarator_list" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_between_empty_brackets" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
<setting id="org.eclipse.cdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.brace_position_for_block" value="end_of_line"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_arguments" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_expression_list" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_parameters" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.continuation_indentation" value="2"/>
<setting id="org.eclipse.cdt.core.formatter.alignment_for_expression_list" value="0"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_parameters" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.alignment_for_conditional_expression" value="80"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.indent_access_specifier_compare_to_type_header" value="true"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_namespace_header" value="true"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.alignment_for_compact_if" value="0"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_parameters" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_expression_list" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_exception_specification" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_new_line_before_identifier_in_function_declaration" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.alignment_for_base_clause_in_type_declaration" value="80"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_exception_specification" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.indent_declaration_compare_to_template_header" value="false"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.indent_statements_compare_to_body" value="true"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.indent_statements_compare_to_block" value="true"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_arguments" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_parameters" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.tabulation.char" value="tab"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_parameters" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
<setting id="org.eclipse.cdt.core.formatter.compact_else_if" value="true"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_colon_in_base_clause" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_new_line_after_template_declaration" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
<setting id="org.eclipse.cdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
<setting id="org.eclipse.cdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.indentation.size" value="4"/>
<setting id="org.eclipse.cdt.core.formatter.brace_position_for_namespace_declaration" value="end_of_line"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_arguments" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_namespace_declaration" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_parameters" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_arguments" value="do not insert"/>
</profile>
</profiles>
<?xml version="1.0" encoding="UTF-8"?>
<cdtprojectproperties>
<section name="org.eclipse.cdt.internal.ui.wizards.settingswizards.IncludePaths">
<language name="holder for library settings">
</language>
<language name="Assembly">
<includepath>/usr/include</includepath>
<includepath workspace_path="true">/SCOREF-MGMT/src</includepath>
<includepath workspace_path="true">/SCOREF-MGMT/src/packets</includepath>
<includepath workspace_path="true">/SCOREF-MGMT/src/util</includepath>
<includepath>/usr/include/c++/4.4</includepath>
<includepath>/usr/include/linux</includepath>
<includepath>/usr/lib/gcc/i486-linux-gnu/4.4/include</includepath>
<includepath>/usr/include/c++/4.4/i486-linux-gnu/</includepath>
<includepath>/usr/include/boost</includepath>
<includepath>/usr/include/c++/4.6/</includepath>
<includepath>/usr/include/x86_64-linux-gnu/</includepath>
<includepath>/usr/lib/gcc/x86_64-linux-gnu/4.6/include/</includepath>
<includepath>/usr/include/c++/4.6/x86_64-linux-gnu/</includepath>
<includepath>/usr/include/i386-linux-gnu/</includepath>
</language>
<language name="GNU C++">
<includepath>/usr/include</includepath>
<includepath workspace_path="true">/SCOREF-MGMT/src</includepath>
<includepath workspace_path="true">/SCOREF-MGMT/src/packets</includepath>
<includepath workspace_path="true">/SCOREF-MGMT/src/util</includepath>
<includepath>/usr/include/c++/4.4</includepath>
<includepath>/usr/include/linux</includepath>
<includepath>/usr/lib/gcc/i486-linux-gnu/4.4/include</includepath>
<includepath>/usr/include/c++/4.4/i486-linux-gnu/</includepath>
<includepath>/usr/include/boost</includepath>
<includepath>/usr/include/c++/4.6/</includepath>
<includepath>/usr/include/x86_64-linux-gnu/</includepath>
<includepath>/usr/lib/gcc/x86_64-linux-gnu/4.6/include/</includepath>
<includepath>/usr/include/c++/4.6/x86_64-linux-gnu/</includepath>
<includepath>/usr/include/i386-linux-gnu/</includepath>
</language>
<language name="GNU C">
<includepath>/usr/include</includepath>
<includepath workspace_path="true">/SCOREF-MGMT/src</includepath>
<includepath workspace_path="true">/SCOREF-MGMT/src/packets</includepath>
<includepath workspace_path="true">/SCOREF-MGMT/src/util</includepath>
<includepath>/usr/include/c++/4.4</includepath>
<includepath>/usr/include/linux</includepath>
<includepath>/usr/lib/gcc/i486-linux-gnu/4.4/include</includepath>
<includepath>/usr/include/c++/4.4/i486-linux-gnu/</includepath>
<includepath>/usr/include/boost</includepath>
<includepath>/usr/include/c++/4.6/</includepath>
<includepath>/usr/include/x86_64-linux-gnu/</includepath>
<includepath>/usr/lib/gcc/x86_64-linux-gnu/4.6/include/</includepath>
<includepath>/usr/include/c++/4.6/x86_64-linux-gnu/</includepath>
<includepath>/usr/include/i386-linux-gnu/</includepath>
</language>
</section>
<section name="org.eclipse.cdt.internal.ui.wizards.settingswizards.Macros">
<language name="holder for library settings">
</language>
<language name="Assembly">
</language>
<language name="GNU C++">
</language>
<language name="GNU C">
</language>
</section>
</cdtprojectproperties>
Please find .doxygen file in the root directory of the project.
Following command will generate source code documentation in ./doc/
directory.
$ doxygen SCOREF-MGMT.doxygen
More documentation, especially on control & data flow, will be added
over time. Class diagrams may be reached through Doxygen documentation.
- Baris Demiray <baris.demiray@eurecom.fr>
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file <filename>.{hpp|cpp}
* \brief <brief>
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
~ SCOREF Management Module Release ~
SCOREF-MGMT module releases involve statically-built binaries,
configuration files and relevant documentation. There is a script
in the root of Software/ (same with this document) directory named
make-release.sh and it can be used as follows.
Firstly, one has to ensure that there are no build errors as the
script doesn't check for these.
Then you can run the script giving the version name as follows,
demiray@sud:~/workspace/SCOREF-MGMT/Software$ ./make-release.sh v1.8.0
Building the version v1.8.0
Preparing the release...
Copying binary...
Copying configuration files...
Copying documentation...
Preparing the compressed archive...
Removing temporary directory...
Release is ready
The compressed archive of the release will be ready in the same directory,
demiray@sud:~/workspace/SCOREF-MGMT/Software$ ls -l SCOREF-MGMT-v1.8.0.tar.bz2
-rw-r--r-- 1 demiray umts 705692 Jan 11 16:34 SCOREF-MGMT-v1.8.0.tar.bz2
In this archive file there are the documents listed below,
demiray@sud:~/workspace/SCOREF-MGMT/Software$ tar jtf SCOREF-MGMT-v1.8.0.tar.bz2
SCOREF-MGMT-v1.8.0/
SCOREF-MGMT-v1.8.0/MGMT.conf
SCOREF-MGMT-v1.8.0/SCOREF-MGMT
SCOREF-MGMT-v1.8.0/configuration/
SCOREF-MGMT-v1.8.0/configuration/MGMT.IHM.conf
SCOREF-MGMT-v1.8.0/README.RUNNING
SCOREF-MGMT-v1.8.0/README
This file is ready to be put on SVN or to be sent to project partners.
- Baris Demiray <baris.demiray@eurecom.fr>
~ SCOREF Management Module Implementation ~
SCOREF-MGMT is a server application that handles messages sent from
GN (GeoNetworking) and FAC (Facilities) modules. Since SCOREF-MGMT is
the server it has to be started before these modules. SCOREF-MGMT
expects two command-line arguments having one optional, and they are
configuration file and optional log file name, respectively. If there
already is a log file with the same name it will be renamed (appending
date and time to its current name) and a new file will be created.
All the output is directed to this file and to standard output only for
debugging purposes. Further versions will write to the log file only.
[demiray@leynes test]$ ./SCOREF-MGMT MGMT.conf [LogFileName]
After SCOREF-MGMT is started it'll read given configuration file along
with those it finds under configuration/ directory (see Section 2.
Configuration File for FACilities in Software/SoftwareComponents/ \
MGMT/CORE/Documentation/SCOREF-MGMT_Configuration.pdf) and update local
configuration (such as UDP server port) and MIB (Management Information
Base) parameters, then it'll start listening for incoming connections on
UDP port defined by CONF_SERVER_PORT parameter in the configuration file.
Output of a sample run is given below:
demiray@sud:~/workspace/SCOREF-MGMT/Software/bin$ ./SCOREF-MGMT MGMT.conf
2012/11/23-16:06:24 INFO: Management Information Base has been created
2012/11/23-16:06:24 INFO: Following 3 file(s) have been found (only those with .conf extension will be parsed): .svn, MGMT.IHM.conf, MGMT.conf
2012/11/23-16:06:24WARNING: There is a file named '.svn' without .conf extension in given list
2012/11/23-16:06:24 INFO: Parsing configuration file 'configuration/MGMT.IHM.conf'
2012/11/23-16:06:24 INFO: Adding IHM integer parameter [name:MIB_MC002_GROUPNUM, id:49408, value:0]
2012/11/23-16:06:24 INFO: Adding IHM string parameter [name:MIB_MC002_GROUP1, id:49409, value:NULL]
...
At this point GN and FAC can be started. Please refer to relevant documentation
on how to do it and let me know about errors if you encounter any.
- Baris Demiray <baris.demiray@eurecom.fr>
Google C++ Testing Framework is used for SCOREF-MGMT, relevant
code and documentation can be found under test/ directory.
Unit tests can be compiled from root directory as well. To do so
issue following command,
$ make test
- Baris Demiray <baris.demiray@eurecom.fr>
# Doxyfile 1.6.3
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project
#
# All text after a hash (#) is considered a comment and will be ignored
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (" ")
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the config file
# that follow. The default is UTF-8 which is also the encoding used for all
# text before the first occurrence of this tag. Doxygen uses libiconv (or the
# iconv built into libc) for the transcoding. See
# http://www.gnu.org/software/libiconv for the list of possible encodings.
DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
PROJECT_NAME = "SCORE@F MANAGEMENT Module"
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 1.9.0
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = doc/
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output
# format and will distribute the generated files over these directories.
# Enabling this option can be useful when feeding doxygen a huge amount of
# source files, where putting all generated files in the same directory would
# otherwise cause performance problems for the file system.
CREATE_SUBDIRS = NO
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# The default language is English, other supported languages are:
# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
OUTPUT_LANGUAGE = English
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
# include brief member descriptions after the members that are listed in
# the file and class documentation (similar to JavaDoc).
# Set to NO to disable this.
BRIEF_MEMBER_DESC = YES
# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
# the brief description of a member or function before the detailed description.
# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
REPEAT_BRIEF = YES
# This tag implements a quasi-intelligent brief description abbreviator
# that is used to form the text in various listings. Each string
# in this list, if found as the leading text of the brief description, will be
# stripped from the text and the result after processing the whole list, is
# used as the annotated text. Otherwise, the brief description is used as-is.
# If left blank, the following values are used ("$name" is automatically
# replaced with the name of the entity): "The $name class" "The $name widget"
# "The $name file" "is" "provides" "specifies" "contains"
# "represents" "a" "an" "the"
ABBREVIATE_BRIEF =
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# Doxygen will generate a detailed section even if there is only a brief
# description.
ALWAYS_DETAILED_SEC = NO
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
INLINE_INHERITED_MEMB = NO
# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
# path before files name in the file list and in the header files. If set
# to NO the shortest path that makes the file name unique will be used.
FULL_PATH_NAMES = NO
# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
# can be used to strip a user-defined part of the path. Stripping is
# only done if one of the specified strings matches the left-hand part of
# the path. The tag can be used to show relative paths in the file list.
# If left blank the directory from which doxygen is run is used as the
# path to strip.
STRIP_FROM_PATH =
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
# the path mentioned in the documentation of a class, which tells
# the reader which header file to include in order to use a class.
# If left blank only the name of the header file containing the class
# definition is used. Otherwise one should specify the include paths that
# are normally passed to the compiler using the -I flag.
STRIP_FROM_INC_PATH =
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
# (but less readable) file names. This can be useful is your file systems
# doesn't support long names like on DOS, Mac, or CD-ROM.
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
# will interpret the first line (until the first dot) of a JavaDoc-style
# comment as the brief description. If set to NO, the JavaDoc
# comments will behave just like regular Qt-style comments
# (thus requiring an explicit @brief command for a brief description.)
JAVADOC_AUTOBRIEF = NO
# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
# interpret the first line (until the first dot) of a Qt-style
# comment as the brief description. If set to NO, the comments
# will behave just like regular Qt-style comments (thus requiring
# an explicit \brief command for a brief description.)
QT_AUTOBRIEF = NO
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
# treat a multi-line C++ special comment block (i.e. a block of //! or ///
# comments) as a brief description. This used to be the default behaviour.
# The new default is to treat a multi-line C++ comment block as a detailed
# description. Set this tag to YES if you prefer the old behaviour instead.
MULTILINE_CPP_IS_BRIEF = NO
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
# member inherits the documentation from any documented member that it
# re-implements.
INHERIT_DOCS = YES
# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
# a new page for each member. If set to NO, the documentation of a member will
# be part of the file/class/namespace that contains it.
SEPARATE_MEMBER_PAGES = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab.
# Doxygen uses this value to replace tabs by spaces in code fragments.
TAB_SIZE = 4
# This tag can be used to specify a number of aliases that acts
# as commands in the documentation. An alias has the form "name=value".
# For example adding "sideeffect=\par Side Effects:\n" will allow you to
# put the command \sideeffect (or @sideeffect) in the documentation, which
# will result in a user-defined paragraph with heading "Side Effects:".
# You can put \n's in the value part of an alias to insert newlines.
ALIASES =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
# sources only. Doxygen will then generate output that is more tailored for C.
# For instance, some of the names that are used will be different. The list
# of all members will be omitted, etc.
OPTIMIZE_OUTPUT_FOR_C = NO
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
# sources only. Doxygen will then generate output that is more tailored for
# Java. For instance, namespaces will be presented as packages, qualified
# scopes will look different, etc.
OPTIMIZE_OUTPUT_JAVA = NO
# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
# sources only. Doxygen will then generate output that is more tailored for
# Fortran.
OPTIMIZE_FOR_FORTRAN = NO
# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
# sources. Doxygen will then generate output that is tailored for
# VHDL.
OPTIMIZE_OUTPUT_VHDL = NO
# Doxygen selects the parser to use depending on the extension of the files it parses.
# With this tag you can assign which parser to use for a given extension.
# Doxygen has a built-in mapping, but you can override or extend it using this tag.
# The format is ext=language, where ext is a file extension, and language is one of
# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat
# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
EXTENSION_MAPPING =
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
# to include (a tag file for) the STL sources as input, then you should
# set this tag to YES in order to let doxygen match functions declarations and
# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
# func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
BUILTIN_STL_SUPPORT = YES
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
CPP_CLI_SUPPORT = NO
# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
# Doxygen will parse them like normal C++ but will assume all classes use public
# instead of private inheritance when no explicit protection keyword is present.
SIP_SUPPORT = NO
# For Microsoft's IDL there are propget and propput attributes to indicate getter
# and setter methods for a property. Setting this option to YES (the default)
# will make doxygen to replace the get and set methods by a property in the
# documentation. This will only work if the methods are indeed getting or
# setting a simple type. If this is not the case, or you want to show the
# methods anyway, you should set this option to NO.
IDL_PROPERTY_SUPPORT = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
DISTRIBUTE_GROUP_DOC = NO
# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
# the same type (for instance a group of public functions) to be put as a
# subgroup of that type (e.g. under the Public Functions section). Set it to
# NO to prevent subgrouping. Alternatively, this can be done per class using
# the \nosubgrouping command.
SUBGROUPING = YES
# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
# is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
# namespace, or class. And the struct will be named TypeS. This can typically
# be useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name.
TYPEDEF_HIDES_STRUCT = NO
# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
# determine which symbols to keep in memory and which to flush to disk.
# When the cache is full, less often used symbols will be written to disk.
# For small to medium size projects (<1000 input files) the default value is
# probably good enough. For larger projects a too small cache size can cause
# doxygen to be busy swapping symbols to and from disk most of the time
# causing a significant performance penality.
# If the system has enough physical memory increasing the cache will improve the
# performance by keeping more symbols in memory. Note that the value works on
# a logarithmic scale so increasing the size by one will rougly double the
# memory usage. The cache size is given by this formula:
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
# corresponding to a cache size of 2^16 = 65536 symbols
SYMBOL_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
# documentation are documented, even if no documentation was available.
# Private class members and static file members will be hidden unless
# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
EXTRACT_ALL = YES
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
EXTRACT_PRIVATE = YES
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
EXTRACT_STATIC = YES
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
# defined locally in source files will be included in the documentation.
# If set to NO only classes defined in header files are included.
EXTRACT_LOCAL_CLASSES = YES
# This flag is only useful for Objective-C code. When set to YES local
# methods, which are defined in the implementation section but not in
# the interface are included in the documentation.
# If set to NO (the default) only methods in the interface are included.
EXTRACT_LOCAL_METHODS = NO
# If this flag is set to YES, the members of anonymous namespaces will be
# extracted and appear in the documentation as a namespace called
# 'anonymous_namespace{file}', where file will be replaced with the base
# name of the file that contains the anonymous namespace. By default
# anonymous namespace are hidden.
EXTRACT_ANON_NSPACES = YES
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
# undocumented members of documented classes, files or namespaces.
# If set to NO (the default) these members will be included in the
# various overviews, but no documentation section is generated.
# This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy.
# If set to NO (the default) these classes will be included in the various
# overviews. This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_CLASSES = NO
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
# friend (class|struct|union) declarations.
# If set to NO (the default) these declarations will be included in the
# documentation.
HIDE_FRIEND_COMPOUNDS = NO
# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
# documentation blocks found inside the body of a function.
# If set to NO (the default) these blocks will be appended to the
# function's detailed documentation block.
HIDE_IN_BODY_DOCS = NO
# The INTERNAL_DOCS tag determines if documentation
# that is typed after a \internal command is included. If the tag is set
# to NO (the default) then the documentation will be excluded.
# Set it to YES to include the internal documentation.
INTERNAL_DOCS = NO
# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
# file names in lower-case letters. If set to YES upper-case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# and Mac users are advised to set this option to NO.
CASE_SENSE_NAMES = YES
# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
# will show members with their full class and namespace scopes in the
# documentation. If set to YES the scope will be hidden.
HIDE_SCOPE_NAMES = NO
# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
# will put a list of the files that are included by a file in the documentation
# of that file.
SHOW_INCLUDE_FILES = YES
# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
# will list include files with double quotes in the documentation
# rather than with sharp brackets.
FORCE_LOCAL_INCLUDES = NO
# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
# is inserted in the documentation for inline members.
INLINE_INFO = YES
# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
# will sort the (detailed) documentation of file and class members
# alphabetically by member name. If set to NO the members will appear in
# declaration order.
SORT_MEMBER_DOCS = YES
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
# brief documentation of file, namespace and class members alphabetically
# by member name. If set to NO (the default) the members will appear in
# declaration order.
SORT_BRIEF_DOCS = NO
# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
SORT_MEMBERS_CTORS_1ST = NO
# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
# hierarchy of group names into alphabetical order. If set to NO (the default)
# the group names will appear in their defined order.
SORT_GROUP_NAMES = NO
# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
# sorted by fully-qualified names, including namespaces. If set to
# NO (the default), the class list will be sorted only by class name,
# not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
# Note: This option applies only to the class list, not to the
# alphabetical list.
SORT_BY_SCOPE_NAME = NO
# The GENERATE_TODOLIST tag can be used to enable (YES) or
# disable (NO) the todo list. This list is created by putting \todo
# commands in the documentation.
GENERATE_TODOLIST = YES
# The GENERATE_TESTLIST tag can be used to enable (YES) or
# disable (NO) the test list. This list is created by putting \test
# commands in the documentation.
GENERATE_TESTLIST = YES
# The GENERATE_BUGLIST tag can be used to enable (YES) or
# disable (NO) the bug list. This list is created by putting \bug
# commands in the documentation.
GENERATE_BUGLIST = YES
# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
# disable (NO) the deprecated list. This list is created by putting
# \deprecated commands in the documentation.
GENERATE_DEPRECATEDLIST= YES
# The ENABLED_SECTIONS tag can be used to enable conditional
# documentation sections, marked by \if sectionname ... \endif.
ENABLED_SECTIONS =
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
# the initial value of a variable or define consists of for it to appear in
# the documentation. If the initializer consists of more lines than specified
# here it will be hidden. Use a value of 0 to hide initializers completely.
# The appearance of the initializer of individual variables and defines in the
# documentation can be controlled using \showinitializer or \hideinitializer
# command in the documentation regardless of this setting.
MAX_INITIALIZER_LINES = 30
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
# at the bottom of the documentation of classes and structs. If set to YES the
# list will mention the files that were used to generate the documentation.
SHOW_USED_FILES = YES
# If the sources in your project are distributed over multiple directories
# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
# in the documentation. The default is NO.
SHOW_DIRECTORIES = YES
# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
# This will remove the Files entry from the Quick Index and from the
# Folder Tree View (if specified). The default is YES.
SHOW_FILES = YES
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
# Namespaces page.
# This will remove the Namespaces entry from the Quick Index
# and from the Folder Tree View (if specified). The default is YES.
SHOW_NAMESPACES = YES
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
# doxygen should invoke to get the current version for each file (typically from
# the version control system). Doxygen will invoke the program by executing (via
# popen()) the command <command> <input-file>, where <command> is the value of
# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
# provided by doxygen. Whatever the program writes to standard output
# is used as the file version. See the manual for examples.
FILE_VERSION_FILTER =
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
# doxygen. The layout file controls the global structure of the generated output files
# in an output format independent way. The create the layout file that represents
# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
# file name after the option, if omitted DoxygenLayout.xml will be used as the name
# of the layout file.
LAYOUT_FILE =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
# The QUIET tag can be used to turn on/off the messages that are generated
# by doxygen. Possible values are YES and NO. If left blank NO is used.
QUIET = NO
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated by doxygen. Possible values are YES and NO. If left blank
# NO is used.
WARNINGS = YES
# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
# automatically be disabled.
WARN_IF_UNDOCUMENTED = YES
# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some
# parameters in a documented function, or documenting parameters that
# don't exist or using markup commands wrongly.
WARN_IF_DOC_ERROR = YES
# This WARN_NO_PARAMDOC option can be abled to get warnings for
# functions that are documented, but have no documentation for their parameters
# or return value. If set to NO (the default) doxygen will only warn about
# wrong or incomplete parameter documentation, but not about the absence of
# documentation.
WARN_NO_PARAMDOC = NO
# The WARN_FORMAT tag determines the format of the warning messages that
# doxygen can produce. The string should contain the $file, $line, and $text
# tags, which will be replaced by the file and line number from which the
# warning originated and the warning text. Optionally the format may contain
# $version, which will be replaced by the version of the file (if it could
# be obtained via FILE_VERSION_FILTER)
WARN_FORMAT = "$file:$line: $text"
# The WARN_LOGFILE tag can be used to specify a file to which warning
# and error messages should be written. If left blank the output is written
# to stderr.
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag can be used to specify the files and/or directories that contain
# documented source files. You may enter file names like "myfile.cpp" or
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = src/
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
# also the default input encoding. Doxygen uses libiconv (or the iconv built
# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
# the list of possible encodings.
INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank the following patterns are tested:
# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
FILE_PATTERNS =
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
# If left blank NO is used.
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded
# from the input.
EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories. Note that the wildcards are matched
# against the file with absolute path, so to exclude all test directories
# for example use the pattern */test/*
EXCLUDE_PATTERNS =
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
EXCLUDE_SYMBOLS =
# The EXAMPLE_PATH tag can be used to specify one or more files or
# directories that contain example code fragments that are included (see
# the \include command).
EXAMPLE_PATH =
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank all files are included.
EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude
# commands irrespective of the value of the RECURSIVE tag.
# Possible values are YES and NO. If left blank NO is used.
EXAMPLE_RECURSIVE = NO
# The IMAGE_PATH tag can be used to specify one or more files or
# directories that contain image that are included in the documentation (see
# the \image command).
IMAGE_PATH =
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
# by executing (via popen()) the command <filter> <input-file>, where <filter>
# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
# input file. Doxygen will then use the output that the filter program writes
# to standard output.
# If FILTER_PATTERNS is specified, this tag will be
# ignored.
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis.
# Doxygen will compare the file name with each pattern and apply the
# filter if there is a match.
# The filters are a list of the form:
# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
# is applied to all files.
FILTER_PATTERNS =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER) will be used to filter the input files when producing source
# files to browse (i.e. when SOURCE_BROWSER is set to YES).
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
# If the SOURCE_BROWSER tag is set to YES then a list of source files will
# be generated. Documented entities will be cross-referenced with these sources.
# Note: To get rid of all source code in the generated output, make sure also
# VERBATIM_HEADERS is set to NO.
SOURCE_BROWSER = NO
# Setting the INLINE_SOURCES tag to YES will include the body
# of functions and classes directly in the documentation.
INLINE_SOURCES = NO
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
# doxygen to hide any special comment blocks from generated source code
# fragments. Normal C and C++ comments will always remain visible.
STRIP_CODE_COMMENTS = YES
# If the REFERENCED_BY_RELATION tag is set to YES
# then for each documented function all documented
# functions referencing it will be listed.
REFERENCED_BY_RELATION = NO
# If the REFERENCES_RELATION tag is set to YES
# then for each documented function all documented entities
# called/used by that function will be listed.
REFERENCES_RELATION = NO
# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
# link to the source code.
# Otherwise they will link to the documentation.
REFERENCES_LINK_SOURCE = YES
# If the USE_HTAGS tag is set to YES then the references to source code
# will point to the HTML generated by the htags(1) tool instead of doxygen
# built-in source browser. The htags tool is part of GNU's global source
# tagging system (see http://www.gnu.org/software/global/global.html). You
# will need version 4.8.6 or higher.
USE_HTAGS = NO
# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
# will generate a verbatim copy of the header file for each class for
# which an include is specified. Set to NO to disable this.
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
# of all compounds will be generated. Enable this if the project
# contains a lot of classes, structs, unions or interfaces.
ALPHABETICAL_INDEX = YES
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
# in which this list will be split (can be a number in the range [1..20])
COLS_IN_ALPHA_INDEX = 5
# In case all classes in a project start with a common prefix, all
# classes will be put under the same header in the alphabetical index.
# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
# should be ignored while generating the index headers.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
# generate HTML output.
GENERATE_HTML = YES
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `html' will be used as the default path.
HTML_OUTPUT = html
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
# doxygen will generate files with .html extension.
HTML_FILE_EXTENSION = .html
# The HTML_HEADER tag can be used to specify a personal HTML header for
# each generated HTML page. If it is left blank doxygen will generate a
# standard header.
HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to
# fine-tune the look of the HTML output. If the tag is left blank doxygen
# will generate a default style sheet. Note that doxygen will try to copy
# the style sheet file to the HTML output directory, so don't put your own
# stylesheet in the HTML output directory as well, or it will be erased!
HTML_STYLESHEET =
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting
# this to NO can help when comparing the output of multiple runs.
HTML_TIMESTAMP = YES
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to
# NO a bullet list will be used.
HTML_ALIGN_MEMBERS = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded. For this to work a browser that supports
# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
HTML_DYNAMIC_SECTIONS = NO
# If the GENERATE_DOCSET tag is set to YES, additional index files
# will be generated that can be used as input for Apple's Xcode 3
# integrated development environment, introduced with OSX 10.5 (Leopard).
# To create a documentation set, doxygen will generate a Makefile in the
# HTML output directory. Running make will produce the docset in that
# directory and running "make install" will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
# it at startup.
# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
GENERATE_DOCSET = NO
# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
# feed. A documentation feed provides an umbrella under which multiple
# documentation sets from a single provider (such as a company or product suite)
# can be grouped.
DOCSET_FEEDNAME = "Doxygen generated docs"
# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
# should uniquely identify the documentation set bundle. This should be a
# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
# will append .docset to the name.
DOCSET_BUNDLE_ID = org.doxygen.Project
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
# will be generated that can be used as input for tools like the
# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
# of the generated HTML documentation.
GENERATE_HTMLHELP = NO
# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
# be used to specify the file name of the resulting .chm file. You
# can add a path in front of the file if the result should not be
# written to the html output directory.
CHM_FILE =
# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
# be used to specify the location (absolute path including file name) of
# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
# the HTML help compiler on the generated index.hhp.
HHC_LOCATION =
# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
# controls if a separate .chi index file is generated (YES) or that
# it should be included in the master .chm file (NO).
GENERATE_CHI = NO
# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
# is used to encode HtmlHelp index (hhk), content (hhc) and project file
# content.
CHM_INDEX_ENCODING =
# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
# controls whether a binary table of contents is generated (YES) or a
# normal table of contents (NO) in the .chm file.
BINARY_TOC = NO
# The TOC_EXPAND flag can be set to YES to add extra items for group members
# to the contents of the HTML help documentation and to the tree view.
TOC_EXPAND = NO
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
# are set, an additional index file will be generated that can be used as input for
# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
# HTML documentation.
GENERATE_QHP = NO
# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
# be used to specify the file name of the resulting .qch file.
# The path specified is relative to the HTML output folder.
QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating
# Qt Help Project output. For more information please see
# http://doc.trolltech.com/qthelpproject.html#namespace
QHP_NAMESPACE = org.doxygen.Project
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
# Qt Help Project output. For more information please see
# http://doc.trolltech.com/qthelpproject.html#virtual-folders
QHP_VIRTUAL_FOLDER = doc
# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add.
# For more information please see
# http://doc.trolltech.com/qthelpproject.html#custom-filters
QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see
# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's
# filter section matches.
# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
QHP_SECT_FILTER_ATTRS =
# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
# be used to specify the location of Qt's qhelpgenerator.
# If non-empty doxygen will try to run qhelpgenerator on the generated
# .qhp file.
QHG_LOCATION =
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
# will be generated, which together with the HTML files, form an Eclipse help
# plugin. To install this plugin and make it available under the help contents
# menu in Eclipse, the contents of the directory containing the HTML and XML
# files needs to be copied into the plugins directory of eclipse. The name of
# the directory within the plugins directory should be the same as
# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before the help appears.
GENERATE_ECLIPSEHELP = NO
# A unique identifier for the eclipse help plugin. When installing the plugin
# the directory name containing the HTML and XML files should also have
# this name.
ECLIPSE_DOC_ID = org.doxygen.Project
# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
# top of each HTML page. The value NO (the default) enables the index and
# the value YES disables it.
DISABLE_INDEX = NO
# This tag can be used to set the number of enum values (range [1..20])
# that doxygen will group on one line in the generated HTML documentation.
ENUM_VALUES_PER_LINE = 4
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
# structure should be generated to display hierarchical information.
# If the tag value is set to YES, a side panel will be generated
# containing a tree-like index structure (just like the one that
# is generated for HTML Help). For this to work a browser that supports
# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
# Windows users are probably better off using the HTML help feature.
GENERATE_TREEVIEW = NO
# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
# and Class Hierarchy pages using a tree view instead of an ordered list.
USE_INLINE_TREES = NO
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
# used to set the initial width (in pixels) of the frame in which the tree
# is shown.
TREEVIEW_WIDTH = 250
# Use this tag to change the font size of Latex formulas included
# as images in the HTML documentation. The default is 10. Note that
# when you change the font size after a successful doxygen run you need
# to manually remove any form_*.png images from the HTML output directory
# to force them to be regenerated.
FORMULA_FONTSIZE = 10
# When the SEARCHENGINE tag is enabled doxygen will generate a search box for the HTML output. The underlying search engine uses javascript
# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) there is already a search function so this one should
# typically be disabled. For large projects the javascript based search engine
# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
SEARCHENGINE = YES
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be implemented using a PHP enabled web server instead of at the web client using Javascript. Doxygen will generate the search PHP script and index
# file to put on the web server. The advantage of the server based approach is that it scales better to large projects and allows full text search. The disadvances is that it is more difficult to setup
# and does not have live searching capabilities.
SERVER_BASED_SEARCH = NO
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
GENERATE_LATEX = YES
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `latex' will be used as the default path.
LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked. If left blank `latex' will be used as the default command name.
# Note that when enabling USE_PDFLATEX this option is only used for
# generating bitmaps for formulas in the HTML output, but not in the
# Makefile that is written to the output directory.
LATEX_CMD_NAME = latex
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
# generate index for LaTeX. If left blank `makeindex' will be used as the
# default command name.
MAKEINDEX_CMD_NAME = makeindex
# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
# LaTeX documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used
# by the printer. Possible values are: a4, a4wide, letter, legal and
# executive. If left blank a4wide will be used.
PAPER_TYPE = a4wide
# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
# packages that should be included in the LaTeX output.
EXTRA_PACKAGES =
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
# the generated latex document. The header should contain everything until
# the first chapter. If it is left blank doxygen will generate a
# standard header. Notice: only use this tag if you know what you are doing!
LATEX_HEADER =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
# contain links (just like the HTML output) instead of page references
# This makes the output suitable for online browsing using a pdf viewer.
PDF_HYPERLINKS = YES
# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
# plain latex in the generated Makefile. Set this option to YES to get a
# higher quality PDF documentation.
USE_PDFLATEX = YES
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
# command to the generated LaTeX files. This will instruct LaTeX to keep
# running if errors occur, instead of asking the user for help.
# This option is also used when generating formulas in HTML.
LATEX_BATCHMODE = NO
# If LATEX_HIDE_INDICES is set to YES then doxygen will not
# include the index chapters (such as File Index, Compound Index, etc.)
# in the output.
LATEX_HIDE_INDICES = NO
# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER.
LATEX_SOURCE_CODE = YES
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
# The RTF output is optimized for Word 97 and may not look very pretty with
# other RTF readers or editors.
GENERATE_RTF = NO
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `rtf' will be used as the default path.
RTF_OUTPUT = rtf
# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
# RTF documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_RTF = NO
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
# will contain hyperlink fields. The RTF file will
# contain links (just like the HTML output) instead of page references.
# This makes the output suitable for online browsing using WORD or other
# programs which support those fields.
# Note: wordpad (write) and others do not support links.
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's
# config file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an rtf document.
# Syntax is similar to doxygen's config file.
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
# generate man pages
GENERATE_MAN = NO
# The MAN_OUTPUT tag is used to specify where the man pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `man' will be used as the default path.
MAN_OUTPUT = man
# The MAN_EXTENSION tag determines the extension that is added to
# the generated man pages (default is the subroutine's section .3)
MAN_EXTENSION = .3
# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
# then it will generate one additional man file for each entity
# documented in the real man page(s). These additional files
# only source the real man page, but without them the man command
# would be unable to find the correct page. The default is NO.
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
# If the GENERATE_XML tag is set to YES Doxygen will
# generate an XML file that captures the structure of
# the code including all documentation.
GENERATE_XML = NO
# The XML_OUTPUT tag is used to specify where the XML pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `xml' will be used as the default path.
XML_OUTPUT = xml
# The XML_SCHEMA tag can be used to specify an XML schema,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_SCHEMA =
# The XML_DTD tag can be used to specify an XML DTD,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_DTD =
# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
# dump the program listings (including syntax highlighting
# and cross-referencing information) to the XML output. Note that
# enabling this will significantly increase the size of the XML output.
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
# generate an AutoGen Definitions (see autogen.sf.net) file
# that captures the structure of the code including all
# documentation. Note that this feature is still experimental
# and incomplete at the moment.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
# If the GENERATE_PERLMOD tag is set to YES Doxygen will
# generate a Perl module file that captures the structure of
# the code including all documentation. Note that this
# feature is still experimental and incomplete at the
# moment.
GENERATE_PERLMOD = NO
# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
# the necessary Makefile rules, Perl scripts and LaTeX code to be able
# to generate PDF and DVI output from the Perl module output.
PERLMOD_LATEX = NO
# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
# nicely formatted so it can be parsed by a human reader.
# This is useful
# if you want to understand what is going on.
# On the other hand, if this
# tag is set to NO the size of the Perl module output will be much smaller
# and Perl will parse it just the same.
PERLMOD_PRETTY = YES
# The names of the make variables in the generated doxyrules.make file
# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
# This is useful so different doxyrules.make files included by the same
# Makefile don't overwrite each other's variables.
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
# evaluate all C-preprocessor directives found in the sources and include
# files.
ENABLE_PREPROCESSING = YES
# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
# names in the source code. If set to NO (the default) only conditional
# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.
MACRO_EXPANSION = NO
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_DEFINED tags.
EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# in the INCLUDE_PATH (see below) will be search if a #include is found.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by
# the preprocessor.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
# directories. If left blank, the patterns specified with FILE_PATTERNS will
# be used.
INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that
# are defined before the preprocessor is started (similar to the -D option of
# gcc). The argument of the tag is a list of macros of the form: name
# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed. To prevent a macro definition from being
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
# The macro definition that is found in the sources will be used.
# Use the PREDEFINED tag if you want to use a different macro definition.
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
# doxygen's preprocessor will remove all function-like macros that are alone
# on a line, have an all uppercase name, and do not end with a semicolon. Such
# function macros are typically used for boiler-plate code, and will confuse
# the parser if not removed.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
# The TAGFILES option can be used to specify one or more tagfiles.
# Optionally an initial location of the external documentation
# can be added for each tagfile. The format of a tag file without
# this location is as follows:
#
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
#
# TAGFILES = file1=loc1 "file2 = loc2" ...
# where "loc1" and "loc2" can be relative or absolute paths or
# URLs. If a location is present for each tag, the installdox tool
# does not have to be run to correct the links.
# Note that each tag file must have a unique name
# (where the name does NOT include the path)
# If a tag file is not located in the directory in which doxygen
# is run, you must also specify the path to the tagfile here.
TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.
GENERATE_TAGFILE =
# If the ALLEXTERNALS tag is set to YES all external classes will be listed
# in the class index. If set to NO only the inherited external classes
# will be listed.
ALLEXTERNALS = NO
# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
# in the modules index. If set to NO, only the current project's groups will
# be listed.
EXTERNAL_GROUPS = YES
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of `which perl').
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
# or super classes. Setting the tag to NO turns the diagrams off. Note that
# this option is superseded by the HAVE_DOT option below. This is only a
# fallback. It is recommended to install and use dot, since it yields more
# powerful graphs.
CLASS_DIAGRAMS = YES
# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see
# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.
MSCGEN_PATH =
# If set to YES, the inheritance and collaboration graphs will hide
# inheritance and usage relations if the target is undocumented
# or is not a class.
HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz, a graph visualization
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
HAVE_DOT = YES
# By default doxygen will write a font called FreeSans.ttf to the output
# directory and reference it in all dot files that doxygen generates. This
# font does not include all possible unicode characters however, so when you need
# these (or just want a differently looking font) you can specify the font name
# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
# which can be done by putting it in a standard location or by setting the
# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
# containing the font.
DOT_FONTNAME = FreeSans
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
# The default size is 10pt.
DOT_FONTSIZE = 10
# By default doxygen will tell dot to use the output directory to look for the
# FreeSans.ttf font (which doxygen will put there itself). If you specify a
# different font using DOT_FONTNAME you can set the path where dot
# can find it using this tag.
DOT_FONTPATH =
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect inheritance relations. Setting this tag to YES will force the
# the CLASS_DIAGRAMS tag to NO.
CLASS_GRAPH = YES
# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect implementation dependencies (inheritance, containment, and
# class references variables) of the class with other documented classes.
COLLABORATION_GRAPH = YES
# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for groups, showing the direct groups dependencies
GROUP_GRAPHS = YES
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
UML_LOOK = YES
# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
TEMPLATE_RELATIONS = NO
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
# tags are set to YES then doxygen will generate a graph for each documented
# file showing the direct and indirect include dependencies of the file with
# other documented files.
INCLUDE_GRAPH = YES
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
# documented header file showing the documented files that directly or
# indirectly include this file.
INCLUDED_BY_GRAPH = YES
# If the CALL_GRAPH and HAVE_DOT options are set to YES then
# doxygen will generate a call dependency graph for every global function
# or class method. Note that enabling this option will significantly increase
# the time of a run. So in most cases it will be better to enable call graphs
# for selected functions only using the \callgraph command.
CALL_GRAPH = YES
# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
# doxygen will generate a caller dependency graph for every global function
# or class method. Note that enabling this option will significantly increase
# the time of a run. So in most cases it will be better to enable caller
# graphs for selected functions only using the \callergraph command.
CALLER_GRAPH = YES
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
# will graphical hierarchy of all classes instead of a textual one.
GRAPHICAL_HIERARCHY = YES
# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
# then doxygen will show the dependencies a directory has on other directories
# in a graphical way. The dependency relations are determined by the #include
# relations between the files in the directories.
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot. Possible values are png, jpg, or gif
# If left blank png will be used.
DOT_IMAGE_FORMAT = png
# The tag DOT_PATH can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
DOT_PATH =
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the
# \dotfile command).
DOTFILE_DIRS =
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
# nodes that will be shown in the graph. If the number of nodes in a graph
# becomes larger than this value, doxygen will truncate the graph, which is
# visualized by representing a node as a red box. Note that doxygen if the
# number of direct children of the root node in a graph is already larger than
# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
DOT_GRAPH_MAX_NODES = 50
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
# graphs generated by dot. A depth value of 3 means that only nodes reachable
# from the root by following a path via at most 3 edges will be shown. Nodes
# that lay further from the root node will be omitted. Note that setting this
# option to 1 or 2 may greatly reduce the computation time needed for large
# code bases. Also note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
MAX_DOT_GRAPH_DEPTH = 0
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
# background. This is disabled by default, because dot on Windows does not
# seem to support this out of the box. Warning: Depending on the platform used,
# enabling this option may lead to badly anti-aliased labels on the edges of
# a graph (i.e. they become hard to read).
DOT_TRANSPARENT = NO
# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
# makes dot run faster, but since only newer versions of dot (>1.8.10)
# support this, this feature is disabled by default.
DOT_MULTI_TARGETS = YES
# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
# generate a legend page explaining the meaning of the various boxes and
# arrows in the dot generated graphs.
GENERATE_LEGEND = YES
# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
# remove the intermediate dot files that are used to generate
# the various graphs.
DOT_CLEANUP = YES
- A document having doxygen-generated class diagrams (and more) will be produced
- boost::property_tree::ini_parser could be utilised for configuration file parse
- Baris Demiray <baris.demiray@eurecom.fr>
Checking ../SCOREF-MGMT/Software/src/main.cpp...
Checking ../SCOREF-MGMT/Software/src/main.cpp: BOOST_VERSION_1_50...
Checking ../SCOREF-MGMT/Software/src/main.cpp: UNUSED...
1/31 files checked 3% done
Checking ../SCOREF-MGMT/Software/src/mgmt_client.cpp...
2/31 files checked 6% done
Checking ../SCOREF-MGMT/Software/src/mgmt_client_manager.cpp...
3/31 files checked 10% done
Checking ../SCOREF-MGMT/Software/src/mgmt_comm_prof_manager.cpp...
4/31 files checked 17% done
Checking ../SCOREF-MGMT/Software/src/mgmt_configuration.cpp...
[../SCOREF-MGMT/Software/src/mgmt_configuration.cpp:246]: (warning) Return value of std::remove() ignored. Elements remain in container.
[../SCOREF-MGMT/Software/src/mgmt_configuration.cpp:248]: (warning) Return value of std::remove() ignored. Elements remain in container.
5/31 files checked 25% done
Checking ../SCOREF-MGMT/Software/src/mgmt_information_base.cpp...
6/31 files checked 32% done
Checking ../SCOREF-MGMT/Software/src/mgmt_inquiry_thread.cpp...
7/31 files checked 33% done
Checking ../SCOREF-MGMT/Software/src/mgmt_its_key_manager.cpp...
8/31 files checked 38% done
Checking ../SCOREF-MGMT/Software/src/mgmt_packet_factory.cpp...
Checking ../SCOREF-MGMT/Software/src/mgmt_packet_factory.cpp: UNUSED...
9/31 files checked 39% done
Checking ../SCOREF-MGMT/Software/src/mgmt_packet_handler.cpp...
Checking ../SCOREF-MGMT/Software/src/mgmt_packet_handler.cpp: UNUSED...
10/31 files checked 44% done
Checking ../SCOREF-MGMT/Software/src/mgmt_server.cpp...
Checking ../SCOREF-MGMT/Software/src/mgmt_server.cpp: UNUSED...
11/31 files checked 50% done
Checking ../SCOREF-MGMT/Software/src/packets/mgmt_fac_packet_comm_profile_selection_request.cpp...
12/31 files checked 52% done
Checking ../SCOREF-MGMT/Software/src/packets/mgmt_fac_packet_comm_profile_selection_response.cpp...
13/31 files checked 54% done
Checking ../SCOREF-MGMT/Software/src/packets/mgmt_fac_packet_configuration_notification.cpp...
14/31 files checked 57% done
Checking ../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet.cpp...
15/31 files checked 59% done
Checking ../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp...
Checking ../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp: UNUSED...
16/31 files checked 63% done
Checking ../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_response.cpp...
17/31 files checked 66% done
Checking ../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_configuration_available.cpp...
18/31 files checked 68% done
Checking ../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_get_configuration.cpp...
19/31 files checked 69% done
Checking ../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_location_table_request.cpp...
20/31 files checked 71% done
Checking ../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_location_table_response.cpp...
21/31 files checked 74% done
Checking ../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_location_update.cpp...
22/31 files checked 77% done
Checking ../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_network_state.cpp...
23/31 files checked 79% done
Checking ../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_set_configuration.cpp...
24/31 files checked 82% done
Checking ../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_wireless_state_request.cpp...
25/31 files checked 84% done
Checking ../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_wireless_state_response.cpp...
26/31 files checked 86% done
Checking ../SCOREF-MGMT/Software/src/util/mgmt_exception.cpp...
27/31 files checked 87% done
Checking ../SCOREF-MGMT/Software/src/util/mgmt_log.cpp...
28/31 files checked 90% done
Checking ../SCOREF-MGMT/Software/src/util/mgmt_udp_socket.cpp...
29/31 files checked 94% done
Checking ../SCOREF-MGMT/Software/src/util/mgmt_util.cpp...
30/31 files checked 99% done
Checking ../SCOREF-MGMT/Software/test/unittest/main.cpp...
Checking ../SCOREF-MGMT/Software/test/unittest/main.cpp: PRIVATE...
31/31 files checked 100% done
Checking usage of global functions..
[../SCOREF-MGMT/Software/src/mgmt_its_key_manager.cpp:61]: (style) The function 'findKeyId' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:116]: (style) The function 'getAccess11n' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:112]: (style) The function 'getAccess3g' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:120]: (style) The function 'getAccessEthernet' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:108]: (style) The function 'getAccessItsG5' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:124]: (style) The function 'getChannelCch' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:128]: (style) The function 'getChannelSch1' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:132]: (style) The function 'getChannelSch2' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:136]: (style) The function 'getChannelSch3' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:140]: (style) The function 'getChannelSch4' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_fac_packet_comm_profile_selection_request.cpp:54]: (style) The function 'getLatency' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:104]: (style) The function 'getNetworkDsmiIpv4v6' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:84]: (style) The function 'getNetworkGn' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:96]: (style) The function 'getNetworkIpv4' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:100]: (style) The function 'getNetworkIpv4v6' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:92]: (style) The function 'getNetworkIpv6' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:88]: (style) The function 'getNetworkIpv6Gn' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_fac_packet_comm_profile_selection_request.cpp:58]: (style) The function 'getRelevance' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_fac_packet_comm_profile_selection_request.cpp:62]: (style) The function 'getReliability' is never used.
[../SCOREF-MGMT/Software/src/mgmt_client.cpp:96]: (style) The function 'getState' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:60]: (style) The function 'getTransportBtpA' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:64]: (style) The function 'getTransportBtpB' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:76]: (style) The function 'getTransportRtp' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:80]: (style) The function 'getTransportStcp' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:68]: (style) The function 'getTransportTcp' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_comm_profile_request.cpp:72]: (style) The function 'getTransportUdp' is never used.
[../SCOREF-MGMT/Software/src/packets/mgmt_gn_packet_get_configuration.cpp:57]: (style) The function 'getTxMode' is never used.
[../SCOREF-MGMT/Software/src/mgmt_client_manager.cpp:190]: (style) The function 'isFacConnected' is never used.
##########################################################################################
#
# EURECOM OpenAirInterface
# Copyright(c) 1999 - 2012 EURECOM
#
# 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 http://www.gnu.org/licenses/.
#
# Contact Information
# Openair Admin: openair_admin@eurecom.fr
# Openair Tech : openair_tech@eurecom.fr
# Forums : http://forums.eurecom.fsr/openairinterface
# Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
#
##########################################################################################
# SCOREF Management Module Configuration
# Maintainer: baris.demiray@eurecom.fr
####################
# Generic parameters
CONF_IPV6_ENABLED = 0
# Log levels are as follows
# 0, 1, 2, 3, 4 for TRACE, DEBUG, INFO, WARNING, and ERROR respectively
CONF_LOG_LEVEL = 1
#######################
# Connection parameters
CONF_SERVER_PORT = 1402
CONF_WIRELESS_STATE_UPDATE_INTERVAL = 60
########################################
# Management Information Base Parameters
########################################
# Common parameters
MIB_GN_ALL_STATION_TYPE = 1
MIB_GN_ALL_STATION_SUBTYPE = 1
##########################
# Network (NET) parameters
MIB_GN_NET_LOCAL_ADDR_CONF_METHOD = 0
MIB_GN_NET_DEFAULT_HOP_LIMIT = 1
MIB_GN_NET_MAX_PACKET_LIFETIME = 20000
MIB_GN_NET_MIN_PACKET_REPETITION_INTERVAL = 1000
MIB_GN_NET_GEO_BCAST_FORWARDING_ALGORITHM = 0
MIB_GN_NET_GEO_UCAST_FORWARDING_ALGORITHM = 0
MIB_GN_NET_TRAFFIC_CLASS_RELEVANCE = 5
MIB_GN_NET_TRAFFIC_CLASS_RELIABILITY = 2
MIB_GN_NET_TRAFFIC_CLASS_LATENCY = 2
MIB_GN_NET_CBF_MIN_TTS = 100
MIB_GN_NET_CBF_MAX_TTS = 500
MIB_GN_NET_MAX_COMM_RANGE = 1000
MIB_GN_NET_DEF_TX_POWER = 5
MIB_GN_NET_DEF_BITRATE = 12
MIB_GN_NET_DEF_CHANNEL = 178
MIB_GN_NET_DEF_PRIORITY = 5
MIB_GN_NET_DEF_CHANNEL_BW = 30
MIB_GN_NET_SEC_ALLOW_UNSECURE = 1
MIB_GN_NET_SEC_END2END = 0
MIB_GN_NET_SEC_PSEUDONYM = 0
#############################
# Facilities (FAC) Parameters
MIB_GN_FAC_VEHICLE_WIDTH = 3
MIB_GN_FAC_VEHICLE_LENGTH = 7
MIB_GN_FAC_CAM_BTP_PORT = 2000
MIB_GN_FAC_DENM_BTP_PORT = 3000
MIB_GN_FAC_LDM_GARBAGE_COLLECTION_INTERVAL = 1000
########################################################
# Communication Profiles (defined in SCOREF-L221 section
# 4.1.3 Les Profils de Communication)
# Format: Transport, Network, Access, and Channel parts are
# separated with comma. If there is more than one entry 'in'
# these parts it's separated by a semicolon.
# Example: BTP,GN,ITSG5,CCH -> Comma separated
# TCP:UDP -> Semicolon separated
CP1 = BTP,GN,ITSG5,CCH
CP2 = BTP,GN,ITSG5,SCH1
CP3 = BTP,GN,ITSG5,SCH2
CP4 = BTP,GN,ITSG5,SCH3
CP5 = BTP,GN,ITSG5,SCH4
CP6 = TCP,IPv6_GN,ITSG5,CCH
CP7 = TCP,IPv6_GN,ITSG5,SCH1
CP8 = TCP,IPv6_GN,ITSG5,SCH2
CP9 = TCP,IPv6_GN,ITSG5,SCH3
CP10 = TCP,IPv6_GN,ITSG5,SCH4
CP11 = TCP:UDP,IPv4/v6:DSMIPv4/v6,3G
CP12 = TCP:UDP,IPv6,11n
CP13 = UDP,IPv6,Ethernet
####################################################################################################
# File name: MGMT.IHM.conf #
# Contact: Baris Demiray <baris.demiray@eurecom.fr> #
# Michelle Wetterwald <michelle.wetterwald@eurecom.fr> #
# EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE #
# Tél: +33 (0)4 93 00 81 00 Fax: +33 (0)4 93 00 82 00 #
# Project: SCORE@F | http://www.scoref.fr/ #
# Description: This is a sample configuration file for those FACilities who want to introduce new #
# configurations to Management module #
# Last updated: 11/10/12 #
# Information: Management module traverses ./configuration/ directory and parses any file with #
# .conf extension find therein. Rules to adhere in order to introduce new #
# configuration to Management module, #
# File naming scheme: MGMT.<applicationName>.conf #
# Configuration item naming scheme: 2-byte configuration parameter ID has to be #
# given since this is needed for Management to build a CONFIGURATION_RESPONSE packet #
# <configurationParameterName>|<configurationParameterID> = <value> #
# For IHM, for example, configuration parameter IDs start from 0xC100 and goes on up #
# to 0xC116. Any other application should declare a range. Integer, floating point, #
# and string values may be supplied as follows: #
# MIB_MC002_VEHICLE_TYPE|0xC100 = 1 #
# MIB_MC002_SPEED|0xC101 = 70.8 #
# MIB_MC002_LANG|0xC102 = "en-us" #
# Please notice that configuration parameter ID is given in hexadecimal denotation #
# and string values has be given with quotes #
# Reference: Software/SoftwareComponents/MGMT/CORE/Documentation/SCOREF-MGMT_Configuration.pdf #
####################################################################################################
# IHM Configuration
MIB_MC002_GROUPNUM|0xC100 = 0
MIB_MC002_GROUP1|0xC101 = NULL
MIB_MC002_GROUP2|0xC102 = NULL
MIB_MC002_GROUP3|0xC103 = NULL
MIB_MC002_GROUPN|0xC104 = NULL
MIB_MC002_CRITICLIMIT|0xC105 = 15
MIB_MC002_PLUG|0xC106 = 1
MIB_MC002_VEHICLETYPE|0xC107 = 1
MIB_MC002_CHARGETYPE|0xC108 = 1
MIB_MC002_ACTIVLIMIT|0xC109 = 0
MIB_MC002_WAITTIME|0xC10A = 0
MIB_MC002_CHARGETIME|0xC10B = 0
MIB_MC002_PROVIDERNUM|0xC10C = 6
MIB_MC002_PROVIDER1|0xC10D = NULL
MIB_MC002_PROVIDER2|0xC10E = NULL
MIB_MC002_PROVIDER3|0xC10F = NULL
MIB_MC002_PROVIDERN|0xC110 = NULL
MIB_MC002_PRICE|0xC111 = 0
MIB_MC002_DETOUR|0xC112 = 0
valgrind --track-origins=yes --leak-check=full --show-reachable=yes -v -v ./SCOREF-MGMT MGMT.conf
# Verify parameters
if [ $# -ne 1 ]
then
echo "Usage: `basename $0` <version>"
exit
fi
VERSION=$1
BINARY_NAME=SCOREF-MGMT
RELEASE_NAME="$BINARY_NAME-$VERSION"
echo "Building the version $VERSION"
make clean &> /dev/null
make BUILD_STATIC=1 -j &> /dev/null
strip bin/$BINARY_NAME
echo "Preparing the release..."
mkdir $RELEASE_NAME
echo "Copying binary..."
cp bin/$BINARY_NAME $RELEASE_NAME
echo "Copying configuration files..."
cp bin/MGMT.conf bin/configuration -r $RELEASE_NAME
rm $RELEASE_NAME/configuration/.svn -rfv &> /dev/null
echo "Copying documentation..."
cp README README.RUNNING $RELEASE_NAME
echo "Preparing the compressed archive..."
tar cjvf $RELEASE_NAME.tar.bz2 $RELEASE_NAME &> /dev/null
echo "Removing temporary directory..."
rm $RELEASE_NAME -rf &> /dev/null
echo "Release is ready"
exit
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_packet_sender.hpp
* \brief This is an abstract base class implemented by ManagementServer class
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_PACKET_SENDER_H_
#define MGMT_PACKET_SENDER_H_
/**
* This is an abstract base class implemented by ManagementServer class
* to provide functionality of status query packet sending for InquiryThread
*/
class IManagementPacketSender {
public:
/**
* Virtual destructor for this abstract base class
*/
// virtual ~IManagementPacketSender() = 0;
public:
/**
* Send a Wireless State Request packet to GN client
*
* @param none
* @return true if success, false otherwise
*/
virtual bool sendWirelessStateRequest() = 0;
};
#endif /* MGMT_PACKET_SENDER_H_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file main.cpp
* \brief SCOREF Management module's hometown
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include <iostream>
#include <vector>
#include <string>
#include <ctime>
using namespace std;
#include <boost/program_options.hpp>
#include <boost/array.hpp>
#include <boost/asio.hpp>
using boost::asio::ip::udp;
#include "mgmt_packet_handler.hpp"
#include "mgmt_client_manager.hpp"
#include "util/mgmt_exception.hpp"
#include "mgmt_configuration.hpp"
#include "util/mgmt_util.hpp"
#include "util/mgmt_log.hpp"
#include "mgmt_server.hpp"
#include "version.hpp"
void printVersion() {
cerr << "SCORE@F MANAGEMENT Module version " << MGMT_VERSION << endl;
}
void printHelp(const string& binaryName) {
cerr << binaryName << " <configurationFile> [logFileName]" << endl;
}
#ifdef BOOST_VERSION_1_50
const string CONF_HELP_PARAMETER_STRING = "help";
const string CONF_LOG_LEVEL_PARAMETER_STRING = "loglevel";
#endif
int main(int argc, char** argv) {
string logFileName, configurationFileName;
/**
* Process command-line parameters
* Configuration file name is necessary yet log file name is optional here
*/
if (argc > 1 && (!string(argv[1]).compare("-v") || !string(argv[1]).compare("--version"))) {
printVersion();
exit(0);
} else if (argc == 2) {
logFileName = "SCOREF-MGMT.log";
configurationFileName = argv[1];
} else if (argc == 3) {
configurationFileName = argv[1];
logFileName = argv[2];
} else {
printHelp(argv[0]);
exit(1);
}
#ifdef BOOST_VERSION_1_50
/**
* Define and parse command-line parameters
*/
po::options_description commandLineOptions("Command-line options");
desc.add_options()
(CONF_HELP_PARAMETER_STRING, "Print help message")
(CONF_LOG_LEVEL_PARAMETER_STRING, po::value<int>(), "Set log level (DEBUG=0, INFO=1, WARNING=2, ERROR=3)");
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, commandLineOptions), vm);
po::notify(vm);
if (vm.count(CONF_HELP_PARAMETER_STRING)) {
printHelp(argv[0]);
return 1;
}
if (vm.count(CONF_LOG_LEVEL_PARAMETER_STRING)) {
logger.info("Log level was set to " + vm[CONF_LOG_LEVEL_PARAMETER_STRING].as<int>());
logger.setLogLevel(vm[CONF_LOG_LEVEL_PARAMETER_STRING.as<int>]);
} else {
logger.info("Compression level was not set, default is DEBUG");
}
#endif
/**
* Create a Logger object
*/
Logger logger(logFileName, Logger::TRACE);
/**
* Prepare the list of FACilities configuration files by traversing
* the configration/ directory's content
*/
string facilitiesConfigurationFileDirectory = "configuration/";
vector<string> configurationFileVector = Util::getListOfFiles(facilitiesConfigurationFileDirectory);
/**
* Add MGMT module's configuration file to the list
*/
configurationFileVector.push_back(configurationFileName);
Configuration configuration(configurationFileVector, logger);
configuration.setFacilitiesConfigurationDirectory(facilitiesConfigurationFileDirectory);
/**
* Create the father
*/
ManagementInformationBase mib(logger);
/**
* Parse configuration file and create UDP server socket
*/
try {
configuration.parseConfigurationFiles(mib);
} catch (Exception& e) {
e.updateStackTrace("Cannot parse the configuration file");
e.printStackTrace();
exit(-1);
}
/**
* Update IPv6 configuration
*/
if (configuration.isIpv6Enabled())
mib.enableIpv6();
/**
* Initialise MIB
*/
try {
mib.initialise();
} catch (Exception& e) {
e.updateStackTrace("Cannot initialise ManagementInformationBase!");
throw;
}
/**
* Instantiate a Client Manager and pass it to Management Server
*/
boost::asio::io_service ioService;
ManagementClientManager clientManager(mib, configuration, logger);
ManagementServer server(ioService, configuration, mib, clientManager, logger);
try {
ioService.run();
} catch (Exception& e) {
e.updateStackTrace("Cannot run I/O service!");
e.printStackTrace();
} catch (std::exception& e) {
logger.error(e.what());
}
logger.info("Exiting...");
return 0;
}
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_client.cpp
* \brief A container to hold information about Management clients
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "packets/mgmt_gn_packet_location_table_request.hpp"
#include "util/mgmt_exception.hpp"
#include <boost/lexical_cast.hpp>
#include "mgmt_client.hpp"
ManagementClient::ManagementClient(ManagementInformationBase& mib, const udp::endpoint& clientEndpoint, u_int8_t wirelessStateUpdateInterval, u_int8_t locationUpdateInterval, Logger& logger)
: mib(mib), clientEndpoint(clientEndpoint), logger(logger) {
/**
* Check that source port is not an ephemeral port which would
* change every time a client sendto()s to MGMT
*/
if (clientEndpoint.port() >= 32768 && clientEndpoint.port() <= 61000)
logger.error("Client uses an ephemeral port that will change every time it sends data and this will confuse my state management!");
/**
* Initialise state strings map
*/
clientStateStringMap.insert(std::make_pair(ManagementClient::OFFLINE, "OFFLINE"));
clientStateStringMap.insert(std::make_pair(ManagementClient::ONLINE, "ONLINE"));
/**
* Initialise type strings map
*/
clientTypeStringMap.insert(std::make_pair(ManagementClient::UNKNOWN, "Unknown"));
clientTypeStringMap.insert(std::make_pair(ManagementClient::GN, "GeoNetworking"));
clientTypeStringMap.insert(std::make_pair(ManagementClient::FAC, "Facilities"));
clientTypeStringMap.insert(std::make_pair(ManagementClient::LTE, "Long Term Evolution"));
/**
* Initialise this client's state and type
*/
state = ManagementClient::OFFLINE;
type = ManagementClient::UNKNOWN;
/**
* We are not waiting a reply from this client now
*/
repliedToTheLastPacket = true;
}
ManagementClient::ManagementClient(const ManagementClient& managementClient)
: mib(managementClient.mib), clientEndpoint(managementClient.clientEndpoint), logger(managementClient.logger) {
throw Exception("Copy constructor is called for a ManagementClient object!", logger);
}
ManagementClient::~ManagementClient() {
clientTypeStringMap.clear();
}
boost::asio::ip::address ManagementClient::getAddress() const {
return clientEndpoint.address();
}
unsigned short int ManagementClient::getPort() const {
return clientEndpoint.port();
}
const udp::endpoint& ManagementClient::getEndpoint() const {
return this->clientEndpoint;
}
ManagementClient::ManagementClientState ManagementClient::getState() const {
return state;
}
bool ManagementClient::setState(ManagementClient::ManagementClientState state) {
if (this->state == state)
return true;
logger.info("State has changed from " + clientStateStringMap[this->state] + " to " + clientStateStringMap[state]);
this->state = state;
return true;
}
ManagementClient::ManagementClientType ManagementClient::getType() const {
return this->type;
}
bool ManagementClient::setType(ManagementClient::ManagementClientType type) {
this->type = type;
return true;
}
bool ManagementClient::operator==(const ManagementClient& client) const {
if (this->clientEndpoint.address() == client.getAddress())
return true;
return false;
}
bool ManagementClient::operator<(const ManagementClient& client) const {
if (this->clientEndpoint.address() < client.getAddress())
return true;
return false;
}
void ManagementClient::waitingForReply() {
repliedToTheLastPacket = false;
}
void ManagementClient::replyReceived() {
repliedToTheLastPacket = true;
}
bool ManagementClient::isAlive() {
return state == ManagementClient::ONLINE && repliedToTheLastPacket == true;
}
string ManagementClient::toString() {
stringstream ss;
ss << "ManagementClient[ip:" << clientEndpoint.address().to_string()
<< ", port:" << boost::lexical_cast<string>(clientEndpoint.port())
<< ", type:" << clientTypeStringMap[type] << ", state:" << clientStateStringMap[state] << "]";
return ss.str();
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_client.hpp
* \brief A container to hold information about Management clients
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_CLIENT_HPP_
#define MGMT_CLIENT_HPP_
#include "util/mgmt_log.hpp"
#include <boost/asio.hpp>
#include <string>
#include <map>
using boost::asio::ip::udp;
/**
* A container to hold information about Management clients, mostly used
* in Message Handler code
*/
class ManagementClient {
public:
/**
* Client state
*/
enum ManagementClientState {
/**
* Client is not connected or is unreachable
*/
OFFLINE = 0,
/**
* A client is connected and alive
*/
ONLINE = 1,
};
/**
* Client type
*/
enum ManagementClientType {
/**
* Initial value, this is the value set when a client object
* is created but the type has not yet determined
*/
UNKNOWN = 0,
/**
* GeoNetworking client
*/
GN = 1,
/**
* Facilities client
*/
FAC = 2,
/**
* LTE client
*/
LTE = 3
};
public:
/**
* Constructor for ManagementClient class
*
* @param mib Management Information Base reference
* @param clientEndpoint Client's connection information
* @param wirelessStateUpdateInterval Determines how frequent the wireless state update will be performed
* @param locationUpdateInterval Determines how frequent the location update will be performed
* @logger Logger object reference
*/
ManagementClient(ManagementInformationBase& mib, const udp::endpoint& clientEndpoint, u_int8_t wirelessStateUpdateInterval, u_int8_t locationUpdateInterval, Logger& logger);
/**
* Destructor for ManagementClient class
*/
~ManagementClient();
private:
/**
* Copy constructor to prevent the usage of default copy constructor
*/
ManagementClient(const ManagementClient& managementClient);
public:
/**
* Getter for IP address of this client
*
* @return IP address of this client
*/
boost::asio::ip::address getAddress() const;
/**
* Getter for port number of this client
*
* @return Port number of this client
*/
unsigned short int getPort() const;
/**
* Returns a reference to the udp::endpoint of this client
*
* return A reference to udp::endpoint of this client
*/
const udp::endpoint& getEndpoint() const;
/**
* Returns the state of this client
*
* @return ManagementClientState value for this client
*/
ManagementClientState getState() const;
/**
* Sets the state of this client with given state
*
* @param state New ManagementClientState for this client
* @return true on success, false otherwise
*/
bool setState(ManagementClientState state);
/**
* Returns the type of this client
*
* @return ManagementClientType value for this client
*/
ManagementClientType getType() const;
/**
* Sets the type of this client with given state
*
* @param state New ManagementClientType for this client
* @return true on success, false otherwise
*/
bool setType(ManagementClientType type);
/**
* Overloaded == operator to use ManagementClient type as a std::map key
*
* @param client Client that is going to be compared with
* @return true if clients are the same, false otherwise
*/
bool operator==(const ManagementClient& client) const;
/**
* Overloaded < operator to use ManagementClient type as a std::map key
*
* @param client Client that is going to be compared with
* @return true if host object's IP address is smaller, false otherwise
*/
bool operator<(const ManagementClient& client) const;
/**
* This is called when we send a packet to this client that
* requires a response
*
* @param none
* @return none
*/
void waitingForReply();
/**
* This is called when we receive a reply corresponding to the
* request packet we sent to this client
*
* @param none
* @return none
*/
void replyReceived();
/**
* Returns if this client has replied to the last packet we sent
*
* @param none
* @return true if this client is alive, false otherwise
*/
bool isAlive();
/**
* Returns string representation of this client
*
* @return std::string representation of this client
*/
string toString();
private:
/**
* Management Information Base reference
*/
ManagementInformationBase& mib;
/**
* Client's udp::endpoint information
*/
udp::endpoint clientEndpoint;
/**
* Client's connection state with Management module
*/
ManagementClient::ManagementClientState state;
/**
* Client type
*/
ManagementClient::ManagementClientType type;
/**
* Logger object reference
*/
Logger& logger;
/**
* String representations for Management Client states
*/
map<ManagementClient::ManagementClientState, string> clientStateStringMap;
/**
* String representations for Management Client types
*/
map<ManagementClient::ManagementClientType, string> clientTypeStringMap;
/**
* True if this client has replied to the last packet we sent to
* it that requires a response, false otherwise
*/
bool repliedToTheLastPacket;
/**
* Last heartbeat's receive time
*/
time_t lastHeartbeatTime;
};
#endif /* MGMT_CLIENT_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_client_manager.cpp
* \brief A container for a manager for Management clients
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "packets/mgmt_gn_packet_configuration_available.hpp"
#include "mgmt_client_manager.hpp"
#include "util/mgmt_exception.hpp"
#include <boost/lexical_cast.hpp>
ManagementClientManager::ManagementClientManager(ManagementInformationBase& mib, Configuration& configuration, Logger& logger)
: mib(mib), configuration(configuration), logger(logger) {
}
ManagementClientManager::~ManagementClientManager() {
clientVector.clear();
}
ManagementClientManager::Task ManagementClientManager::updateClientState(const udp::endpoint& clientEndpoint, EventType eventType) {
bool clientExists = false;
ManagementClient* client = NULL;
/**
* Traverse client list and check if we already have this client
*/
for (vector<ManagementClient*>::const_iterator it = clientVector.begin(); it != clientVector.end(); ++it) {
logger.trace("Comparing IP addresses " + (*it)->getAddress().to_string() + " and " + clientEndpoint.address().to_string());
logger.trace("Comparing UDP ports " + boost::lexical_cast<string>((*it)->getPort()) + " and " + boost::lexical_cast<string>(clientEndpoint.port()));
if ((*it)->getAddress() == clientEndpoint.address() && (*it)->getPort() == clientEndpoint.port()) {
logger.debug("A client object for " + clientEndpoint.address().to_string() + ":" + boost::lexical_cast<string>(clientEndpoint.port()) + " is found");
client = *it;
clientExists = true;
}
}
/**
* Create a new client object if we couldn't find one
*/
if (!clientExists) {
ManagementClient* newClient = NULL;
try {
newClient = new ManagementClient(mib, clientEndpoint, configuration.getWirelessStateUpdateInterval(), configuration.getLocationUpdateInterval(), logger);
} catch (Exception& e) {
e.updateStackTrace("Cannot create a ManagementClient object!");
throw;
} catch (std::exception& e) {
throw Exception(e.what(), logger);
}
clientVector.push_back(newClient);
logger.info("A client object for " + clientEndpoint.address().to_string() + ":" + boost::lexical_cast<string>(clientEndpoint.port()) + " is created");
client = newClient;
}
/**
* Update client's (the one either found or created) state according
* to the event type
*/
switch (eventType) {
case MGMT_GN_EVENT_CONF_REQUEST:
case MGMT_FAC_EVENT_CONF_REQUEST:
case MGMT_FAC_EVENT_CONF_NOTIFICATION:
case MGMT_GN_EVENT_STATE_WIRELESS_STATE_RESPONSE:
case MGMT_GN_EVENT_STATE_NETWORK_STATE:
case MGMT_GN_EVENT_CONF_COMM_PROFILE_REQUEST:
case MGMT_FAC_EVENT_CONF_COMM_PROFILE_REQUEST:
case MGMT_FAC_EVENT_CONF_COMM_PROFILE_SELECTION_REQUEST:
case MGMT_GN_EVENT_LOCATION_TABLE_RESPONSE:
case MGMT_FAC_EVENT_LOCATION_UPDATE:
case MGMT_LTE_EVENT_STATE_WIRELESS_STATE_RESPONSE:
client->setState(ManagementClient::ONLINE);
break;
/**
* Any other packet doesn't cause a state change for clients
*/
default:
break;
}
/**
* Update client's type according to incoming message
*/
switch (eventType) {
case MGMT_GN_EVENT_LOCATION_UPDATE:
case MGMT_GN_EVENT_LOCATION_TABLE_REQUEST:
case MGMT_GN_EVENT_LOCATION_TABLE_RESPONSE:
case MGMT_GN_EVENT_CONF_UPDATE_AVAILABLE:
case MGMT_GN_EVENT_CONF_REQUEST:
case MGMT_GN_EVENT_CONF_CONT_RESPONSE:
case MGMT_GN_EVENT_CONF_BULK_RESPONSE:
case MGMT_GN_EVENT_CONF_COMM_PROFILE_REQUEST:
case MGMT_GN_EVENT_CONF_COMM_PROFILE_RESPONSE:
case MGMT_GN_EVENT_STATE_WIRELESS_STATE_REQUEST:
case MGMT_GN_EVENT_STATE_WIRELESS_STATE_RESPONSE:
case MGMT_GN_EVENT_STATE_NETWORK_STATE:
client->setType(ManagementClient::GN);
break;
case MGMT_FAC_EVENT_LOCATION_UPDATE:
case MGMT_FAC_EVENT_LOCATION_TABLE_REQUEST:
case MGMT_FAC_EVENT_LOCATION_TABLE_RESPONSE:
case MGMT_FAC_EVENT_CONF_REQUEST:
case MGMT_FAC_EVENT_CONF_CONT_RESPONSE:
case MGMT_FAC_EVENT_CONF_BULK_RESPONSE:
case MGMT_FAC_EVENT_CONF_NOTIFICATION:
case MGMT_FAC_EVENT_CONF_COMM_PROFILE_REQUEST:
case MGMT_FAC_EVENT_CONF_COMM_PROFILE_RESPONSE:
case MGMT_FAC_EVENT_CONF_COMM_PROFILE_SELECTION_REQUEST:
case MGMT_FAC_EVENT_CONF_COMM_PROFILE_SELECTION_RESPONSE:
client->setType(ManagementClient::FAC);
break;
case MGMT_LTE_EVENT_STATE_WIRELESS_STATE_RESPONSE:
client->setType(ManagementClient::LTE);
break;
case MGMT_EVENT_ANY:
default:
logger.warning("Cannot determine client type by incoming event type/subtype!");
client->setType(ManagementClient::UNKNOWN);
break;
}
logger.info(toString());
/**
* Return a task according to the client type
*/
if (client->getType() == ManagementClient::GN && !clientExists) {
/**
* This is a new GN client so we should ask for Location Table
*/
return ManagementClientManager::SEND_LOCATION_TABLE_REQUEST;
}
return ManagementClientManager::NOTHING;
}
const ManagementClient* ManagementClientManager::getClientByType(ManagementClient::ManagementClientType clientType) const {
/**
* Traverse client vector and find the specific client of given type
*/
for (vector<ManagementClient*>::const_iterator it = clientVector.begin(); it != clientVector.end(); ++it) {
if ((*it)->getType() == clientType)
return *it;
}
return NULL;
}
ManagementClient* ManagementClientManager::getClientByEndpoint(const udp::endpoint& endPoint) {
/**
* Traverse client vector and find the specific client at given end point
*/
for (vector<ManagementClient*>::const_iterator it = clientVector.begin(); it != clientVector.end(); ++it) {
if ((*it)->getEndpoint() == endPoint)
return *it;
}
return NULL;
}
bool ManagementClientManager::isGnConnected() const {
return (getClientByType(ManagementClient::GN) == NULL) ? false : true;
}
bool ManagementClientManager::isFacConnected() const {
return (getClientByType(ManagementClient::FAC) == NULL) ? false : true;
}
string ManagementClientManager::toString() {
stringstream ss;
ss << "Client Status[count:" << clientVector.size() << "]" << endl;
for (vector<ManagementClient*>::iterator it = clientVector.begin(); it != clientVector.end(); ++it)
ss << (*it)->toString() << endl;
return ss.str();
}
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fsr/openairinterface
Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
*******************************************************************************/
/*!
* \file mgmt_client_manager.hpp
* \brief A container for a manager for Management clients
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_CLIENT_MANAGER_HPP_
#define MGMT_CLIENT_MANAGER_HPP_
#include "util/mgmt_udp_socket.hpp"
#include "mgmt_configuration.hpp"
#include "mgmt_types.hpp"
#include "util/mgmt_log.hpp"
#include "mgmt_client.hpp"
#include <vector>
using namespace std;
/**
* A container for a manager for Management clients
*/
class ManagementClientManager {
public:
/**
* Following enumeration is used to tell caller of updateManagementClientState()
* method what steps are to follow
*/
enum Task {
/**
* Nothing is to be done
*/
NOTHING = 0,
/**
* Send a Location Table Request (only if the client is GN)
*/
SEND_LOCATION_TABLE_REQUEST = 1
};
public:
/**
* Constructor for ManagementClientManager class
*
* @param mib Management Information Base reference
* @param configuration Management configuration to pass to/to manage client objects
* @param logger Logger object reference
*/
ManagementClientManager(ManagementInformationBase& mib, Configuration& configuration, Logger& logger);
/**
* Destructor for ManagementClientManager class
*/
~ManagementClientManager();
public:
/**
* Handles incoming data and updates client vector accordingly, by creating
* a new client object if necessary or updating its state if there's one
* defined for sender source address
*
* @param clientEndpoint A udp::endpoint reference
* @param eventType Type/subtype of event the packet was sent for
* @return ManagementClientManager::Task for the caller
*/
ManagementClientManager::Task updateClientState(const udp::endpoint& clientEndpoint, EventType eventType);
/**
* Returns relevant ManagementClient of given type
*
* @return A const pointer of the ManagementClient object of given type
*/
const ManagementClient* getClientByType(ManagementClient::ManagementClientType clientType) const;
/**
* Returns the client at given end
*
* @param endPoint Connection end point information of type udp::endpoint
* @return A pointer of the relevant ManagementClient object
*/
ManagementClient* getClientByEndpoint(const udp::endpoint& endPoint);
/**
* Tells if GN is connected
*
* @param none
* @return true if there's a GN connected, false otherwise
*/
bool isGnConnected() const;
/**
* Tells if FAC is connected
*
* @param none
* @return true if there's a FAC connected, false otherwise
*/
bool isFacConnected() const;
/**
* Returns the string representation of Client Manager and the clients it manages
*
* @param none
* @return std::string representation of this class
*/
string toString();
private:
/**
* Management Information Base reference
*/
ManagementInformationBase& mib;
/**
* Client vector holding clients of connected/online (see ManagementClientState) state
*/
vector<ManagementClient*> clientVector;
/**
* Configuration object reference to fetch necessary configuration information
*/
Configuration& configuration;
/**
* Logger object reference
*/
Logger& logger;
};
#endif /* MGMT_CLIENT_MANAGER_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_comm_prof_manager.cpp
* \brief Communication Profiles list is kept and maintained by this container
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_comm_prof_manager.hpp"
#include "util/mgmt_exception.hpp"
#include <boost/lexical_cast.hpp>
CommunicationProfileManager::CommunicationProfileManager(Logger& logger)
: logger(logger) {
initialise();
}
CommunicationProfileManager::~CommunicationProfileManager() {
communicationProfileMap.clear();
communicationProfileStringMap.clear();
}
bool CommunicationProfileManager::insert(const string& profileIdString, const string& profileDefinitionString) {
if (profileIdString.empty() || profileDefinitionString.empty())
return false;
/**
* Parse communication profiles defined in the configuration file and
* insert them into the communication profile map
*/
CommunicationProfileItem communicationProfileItem;
/**
* std::string as a map key should not have a NULL at
* the end so here we trim it
*/
string trimmedProfileDefinitionString = Util::trim(profileDefinitionString, '\0');
try {
communicationProfileItem = parse(profileIdString, trimmedProfileDefinitionString);
} catch (Exception& e) {
e.updateStackTrace("Cannot parse Communication Profile definitions");
throw;
}
communicationProfileMap.insert(communicationProfileMap.end(), std::make_pair(communicationProfileItem.id, communicationProfileItem));
logger.debug("Communication profile: " + profileIdString + ":" + profileDefinitionString);
logger.info("Communication profile: " + communicationProfileItem.toString());
return true;
}
u_int8_t CommunicationProfileManager::getProfileCount() const {
return communicationProfileMap.size();
}
map<CommunicationProfileID, CommunicationProfileItem>& CommunicationProfileManager::getProfileMap() {
return communicationProfileMap;
}
map<CommunicationProfileID, CommunicationProfileItem> CommunicationProfileManager::getProfileMapSubset(u_int32_t filter) {
/**
* If we're asked everything, return everything
*/
if (filter == 0xFFFFFFFF)
return getProfileMap();
map<CommunicationProfileID, CommunicationProfileItem> filteredProfileMap;
map<CommunicationProfileID, CommunicationProfileItem>::const_iterator it = communicationProfileMap.begin();
/**
* If `filter' is zero then return an empty map
*/
if (!filter)
return filteredProfileMap;
u_int8_t transportMask = ((filter & 0xFF000000) >> 24);
u_int8_t networkMask = ((filter & 0xFF0000) >> 16);
u_int8_t accessMask = ((filter & 0xFF00) >> 8);
u_int8_t channelMask = (filter & 0xFF);
logger.info("Preparing a communication profile subset with following filter...");
logger.info("Comm. Profile Filter [transport:" + Util::getBinaryRepresentation(transportMask) + " network:" + Util::getBinaryRepresentation(networkMask) + " access:" + Util::getBinaryRepresentation(accessMask) + " channel:" + Util::getBinaryRepresentation(channelMask) + "]");
/**
* Travers all the communication profiles and find those match with the filter...
*/
while (it != communicationProfileMap.end()) {
/**
* We should take the subset of communication profile table having those profiles
* that provide all the protocols requested in the filter
*/
logger.info("Checking with: " + it->second.toString());
/**
* If the mask is 0xFF then client wants everything, don't check further
*/
if ((transportMask == 0xFF || (it->second.transport & transportMask) == it->second.transport) &&
(networkMask == 0xFF || (it->second.network & networkMask) == it->second.network) &&
(accessMask == 0xFF || (it->second.access & accessMask) == it->second.access)) {
/**
* Channel information is present only if Access technology is ITSG5 so
* we check if `access' field's first bit is set or not
*/
if (channelMask == 0xFF || (Util::isBitSet(it->second.access, 0) && (it->second.channel & channelMask) == it->second.channel)) {
logger.info("Communication profile match, adding this into the COMM_PROFILE_RESPONSE packet...");
filteredProfileMap.insert(filteredProfileMap.end(), std::make_pair(it->first, it->second));
}
}
++it;
}
return filteredProfileMap;
}
CommunicationProfileID CommunicationProfileManager::selectProfile(bool ipv6Enabled, u_int8_t latency, u_int8_t relevance, u_int8_t reliability) {
/**
* Select an appropriate CP according to user requirements
* This decision making was designed by Michelle with regards to the definition in L221 document
*
* See Documentation/Communication Profile Selection/CP Mapping.docx for further information
*/
if (relevance <= 1 && latency <= 1 && reliability <= 1)
return 1;
else if (relevance == 3 && latency == 2 && reliability == 2)
return 1;
else if (relevance <= 3 && latency <= 2 && reliability <= 2)
return 1; // This is 3 in Michelle's document, but changed later on
else if (relevance <= 7 && latency <= 3 && reliability <= 3) {
if (ipv6Enabled)
return 11;
else
return 1; // This is 3 in Michelle's document, but changed later on
}
return 0;
}
string CommunicationProfileManager::toString() const {
stringstream ss;
ss << "Communication profile count: " << communicationProfileMap.size() << endl;
map<CommunicationProfileID, CommunicationProfileItem>::const_iterator it = communicationProfileMap.begin();
while (it != communicationProfileMap.end()) {
ss << "Communication Profile [ID:" << it->second.id
<< ", transport:" << it->second.transport
<< ", network:" << it->second.network
<< ", access: " << it->second.access
<< ", channel: " << it->second.channel << "]" << endl;
++it;
}
return ss.str();
}
void CommunicationProfileManager::initialise() {
/*
* Transport string & index map
*/
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("BTP_A", 1));
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("BTP_B", 2));
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("TCP", 3));
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("UDP", 4));
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("RTP", 5));
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("STCP", 6));
/*
* Network string & index map
*/
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("GN", 1));
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("IPv6_GN", 2));
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("IPv6", 3));
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("IPv4", 4));
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("IPv4/v6", 5));
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("DSMIPv4/v6", 6));
/*
* Access string & index map
*/
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("ITSG5", 1));
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("3G", 2));
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("11n", 3));
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("Ethernet", 4));
/*
* Channel string & index map
*/
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("CCH", 1));
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("SCH1", 2));
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("SCH2", 3));
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("SCH3", 4));
communicationProfileStringMap.insert(communicationProfileStringMap.end(), std::make_pair("SCH4", 5));
}
CommunicationProfileItem CommunicationProfileManager::parse(const string& profileIdString, const string& profileDefinitionString) {
CommunicationProfileItem communicationProfileItem;
u_int8_t profileID = 0x00;
try {
profileID = (u_int8_t)boost::lexical_cast<unsigned short>(profileIdString.substr(profileIdString.find("CP") + 2, profileIdString.length() - 2).c_str());
communicationProfileItem.id = profileID;
} catch (...) {
throw Exception("Cannot parse Communication Profile ID string '" + profileIdString + "' in configuration file", logger);
}
/*
* Parse communication profile string and get tokens for each layer
*/
vector<string> profileItemVector = Util::split(profileDefinitionString, ',');
const string access = profileItemVector[2];
string channel;
/*
* For access methods `3G' and `Ethernet' this information is not relevant; for `11n'
* the choice is made by the Access Point, here parse accordingly
*/
if (!access.compare(0, 2, "3G") || !access.compare(0, 3, "11n") || !access.compare(0, 8, "Ethernet")) {
channel = "";
} else {
channel = profileItemVector[3];
}
/*
* Fill transport, network, access, and channel fields respectively
*/
setFlags(profileItemVector[0], communicationProfileItem.transport);
setFlags(profileItemVector[1], communicationProfileItem.network);
setFlags(profileItemVector[2], communicationProfileItem.access);
if (channel.empty()) {
logger.info("Access type is either 3G, or Ethernet, or 11n. Skipping channel information");
} else {
setFlags(profileItemVector[3], communicationProfileItem.channel);
}
return communicationProfileItem;
}
bool CommunicationProfileManager::setFlags(const string& configuration, u_int8_t& octet) {
if (configuration.empty())
return false;
vector<string> profileStrings = Util::split(configuration, ':');
vector<string>::iterator iterator = profileStrings.begin();
while (iterator != profileStrings.end()) {
/**
* Verify incoming communication profile definition string item and handle "BTP" exception
*/
if (iterator->compare("BTP") == 0) {
logger.debug("Communication profile string 'BTP' has found, both BTP_A and BTP_B flags will be set");
/**
* If communication profile includes BTP then we should set both BTP_A and BTP_B
* bits since they'll both be defined and available
*
* Bit indexes start from 1 in 'MNGT to CM-GN Interface' paper but it
* corresponds to bit 0 for Util::setBit() so here we subtract 1 to
* find index against 0 as the first
*/
Util::setBit(octet, static_cast<u_int8_t>(communicationProfileStringMap["BTP_A"] - 1));
Util::setBit(octet, static_cast<u_int8_t>(communicationProfileStringMap["BTP_B"] - 1));
} else if (communicationProfileStringMap[*iterator] != 0) {
/*
* If index is valid than set the bit at that index
*/
Util::setBit(octet, static_cast<u_int8_t>(communicationProfileStringMap[*iterator] - 1));
} else if (communicationProfileStringMap[*iterator] == 0) {
/*
* Invalid strings are ignored
*/
logger.warning("Communication profile definition string '" + *iterator + "' is not valid!");
logger.info("Check SCOREF-MGMT_Configuration.pdf file for valid configuration settings");
}
++iterator;
}
return true;
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_comm_prof_manager.hpp
* \brief Communication Profiles list is kept and maintained by this container
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_COMM_PROF_MANAGER_HPP_
#define MGMT_COMM_PROF_MANAGER_HPP_
#include "util/mgmt_util.hpp"
#include "util/mgmt_log.hpp"
#include "mgmt_types.hpp"
#include <string>
#include <map>
using namespace std;
/**
* Communication Profile Item
*/
typedef u_int32_t CommunicationProfileID;
struct CommunicationProfileItem {
CommunicationProfileID id;
u_int8_t transport;
u_int8_t network;
u_int8_t access;
u_int8_t channel;
/**
* Constructor for CommunicationProfileItem to
* initialise variables
*/
CommunicationProfileItem() {
id = 0;
transport = 0;
network = 0;
access = 0;
channel = 0;
}
string toString() const {
stringstream ss;
ss << "[id:" << setfill('0') << setw(2) << id
<< " transport:" << Util::getBinaryRepresentation(transport)
<< " network:" << Util::getBinaryRepresentation(network)
<< " access:" << Util::getBinaryRepresentation(access)
<< " channel:" << Util::getBinaryRepresentation(channel) << "]";
return ss.str();
}
} __attribute__((packed));
/**
* Communication Profiles list is kept and maintained by this container
*/
class CommunicationProfileManager {
public:
/**
* Constructor for CommunicationProfileManager class
*
* @param logger Logger object reference
*/
CommunicationProfileManager(Logger& logger);
/**
* Destructor for CommunicationProfileManager class
*/
~CommunicationProfileManager();
public:
/**
* Inserts given communication profile information into the table
*
* @param profileIdString Communication profile ID string
* @param profileDefinitionString Communication profile details
* @return true on success, false otherwise
*/
bool insert(const string& profileIdString, const string& profileDefinitionString);
/**
* Returns the number of profiles present
*
* @return Number of communication profiles, ie. table size
*/
u_int8_t getProfileCount() const;
/**
* Returns communication profile map
*
* @return std::map of Communication Profile Table
*/
map<CommunicationProfileID, CommunicationProfileItem>& getProfileMap();
/**
* Returns communication profile map subset filtered by incoming request map
*
* @param filter 32-bit filter part of a Communication Profile Request packet
* @return Filtered subset of communication profile
*/
map<CommunicationProfileID, CommunicationProfileItem> getProfileMapSubset(u_int32_t filter);
/**
* In this method we have the intelligent code that'll pick a proper communication
* profile according to the parameters (or in other words the requirements) given
* by the client
*
* @param ipv6Enabled Indicates if IPv6 is enabled
* @param latency Latency requirement
* @param relevance Relevance requirement
* @param reliability Reliability requirement
* @return A communication profile ID of type CommunicationProfileID
*/
static CommunicationProfileID selectProfile(bool ipv6Enabled, u_int8_t latency, u_int8_t relevance, u_int8_t reliability);
/**
* Returns string representation of Communication Profile Table
*
* return std::string representation of table
*/
string toString() const;
private:
/**
* Initialises profile item strings
*/
void initialise();
/**
* Parses comma-separated Communication Profile string and returns
* a CommunicationProfileItem structure filled accordingly
*
* @param profileIdString Profile ID string (CP1, CP2, etc.)
* @param profileDefinitionString Comma-separated profile definition
* @return CommunicationProfileItem having parsed information
*/
CommunicationProfileItem parse(const string& profileIdString, const string& profileDefinitionString);
/**
* A helper method to set any bits given in particular communication
* profile string, e.g. if a string "IPv4/v6:DSMIPv4/v6" is given then
* this method will set both 'IPv4/v6' and 'DSMIPv4/v6' flags in given
* octet
*
* @param octet Octet that the found out flags will be set
* @return true on success, false otherwise
*/
bool setFlags(const string& configuration, u_int8_t& octet);
private:
/**
* Communication profile map
*/
map<CommunicationProfileID, CommunicationProfileItem> communicationProfileMap;
/**
* Communication profile string and bitmap index map
*/
map<string, u_int8_t> communicationProfileStringMap;
/**
* Logger object reference
*/
Logger& logger;
};
#endif /* MGMT_COMM_PROF_MANAGER_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_configuration.cpp
* \brief A container with configuration file parsing capability
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "util/mgmt_exception.hpp"
#include "mgmt_configuration.hpp"
#include <boost/lexical_cast.hpp>
#include <boost/tokenizer.hpp>
#include <iostream>
#include <fstream>
using namespace boost;
using namespace std;
/**
* Initialise configuration parameter name strings
*/
const string Configuration::CONF_SERVER_PORT_PARAMETER("CONF_SERVER_PORT");
const string Configuration::CONF_WIRELESS_STATE_UPDATE_INTERVAL("CONF_WIRELESS_STATE_UPDATE_INTERVAL");
const string Configuration::CONF_LOCATION_UPDATE_INTERVAL("CONF_LOCATION_UPDATE_INTERVAL");
const string Configuration::CONF_IPV6_ENABLED("CONF_IPV6_ENABLED");
const string Configuration::CONF_LOG_LEVEL("CONF_LOG_LEVEL");
Configuration::Configuration(const vector<string>& configurationFileNameVector, Logger& logger)
: configurationFileNameVector(configurationFileNameVector), logger(logger) {
/**
* Write given configuration files' names
*/
stringstream ss;
vector<string>::const_iterator it = configurationFileNameVector.begin();
while (it != configurationFileNameVector.end())
/**
* Following is a nasty-looking one-liner not to put a comma at the end
*/
ss << *it++ << ((it+1 == configurationFileNameVector.end()) ? "" : ", ");
logger.info("Following " + boost::lexical_cast<string>(configurationFileNameVector.size()) + \
" file(s) have been found (only those with .conf extension will be parsed): " + ss.str());
/**
* Set default values
*/
this->serverPort = 1402;
this->wirelessStateUpdateInterval = 10;
this->locationUpdateInterval = 20;
this->ipv6Enabled = false;
}
Configuration::~Configuration() {
configurationFileNameVector.clear();
}
bool Configuration::parseConfigurationFiles(ManagementInformationBase& mib) {
/**
* Verify there is at least one configuration file given to be parsed
*/
if (configurationFileNameVector.empty())
throw Exception("No configuration file name is given to be parsed", logger);
ifstream configurationFileStream;
string parameter, value;
string line;
string netParameterPrefix("MIB_GN_NET");
string facParameterPrefix("MIB_GN_FAC");
string ihmParameterPrefix("MIB_MC002");
string commonParameterPrefix("MIB_GN_ALL");
string confParameterPrefix("CONF_");
string communicationProfilePrefix("CP");
/*
* Here we traverse configuration files and let MIB know about
* every single parameter/[parameterID/]value pair we find
*/
for (vector<string>::const_iterator it = configurationFileNameVector.begin(); it != configurationFileNameVector.end(); ++it) {
/**
* Check file name extension and do not parse if it's not '.conf'
*/
string fileExtension = Util::getFileExtension(*it);
if (fileExtension.compare(".conf") != 0) {
logger.warning("There is a file named '" + *it + "' without .conf extension in given list");
continue;
}
string configurationFile = *it;
/**
* Add directory name if a FACilities configuration file is being parsed
*/
if (configurationFile.compare("MGMT.conf") != 0)
configurationFile = facilitiesConfigurationDirectory + configurationFile;
logger.info("Parsing configuration file '" + configurationFile + "'");
configurationFileStream.open(configurationFile.c_str());
if (configurationFileStream.is_open()) {
/**
* Traverse and parse configuration file lines
*/
while (!configurationFileStream.eof()) {
getline(configurationFileStream, line);
if (parseLine(line, parameter, value)) {
/**
* Trim value if it's not a string
*/
if (value.find('"') == string::npos)
value = Util::trim(value, '\0');
/*
* NETwork and FACilities parameters are sent to MIB
*/
if (!line.compare(0, netParameterPrefix.length(), netParameterPrefix) ||
!line.compare(0, facParameterPrefix.length(), facParameterPrefix) ||
!line.compare(0, commonParameterPrefix.length(), commonParameterPrefix)) {
try {
ItsKeyValue valueContainer;
valueContainer.intValue = atoi(value.c_str());
if (mib.setValue(parameter, valueContainer))
logger.info("Parameter '" + parameter + "' has been set to '" + value + "'");
} catch (Exception& e) {
e.updateStackTrace("Cannot set MIB ITS key using value given in the configuration file");
throw;
}
/*
* General configuration parameters are handled locally in this class
*/
} else if (!line.compare(0, confParameterPrefix.size(), confParameterPrefix)) {
try {
setValue(parameter, value);
} catch (Exception& e) {
e.updateStackTrace("Cannot process given configuration value");
throw;
}
/*
* Communication profiles are sent to MIB
*/
} else if (!line.compare(0, communicationProfilePrefix.size(), communicationProfilePrefix)) {
try {
mib.getCommunicationProfileManager().insert(parameter, value);
} catch (Exception& e) {
e.updateStackTrace("Cannot process communication profile string");
throw;
}
/**
* Point de Charge Vehicule Electrique (PCVE) IHM Parameters
*/
} else if (!line.compare(0, ihmParameterPrefix.size(), ihmParameterPrefix)) {
/**
* Parse parameter of format <configurationParameter|configurationParameterID>
*/
string parameterName;
u_int16_t parameterId;
parseParameterId(parameter, parameterName, parameterId);
/**
* Update MIB and add new ITS key but before check ITS data type (it
* can be integer and string)
*/
if (Util::isNumeric(value)) {
logger.info("Adding IHM integer parameter [name:" + parameterName + ", id:" + boost::lexical_cast<string>(parameterId) + ", value:" + value + "]");
mib.getItsKeyManager().addKey(static_cast<ItsKeyID>(parameterId), parameterName, ITS_KEY_TYPE_IHM, atoi(value.c_str()));
} else if (value.find('.') != string::npos) {
logger.info("Adding IHM float parameter [name:" + parameterName + ", id:" + boost::lexical_cast<string>(parameterId) + ", value:" + value + "]");
mib.getItsKeyManager().addKey(static_cast<ItsKeyID>(parameterId), parameterName, ITS_KEY_TYPE_IHM, boost::lexical_cast<float>(value));
} else {
logger.info("Adding IHM string parameter [name:" + parameterName + ", id:" + boost::lexical_cast<string>(parameterId) + ", value:" + value + "]");
/**
* Parse value trimming '"' characters and whitespace if it's not "NULL"
*/
if (value.find("NULL") == string::npos) {
value = value.substr(value.find('"') + 1, value.length() - value.find('"') - 2);
} else {
// Since NULL actually means empty string
value = "";
}
mib.getItsKeyManager().addKey(static_cast<ItsKeyID>(parameterId), parameterName, ITS_KEY_TYPE_IHM, value);
}
} else {
logger.warning("Unrecognized configuration item: '" + parameter + "'");
}
}
}
logger.debug("Closing file stream for '" + configurationFile + "'");
configurationFileStream.close();
} else {
configurationFileStream.close();
throw Exception("Cannot open configuration file '" + configurationFile + "'!", logger);
}
}
return true;
}
bool Configuration::parseLine(const string& line, string& parameter, string& value) {
/**
* Get the substring till '#' character if there's one
*/
string configurationLine = line;
if (line.find('#') != string::npos) {
configurationLine.erase(0, configurationLine.length() - configurationLine.find('#'));
}
/**
* Ignore this line if it's empty or there's no equal sign in it
*/
if (configurationLine.empty() || configurationLine.find('=') == string::npos)
return false;
/**
* Parse the line according to the place of equal sign
*/
parameter = configurationLine.substr(0, configurationLine.find("="));
value = configurationLine.substr(configurationLine.find("=") + 1, configurationLine.length());
/**
* Trim value string if there's no '"' character
*/
remove(parameter.begin(), parameter.end() + 1, ' ');
if (value.find('"') == string::npos)
remove(value.begin(), value.end() + 1, ' ');
return true;
}
bool Configuration::parseParameterId(const string& param, string& parameterString, u_int16_t& parameterId) {
if (param.find('|') == string::npos)
return false;
/**
* Parse the string according to the separator '|'
*/
parameterString = param.substr(0, param.find('|'));
stringstream parameterIdStringStream;
parameterIdStringStream << hex << param.substr(param.find('|') + 1, param.length());
/**
* Cast parameter ID string and update incoming variable reference
*/
parameterIdStringStream >> parameterId;
return true;
}
bool Configuration::setValue(const string& parameter, const string& value) {
/**
* Parse CONF_SERVER_PORT parameter
*/
if (!parameter.compare(0, CONF_SERVER_PORT_PARAMETER.length(), CONF_SERVER_PORT_PARAMETER)) {
setServerPort(atoi(value.c_str()));
/**
* Parse CONF_WIRELESS_STATE_UPDATE_INTERVAL parameter
*/
} else if (!parameter.compare(0, CONF_WIRELESS_STATE_UPDATE_INTERVAL.length(), CONF_WIRELESS_STATE_UPDATE_INTERVAL)) {
setWirelessStateUpdateInterval(atoi(value.c_str()));
/**
* Parse CONF_LOCATION_UPDATE_INTERVAL parameter
*/
} else if (!parameter.compare(0, CONF_LOCATION_UPDATE_INTERVAL.length(), CONF_LOCATION_UPDATE_INTERVAL)) {
/**
* This configuration parameter is removed because Location Update is now sent by
* a module developed by Laurens from POTI directly to GN
*
* Add the following configuration parameter into MGMT.conf to get this back
*
* CONF_LOCATION_UPDATE_INTERVAL = 30
*/
setLocationUpdateInterval(atoi(value.c_str()));
/**
* Parse CONF_IPV6_ENABLED parameter
*/
} else if (!parameter.compare(0, CONF_IPV6_ENABLED.length(), CONF_IPV6_ENABLED)) {
if (atoi(value.c_str()) == 1)
ipv6Enabled = true;
else if (atoi(value.c_str()) == 0)
ipv6Enabled = false;
else
throw Exception(CONF_IPV6_ENABLED + " can be 0 or 1, invalid value (" + value + ") provided", logger);
logger.info(string("IPv6 is ") + ((ipv6Enabled) ? "enabled" : "disabled"));
/**
* Parse CONF_LOG_LEVEL parameter
*/
} else if (!parameter.compare(0, CONF_LOG_LEVEL.length(), CONF_LOG_LEVEL)) {
if (atoi(value.c_str()) < 0 || atoi(value.c_str()) > 4)
throw Exception(CONF_LOG_LEVEL + " can be 0 to 4, invalid value (" + value + ") provided", logger);
/**
* Update the log level
*/
logger.setLogLevel(static_cast<Logger::LOG_LEVEL>(atoi(value.c_str())));
logger.info("Log level is updated to " + logger.getCurrentLogLevelName());
}
return true;
}
const vector<string>& Configuration::getConfigurationFileVector() const {
return configurationFileNameVector;
}
void Configuration::addConfigurationFile(const string& configurationFileName) {
this->configurationFileNameVector.push_back(configurationFileName);
}
void Configuration::setFacilitiesConfigurationDirectory(const string& directory) {
facilitiesConfigurationDirectory = directory;
}
int Configuration::getServerPort() const {
return serverPort;
}
void Configuration::setServerPort(int serverPort) {
if (serverPort > 0 && serverPort < 65535)
this->serverPort = serverPort;
/**
* Do nothing and so keep the default value otherwise
*/
}
u_int8_t Configuration::getWirelessStateUpdateInterval() const {
return wirelessStateUpdateInterval;
}
void Configuration::setWirelessStateUpdateInterval(u_int8_t interval) {
/**
* Verify incoming value for wireless state update interval
* Keep default value if incoming is invalid
*/
if (interval >= 10 && interval <= 120) {
logger.info("Setting Wireless State Update Interval to " + boost::lexical_cast<string>((int)interval) + " seconds");
wirelessStateUpdateInterval = interval;
} else
logger.warning("Parsed value (" + boost::lexical_cast<string>((int)interval) + ") of Wireless State Update Interval is invalid [min=10,max=120], keeping default value (" + boost::lexical_cast<string>((int)wirelessStateUpdateInterval) + ")");
}
u_int8_t Configuration::getLocationUpdateInterval() const {
return locationUpdateInterval;
}
void Configuration::setLocationUpdateInterval(u_int8_t interval) {
/**
* Verify incoming value for location update interval
* Keep default value if incoming is invalid
*/
if (interval >= 20 && interval <= 120) {
logger.info("Setting Location Update Interval to " + boost::lexical_cast<string>((int)interval) + " seconds");
locationUpdateInterval = interval;
} else
logger.warning("Parsed value (" + boost::lexical_cast<string>((int)interval) + ") of Location Update Interval is invalid [min=20,max=120], keeping default value (" + boost::lexical_cast<string>((int)locationUpdateInterval) + ")");
}
bool Configuration::isIpv6Enabled() const {
return ipv6Enabled;
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_configuration.hpp
* \brief A container with configuration file parsing capability
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_CONFIGURATION_HPP_
#define MGMT_CONFIGURATION_HPP_
#include "mgmt_information_base.hpp"
#include "util/mgmt_log.hpp"
#include <string>
using namespace std;
/**
* This is a little interface to pass to Communication Profile Manager without
* exposing every single configuration detail
*/
class IPv6Configuration {
public:
/**
* Virtual destructor for IPv6Configuration class
*/
virtual ~IPv6Configuration() {}
public:
/**
* Returns a boolean that indicates IPv6 enable/disable configuration
*/
virtual bool isIpv6Enabled() const = 0;
protected:
/**
* IPv6 is enabled or not
*/
bool ipv6Enabled;
};
/**
* A container with configuration file parsing capability, this class is utilised
* to update ManagementInformationBase class with configuration file content
*/
class Configuration : public IPv6Configuration {
public:
/**
* Parameter string for UDP server port
*/
static const string CONF_SERVER_PORT_PARAMETER;
/**
* Parameter string for repetition interval (in seconds)
* for Wireless State Request message
*/
static const string CONF_WIRELESS_STATE_UPDATE_INTERVAL;
/**
* Parameter string for repetition interval (in seconds)
* for Location Update message
*/
static const string CONF_LOCATION_UPDATE_INTERVAL;
/**
* Parameter string for IPv6 enabling
*/
static const string CONF_IPV6_ENABLED;
/**
* Parameter string for log level
*/
static const string CONF_LOG_LEVEL;
public:
/**
* Constructor for Configuration class
*
* @param configurationFileNameList Configuration files that shall be parsed
* @param logger Logger object reference
*/
Configuration(const vector<string>& configurationFileNameVector, Logger& logger);
/**
* Destructor for Configuration class
*/
~Configuration();
public:
/**
* Parses given set of configuration files and updates MIB accordingly
*
* @param mib Management Information Base reference
* @return true on success, false otherwise
*/
bool parseConfigurationFiles(ManagementInformationBase& mib);
/**
* Returns configuration file name vector
*
* @return Configuration file name vector
*/
const vector<string>& getConfigurationFileVector() const;
/**
* Adds a configuration file name to the vector
*
* @param configurationFileName New configuration file's name
* @return none
*/
void addConfigurationFile(const string& configurationFileName);
/**
* Sets the directory name where Configuration class is going to
* look for FACilities configuration files
*
* @param directory Directory name (relative to ./)
* @return none
*/
void setFacilitiesConfigurationDirectory(const string& directory);
/**
* Returns UDP server port number
*
* @param none
* @return UDP server port number
*/
int getServerPort() const;
/**
* Sets UDP server port number
*
* @param new port number
* @return none
*/
void setServerPort(int serverPort);
/**
* Returns Wireless State Update interval (in seconds)
*
* @return Wireless State Update interval in seconds
*/
u_int8_t getWirelessStateUpdateInterval() const;
/**
* Sets Wireless State Update interval
*
* @param interval Wireless State Update interval in seconds
* @return none
*/
void setWirelessStateUpdateInterval(u_int8_t interval);
/**
* Returns Location Update interval (in seconds)
*
* @return Location Update interval in seconds
*/
u_int8_t getLocationUpdateInterval() const;
/**
* Sets Location Update interval
*
* @param interval Location Update interval in seconds
* @return none
*/
void setLocationUpdateInterval(u_int8_t interval);
/**
* Returns a boolean indication IPv6 configuration
* @implements bool IPv6Configuration::isIpv6Enabled()
*/
bool isIpv6Enabled() const;
private:
/**
* Parses incoming string of format "parameter = value" and fills in
* passed parameter and value variables
*
* @param line Configuration file line
* @param parameter Parameter's name
* @param value Parameter's value
* @return true on success, false otherwise
*/
static bool parseLine(const string& line, string& parameter, string& value);
/**
* Parses IHM configuration IDs of type <configurationItemName|configurationItemID>
*
* @param param Parameter string (input)
* @param parameterString "configurationItemName" part of the parameter string (output)
* @param parameterID "configurationItemID" part of the parameter string (output)
* @return bool true on success, false otherwise
*/
static bool parseParameterId(const string& param, string& parameterString, u_int16_t& parameterId);
/**
* Sets configuration parameter's value with given value
*
* @param parameter Parameter name
* @param value Parameter value
* @return true on success, false otherwise
*/
bool setValue(const string& parameter, const string& value);
private:
/**
* Directory where FACilities configuration files reside
*/
string facilitiesConfigurationDirectory;
/**
* Configuration files name vector
*/
vector<string> configurationFileNameVector;
/**
* UDP server port number
*/
int serverPort;
/**
* Wireless State Update interval (in seconds)
*/
u_int8_t wirelessStateUpdateInterval;
/**
* Location Update interval (in seconds)
*/
u_int8_t locationUpdateInterval;
/**
* Log level configuration
*/
Logger::LOG_LEVEL logLevel;
/**
* Logger object reference
*/
Logger& logger;
};
#endif /* MGMT_CONFIGURATION_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_information_base.cpp
* \brief A container to hold configuration parameters of Management entity
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_information_base.hpp"
#include "util/mgmt_exception.hpp"
#include <boost/lexical_cast.hpp>
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
ManagementInformationBase::ManagementInformationBase(Logger& logger)
: itsKeyManager(logger), communicationProfileManager(logger), logger(logger) {
logger.info("Management Information Base has been created");
/**
* Default configuration for IPv6 is OFF
*/
this->ipv6Enabled = false;
}
ManagementInformationBase::~ManagementInformationBase() {}
bool ManagementInformationBase::initialise() {
try {
// Common Parameters
itsKeyManager.addKey(MGMT_GN_ALL_ITSKEY_ID_STATION_TYPE, "MIB_GN_ALL_STATION_TYPE", ITS_KEY_TYPE_COMMON, 1, 1, 30);
itsKeyManager.addKey(MGMT_GN_ALL_ITSKEY_ID_STATION_SUBTYPE, "MIB_GN_ALL_STATION_SUBTYPE", ITS_KEY_TYPE_COMMON, 1, 0, 1);
// NETwork Parameters
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_GN_LOCAL_ADD_CONF_METHOD, "MIB_GN_NET_LOCAL_ADDR_CONF_METHOD", ITS_KEY_TYPE_NET, 0, 0, 1);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_DEFAULT_HOP_LIMIT, "MIB_GN_NET_DEFAULT_HOP_LIMIT", ITS_KEY_TYPE_NET, 1, 0, 255);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_GN_MAX_PKT_LIFETIME, "MIB_GN_NET_MAX_PACKET_LIFETIME", ITS_KEY_TYPE_NET, 20000, 1, 6300000);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_GN_MIN_PKT_REPETITION_INTERVAL, "MIB_GN_NET_MIN_PACKET_REPETITION_INTERVAL", ITS_KEY_TYPE_NET, 1000);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_GN_GEO_BCAST_FORWARDING_ALG, "MIB_GN_NET_GEO_BCAST_FORWARDING_ALGORITHM", ITS_KEY_TYPE_NET, 0, 0, 2);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_GN_GEO_UCAST_FORWARDING_ALG, "MIB_GN_NET_GEO_UCAST_FORWARDING_ALGORITHM", ITS_KEY_TYPE_NET, 0, 0, 3);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_GN_TRAFFIC_CLASS_RELEVANCE, "MIB_GN_NET_TRAFFIC_CLASS_RELEVANCE", ITS_KEY_TYPE_NET, 5, 0, 7);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_GN_TRAFFIC_CLASS_RELIABILITY, "MIB_GN_NET_TRAFFIC_CLASS_RELIABILITY", ITS_KEY_TYPE_NET, 2, 0, 3);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_GN_TRAFFIC_CLASS_LATENCY, "MIB_GN_NET_TRAFFIC_CLASS_LATENCY", ITS_KEY_TYPE_NET, 2, 0, 3);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_GN_CBF_MIN_TTS, "MIB_GN_NET_CBF_MIN_TTS", ITS_KEY_TYPE_NET, 100);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_GN_CBF_MAX_TTS, "MIB_GN_NET_CBF_MAX_TTS", ITS_KEY_TYPE_NET, 500);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_GN_MAX_COMM_RANGE, "MIB_GN_NET_MAX_COMM_RANGE", ITS_KEY_TYPE_NET, 1000);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_GN_DEF_TX_POWER, "MIB_GN_NET_DEF_TX_POWER", ITS_KEY_TYPE_NET, 5);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_GN_DEF_BITRATE, "MIB_GN_NET_DEF_BITRATE", ITS_KEY_TYPE_NET, 12);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_GN_DEF_CHANNEL, "MIB_GN_NET_DEF_CHANNEL", ITS_KEY_TYPE_NET, 178);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_GN_DEF_PRIORITY, "MIB_GN_NET_DEF_PRIORITY", ITS_KEY_TYPE_NET, 5, 0, 7);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_GN_DEF_CHANNEL_BW, "MIB_GN_NET_DEF_CHANNEL_BW", ITS_KEY_TYPE_NET, 30);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_SEC_ALLOW_UNSECURE, "MIB_GN_NET_SEC_ALLOW_UNSECURE", ITS_KEY_TYPE_NET, 1);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_SEC_END_2_END, "MIB_GN_NET_SEC_END2END", ITS_KEY_TYPE_NET, 0);
itsKeyManager.addKey(MGMT_GN_NET_ITSKEY_ID_SEC_PSEUDONYM, "MIB_GN_NET_SEC_PSEUDONYM", ITS_KEY_TYPE_NET, 0);
// FACilities Parameters
itsKeyManager.addKey(MGMT_GN_FAC_ITSKEY_ID_VEHICLE_WIDTH, "MIB_GN_FAC_VEHICLE_WIDTH", ITS_KEY_TYPE_FAC, 3);
itsKeyManager.addKey(MGMT_GN_FAC_ITSKEY_ID_VEHICLE_LENGTH, "MIB_GN_FAC_VEHICLE_LENGTH", ITS_KEY_TYPE_FAC, 7);
itsKeyManager.addKey(MGMT_GN_FAC_ITSKEY_ID_CAM_BTP_PORT, "MIB_GN_FAC_CAM_BTP_PORT", ITS_KEY_TYPE_FAC, 2000);
itsKeyManager.addKey(MGMT_GN_FAC_ITSKEY_ID_DENM_BTP_PORT, "MIB_GN_FAC_DENM_BTP_PORT", ITS_KEY_TYPE_FAC, 3000);
itsKeyManager.addKey(MGMT_GN_FAC_ITSKEY_ID_LDM_GARBAGE_COLLECTION_INTERVAL, "MIB_GN_FAC_LDM_GARBAGE_COLLECTION_INTERVAL", ITS_KEY_TYPE_FAC, 1000);
} catch (Exception& e) {
e.updateStackTrace("Cannot define ITS key");
throw;
}
logger.info("Management Information Base has been initialised");
logger.info("Number of ITS key elements defined is " + boost::lexical_cast<string>(itsKeyManager.getNumberOfKeys()));
return true;
}
bool ManagementInformationBase::setValue(ItsKeyID id, ItsKeyValue value) {
try {
itsKeyManager.setKeyValue(id, value);
} catch (Exception& e) {
e.updateStackTrace("Cannot set ITS key using its ID");
throw;
}
return true;
}
bool ManagementInformationBase::setValue(ItsKeyID id, const vector<unsigned char>& value) {
/**
* Set the value according to its data type
*/
logger.info("ITS key type to be changed is " + itsKeyManager.getDataTypeName(id));
switch (itsKeyManager.getDataType(id)) {
case ITS_DATA_TYPE_FLOAT:
if (value.size() != 4) {
logger.warning("ITS Key ID " + boost::lexical_cast<string>((int)id) + " has float type but incompatible size");
return false;
} else
logger.debug("ITS Key size is compatible, updating corresponding key...");
/**
* And update the value
*/
logger.info("ITS Key ID " + boost::lexical_cast<string>((int)id) + "'s current value is " + boost::lexical_cast<string>(itsKeyManager.getKeyValue(id).floatValue));
itsKeyManager.getKeyValue(id).floatValue = Util::parse4byteFloat(value);
logger.info("ITS Key ID " + boost::lexical_cast<string>((int)id) + "'s new value is " + boost::lexical_cast<string>(itsKeyManager.getKeyValue(id).floatValue));
break;
case ITS_DATA_TYPE_INTEGER:
if (value.size() != 4) {
logger.warning("ITS Key ID " + boost::lexical_cast<string>((int)id) + " has integer type but incompatible size");
return false;
} else
logger.debug("ITS Key size is compatible, updating corresponding key...");
/**
* And update the value
*/
logger.info("ITS Key ID " + boost::lexical_cast<string>((int)id) + "'s current value is " + boost::lexical_cast<string>(itsKeyManager.getKeyValue(id).intValue));
Util::parse4byteInteger(value.data(), &itsKeyManager.getKeyValue(id).intValue);
logger.info("ITS Key ID " + boost::lexical_cast<string>((int)id) + "'s new value is " + boost::lexical_cast<string>(itsKeyManager.getKeyValue(id).intValue));
break;
case ITS_DATA_TYPE_STRING:
logger.info("ITS Key ID " + boost::lexical_cast<string>((int)id) + "'s current value is " + itsKeyManager.getKeyValue(id).stringValue);
itsKeyManager.getKeyValue(id).stringValue = string(value.begin(), value.end());
logger.info("ITS Key ID " + boost::lexical_cast<string>((int)id) + "'s current value is " + itsKeyManager.getKeyValue(id).stringValue);
break;
default:
logger.warning("Invalid data type for an ITS key");
return false;
}
return true;
}
bool ManagementInformationBase::setValue(const string& name, ItsKeyValue value) {
if (name.empty())
throw Exception("Incoming parameter name is empty!", logger);
try {
itsKeyManager.setKeyValue(name, value);
} catch (Exception& e) {
e.updateStackTrace("Cannot set ITS key using its name");
throw;
}
return true;
}
ItsKeyValue ManagementInformationBase::getItsKeyValue(ItsKeyID id) {
return itsKeyManager.getKeyValue(id);
}
std::size_t ManagementInformationBase::getLength(ItsKeyID itsKey) {
return itsKeyManager.getDataTypeSize(itsKey);
}
ItsKeyManager& ManagementInformationBase::getItsKeyManager() {
return this->itsKeyManager;
}
WirelessStateResponseItem* ManagementInformationBase::getWirelessState(InterfaceID interfaceId) {
return wirelessStateMap[interfaceId];
}
bool ManagementInformationBase::updateWirelessState(InterfaceID interfaceId, WirelessStateResponseItem* wirelessState) {
map<InterfaceID, WirelessStateResponseItem*>::iterator itemIndex = wirelessStateMap.find(interfaceId);
/**
* First check if we already had this Interface ID, if yes, then replace it
*/
if (itemIndex == wirelessStateMap.end())
wirelessStateMap.insert(wirelessStateMap.end(), pair<InterfaceID, WirelessStateResponseItem*>(interfaceId, wirelessState));
else
itemIndex->second = wirelessState;
/**
* Print the list of interfaces we had so far
*/
logger.info("I had the information for following interfaces so far...");
for (map<InterfaceID, WirelessStateResponseItem*>::const_iterator it = wirelessStateMap.begin(); it != wirelessStateMap.end(); ++it)
logger.info(it->second->toString());
return true;
}
NetworkStateMessage& ManagementInformationBase::getNetworkState() {
return networkState;
}
CommunicationProfileManager& ManagementInformationBase::getCommunicationProfileManager() {
return communicationProfileManager;
}
bool ManagementInformationBase::updateLocationTable(LocationTableItem* locationTableItem) {
locationTable.insert(locationTable.end(), pair<GnAddress, LocationTableItem*>(locationTableItem->gnAddress, locationTableItem));
return true;
}
const LocationInformation& ManagementInformationBase::getLocationInformation() {
return location;
}
bool ManagementInformationBase::setLocationInformation(const LocationInformation& locationUpdate) {
location = locationUpdate;
return true;
}
bool ManagementInformationBase::setNetworkFlags(const u_int8_t& networkFlags) {
this->networkFlags = networkFlags;
return true;
}
void ManagementInformationBase::enableIpv6() {
ipv6Enabled = true;
}
bool ManagementInformationBase::isIpv6Enabled() const {
return ipv6Enabled;
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_information_base.hpp
* \brief A container to hold configuration parameters of Management entity
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_INFORMATION_BASE_HPP_
#define MGMT_INFORMATION_BASE_HPP_
#include "mgmt_comm_prof_manager.hpp"
#include "mgmt_its_key_manager.hpp"
#include "mgmt_types.hpp"
#include <sys/types.h>
#include <string>
#include <map>
/**
* A container to hold configuration parameters of Management entity
*/
class ManagementInformationBase {
public:
/**
* Constructor for ManagementInformationBase class
*
* @param Logger object reference
*/
ManagementInformationBase(Logger& logger);
/**
* Destructor for ManagementInformationBase class
*/
~ManagementInformationBase();
public:
/**
* Initialises ItsKeyManager member by defining configuration items
*
* @return true on success, false otherwise
*/
bool initialise();
/**
* Returns value of relevant ITS key through ItsKeyManager methods
*
* @param itsKeyId ITS key ID
* @return Value of relevant ITS key
*/
ItsKeyValue getItsKeyValue(ItsKeyID itsKeyId);
/**
* Sets value of relevant ITS key through ItsKeyManager methods
*
* @param itsKeyId ITS key ID
* @param value Value to be set
* @return true on success, false otherwise
*/
bool setValue(ItsKeyID itsKeyId, ItsKeyValue value);
/**
* Sets value of relevant ITS key through ItsKeyManager methods
*
* @param itsKeyId ITS key ID
* @param value Value to be set
* @return true on success, false otherwise
*/
bool setValue(ItsKeyID itsKeyId, const vector<unsigned char>& value);
/**
* Sets value of relevant ITS key through ItsKeyManager methods
*
* @param configurationItemName std::string name of configuration item
* @param value Value to be set
* @return true on success, false otherwise
*/
bool setValue(const string& configurationItemName, ItsKeyValue value);
/**
* Returns DWORD length of relevant ITS key
*
* @param itsKeyId ITS key ID
* @return byte length of given key of type std::size_t
*/
std::size_t getLength(ItsKeyID itsKeyId);
/**
* Returns ItsKeyManager container's reference
*
* @return ItsKeyManager reference
*/
ItsKeyManager& getItsKeyManager();
/**
* Returns wireless state of relevant interface
*
* @param interfaceId Interface ID of the interface
* @return A reference to WirelessStateResponseItem of relevant interface
*/
WirelessStateResponseItem* getWirelessState(InterfaceID interfaceId);
/**
* Adds a new wireless state information for an interface
*
* @param interfaceId Interface ID of type InterfaceID
* @param wirelessState Wireless State information
* @return true on success, false otherwise
*/
bool updateWirelessState(InterfaceID interfaceId, WirelessStateResponseItem* wirelessState);
/**
* Returns the network state of this MIB
*
* @return A reference to the NetworkStateMessage object of this MIB
*/
NetworkStateMessage& getNetworkState();
/**
* Returns Communication Profile Manager reference
*
* @return Communication Profile Manager reference
*/
CommunicationProfileManager& getCommunicationProfileManager();
/**
* Updates Location Table with given information
*
* @param locationTableItem A pointer to a location Table Item
* @return true on success, false otherwise
*/
bool updateLocationTable(LocationTableItem* locationTableItem);
/**
* Returns location information
*
* @return LocationInformation structure
*/
const LocationInformation& getLocationInformation();
/**
* Updates location information with given data
*
* @param locationUpdate A copy of a LocationInformation structure
* @return true on success, false otherwise
*/
bool setLocationInformation(const LocationInformation& locationUpdate);
/**
* Sets network flags
*
* @param networkFlags Network flags of type u_int8_t
* @return true on success, false otherwise
*/
bool setNetworkFlags(const u_int8_t& networkFlags);
/**
* Sets IPv6 configuration value, if this is not called then the
* default value "false" will stay intact
*/
void enableIpv6();
/**
* Retuns a boolean indication IPv6 configuration status
*/
bool isIpv6Enabled() const;
private:
/**
* An object of ItsKeyManager class to keep track of ITS keys and their values
*/
ItsKeyManager itsKeyManager;
/**
* Wireless and network state messages
*/
map<InterfaceID, WirelessStateResponseItem*> wirelessStateMap;
/**
* Network state of this MIB entity
*/
NetworkStateMessage networkState;
/**
* Location Table map
*/
u_int8_t networkFlags;
/**
* Location table that consists of a map of LocationTableItem objects
*/
map<GnAddress, LocationTableItem*> locationTable;
/**
* Communication profile manager
*/
CommunicationProfileManager communicationProfileManager;
/**
* Location information
*/
LocationInformation location;
/**
* Ipv6 configuration
*/
bool ipv6Enabled;
/**
* Logger object reference
*/
Logger& logger;
};
#endif /* MGMT_INFORMATION_BASE_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_inquiry_thread.cpp
* \brief A thread worker function to ask repetitive questions to relevant modules to update MIB
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_inquiry_thread.hpp"
#include <boost/lexical_cast.hpp>
#include <boost/date_time.hpp>
#include "util/mgmt_util.hpp"
#include <boost/thread.hpp>
#include <iostream>
using namespace std;
InquiryThread::InquiryThread(IManagementPacketSender* packetSender, u_int8_t wirelessStateUpdateInterval, Logger& logger)
: packetSender(packetSender), logger(logger) {
this->wirelessStateUpdateInterval = wirelessStateUpdateInterval;
}
InquiryThread::~InquiryThread() {
}
void InquiryThread::operator()() {
/**
* Send a Wireless State Request every `wirelessStateUpdateInterval' second(s)
*/
boost::posix_time::seconds wait(wirelessStateUpdateInterval);
while (true) {
logger.info("Will wait for " + boost::lexical_cast<string>((int)wirelessStateUpdateInterval) + " second(s) to send a Wireless State Request");
boost::this_thread::sleep(wait);
if (requestWirelessStateUpdate())
logger.info("A Wireless State Request packet sent to GN");
else
logger.warning("Cannot send a Wireless State Request packet to GN!");
}
}
bool InquiryThread::requestWirelessStateUpdate() {
/**
* Use ManagementServerFunctionality to send a Wireless State Update to GN
*/
return packetSender->sendWirelessStateRequest();
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_inquiry_thread.hpp
* \brief A thread worker function to ask repetitive questions to relevant modules to update MIB
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_INQUIRY_THREAD_HPP_
#define MGMT_INQUIRY_THREAD_HPP_
#include "interface/mgmt_packet_sender.hpp"
#include "mgmt_information_base.hpp"
#include "util/mgmt_log.hpp"
/**
* A thread worker function to ask repetitive questions to relevant modules to update MIB
*/
class InquiryThread {
public:
/**
* Constructor for InquiryThread class
*
* @param packetSender Packet sending functionality of ManagementServer class
* @param wirelessStateUpdateInterval Wireless State Update interval in seconds
* @param logger Logger object reference
*/
InquiryThread(IManagementPacketSender* packetSender, u_int8_t wirelessStateUpdateInterval, Logger& logger);
/**
* Destructor for InquiryThread class
*/
virtual ~InquiryThread();
public:
/**
* () operator overload to pass this method to boost::thread
*
* @param none
* @return none
*/
void operator()();
/**
* Sends request for a Wireless State Response message
* Incoming message will be handled and MIB will be updated
* accordingly by GeonetMessageHandler class
*
* @param none
* @return true on success, false otherwise
*/
bool requestWirelessStateUpdate();
private:
/**
* IManagementPacketSender reference to use ManagementServer's functionality
*/
IManagementPacketSender* packetSender;
/**
* Wireless State Update interval in seconds
*/
u_int8_t wirelessStateUpdateInterval;
/**
* Logger object reference
*/
Logger& logger;
};
#endif /* MGMT_INQUIRY_THREAD_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_its_key_manager.cpp
* \brief ITS keys and relevant configuration information is maintained in this container
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_its_key_manager.hpp"
#include "util/mgmt_exception.hpp"
#include <boost/lexical_cast.hpp>
#include "util/mgmt_util.hpp"
#include <sstream>
ItsKeyManager::ItsKeyManager(Logger& logger) : logger(logger) {
/**
* Insert string correspondences for numerical values of ITS key data types
*/
itsKeyDataTypeName.insert(itsKeyDataTypeName.end(), std::make_pair(ITS_DATA_TYPE_FLOAT, "FLOAT"));
itsKeyDataTypeName.insert(itsKeyDataTypeName.end(), std::make_pair(ITS_DATA_TYPE_INTEGER, "INTEGER"));
itsKeyDataTypeName.insert(itsKeyDataTypeName.end(), std::make_pair(ITS_DATA_TYPE_STRING, "STRING"));
}
ItsKeyManager::~ItsKeyManager() {
itsKeyMap.clear();
}
ItsKeyID ItsKeyManager::findKeyId(const string& keyName) const {
map<ItsKeyID, ItsKey>::const_iterator iterator = itsKeyMap.begin();
while (iterator != this->itsKeyMap.end()) {
if (!iterator->second.name.compare(keyName))
return iterator->first;
++iterator;
}
return static_cast<ItsKeyID>(0xDEAD);
}
map<ItsKeyID, ItsKeyValue> ItsKeyManager::getSubset(ItsKeyType keyType) const {
map<ItsKeyID, ItsKey>::const_iterator iterator = itsKeyMap.begin();
map<ItsKeyID, ItsKeyValue> subset;
while (iterator != this->itsKeyMap.end()) {
// Add every ITS key which is common and is of requested type into the map
if (iterator->second.keyType == keyType || iterator->second.keyType == ITS_KEY_TYPE_COMMON || keyType == ITS_KEY_TYPE_ALL)
subset.insert(subset.end(), std::make_pair(iterator->first, iterator->second.value));
++iterator;
}
return subset;
}
bool ItsKeyManager::addKey(ItsKeyID id, const string& name, ItsKeyType keyType, ItsDataType dataType, ItsKeyValue value, ItsKeyValue minValue, ItsKeyValue maxValue) {
/**
* Validate incoming values
*/
if (name.empty())
throw Exception("ITS key name is empty!", logger);
else if (dataType == ITS_DATA_TYPE_INTEGER && (value.intValue < minValue.intValue || value.intValue > maxValue.intValue))
throw Exception("ITS key '" + name + "'s value (" + boost::lexical_cast<string>(value.intValue) + ") is out-of-range!", logger);
else if (dataType == ITS_DATA_TYPE_FLOAT && (value.floatValue < minValue.floatValue || value.floatValue > maxValue.floatValue))
throw Exception("ITS key '" + name + "'s value (" + boost::lexical_cast<string>(value.floatValue) + ") is out-of-range!", logger);
ItsKey itsKey;
itsKey.name = name;
itsKey.keyType = keyType;
itsKey.dataType = dataType;
itsKey.value = value;
itsKey.minValue = minValue;
itsKey.maxValue = maxValue;
itsKeyMap.insert(itsKeyMap.end(), std::make_pair(id, itsKey));
return true;
}
bool ItsKeyManager::addKey(ItsKeyID id, const string& name, ItsKeyType keyType, u_int32_t value, u_int32_t minValue, u_int32_t maxValue) {
ItsKeyValue valueContainer, minValueContainer, maxValueContainer;
valueContainer.intValue = value;
minValueContainer.intValue = minValue;
maxValueContainer.intValue = maxValue;
ItsKey itsKey;
itsKey.name = name;
itsKey.keyType = keyType;
itsKey.dataType = ITS_DATA_TYPE_INTEGER;
itsKey.value = valueContainer;
itsKey.minValue = minValueContainer;
itsKey.maxValue = maxValueContainer;
itsKeyMap.insert(itsKeyMap.end(), std::make_pair(id, itsKey));
return true;
}
bool ItsKeyManager::addKey(ItsKeyID id, const string& name, ItsKeyType keyType, const string& value) {
ItsKeyValue valueContainer;
valueContainer.stringValue = Util::trim(value, '"');
ItsKey itsKey;
itsKey.name = name;
itsKey.keyType = keyType;
itsKey.dataType = ITS_DATA_TYPE_STRING;
itsKey.value = valueContainer;
itsKeyMap.insert(itsKeyMap.end(), std::make_pair(id, itsKey));
return true;
}
ItsKeyValue& ItsKeyManager::getKeyValue(ItsKeyID id) {
return itsKeyMap[id].value;
}
ItsKeyType ItsKeyManager::getKeyType(ItsKeyID id) {
return itsKeyMap[id].keyType;
}
ItsDataType ItsKeyManager::getDataType(ItsKeyID id) {
return itsKeyMap[id].dataType;
}
string ItsKeyManager::getDataTypeName(ItsKeyID id) {
return itsKeyDataTypeName[itsKeyMap[id].dataType];
}
std::size_t ItsKeyManager::getDataTypeSize(ItsKeyID id) {
switch (itsKeyMap[id].dataType) {
case ITS_DATA_TYPE_INTEGER:
return sizeof(int);
case ITS_DATA_TYPE_FLOAT:
return sizeof(float);
case ITS_DATA_TYPE_STRING:
return itsKeyMap[id].value.stringValue.length();
default:
logger.warning("ITS key with ID " + boost::lexical_cast<string>((int)id) + " doesn't have a valid data type!");
/**
* Most of the ITS keys are of type integer so let's return the size of an integer
*/
return sizeof(int);
}
}
bool ItsKeyManager::setKeyValue(const string& name, ItsKeyValue value) {
map<ItsKeyID, ItsKey>::iterator iterator = itsKeyMap.begin();
while (iterator != this->itsKeyMap.end()) {
if (!name.compare(0, iterator->second.name.length(), iterator->second.name)) {
iterator->second.value = value;
return true;
}
++iterator;
}
return false;
}
bool ItsKeyManager::setKeyValue(ItsKeyID id, ItsKeyValue value) {
itsKeyMap[id].value = value;
return true;
}
u_int16_t ItsKeyManager::getNumberOfKeys(ItsKeyType type) const {
/**
* If we're asked for all, return the size of the ITS key map
*/
if (type == ITS_KEY_TYPE_ALL)
return itsKeyMap.size();
map<ItsKeyID, ItsKey>::const_iterator iterator = itsKeyMap.begin();
u_int16_t numberOfKeys = 0;
while (iterator != itsKeyMap.end()) {
/**
* Count all `common' keys and those of type `type'
*/
if (type == ITS_KEY_TYPE_COMMON || iterator->second.keyType == type)
++numberOfKeys;
++iterator;
}
return numberOfKeys;
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_its_key_manager.hpp
* \brief ITS keys and relevant configuration information is maintained in this container
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_ITS_KEY_MANAGER_HPP_
#define MGMT_ITS_KEY_MANAGER_HPP_
#include <map>
#include <string>
#include <climits>
using namespace std;
#include "mgmt_types.hpp"
#include "util/mgmt_log.hpp"
#include <sys/types.h>
/**
* ITS key types according to module they belong to
*
* ITS_KEY_TYPE_COMMON: ITS keys common for NETwork and FACilities,
* ITS_KEY_TYPE_NET: NETwork ITS keys,
* ITS_KEY_TYPE_FAC: FACilities ITS keys,
* ITS_KEY_TYPE_IHM: PCVE IHM keys,
* ITS_KEY_TYPE_ALL: All ITS keys defined
*/
enum ItsKeyType {
ITS_KEY_TYPE_COMMON = 0,
ITS_KEY_TYPE_NET = 1,
ITS_KEY_TYPE_FAC = 2,
ITS_KEY_TYPE_IHM = 3,
ITS_KEY_TYPE_ALL = 4
};
/**
* ITS data type
*/
enum ItsDataType {
ITS_DATA_TYPE_INTEGER = 0,
ITS_DATA_TYPE_FLOAT = 1,
ITS_DATA_TYPE_STRING = 2
};
/**
* ITS key value container that can contain
* integer, float, and string values
*/
struct ItsKeyValue {
string stringValue;
float floatValue;
u_int32_t intValue;
};
/**
* ITS key structure holding every property of an ITS key
*/
struct ItsKey {
string name;
ItsKeyType keyType;
ItsDataType dataType;
ItsKeyValue value;
ItsKeyValue minValue;
ItsKeyValue maxValue;
};
/**
* ITS keys and relevant configuration information is maintained in this container
*/
class ItsKeyManager {
public:
/**
* Constructor for ItsKeyManager class
*
* @param logger Logger object reference
*/
ItsKeyManager(Logger& logger);
/**
* Destructor for ItsKeyManager class
*/
~ItsKeyManager();
public:
/**
* Enqueues given ITS key, name and value to ITS keys map
*
* @param id ITS key ID of new key to be added
* @param name Name of new key to be added
* @param keyType ITS key type
* @param dataType ITS key's data type
* @param value Value of new key to be added
* @param minValue Minimum value of new key
* @param maxValue Maximum value of new key
* @return true on success, false otherwise
*/
bool addKey(ItsKeyID id, const string& name, ItsKeyType keyType, ItsDataType dataType, ItsKeyValue value, ItsKeyValue minValue, ItsKeyValue maxValue);
/**
* Enqueues given ITS key, name and value to ITS keys map
*
* @param id ITS key ID of new key to be added
* @param name Name of new key to be added
* @param keyType ITS key type
* @param value Value of new key to be added
* @param minValue Minimum value of new key
* @param maxValue Maximum value of new key
* @return true on success, false otherwise
*/
bool addKey(ItsKeyID id, const string& name, ItsKeyType keyType, u_int32_t value, u_int32_t minValue = 0, u_int32_t maxValue = INT_MAX);
/**
* Enqueues given ITS key, name and value to ITS keys map
*
* @param id ITS key ID of new key to be added
* @param name Name of new key to be added
* @param keyType ITS key type
* @param value Value of new key to be added
* @return true on success, false otherwise
*/
bool addKey(ItsKeyID id, const string& name, ItsKeyType keyType, const string& value);
/**
* Returns the value container of the key with given ITS key ID
*
* @param id ITS key ID of the key
* @return Value of ITS key
*/
ItsKeyValue& getKeyValue(ItsKeyID id);
/**
* Returns ITS key type
*
* @param id ITS key ID of the key
* @return ITS key type
*/
ItsKeyType getKeyType(ItsKeyID id);
/**
* Returns ITS data type (integer or string)
*
* @param id ITS key ID of the key
* @return ITS key type
*/
ItsDataType getDataType(ItsKeyID id);
/**
* Returns ITS data type's string name
*
* @param id ITS key ID of the key
* @return std::string name of the data type of the ITS key
*/
string getDataTypeName(ItsKeyID id);
/**
* Returns the size of ITS key
*
* @param id ITS key ID of the key
* @return Size of the ITS key's value in bytes
*/
std::size_t getDataTypeSize(ItsKeyID id);
/**
* Sets the value of ITS key given its name
*
* @param name Name of ITS key to be reset
* @param value Value to be set as the new value of relevant ITS key
* @return true on success, false otherwise
*/
bool setKeyValue(const string& name, ItsKeyValue value);
/**
* Sets the value of ITS key given its ITS key ID
*
* @param id ITS key ID of ITS key to be reset
* @param value Value to be set as the new value of relevant ITS key
* @return true on success, false otherwise
*/
bool setKeyValue(ItsKeyID id, ItsKeyValue value);
/**
* Returns ITS key ID of ITS key given its name
*
* @param keyName Name of the ITS key being searched
* @return ITS key ID of the ITS key if found, 0xDEAD otherwise
*/
ItsKeyID findKeyId(const string& keyName) const;
/**
* Returns the number of ITS keys defined in ITS key map
*
* @param type ITS Key type, may take following values,
* ITS_KEY_TYPE_COMMON = Returns ITS keys common for NETwork and FACilities,
* ITS_KEY_TYPE_NET = Returns NETwork ITS keys,
* ITS_KEY_TYPE_FAC = Returns FACilities ITS keys,
* ITS_KEY_TYPE_ALL = Returns all ITS keys defined
*/
u_int16_t getNumberOfKeys(ItsKeyType type = ITS_KEY_TYPE_COMMON) const;
public:
/**
* Returns the subset of ITS key map having ITS keys of given type
*
* @param keyType ITS key type to filter ITS keys
* @return List of type std::map containing ITS keys of asked type
*/
map<ItsKeyID, ItsKeyValue> getSubset(ItsKeyType keyType) const;
private:
/**
* List of type std::map for 'ITS key ID to ITS key value' mapping
*/
map<ItsKeyID, ItsKey> itsKeyMap;
/**
* String name map for ITS key data types
*/
map<ItsDataType, string> itsKeyDataTypeName;
/**
* Logger object reference
*/
Logger& logger;
};
#endif /* MGMT_ITS_KEY_MANAGER_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_packet_factory.cpp
* \brief A container with necessary (mostly responses) packet generation functionality
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "packets/mgmt_fac_packet_comm_profile_selection_response.hpp"
#include "packets/mgmt_gn_packet_comm_profile_response.hpp"
#include "packets/mgmt_gn_packet_set_configuration.hpp"
#include "mgmt_packet_factory.hpp"
#include <iostream>
using namespace std;
ManagementPacketFactory::ManagementPacketFactory(ManagementInformationBase& mib, Logger& logger) :
mib(mib), logger(logger) {
}
GeonetPacket* ManagementPacketFactory::createSetConfigurationEventPacket(ItsKeyID itsKeyID) {
return new GeonetSetConfigurationEventPacket(mib, logger, itsKeyID);
}
GeonetPacket* ManagementPacketFactory::createCommunicationProfileResponse(GeonetCommunicationProfileRequestPacket* request) {
return new GeonetCommunicationProfileResponsePacket(mib, request->getCommunicationProfileRequestSet(), request->getSequenceNumber(), logger);
}
GeonetPacket* ManagementPacketFactory::createCommunicationProfileSelectionResponse(FacCommunicationProfileSelectionRequestPacket* request) {
return new FacCommunicationProfileSelectionResponsePacket(mib, request->getLatency(), request->getRelevance(), request->getReliability(), request->getSequenceNumber(), logger);
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_packet_factory.hpp
* \brief A container with necessary (mostly responses) packet generation functionality
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_PACKET_FACTORY_HPP_
#define MGMT_PACKET_FACTORY_HPP_
#include "packets/mgmt_fac_packet_comm_profile_selection_request.hpp"
#include "packets/mgmt_gn_packet_comm_profile_request.hpp"
#include "packets/mgmt_gn_packet.hpp"
#include "mgmt_information_base.hpp"
#include "util/mgmt_log.hpp"
#include "mgmt_types.hpp"
/**
* A container with necessary (mostly responses) packet generation functionality
*/
class ManagementPacketFactory {
public:
/**
* Constructor for ManagementPacketFactory class
*
* @param mib Management Information Base reference
* @param logger Logger object reference
*/
ManagementPacketFactory(ManagementInformationBase& mib, Logger& logger);
public:
/**
* Creates and returns a Set Configuration packet whose type is determined
* by the default parameter
*
* @param itsKeyID ITS key ID, if this has the default value MGMT_GN_ITSKEY_ALL
* then this method creates a bulk response, otherwise generated packet will carry
* specified ITS key only
* @return Pointer to the GeonetPacket created
*/
GeonetPacket* createSetConfigurationEventPacket(ItsKeyID itsKeyID = MGMT_GN_ITSKEY_ALL);
/**
* Creates a Communication Profile Response packet according to what
* was asked in relevant request packet
*
* @param request Pointer to the Communication Profile Request packet
* @return Pointer to the Communication Profile Response packet
*/
GeonetPacket* createCommunicationProfileResponse(GeonetCommunicationProfileRequestPacket* request);
/**
* Creates a Communication Profile Selection Response packet according to what
* was asked in relevant request packet
*
* @param request Pointer to the Communication Profile Selection Request packet
* @return Pointer to the Communication Profile Selection Response packet
*/
GeonetPacket* createCommunicationProfileSelectionResponse(FacCommunicationProfileSelectionRequestPacket* request);
private:
/**
* ManagementInformationBase reference used to fetch necessary information
* to create certain messages/replies
*/
ManagementInformationBase& mib;
/**
* Logger object reference
*/
Logger& logger;
};
#endif /* MGMT_PACKET_FACTORY_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_handler.cpp
* \brief A container with packet handling functionality, all the packets read on the socket is passed here
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_packet_handler.hpp"
#include "util/mgmt_exception.hpp"
#include <boost/lexical_cast.hpp>
#include "mgmt_types.hpp"
#include "util/mgmt_util.hpp"
#include <exception>
#include <iostream>
#include <cstring>
using namespace std;
PacketHandler::PacketHandler(ManagementInformationBase& mib, Logger& logger) :
mib(mib), logger(logger) {
try {
this->packetFactory = new ManagementPacketFactory(mib, logger);
} catch (...) {
throw Exception("Cannot allocate a Geonet Packet Factory!", logger);
}
}
PacketHandler::PacketHandler(const PacketHandler& packetHandler) :
mib(packetHandler.mib), logger(packetHandler.logger) {
throw Exception("Copy constructor for a PacketHandler object is called!", logger);
}
PacketHandler::~PacketHandler() {
delete packetFactory;
}
PacketHandlerResult* PacketHandler::handle(const vector<unsigned char>& packetBuffer) {
if (packetBuffer.size() < sizeof(MessageHeader)) {
logger.error("Buffer size (" + boost::lexical_cast<string>(packetBuffer.size()) + " byte(s)) is not enough to carry a message!");
logger.warning("Discarding packet...");
return new PacketHandlerResult(PacketHandlerResult::INVALID_PACKET, NULL);
}
u_int16_t eventType = GeonetPacket::parseEventTypeOfPacketBuffer(packetBuffer);
switch (eventType) {
case MGMT_GN_EVENT_CONF_REQUEST:
logger.info("GET_CONFIGURATION packet of size " + boost::lexical_cast<string>(packetBuffer.size()) + " has been received from GN");
return handleGetConfigurationEvent(new GeonetGetConfigurationEventPacket(packetBuffer, logger), ManagementClient::GN);
case MGMT_FAC_EVENT_CONF_REQUEST:
logger.info("GET_CONFIGURATION packet of size " + boost::lexical_cast<string>(packetBuffer.size()) + " has been received from FAC");
return handleGetConfigurationEvent(new GeonetGetConfigurationEventPacket(packetBuffer, logger), ManagementClient::FAC);
case MGMT_GN_EVENT_STATE_NETWORK_STATE:
logger.info("NETWORK_STATE packet of size " + boost::lexical_cast<string>(packetBuffer.size()) + " has been received");
return handleNetworkStateEvent(new GeonetNetworkStateEventPacket(mib, packetBuffer, logger));
case MGMT_GN_EVENT_STATE_WIRELESS_STATE_RESPONSE:
logger.info("WIRELESS_STATE_RESPONSE packet (GN) of size " + boost::lexical_cast<string>(packetBuffer.size()) + " has been received");
return handleWirelessStateResponseEvent(new GeonetWirelessStateResponseEventPacket(mib, packetBuffer, logger));
case MGMT_LTE_EVENT_STATE_WIRELESS_STATE_RESPONSE:
logger.info("WIRELESS_STATE_RESPONSE packet (LTE) of size " + boost::lexical_cast<string>(packetBuffer.size()) + " has been received");
return handleWirelessStateResponseEvent(new LteWirelessStateResponseEventPacket(mib, packetBuffer, logger));
case MGMT_GN_EVENT_CONF_COMM_PROFILE_REQUEST:
logger.info("COMMUNICATION_PROFILE_REQUEST packet of size " + boost::lexical_cast<string>(packetBuffer.size()) + " has been received from GN");
return handleCommunicationProfileRequestEvent(new GeonetCommunicationProfileRequestPacket(packetBuffer, logger), ManagementClient::GN);
case MGMT_FAC_EVENT_CONF_COMM_PROFILE_REQUEST:
logger.info("COMMUNICATION_PROFILE_REQUEST packet of size " + boost::lexical_cast<string>(packetBuffer.size()) + " has been received from FAC");
return handleCommunicationProfileRequestEvent(new GeonetCommunicationProfileRequestPacket(packetBuffer, logger), ManagementClient::FAC);
case MGMT_GN_EVENT_LOCATION_TABLE_RESPONSE:
logger.info("LOCATION_TABLE_RESPONSE packet of size " + boost::lexical_cast<string>(packetBuffer.size()) + " has been received");
return handleLocationTableResponse(new GeonetLocationTableResponseEventPacket(mib, packetBuffer, logger));
case MGMT_FAC_EVENT_CONF_NOTIFICATION:
logger.info("CONFIGURATION_NOTIFICATION packet of size " + boost::lexical_cast<string>(packetBuffer.size()) + " has been received");
return handleConfigurationNotification(new FacConfigurationNotificationPacket(mib, packetBuffer, logger));
case MGMT_FAC_EVENT_LOCATION_UPDATE:
logger.info("LOCATION_UPDATE packet of size " + boost::lexical_cast<string>(packetBuffer.size()) + " has been received");
return handleLocationUpdate(new GeonetLocationUpdateEventPacket(mib, packetBuffer, logger));
case MGMT_FAC_EVENT_CONF_COMM_PROFILE_SELECTION_REQUEST:
logger.info("COMM_PROF_SELECTION_REQUEST packet of size " + boost::lexical_cast<string>(packetBuffer.size()) + " has been received");
return handleCommunicationProfileSelectionRequest(new FacCommunicationProfileSelectionRequestPacket(packetBuffer, logger));
/**
* Handle unexpected packets as well
*/
case MGMT_GN_EVENT_LOCATION_TABLE_REQUEST:
case MGMT_GN_EVENT_CONF_UPDATE_AVAILABLE:
case MGMT_GN_EVENT_CONF_CONT_RESPONSE:
case MGMT_FAC_EVENT_CONF_CONT_RESPONSE:
case MGMT_GN_EVENT_CONF_BULK_RESPONSE:
case MGMT_FAC_EVENT_CONF_BULK_RESPONSE:
case MGMT_GN_EVENT_CONF_COMM_PROFILE_RESPONSE:
case MGMT_FAC_EVENT_CONF_COMM_PROFILE_RESPONSE:
case MGMT_GN_EVENT_STATE_WIRELESS_STATE_REQUEST:
case MGMT_FAC_EVENT_CONF_COMM_PROFILE_SELECTION_RESPONSE:
logger.error("Unexpected packet (event: " + boost::lexical_cast<string>(eventType) + ") received, connected client is buggy");
logger.error("Ignoring...");
return new PacketHandlerResult(PacketHandlerResult::INVALID_PACKET, NULL);
case MGMT_EVENT_ANY:
default:
logger.error("Unknown message received, ignoring...");
return new PacketHandlerResult(PacketHandlerResult::INVALID_PACKET, NULL);
}
return new PacketHandlerResult(PacketHandlerResult::DISCARD_PACKET, NULL);
}
PacketHandlerResult* PacketHandler::handleGetConfigurationEvent(GeonetGetConfigurationEventPacket* request, ManagementClient::ManagementClientType clientType) {
if (!request)
return new PacketHandlerResult(PacketHandlerResult::INVALID_PACKET, NULL);
/**
* Create a response according to the request
*/
GeonetPacket* reply = this->packetFactory->createSetConfigurationEventPacket(static_cast<ItsKeyID> (request->getConfID()));
/**
* Set the event type/sub-type according to the client type (no need to change anything
* if the client type is GN, it's the default value)
*/
if (clientType == ManagementClient::FAC) {
/**
* Mind the type of the Set Configuration packet, it may be BULK or CONTINUOUS
*/
if (reply->getEventType() == MGMT_GN_EVENT_CONF_BULK_RESPONSE)
reply->setEventType(MGMT_FAC_EVENT_CONF_BULK_RESPONSE);
else
reply->setEventType(MGMT_FAC_EVENT_CONF_CONT_RESPONSE);
}
/**
* Clean up
*/
delete request;
logger.info("A SET_CONFIGURATION packet is prepared, will be sent soon...");
return new PacketHandlerResult(PacketHandlerResult::DELIVER_PACKET, reply);
}
PacketHandlerResult* PacketHandler::handleNetworkStateEvent(GeonetNetworkStateEventPacket* request) {
delete request;
/*
* Creation of a GeonetNetworkStateEventPacket is enough for processing...
*/
return new PacketHandlerResult(PacketHandlerResult::DISCARD_PACKET, NULL);
}
PacketHandlerResult* PacketHandler::handleWirelessStateResponseEvent(GeonetPacket* request) {
delete request;
/*
* Creation of a {Lte|Gn}WirelessStateEventPacket is enough for processing...
*/
return new PacketHandlerResult(PacketHandlerResult::DISCARD_PACKET, NULL);
}
PacketHandlerResult* PacketHandler::handleLocationTableResponse(GeonetLocationTableResponseEventPacket* packet) {
delete packet;
/*
* Creation of a GeonetLocationTableResponseEventPacket is enough for processing...
*/
return new PacketHandlerResult(PacketHandlerResult::DISCARD_PACKET, NULL);
}
PacketHandlerResult* PacketHandler::handleConfigurationNotification(FacConfigurationNotificationPacket* packet) {
if (!packet) {
logger.warning("Invalid Configuration Notification packet received!");
return NULL;
}
/**
* MIB is already notified about this ITS key value change in the
* constructor of FacConfigurationNotificationPacket class
*/
/**
* Command ManagementServer to notify GN about this update...
*/
return new PacketHandlerResult(PacketHandlerResult::SEND_CONFIGURATION_UPDATE_AVAILABLE, NULL);
}
PacketHandlerResult* PacketHandler::handleCommunicationProfileRequestEvent(GeonetCommunicationProfileRequestPacket* request, ManagementClient::ManagementClientType clientType) {
if (!request)
return new PacketHandlerResult(PacketHandlerResult::INVALID_PACKET, NULL);
/**
* Create a response according to the request and send to the client right away
*/
GeonetPacket* reply = this->packetFactory->createCommunicationProfileResponse(request);
/**
* Set the event type/sub-type according to the client type (no need to change anything
* if the client type is GN, it's the default value)
*/
if (clientType == ManagementClient::FAC)
reply->setEventType(MGMT_FAC_EVENT_CONF_COMM_PROFILE_RESPONSE);
/**
* Clean up
*/
delete request;
return new PacketHandlerResult(PacketHandlerResult::DELIVER_PACKET, reply);
}
PacketHandlerResult* PacketHandler::handleCommunicationProfileSelectionRequest(FacCommunicationProfileSelectionRequestPacket* request) {
if (!request)
return new PacketHandlerResult(PacketHandlerResult::INVALID_PACKET, NULL);
/**
* Create a response according to the request and send to the client right away
*/
GeonetPacket* reply = this->packetFactory->createCommunicationProfileSelectionResponse(request);
/**
* Clean up
*/
delete request;
return new PacketHandlerResult(PacketHandlerResult::DELIVER_PACKET, reply);
}
PacketHandlerResult* PacketHandler::handleLocationUpdate(GeonetLocationUpdateEventPacket* packet) {
delete packet;
/*
* Creation of a GeonetLocationUpdateEventPacket is enough for processing...
*/
return new PacketHandlerResult(PacketHandlerResult::RELAY_TO_GN, NULL);
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_packet_handler.hpp
* \brief A container with packet handling functionality, all the packets read on the socket is passed here
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_PACKET_HANDLER_HPP_
#define MGMT_PACKET_HANDLER_HPP_
#include <boost/array.hpp>
using namespace boost;
#include "packets/mgmt_fac_packet_configuration_notification.hpp"
#include "packets/mgmt_lte_packet_wireless_state_response.hpp"
#include "packets/mgmt_gn_packet_location_table_response.hpp"
#include "packets/mgmt_gn_packet_wireless_state_response.hpp"
#include "packets/mgmt_gn_packet_comm_profile_request.hpp"
#include "packets/mgmt_gn_packet_get_configuration.hpp"
#include "packets/mgmt_gn_packet_location_update.hpp"
#include "packets/mgmt_gn_packet_network_state.hpp"
#include "packets/mgmt_gn_packet.hpp"
#include "mgmt_information_base.hpp"
#include "mgmt_packet_factory.hpp"
#include "util/mgmt_log.hpp"
#include "mgmt_client.hpp"
/**
* A container for PacketHandler classes feedback to its callers
*/
class PacketHandlerResult {
public:
/**
* Result of packet processing to be returned to relevant unit calling handle()
*/
enum Result {
/**
* Packet is processed and no further action is necessary
*/
DISCARD_PACKET = 0,
/**
* Invalid packet
*/
INVALID_PACKET = 1,
/**
* Deliver the packet given within this PacketHandlerResult object
*/
DELIVER_PACKET = 2,
/**
* All the clients with relevant configuration requirements
* (meaning NET or FAC parameters) should be informed of new configuration
* PS: This comment above is valid only for GN right now since it's the only "other" client than FAC
*/
SEND_CONFIGURATION_UPDATE_AVAILABLE = 3,
/**
* Relays the packet as-is to GN
* This case is used for LOCATION_UPDATE packet
*/
RELAY_TO_GN = 4
};
public:
/**
* Constructor for PacketHandlerResult class
*
* @param result PacketHandler's result after it processes given packet
* @param packet GeonetPacket after it's generated by PacketHandler
*/
PacketHandlerResult(PacketHandlerResult::Result result, GeonetPacket* packet) : result(result), packet(packet) {}
/**
* Deconstructor for this result set, responsible for the deallocation of GeonetPacket pointer
*/
~PacketHandlerResult() {
delete packet;
}
public:
/**
* Returns the result packet of this class
*
* @return Resulting packet of type GeonetPacket
*/
GeonetPacket* getPacket() const {
return this->packet;
}
/**
* Returns the result enumeration
*
* @return Return enumeration of type PacketHandlerResult::Result
*/
PacketHandlerResult::Result getResult() const {
return this->result;
}
private:
/**
* Result enumeration
*/
PacketHandlerResult::Result result;
/**
* GeonetPacket pointer
*/
GeonetPacket* packet;
};
/**
* A container with packet handling functionality, all the packets read on
* the socket is passed here
*/
class PacketHandler {
public:
/**
* Constructor for PacketHandler class
*
* @param mib ManagementInformationBase reference
* @param logger Logger object reference
*/
PacketHandler(ManagementInformationBase& mib, Logger& logger);
/**
* Destructor for PacketHandler class
*/
~PacketHandler();
private:
/**
* Copy constructor to prevent the usage of default one
*/
PacketHandler(const PacketHandler& packetHandler);
public:
/**
* Takes buffer of a packet and processes accordingly
*
* @param packetBuffer Packet buffer
* @return relevant PacketHandler::Result enumeration according to the result
*/
PacketHandlerResult* handle(const vector<unsigned char>& packetBuffer);
private:
/**
* Handles a Get Configuration message creating its reply utilizing relevant
* PacketFactory method
*
* @param packet Pointer to Get Configuration packet object
* @param Management client type information (Event type/subtype changes according to the client type)
* @return Pointer to a PacketHandlerResult object
*/
PacketHandlerResult* handleGetConfigurationEvent(GeonetGetConfigurationEventPacket* packet, ManagementClient::ManagementClientType clientType);
/**
* Handles a Network State message and triggers an update at MIB
*
* @param packet Pointer to Network State packet
* @return Pointer to a PacketHandlerResult object
*/
static PacketHandlerResult* handleNetworkStateEvent(GeonetNetworkStateEventPacket* packet);
/**
* Handles a Wireless State Response message and triggers an update at MIB
*
* @param packet Pointer to incoming Wireless State Response packet
* @return Pointer to a PacketHandlerResult object
*/
static PacketHandlerResult* handleWirelessStateResponseEvent(GeonetPacket* packet);
/**
* Handles a Location Table Response packet
*
* @param Pointer to a Location Table Response packet
* @return Pointer to a PacketHandlerResult object
*/
static PacketHandlerResult* handleLocationTableResponse(GeonetLocationTableResponseEventPacket* packet);
/**
* Handles a Configuration Notification packet
*
* @param Pointer to a Configuration Notification packet
* @return Pointer to a PacketHandlerResult object
*/
PacketHandlerResult* handleConfigurationNotification(FacConfigurationNotificationPacket* packet);
/**
* Handles a Communication Profile Request event message and creates a
* Communication Profile Response packet
*
* @param Pointer to a Communication Profile Request packet
* @param Management client type information (Event type/subtype changes according to the client type)
* @return Pointer to a PacketHandlerResult object
*/
PacketHandlerResult* handleCommunicationProfileRequestEvent(GeonetCommunicationProfileRequestPacket* packet, ManagementClient::ManagementClientType clientType);
/**
* Handles a Communication Profile Selection Request event message and creates a
* Communication Profile Selection Response packet
*
* @param Pointer to a Communication Profile Selection Request packet
* @return Pointer to a PacketHandlerResult object
*/
PacketHandlerResult* handleCommunicationProfileSelectionRequest(FacCommunicationProfileSelectionRequestPacket* request);
/**
* Handles an incoming Location Update message and updates MIB with
* this incoming information
*
* @param Pointer to a Location Update packet
* @return Pointer to a PacketHandlerResult object
*/
PacketHandlerResult* handleLocationUpdate(GeonetLocationUpdateEventPacket* packet);
private:
/**
* GeonetPacketFactory object to hide packet generation details from PacketHandler class
*/
ManagementPacketFactory* packetFactory;
/**
* ManagementInformationBase object to fetch necessary information when needed
*/
ManagementInformationBase& mib;
/**
* Logger object reference
*/
Logger& logger;
};
#endif /* MGMT_PACKET_HANDLER_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fsr/openairinterface
Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
*******************************************************************************/
/*!
* \file mgmt_server.cpp
* \brief Management functionality provided by boost::asio's asynchronous I/O wrapper
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "packets/mgmt_gn_packet_configuration_available.hpp"
#include "packets/mgmt_gn_packet_wireless_state_request.hpp"
#include "packets/mgmt_gn_packet_location_table_request.hpp"
#include "packets/mgmt_gn_packet_location_update.hpp"
#include "util/mgmt_exception.hpp"
#include <boost/lexical_cast.hpp>
#include "mgmt_server.hpp"
#include <boost/bind.hpp>
ManagementServer::ManagementServer(ba::io_service& ioService, const Configuration& configuration, ManagementInformationBase& mib, ManagementClientManager& clientManager, Logger& logger)
try : ioService(ioService), socket(ioService, ba::ip::udp::endpoint(udp::v4(), configuration.getServerPort())), mib(mib), configuration(configuration), clientManager(clientManager),
logger(logger), packetHandler(mib, logger) {
/**
* Immediately start reading data
*/
logger.info("Reading data on port " + boost::lexical_cast<string>(configuration.getServerPort()));
readData();
/**
* Initialise InquiryThread object for Wireless State updates
*/
try {
inquiryThreadObject = new InquiryThread(this, configuration.getWirelessStateUpdateInterval(), logger);
inquiryThread = new boost::thread(*inquiryThreadObject);
} catch (std::exception& e) {
throw Exception(e.what(), logger);
}
} catch (Exception& e) {
e.updateStackTrace("Cannot initialize ManagementServer!");
throw;
}
ManagementServer::~ManagementServer() {
delete inquiryThreadObject;
delete inquiryThread;
rxData.clear();
txData.clear();
}
bool ManagementServer::sendWirelessStateRequest() {
/**
* Check if there's a GN connected
*/
if (!clientManager.isGnConnected()) {
logger.warning("Attempted to send a Wireless Status Request but GN is not connected...");
return false;
}
/**
* Fetch and validate client object
*/
ManagementClient* geoNetworkingClient = clientManager.getClientByEndpoint(recipient);
if (!geoNetworkingClient)
return false;
/**
* Check if we have received a reply for the last packet we sent
*/
if (!geoNetworkingClient->isAlive()) {
logger.error("This client did not reply to the last packet we sent, marking it as OFFLINE");
geoNetworkingClient->setState(ManagementClient::OFFLINE);
return false;
}
/**
* Create the relevant packet and serialize it
*/
GeonetWirelessStateRequestEventPacket request(logger);
txData.resize(TX_BUFFER_SIZE);
request.serialize(txData);
/**
* Send serialized data thru socket
*/
this->send(txData, recipient);
geoNetworkingClient->waitingForReply();
/**
* Reset TX buffer
*/
txData.resize(TX_BUFFER_SIZE);
return true;
}
void ManagementServer::readData() {
try {
/**
* Reset buffers
*/
rxData.resize(RX_BUFFER_SIZE);
/**
* Register handleReceive() as the call-back of Rx
*/
socket.async_receive_from(boost::asio::buffer(rxData, ManagementServer::RX_BUFFER_SIZE), recipient,
boost::bind(&ManagementServer::handleReceive, this,
ba::placeholders::error,
ba::placeholders::bytes_transferred));
} catch (Exception& e) {
e.updateStackTrace("Cannot receive data from asynchronous UDP socket!");
throw;
}
}
void ManagementServer::handleReceive(const boost::system::error_code& error, size_t size) {
try {
/**
* Resize RX buffer according to the amount of data received
*/
rxData.resize(size);
if (!error) {
logger.debug("Following " + boost::lexical_cast<string>(size) + " byte(s) received from " + recipient.address().to_string() + ":" + boost::lexical_cast<string>(recipient.port()));
Util::printHexRepresentation(rxData.data(), size, logger);
/**
* Utilize PacketHandler class to generate a response, if necessary
*/
try {
handleClientData();
} catch (Exception& e) {
e.updateStackTrace("Cannot process Rx data!");
throw;
}
} else {
logger.warning("Error[code:" + boost::lexical_cast<string>(error.value()) + ", message:" + error.message() + "]");
logger.info("Discarding incoming data...");
}
/**
* Read data again...
*/
readData();
} catch (Exception& e) {
e.updateStackTrace("Cannot handle a receive on asynchronous UDP socket!");
throw;
}
}
void ManagementServer::handleClientData() {
/**
* PacketHandler class will return a result set
*/
PacketHandlerResult* result = NULL;
ManagementClientManager::Task task;
try {
result = packetHandler.handle(rxData);
} catch (Exception& e) {
e.updateStackTrace("Cannot process incoming client data!");
throw;
}
/**
* First inform Management Client Manager about this incoming packet (if it's valid)
*/
if (!result)
return;
else if (result->getResult() == PacketHandlerResult::DISCARD_PACKET
|| result->getResult() == PacketHandlerResult::DELIVER_PACKET
|| result->getResult() == PacketHandlerResult::SEND_CONFIGURATION_UPDATE_AVAILABLE
|| result->getResult() == PacketHandlerResult::RELAY_TO_GN) {
/**
* Inform Client Manager of this sender
*/
try {
task = clientManager.updateClientState(recipient, (EventType)GeonetPacket::parseEventTypeOfPacketBuffer(rxData));
} catch (Exception& e) {
e.updateStackTrace("Cannot update Management Client's state according to incoming data!");
throw;
}
}
/**
* Do the necessary told by PacketHandler
*/
GeonetConfigurationAvailableEventPacket* configurationAvailablePacket = NULL;
GeonetLocationUpdateEventPacket* locationUpdatePacket = NULL;
/**
* Find the GN client as we might need to talk to it
*/
const ManagementClient* gnClient = clientManager.getClientByType(ManagementClient::GN);
switch (result->getResult()) {
case PacketHandlerResult::DISCARD_PACKET:
delete result;
break;
case PacketHandlerResult::INVALID_PACKET:
logger.error("Incoming packet is not valid, discarding..");
delete result;
break;
case PacketHandlerResult::DELIVER_PACKET:
/**
* Serialize response packet
*/
txData.resize(TX_BUFFER_SIZE);
result->getPacket()->serialize(txData);
/**
* Send serialized data thru socket
*/
this->send(txData, recipient);
/**
* Reset TX buffer
*/
txData.resize(TX_BUFFER_SIZE);
delete result;
break;
case PacketHandlerResult::SEND_CONFIGURATION_UPDATE_AVAILABLE:
/**
* Update GN client with new configuration information
*/
if (!gnClient) {
logger.info("There is no GN client connected right now, so a CONFIGURATION_AVAILABLE won't be sent");
break;
}
/**
* Create a CONFIGURATION_UPDATE_AVAILABLE packet
*/
try {
configurationAvailablePacket = new GeonetConfigurationAvailableEventPacket(mib, logger);
/**
* Serialize...
*/
txData.resize(TX_BUFFER_SIZE);
configurationAvailablePacket->serialize(txData);
} catch (...) {
throw Exception("Cannot create a CONFIGURATION_UPDATE_AVAILABLE packet!", logger);
}
logger.info("A CONFIGURATION_UPDATE_AVAILABLE packet is prepared, sending...");
/**
* Send serialized data thru socket
*/
this->send(txData, udp::endpoint(udp::v4(), gnClient->getPort()));
/**
* Reset TX buffer
*/
txData.resize(TX_BUFFER_SIZE);
delete result;
break;
case PacketHandlerResult::RELAY_TO_GN:
/**
* Relay incoming LOCATION_UPDATE (from FAC-CM) to CM-GN
*/
if (!gnClient) {
logger.info("There is no GN client connected right now, so the LOCATION_UPDATE won't be relayed");
break;
}
/**
* Create a LOCATION_UPDATE packet
*/
try {
locationUpdatePacket = new GeonetLocationUpdateEventPacket(mib, logger);
/**
* Serialize...
*/
txData.resize(TX_BUFFER_SIZE);
locationUpdatePacket->serialize(txData);
} catch (...) {
throw Exception("Cannot create a LOCATION_UPDATE packet!", logger);
}
logger.info("A LOCATION_UPDATE packet is prepared, sending...");
/**
* Send thru socket
*/
this->send(txData, udp::endpoint(udp::v4(), gnClient->getPort()));
delete result;
break;
default:
logger.warning("Something nasty happened, there's no such task for PacketHandler!");
break;
}
/**
* Do the necessary told by ManagementClientHandler
*/
GeonetLocationTableRequestEventPacket* locationTableRequest = NULL;
switch (task) {
case ManagementClientManager::NOTHING:
break;
case ManagementClientManager::SEND_LOCATION_TABLE_REQUEST:
/**
* Here we should send a LOCATION TABLE REQUEST
*/
try {
locationTableRequest = new GeonetLocationTableRequestEventPacket(0xffffffffffffffff, logger);
locationTableRequest->serialize(txData);
delete locationTableRequest;
} catch (...) {
throw Exception("Cannot create/serialize a Location Table Request packet!", logger);
}
/**
* Send serialized data thru socket
*/
logger.info("Sending a LOCATION_TABLE_REQUEST packet");
this->send(txData, recipient);
break;
default:
logger.warning("Invalid task is returned by ManagementClientManager class!");
break;
}
}
void ManagementServer::handleSend(const boost::system::error_code& errorCode, size_t size) {
/**
* Just print information about the data that has just been sent
*/
logger.debug("Following content (size=" + boost::lexical_cast<string>(size) + ") has been written onto the socket");
Util::printHexRepresentation(txData.data(), size, logger);
}
bool ManagementServer::send(const vector<unsigned char>& buffer, const boost::asio::ip::udp::endpoint& recipient) {
/**
* Ensure that there's only one entering here at any given time
*/
boost::lock_guard<boost::mutex> lock(txMutex);
socket.async_send_to(ba::buffer(buffer), recipient,
boost::bind(&ManagementServer::handleSend, this,
ba::placeholders::error,
ba::placeholders::bytes_transferred));
return true;
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_server.hpp
* \brief This is where everything begins and ends
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_SERVER_H_
#define MGMT_SERVER_H_
#include "interface/mgmt_packet_sender.hpp"
#include "mgmt_information_base.hpp"
#include "mgmt_inquiry_thread.hpp"
#include "mgmt_packet_handler.hpp"
#include "mgmt_client_manager.hpp"
#include "mgmt_configuration.hpp"
#include <boost/thread/mutex.hpp>
#include "util/mgmt_log.hpp"
#include <boost/thread.hpp>
#include <boost/asio.hpp>
#include <vector>
using boost::asio::ip::udp;
namespace ba = boost::asio;
/**
* Management server functionality and a wrapper for boost::asio's asynchronous I/O
*/
class ManagementServer : public IManagementPacketSender {
public:
/**
* Receive buffer size in bytes
*/
static const u_int16_t RX_BUFFER_SIZE = 1024;
/**
* Transmit buffer size in bytes
*/
static const u_int16_t TX_BUFFER_SIZE = 1024;
public:
/**
* Constructor for ManagementServer class
*
* @param ioService I/O functionality is passed by the caller
* @param configuration A reference to the Configuration object of SCOREF-MGMT
* @param mib ManagementInformationBase reference
* @param logger Logger object reference for logging purposes
*/
ManagementServer(ba::io_service& ioService, const Configuration& configuration, ManagementInformationBase& mib, ManagementClientManager& clientManager, Logger& logger);
/**
* Destructor for ManagementServer class
*/
virtual ~ManagementServer();
public:
/**
* Implementation of IManagementPacketSender functionality
*
* @param none
* @return true on success, false otherwise
*/
bool sendWirelessStateRequest();
public:
/**
* Receive data
*/
void readData();
/**
* Callback for Rx, so called when data is read on the socket
*
* @param errorCode Error code
* @param size Amount of data available
*/
void handleReceive(const boost::system::error_code& errorCode, size_t size);
/**
* Handles incoming Management data, called by handleReceive()
*
* @param none
* @return none
*/
void handleClientData();
/**
* Callback for Tx, so called when data is written onto the socket
*
* @param errorCode Error code
* @param size Amount of data to be sent
*/
void handleSend(const boost::system::error_code& errorCode, size_t size);
/**
* Sends given buffer over the socket
*
* @param buffer Buffer to be sent of type unsigned char vector
* @param recipient Destination of type udp::endpoint
*/
bool send(const vector<unsigned char>& buffer, const boost::asio::ip::udp::endpoint& recipient);
private:
/**
* The io_service object that the datagram socket will use to dispatch
* handlers for any asynchronous operation performed on the socket
*/
ba::io_service& ioService;
/**
* udp::socket object
*/
ba::ip::udp::socket socket;
/**
* UDP connection's recipient
*/
ba::ip::udp::endpoint recipient;
/**
* RX buffer
*/
vector<unsigned char> rxData;
/**
* TX buffer
*/
vector<unsigned char> txData;
/**
* Management Information Base reference
*/
ManagementInformationBase& mib;
/**
* Configuration information
*/
const Configuration& configuration;
/**
* Client manager
*/
ManagementClientManager& clientManager;
/**
* InquiryThread object for Wireless State updates
*/
InquiryThread* inquiryThreadObject;
/**
* InquiryThread runner for Wireless State updates
*/
boost::thread* inquiryThread;
/**
* Logger object reference for logging purposes
*/
Logger& logger;
/**
* Response packets are generated using PacketHandler class
*/
PacketHandler packetHandler;
/**
* Mutex to control data transmission
*/
boost::mutex txMutex;
};
#endif /* MGMT_SERVER_H_ */
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_types.h
* \brief Definitions of common data types used in SCOREF Management Module
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_TYPES_HPP_
#define MGMT_TYPES_HPP_
#include "util/mgmt_util.hpp"
#include <sys/types.h>
#include <iomanip>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
/**
* Configuration Item IDs
*/
enum ItsKeyID {
/**
* Common ITS keys
*/
MGMT_GN_ALL_ITSKEY_ID_STATION_TYPE = 0,
MGMT_GN_ALL_ITSKEY_ID_STATION_SUBTYPE = 1,
/**
* Network ITS keys
*/
MGMT_GN_NET_ITSKEY_ID_GN_LOCAL_ADD_CONF_METHOD = 1000,
MGMT_GN_NET_ITSKEY_ID_DEFAULT_HOP_LIMIT = 1001,
MGMT_GN_NET_ITSKEY_ID_GN_MAX_PKT_LIFETIME = 1002,
MGMT_GN_NET_ITSKEY_ID_GN_MIN_PKT_REPETITION_INTERVAL = 1003,
MGMT_GN_NET_ITSKEY_ID_GN_GEO_BCAST_FORWARDING_ALG = 1010,
MGMT_GN_NET_ITSKEY_ID_GN_GEO_UCAST_FORWARDING_ALG = 1011,
MGMT_GN_NET_ITSKEY_ID_GN_TRAFFIC_CLASS_RELEVANCE = 1020,
MGMT_GN_NET_ITSKEY_ID_GN_TRAFFIC_CLASS_RELIABILITY = 1021,
MGMT_GN_NET_ITSKEY_ID_GN_TRAFFIC_CLASS_LATENCY = 1022,
MGMT_GN_NET_ITSKEY_ID_GN_CBF_MIN_TTS = 1030,
MGMT_GN_NET_ITSKEY_ID_GN_CBF_MAX_TTS = 1031,
MGMT_GN_NET_ITSKEY_ID_GN_MAX_COMM_RANGE = 1040,
MGMT_GN_NET_ITSKEY_ID_GN_DEF_TX_POWER = 1050,
MGMT_GN_NET_ITSKEY_ID_GN_DEF_BITRATE = 1051,
MGMT_GN_NET_ITSKEY_ID_GN_DEF_CHANNEL = 1052,
MGMT_GN_NET_ITSKEY_ID_GN_DEF_PRIORITY = 1053,
MGMT_GN_NET_ITSKEY_ID_GN_DEF_CHANNEL_BW = 1054,
MGMT_GN_NET_ITSKEY_ID_SEC_ALLOW_UNSECURE = 2000,
MGMT_GN_NET_ITSKEY_ID_SEC_END_2_END = 2001,
MGMT_GN_NET_ITSKEY_ID_SEC_PSEUDONYM = 2002,
/**
* FACilities ITS keys
*/
MGMT_GN_FAC_ITSKEY_ID_VEHICLE_WIDTH = 2,
MGMT_GN_FAC_ITSKEY_ID_VEHICLE_LENGTH = 3,
MGMT_GN_FAC_ITSKEY_ID_CAM_BTP_PORT = 3010,
MGMT_GN_FAC_ITSKEY_ID_DENM_BTP_PORT = 3011,
MGMT_GN_FAC_ITSKEY_ID_LDM_GARBAGE_COLLECTION_INTERVAL = 3020,
/**
* Configuration set ITS keys
*/
MGMT_GN_ITSKEY_SET_NET = 0xaaaa,
MGMT_GN_ITSKEY_SET_FAC = 0xbbbb,
MGMT_GN_ITSKEY_ALL = 0xffff
};
/**
* Message & Event Types
*/
enum EventType {
/**
* Any
*/
MGMT_EVENT_ANY = 0x000,
/**
* Location
*/
MGMT_GN_EVENT_LOCATION_UPDATE = 0x100,
MGMT_FAC_EVENT_LOCATION_UPDATE = 0x110,
MGMT_GN_EVENT_LOCATION_TABLE_REQUEST = 0x101,
MGMT_FAC_EVENT_LOCATION_TABLE_REQUEST = 0x103,
MGMT_GN_EVENT_LOCATION_TABLE_RESPONSE = 0x102,
MGMT_FAC_EVENT_LOCATION_TABLE_RESPONSE = 0x104,
/**
* Configuration
*/
MGMT_GN_EVENT_CONF_UPDATE_AVAILABLE = 0x300,
MGMT_GN_EVENT_CONF_REQUEST = 0x301,
MGMT_FAC_EVENT_CONF_REQUEST = 0x311,
MGMT_GN_EVENT_CONF_CONT_RESPONSE = 0x302,
MGMT_FAC_EVENT_CONF_CONT_RESPONSE = 0x312,
MGMT_GN_EVENT_CONF_BULK_RESPONSE = 0x303,
MGMT_FAC_EVENT_CONF_BULK_RESPONSE = 0x313,
MGMT_FAC_EVENT_CONF_NOTIFICATION = 0x314,
MGMT_GN_EVENT_CONF_COMM_PROFILE_REQUEST = 0x304,
MGMT_FAC_EVENT_CONF_COMM_PROFILE_REQUEST = 0x315,
MGMT_GN_EVENT_CONF_COMM_PROFILE_RESPONSE = 0x305,
MGMT_FAC_EVENT_CONF_COMM_PROFILE_RESPONSE = 0x316,
MGMT_FAC_EVENT_CONF_COMM_PROFILE_SELECTION_REQUEST = 0x317,
MGMT_FAC_EVENT_CONF_COMM_PROFILE_SELECTION_RESPONSE = 0x318,
/**
* State
*/
MGMT_GN_EVENT_STATE_WIRELESS_STATE_REQUEST = 0x402,
MGMT_GN_EVENT_STATE_WIRELESS_STATE_RESPONSE = 0x403,
MGMT_LTE_EVENT_STATE_WIRELESS_STATE_RESPONSE = 0x423,
MGMT_GN_EVENT_STATE_NETWORK_STATE = 0x404
};
/**
* Configuration Message / Transmission Type
*/
enum ConfigurationTransmissionMode {
C2X_MGMT_GN_CONF_TX_CONT = 0,
C2X_MGMT_GN_CONF_TX_BULK = 1
};
/**
* Message Header
*/
struct MessageHeader {
u_int8_t version;
u_int8_t priority;
u_int8_t eventType;
u_int8_t eventSubtype;
/**
* Returns if this packet contains extended/ventor specific data
*/
bool isExtended() const {
return Util::isBitSet(version, 0);
}
/**
* Returns if this packet contains valid data
*/
bool isValid() const {
return Util::isBitSet(version, 1);
}
/**
* Returns the last 4 bits of version field (which is actual version information)
*/
u_int8_t getVersion() const {
return version & 0x0F;
}
/**
* Returns the first 3 bits of priority field (which is actual priority information)
*/
u_int8_t getPriority() const {
return priority >> 5;
}
} __attribute__((packed));
/**
* Location Information
*/
struct LocationInformation {
u_int32_t timestamp; /* Time in milliseconds */
u_int32_t latitude; /* Latitude in 1/10 micro-degree */
u_int32_t longitude; /* Longitude in 1/10 micro-degree */
u_int16_t speed; /* Speed in signed units of 1 meter */
u_int16_t heading;
u_int16_t altitude;
u_int16_t acceleration; /* TAcc, PodAcc, SAcc, Hacc, AltAcc */
/**
* Initialize everything to zero
*/
LocationInformation() {
timestamp = latitude = longitude = speed = heading = altitude = acceleration = 0;
}
string toString() const {
stringstream ss;
ss << "LocationInformation[timestamp:" << timestamp << ", latitude:" << latitude
<< ", longitude:" << longitude << ", speed:" << speed << ", heading:" << heading
<< ", altitude:" << altitude << ", acceleration:" << acceleration;
return ss.str();
}
} __attribute__((packed));
/**
* Update Location Event
*/
struct LocationUpdateMessage {
MessageHeader header;
LocationInformation location;
} __attribute__((packed));
typedef u_int64_t GnAddress;
/**
* Query Location Table Event Message
*/
struct LocationTableRequest {
MessageHeader header;
GnAddress gnAddress;
} __attribute__((packed));
/**
* Location Table Response Item
*/
struct LocationTableItem {
GnAddress gnAddress;
u_int32_t timestamp; /* Time in milliseconds */
u_int32_t latitude; /* Latitude in 1/10 micro-degree */
u_int32_t longitude; /* Longitude in 1/10 micro-degree */
u_int16_t speed; /* Speed in signed units of 1 meter */
u_int16_t heading;
u_int16_t altitude;
u_int16_t acceleration;
u_int16_t sequenceNumber;
u_int8_t lpvFlags;
u_int8_t reserved;
string toString() const {
stringstream ss;
/**
* Print GN address in hex (as Andrea told) and the rest in decimal notation
*/
ss << "[gnAddr:" << hex << showbase << gnAddress << ", ";
ss << resetiosflags(ios_base::hex) << resetiosflags(ios_base::showbase);
ss << "ts:" << timestamp
<< " lat.:" << latitude
<< " long.:" << longitude
<< " speed:" << speed
<< " heading:" << heading
<< " alt.:" << altitude
<< " accel.:" << acceleration
<< " sn.:" << sequenceNumber
<< " lpv:" << (int)lpvFlags
<< " res.:" << (int)reserved << "]";
return ss.str();
}
} __attribute__((packed));
/**
* Reply Location Event
*/
struct LocationTableResponse {
MessageHeader header;
u_int16_t lpvCount;
u_int8_t networkFlags;
u_int8_t reserved;
// Location table items will follow
} __attribute__((packed));
/**
* Wireless State Request Message
*/
struct WirelessStateRequestMessage {
MessageHeader header;
} __attribute__((packed));
/**
* Wireless State Response Message
*/
struct WirelessStateResponseMessage {
MessageHeader header;
u_int8_t interfaceCount;
u_int8_t reserved_first8;
u_int16_t reserved_last16;
} __attribute__((packed));
/**
* Wireless State of a Certain Interface
*/
typedef u_int16_t InterfaceID;
/**
* Interface type
*/
enum WirelessInterfaceType {
WIRELESS_TYPE_LTE = 0,
WIRELESS_TYPE_GN = 1
};
struct WirelessStateResponseItem {
virtual ~WirelessStateResponseItem() {}
WirelessInterfaceType interfaceType;
/**
* This method stringfies the information contained in this struct and
* to be implemented by sub-structs
*/
virtual string toString() const = 0;
} __attribute__((packed));
/**
* Wireless State for GN
*/
struct GnWirelessStateResponseItem : public WirelessStateResponseItem {
InterfaceID interfaceId; /** 16-bit */
u_int16_t accessTechnology;
u_int16_t channelFrequency;
u_int16_t bandwidth;
u_int8_t channelBusyRatio;
u_int8_t status;
u_int8_t averageTxPower;
u_int8_t reserved;
string toString() const {
stringstream ss;
ss << "GN WirelessState[If ID:" << interfaceId
<< ", Access Tech:" << accessTechnology
<< ", Channel Freq:" << channelFrequency
<< ", Bandwidth:" << bandwidth
<< ", Busy Ratio:" << (int)channelBusyRatio
<< ", Status:" << (int)status
<< ", Average TX Power:" << (int)averageTxPower << "]";
return ss.str();
}
} __attribute__((packed));
/**
* Wireless State for LTE
*/
#define LTE_WIRELESS_STATE_RESPONSE_SIZE 0x14 /** 4-byte header, 16-byte body (including reserved 4 bytes) */
struct LteWirelessStateResponse : public WirelessStateResponseItem {
InterfaceID interfaceId; /** 16-bit */
u_int16_t reservedFirst16bit;
u_int16_t referenceSignalReceivedPower;
u_int16_t referenceSignalReceivedQuality;
u_int8_t channelQualityIndication;
u_int8_t status;
u_int16_t reservedSecond16bit;
u_int32_t packetLossRate;
string toString() const {
stringstream ss;
ss << "LTE WirelessState[If ID:" << interfaceId
<< ", Ref. Sig. Rx Pow.:" << referenceSignalReceivedPower
<< ", Ref. Sig. Rx Qual.:" << referenceSignalReceivedQuality
<< ", Channel Qual. Ind.:" << (int)channelQualityIndication
<< ", Status:" << (int)status
<< ", Pkt Loss Rate:" << packetLossRate << "]";
return ss.str();
}
} __attribute__((packed));
/**
* Network State Message
*/
struct NetworkStateMessage {
MessageHeader header;
u_int32_t timestamp;
u_int32_t rxPackets;
u_int32_t rxBytes;
u_int32_t txPackets;
u_int32_t txBytes;
u_int32_t toUpperLayerPackets;
u_int32_t discardedPackets;
u_int32_t duplicatePackets;
u_int32_t forwardedPackets;
} __attribute__((packed));
/**
* Configuration Available Message
*/
struct ConfigureAvailableMessage {
MessageHeader header;
u_int16_t reserved;
u_int16_t keyCount;
} __attribute__((packed));
/**
* Configuration Request Message
*/
struct ConfigurationRequestMessage {
MessageHeader header;
u_int16_t configurationId;
u_int16_t transmissionMode;
} __attribute__((packed));
/**
* Configuration Item
*
* This structure holds the common "configuration item" fields of
* continuous and bulk configuration set messages
*/
struct ConfigurationItem {
u_int16_t configurationId;
u_int16_t length; /* # of DWORDs */
u_int32_t configurationValue;
} __attribute__((packed));
/**
* Variable-size Configuration Item
*
* This structure holds the variable-size "configuration item" field
* of FAC Configuration Notification
*/
struct VariableSizeConfigurationItem {
u_int16_t configurationId;
u_int16_t length; /* # of bytes */
vector<unsigned char> configurationBuffer;
};
/**
* Set Configuration Event (Continuous)
*/
struct ContinuousConfigurationResponse {
MessageHeader header;
ConfigurationItem configurationItem;
} __attribute__((packed));
/**
* Set Configuration Event (Bulk)
*
* This struct is processed with a std::vector<ConfigurationItem>
* See GeonetSetConfigurationEventPacket.{hpp|cpp}
*/
struct BulkConfigurationResponse {
MessageHeader header;
u_int16_t reserved;
u_int16_t keyCount;
} __attribute__((packed));
/**
* FAC Configuration Notification
*/
struct ConfigurationNotification {
MessageHeader header;
VariableSizeConfigurationItem configurationItem;
};
#endif /* MGMT_TYPES_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_fac_packet_comm_profile_selection_request.cpp
* \brief A container for Communication Profile Selection Request event
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_fac_packet_comm_profile_selection_request.hpp"
#include "../util/mgmt_util.hpp"
#include <sstream>
FacCommunicationProfileSelectionRequestPacket::FacCommunicationProfileSelectionRequestPacket(const vector<unsigned char>& packetBuffer, Logger& logger)
: GeonetPacket(packetBuffer, logger) {
parse(packetBuffer);
}
FacCommunicationProfileSelectionRequestPacket::~FacCommunicationProfileSelectionRequestPacket() {}
u_int8_t FacCommunicationProfileSelectionRequestPacket::getLatency() const {
return packet.latency;
}
u_int8_t FacCommunicationProfileSelectionRequestPacket::getRelevance() const {
return packet.relevance;
}
u_int8_t FacCommunicationProfileSelectionRequestPacket::getReliability() const {
return packet.reliability;
}
u_int8_t FacCommunicationProfileSelectionRequestPacket::getSequenceNumber() const {
return packet.sequenceNumber;
}
bool FacCommunicationProfileSelectionRequestPacket::parse(const vector<unsigned char>& packetBuffer) {
/**
* Verify incoming buffer's size
*/
if (packetBuffer.size() < sizeof(CommunicationProfileSelectionRequest))
return false;
/**
* Parse octets
*/
u_int8_t payloadIndex = sizeof(MessageHeader);
packet.latency = packetBuffer[payloadIndex++];
packet.relevance = packetBuffer[payloadIndex++];
packet.reliability = packetBuffer[payloadIndex++];
packet.sequenceNumber = packetBuffer[payloadIndex];
return true;
}
string FacCommunicationProfileSelectionRequestPacket::toString() const {
stringstream ss;
ss << "CommunicationProfileSelectionRequest["
<< "latency:" << hex << (int)packet.latency
<< ", relevance:" << hex << (int)packet.relevance
<< ", reliability:" << hex << (int)packet.reliability
<< ", sequenceNum:" << (int)packet.sequenceNumber << "]";
return ss.str();
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_fac_packet_comm_profile_selection_request.hpp
* \brief A container for Communication Profile Selection Request event
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_FAC_PACKET_COMM_PROFILE_SELECTION_REQUEST_HPP_
#define MGMT_FAc_PACKET_COMM_PROFILE_SELECTION_REQUEST_HPP_
#include "mgmt_gn_packet.hpp"
/**
* Communication Profile Selection Request
*/
struct CommunicationProfileSelectionRequest {
MessageHeader header;
u_int8_t latency;
u_int8_t relevance;
u_int8_t reliability;
u_int8_t sequenceNumber;
} __attribute__((packed));
/**
* A container for Communication Profile Selection Request event
*/
class FacCommunicationProfileSelectionRequestPacket: public GeonetPacket {
public:
/**
* Constructor for FacCommunicationProfileSelectionRequestPacket class
*
* @param packetBuffer vector containing packet data
* @param logger Logger object reference
*/
FacCommunicationProfileSelectionRequestPacket(const vector<unsigned char>& packetBuffer, Logger& logger);
/**
* Destructor for FacCommunicationProfileSelectionRequestPacket class
*/
~FacCommunicationProfileSelectionRequestPacket();
public:
/**
* Returns `latency' field
*
* @return 8-bit `latency' field
*/
u_int8_t getLatency() const;
/**
* Returns `reliability' field
*
* @return 8-bit `reliability' field
*/
u_int8_t getReliability() const;
/**
* Returns `relevance' field
*
* @return 8-bit `relevance' field
*/
u_int8_t getRelevance() const;
/**
* Returns `sequence number' field
*
* @return 8-bit sequence number field
*/
u_int8_t getSequenceNumber() const;
/**
* Parses the packet buffer and fills in private member
*
* @param packetBuffer Vector containing packet data
* @return true on success, false otherwise
*/
bool parse(const vector<unsigned char>& packetBuffer);
/**
* Returns std::string representation of packet
*
* @return String representation of packet
*/
string toString() const;
private:
CommunicationProfileSelectionRequest packet;
};
#endif /* MGMT_FAC_PACKET_COMM_PROFILE_SELECTION_REQUEST_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2010 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_fac_packet_comm_profile_selection_response.cpp
* \brief A container for Communication Profile Selection Response event
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_fac_packet_comm_profile_selection_response.hpp"
#include "../util/mgmt_util.hpp"
FacCommunicationProfileSelectionResponsePacket::FacCommunicationProfileSelectionResponsePacket(ManagementInformationBase& mib,
u_int8_t latency, u_int8_t relevance, u_int8_t reliability, u_int8_t sequenceNumber, Logger& logger) :
GeonetPacket(false, true, 0x00, 0x00, MGMT_FAC_EVENT_CONF_COMM_PROFILE_SELECTION_RESPONSE, logger), mib(mib) {
packet.latency = latency;
packet.relevance = relevance;
packet.reliability = reliability;
packet.sequenceNumber = sequenceNumber;
}
FacCommunicationProfileSelectionResponsePacket::~FacCommunicationProfileSelectionResponsePacket() {}
bool FacCommunicationProfileSelectionResponsePacket::serialize(vector<unsigned char>& buffer) const {
/**
* Verify incoming buffer size
*/
if (buffer.size() < sizeof(CommunicationProfileSelectionResponse))
return false;
/**
* Serialise header first...
*/
GeonetPacket::serialize(buffer);
/**
* ..then append communication profile information
*/
u_int8_t payloadIndex = sizeof(MessageHeader);
buffer[payloadIndex++] = packet.latency;
buffer[payloadIndex++] = packet.relevance;
buffer[payloadIndex++] = packet.reliability;
buffer[payloadIndex++] = packet.sequenceNumber;
/**
* Get the most suitable communication profile from CommunicationProfileManager...
*/
CommunicationProfileID communicationProfileId = mib.getCommunicationProfileManager().selectProfile(mib.isIpv6Enabled(), packet.latency, packet.relevance, packet.reliability);
logger.debug(string("Ipv6 is ") + ((mib.isIpv6Enabled()) ? "enabled" : "disabled"));
/**
* ...and encode it into the response packet
*/
Util::encode4byteInteger(buffer, payloadIndex, static_cast<int>(communicationProfileId));
/**
* Resize incoming buffer according to packet size
*/
buffer.resize(sizeof(CommunicationProfileSelectionResponse));
return true;
}
string FacCommunicationProfileSelectionResponsePacket::toString() const {
stringstream ss;
ss << GeonetPacket::toString() << endl
<< "Latency: " << hex << (int)packet.latency << endl
<< "Relevance: " << hex << (int)packet.relevance << endl
<< "Reliability: " << hex << (int)packet.reliability << endl
<< "Communication Profile ID: " << oct << (int)packet.communicationProfileId << endl;
return ss.str();
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_fac_packet_comm_profile_selection_response.hpp
* \brief A container for Communication Profile Selection Response event
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_FAC_PACKET_COMM_PROFILE_SELECTION_RESPONSE_HPP_
#define MGMT_FAC_PACKET_COMM_PROFILE_SELECTION_RESPONSE_HPP_
#include "mgmt_gn_packet.hpp"
/**
* Communication Profile Selection Response
*/
struct CommunicationProfileSelectionResponse {
MessageHeader header;
u_int8_t latency;
u_int8_t relevance;
u_int8_t reliability;
u_int8_t sequenceNumber;
u_int32_t communicationProfileId;
} __attribute__((packed));
/**
* A container for Communication Profile Selection Response event
*/
class FacCommunicationProfileSelectionResponsePacket : public GeonetPacket {
public:
/**
* Constructor for FacCommunicationProfileSelectionResponsePacket class
*
* @param mib Management Information Base reference
* @param latency `Latency' requirement parameter
* @param relevance `Relevance' requirement parameter
* @param reliability `Reliability' requirement parameter
* @param sequenceNumber `Sequence Number' of the request (that of response's will match it)
* @param logger Logger object reference
*/
FacCommunicationProfileSelectionResponsePacket(ManagementInformationBase& mib, u_int8_t latency, u_int8_t relevance, u_int8_t reliability, u_int8_t sequenceNumber, Logger& logger);
/**
* Destructor for FacCommunicationProfileSelectionResponsePacket class
*/
~FacCommunicationProfileSelectionResponsePacket();
public:
/**
* Serialises the packet into given buffer
*
* @param Vector to be used to serialise the packet into
* @return true on success, false otherwise
*/
bool serialize(vector<unsigned char>& buffer) const;
/**
* Returns std::string representation of packet
*
* @return String representation of packet
*/
string toString() const;
private:
/**
* Management Information Base reference to fetch
* necessary information to build this packet
*/
ManagementInformationBase& mib;
/**
* A copy of the packet information
*/
CommunicationProfileSelectionResponse packet;
};
#endif /* MGMT_FAC_PACKET_COMM_PROFILE_SELECTION_RESPONSE_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_fac_packet_configuration_notification.cpp
* \brief A container Configuration Notification
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_fac_packet_configuration_notification.hpp"
#include <boost/lexical_cast.hpp>
#include <sstream>
using namespace std;
FacConfigurationNotificationPacket::FacConfigurationNotificationPacket(ManagementInformationBase& mib, const vector<unsigned char>& packetBuffer, Logger& logger) :
GeonetPacket(packetBuffer, logger), mib(mib), logger(logger) {
/**
* Parse the packet...
*/
parse(packetBuffer);
/**
* ...and update MIB with extracted information
*/
logger.info("Notifying MIB about this ITS key value change...");
mib.setValue(static_cast<ItsKeyID>(packet.configurationItem.configurationId), packet.configurationItem.configurationBuffer);
}
FacConfigurationNotificationPacket::~FacConfigurationNotificationPacket() {}
bool FacConfigurationNotificationPacket::parse(const vector<unsigned char>& packetBuffer) {
if (packetBuffer.size() < sizeof(MessageHeader)) {
logger.warning("Incoming buffer is short of size (size=" + boost::lexical_cast<string>(packetBuffer.size()) + ") to carry a Configuration Notification packet!");
return false;
}
/**
* Parse configuration id and size of configuration item
*/
u_int8_t payloadIndex = sizeof(MessageHeader);
packet.configurationItem.configurationId = packetBuffer[payloadIndex];
packet.configurationItem.configurationId <<= 8;
packet.configurationItem.configurationId |= packetBuffer[payloadIndex + 1];
packet.configurationItem.length = packetBuffer[payloadIndex + 2];
packet.configurationItem.length <<= 8;
packet.configurationItem.length |= packetBuffer[payloadIndex + 3];
/**
* Verify packet size again having data length this time
*/
u_int16_t packetHeaderLength = sizeof(MessageHeader) + sizeof(packet.configurationItem.configurationId) + sizeof(packet.configurationItem.length);
if (packetBuffer.size() != packetHeaderLength + packet.configurationItem.length) {
logger.info("Incoming Configuration Notification packet is short of size to carry the payload it asserts it carries!");
return false;
}
/**
* Extract payload...
*/
packet.configurationItem.configurationBuffer.resize(packet.configurationItem.length);
copy(packetBuffer.begin() + packetHeaderLength, packetBuffer.end(), packet.configurationItem.configurationBuffer.begin());
return true;
}
string FacConfigurationNotificationPacket::toString() const {
stringstream ss;
ss << "ConfigurationNotification[ConfID:" << hex << showbase << packet.configurationItem.configurationId
<< resetiosflags(ios_base::hex) << ", Length:" << packet.configurationItem.length << "]";
return ss.str();
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_fac_packet_configuration_notification.hpp
* \brief A container for Configuration Notification
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_FAC_PACKET_CONFIGURATION_NOTIFICATION_HPP_
#define MGMT_FAC_PACKET_CONFIGURATION_NOTIFICATION_HPP_
#include "../util/mgmt_log.hpp"
#include "mgmt_gn_packet.hpp"
/**
* A container for Configuration Notification
*/
class FacConfigurationNotificationPacket : public GeonetPacket {
public:
/**
* Constructor for FacConfigurationNotificationPacket class
*
* @param mib Management Information Base reference to update relevant configuration
* @param packetBuffer Packet bytes
* @param logger Logger object reference
*/
FacConfigurationNotificationPacket(ManagementInformationBase& mib, const vector<unsigned char>& packetBuffer, Logger& logger);
/**
* Destructor for FacConfigurationNotificationPacket class
*/
virtual ~FacConfigurationNotificationPacket();
public:
/**
* Parses incoming packet data and updates `packet' member
*
* @param packetBuffer std::vector carrying packet data
* @return true on success, false otherwise
*/
bool parse(const vector<unsigned char>& packetBuffer);
/**
* Returns string (of type std::string) representation of packet
*
* @return String representation of packet
*/
string toString() const;
private:
/**
* Management Information Base reference
*/
ManagementInformationBase& mib;
/**
* Configuration Notification packet
*/
ConfigurationNotification packet;
/**
* Logger reference
*/
Logger& logger;
};
#endif /* MGMT_FAC_PACKET_CONFIGURATION_NOTIFICATION_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packets.cpp
* \brief Superclass for all Management-Geonet messages
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_gn_packet.hpp"
#include "../util/mgmt_util.hpp"
#include <sstream>
#include <iostream>
using namespace std;
GeonetPacket::GeonetPacket(bool extendedMessage, bool validity, u_int8_t version, u_int8_t priority,
u_int16_t eventType, Logger& logger) : logger(logger) {
Util::resetBuffer(reinterpret_cast<unsigned char*>(&header), sizeof(MessageHeader));
if (extendedMessage)
this->header.version |= 0x80;
if (validity)
this->header.version |= 0x40;
this->header.version |= (version & 0x0f);
this->header.priority = priority;
this->header.priority <<= 5;
this->header.eventType = (eventType >> 8);
this->header.eventSubtype = (eventType & 0xFF);
}
GeonetPacket::GeonetPacket(const vector<unsigned char>& packetBuffer, Logger& logger)
: logger(logger) {
parseHeaderBuffer(packetBuffer, &this->header);
/**
* Print the packet information
*/
logger.info(toString());
}
GeonetPacket::~GeonetPacket() {
}
bool GeonetPacket::parseHeaderBuffer(const vector<unsigned char>& headerBuffer, MessageHeader* header) {
if (headerBuffer.size() < sizeof(MessageHeader) || !header)
return false;
/**
* Parse (E) and (V) fields first
*/
extended = Util::isBitSet(headerBuffer[0], 0);
valid = Util::isBitSet(headerBuffer[0], 1);
if (!valid)
logger.warning("Incoming packet's (V) validity flag is not set! Will parse anyway...");
header->version = headerBuffer[0] & 0x0f;
header->priority = (headerBuffer[1] >> 5);
header->eventType = headerBuffer[2];
header->eventSubtype = headerBuffer[3];
return true;
}
bool GeonetPacket::serialize(vector<unsigned char>& buffer) const {
/**
* Validate incoming buffer's size
*/
if (buffer.size() < sizeof(MessageHeader)) {
logger.error("Incoming buffer is not sufficient to encode a message header into!");
return false;
}
logger.debug("Serialising header...");
buffer[0] = header.version;
buffer[0] |= 0x40; // encode Validity flag as 1
buffer[1] = header.priority;
buffer[1] <<= 5;
buffer[2] = header.eventType;
buffer[3] = header.eventSubtype;
return true;
}
bool GeonetPacket::isExtended() const {
return extended;
}
bool GeonetPacket::isValid() const {
return valid;
}
bool GeonetPacket::setEventType(const u_int16_t& eventType) {
this->header.eventType = (eventType >> 8);
this->header.eventSubtype = (eventType & 0xFF);
return true;
}
u_int16_t GeonetPacket::getEventType() const {
u_int16_t eventType = header.eventType;
eventType <<= 8;
eventType |= header.eventSubtype;
return eventType;
}
string GeonetPacket::toString() const {
stringstream ss;
ss << "GeonetHeader[extended:" << isExtended() << ", valid:" << isValid()
<< ", version:" << (int) header.getVersion() << ", priority:" << (int) header.getPriority()
<< ", eventType:" << hex << showbase << setw(2) << (int) header.eventType
<< ", eventSubType: " << (int) header.eventSubtype << "]";
return ss.str();
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packets.hpp
* \brief Superclass for all Management-Geonet messages
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_GN_PACKET_HPP_
#define MGMT_GN_PACKET_HPP_
#include "../mgmt_information_base.hpp"
#include "../mgmt_types.hpp"
#include "../util/mgmt_log.hpp"
#include <string>
#include <vector>
using namespace std;
/**
* Superclass for all Management-Geonet messages
*/
class GeonetPacket {
public:
/**
* Constructor for GeonetPacket class
*
* @param extendedMessage Indicates if this an extended (vendor specific) message
* @param validity Indicates non-existent data
* @param version Version number
* @param priority Priority
* @param eventType 16-bit Event Type and Event Subtype information
* @param logger Logger object reference
*/
GeonetPacket(bool extendedMessage, bool validity, u_int8_t version, u_int8_t priority, u_int16_t eventType, Logger& logger);
/**
* Buffer-parser constructor for GeonetPacket class
*
* @param packetBuffer Buffer carrying GeonetPacket
* @param logger Logger object reference
*/
GeonetPacket(const vector<unsigned char>& packetBuffer, Logger& logger);
/**
* Virtual destructor for GeonetPacket class
*/
virtual ~GeonetPacket();
public:
/**
* Parses buffer and fills in incoming header structure
*
* @param headerBuffer Buffer carrying message header
* @param header Structure to be filled in
* @return true on success, false otherwise
*/
bool parseHeaderBuffer(const vector<unsigned char>& headerBuffer, MessageHeader* header);
/**
* Serialises header fields onto given buffer
* This method is called by every subclass::serialize()
*
* @param buffer Buffer to serialise buffer on
* @return true on success, false otherwise
*/
virtual bool serialize(vector<unsigned char>& buffer) const;
/**
* Returns if this packet contains extended/vendor specific data
* Those who override this method will be excommunicated, fair warning
*
* @return boolean
*/
bool isExtended() const;
/**
* Returns if this packet contains valid data
* Those who override this method will be excommunicated, fair warning
*
* @return boolean
*/
bool isValid() const;
/**
* Sets the Event Type/SubType field with incoming value
*
* @param eventType 16-bit Event Type/SubType
* @return true on success, false otherwise
*/
bool setEventType(const u_int16_t& eventType);
/**
* Returns the Event Type/SubType value as a 16-bit value
*
* @return 16-bit Event Type/SubType value
*/
u_int16_t getEventType() const;
/**
* Utility method to get event type of a packet buffer
*
* @param buffer A packet buffer of type vector<unsigned char> reference
* @return Event type
*/
static u_int16_t parseEventTypeOfPacketBuffer(const vector<unsigned char>& buffer) {
const MessageHeader* header = reinterpret_cast<const MessageHeader*>(buffer.data());
u_int16_t eventType = header->eventType;
eventType <<= 8;
eventType |= header->eventSubtype;
return eventType;
}
/**
* Returns string representation of relevant GeonetPacket object
*
* @return std::string representation
*/
virtual string toString() const;
protected:
/**
* Header is kept in superclass for every Geonet* subclass
*/
MessageHeader header;
/**
* (E) Extended bit
*/
bool extended;
/**
* (V) Validity bit
*/
bool valid;
/**
* Logger object reference
*/
Logger& logger;
};
#endif /* MGMT_GN_PACKET_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_comm_profile_request.cpp
* \brief A container for Communication Profile Request event
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_gn_packet_comm_profile_request.hpp"
#include "../util/mgmt_util.hpp"
#include <sstream>
GeonetCommunicationProfileRequestPacket::GeonetCommunicationProfileRequestPacket(const vector<unsigned char>& packetBuffer, Logger& logger)
: GeonetPacket(packetBuffer, logger) {
parse(packetBuffer);
}
GeonetCommunicationProfileRequestPacket::~GeonetCommunicationProfileRequestPacket() {
}
u_int32_t GeonetCommunicationProfileRequestPacket::getCommunicationProfileRequestSet() const {
return communicationProfileRequestSet;
}
u_int8_t GeonetCommunicationProfileRequestPacket::getSequenceNumber() const {
return sequenceNumber;
}
#ifdef UNUSED
bool GeonetCommunicationProfileRequestPacket::getTransportBtpA() const {
return transportBtpA;
}
bool GeonetCommunicationProfileRequestPacket::getTransportBtpB() const {
return transportUdp;
}
bool GeonetCommunicationProfileRequestPacket::getTransportTcp() const {
return transportUdp;
}
bool GeonetCommunicationProfileRequestPacket::getTransportUdp() const {
return transportUdp;
}
bool GeonetCommunicationProfileRequestPacket::getTransportRtp() const {
return transportUdp;
}
bool GeonetCommunicationProfileRequestPacket::getTransportStcp() const {
return transportUdp;
}
bool GeonetCommunicationProfileRequestPacket::getNetworkGn() const {
return networkGn;
}
bool GeonetCommunicationProfileRequestPacket::getNetworkIpv6Gn() const {
return networkIpv6Gn;
}
bool GeonetCommunicationProfileRequestPacket::getNetworkIpv6() const {
return networkIpv6;
}
bool GeonetCommunicationProfileRequestPacket::getNetworkIpv4() const {
return networkIpv4;
}
bool GeonetCommunicationProfileRequestPacket::getNetworkIpv4v6() const {
return networkIpv4v6;
}
bool GeonetCommunicationProfileRequestPacket::getNetworkDsmiIpv4v6() const {
return networkDsmIpv4v6;
}
bool GeonetCommunicationProfileRequestPacket::getAccessItsG5() const {
return accessItsG5;
}
bool GeonetCommunicationProfileRequestPacket::getAccess3g() const {
return access3G;
}
bool GeonetCommunicationProfileRequestPacket::getAccess11n() const {
return access11n;
}
bool GeonetCommunicationProfileRequestPacket::getAccessEthernet() const {
return accessEthernet;
}
bool GeonetCommunicationProfileRequestPacket::getChannelCch() const {
return channelCch;
}
bool GeonetCommunicationProfileRequestPacket::getChannelSch1() const {
return channelSch1;
}
bool GeonetCommunicationProfileRequestPacket::getChannelSch2() const {
return channelSch2;
}
bool GeonetCommunicationProfileRequestPacket::getChannelSch3() const {
return channelSch3;
}
bool GeonetCommunicationProfileRequestPacket::getChannelSch4() const {
return channelSch4;
}
#endif
bool GeonetCommunicationProfileRequestPacket::parse(const vector<unsigned char>& packetBuffer) {
/**
* Verify the size of incoming buffer
*/
if (packetBuffer.size() < sizeof(MessageHeader))
return false;
u_int8_t payloadIndex = sizeof(MessageHeader);
/*
* Parse first octet which is "transport"
*/
transportBtpA = Util::isBitSet(packetBuffer[payloadIndex], 0x01);
transportBtpB = Util::isBitSet(packetBuffer[payloadIndex], 0x02);
transportTcp = Util::isBitSet(packetBuffer[payloadIndex], 0x03);
transportUdp = Util::isBitSet(packetBuffer[payloadIndex], 0x04);
transportRtp = Util::isBitSet(packetBuffer[payloadIndex], 0x05);
transportStcp = Util::isBitSet(packetBuffer[payloadIndex], 0x06);
/*
* Parse second octet which is "network"
*/
networkGn = Util::isBitSet(packetBuffer[payloadIndex + 1], 0x01);
networkIpv6Gn = Util::isBitSet(packetBuffer[payloadIndex + 1], 0x02);
networkIpv6 = Util::isBitSet(packetBuffer[payloadIndex + 1], 0x03);
networkIpv4 = Util::isBitSet(packetBuffer[payloadIndex + 1], 0x04);
networkIpv4v6 = Util::isBitSet(packetBuffer[payloadIndex + 1], 0x05);
networkDsmIpv4v6 = Util::isBitSet(packetBuffer[payloadIndex + 1], 0x06);
/*
* Parse third octet which is "access"
*/
accessItsG5 = Util::isBitSet(packetBuffer[payloadIndex + 2], 0x01);
access3G = Util::isBitSet(packetBuffer[payloadIndex + 2], 0x02);
access11n = Util::isBitSet(packetBuffer[payloadIndex + 2], 0x03);
accessEthernet = Util::isBitSet(packetBuffer[payloadIndex + 2], 0x04);
/**
* Parse fourth octet whih is "channel"
*/
channelCch = Util::isBitSet(packetBuffer[payloadIndex + 3], 0x01);
channelSch1 = Util::isBitSet(packetBuffer[payloadIndex + 3], 0x02);
channelSch2 = Util::isBitSet(packetBuffer[payloadIndex + 3], 0x03);
channelSch3 = Util::isBitSet(packetBuffer[payloadIndex + 3], 0x04);
channelSch4 = Util::isBitSet(packetBuffer[payloadIndex + 3], 0x05);
/**
* Parse whole set of requested configuration
*/
Util::parse4byteInteger(packetBuffer.data() + payloadIndex, &communicationProfileRequestSet); payloadIndex += 4;
/**
* Parse the sequence number and ignore reserved part
*/
sequenceNumber = packetBuffer.data()[payloadIndex];
return true;
}
string GeonetCommunicationProfileRequestPacket::toString() const {
stringstream ss;
ss << GeonetPacket::toString() << endl
<< "Transport [BTPA:" << transportBtpA << ", BTPB:" << transportBtpB
<< ", TCP:" << transportTcp << ", UDP:" << transportUdp
<< ", RTP:" << transportRtp << ", STCP:" << transportStcp << "]" << endl
<< "Network [GN:" << networkGn << ", IPv6GN:" << networkIpv6Gn
<< ", IPv6:" << networkIpv6 << ", IPv4:" << networkIpv4
<< ", IPv4v6:" << networkIpv4v6 << ", DSMIPv4v6:" << networkDsmIpv4v6 << "]" << endl
<< "Access [ITSG5:" << accessItsG5 << ", 3G:" << access3G
<< ", 11n:" << access11n << ", Ethernet:" << accessEthernet << "]" << endl
<< "Channel [CCH:" << channelCch << ", SCH1:" << channelSch1
<< ", SCH2:" << channelSch2 << ", SCH3:" << channelSch3
<< ", SCH4: " << channelSch4 << "]" << endl
<< "Sequence number:" << sequenceNumber << endl;
return ss.str();
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_comm_profile_request.hpp
* \brief A container for Communication Profile Request event
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_GN_PACKET_COMM_PROFILE_REQUEST_HPP_
#define MGMT_GN_PACKET_COMM_PROFILE_REQUEST_HPP_
#include "mgmt_gn_packet.hpp"
/**
* Communication Profile Request
*/
struct CommunicationProfileRequest {
MessageHeader header;
u_int8_t transport;
u_int8_t network;
u_int8_t access;
u_int8_t channel;
u_int8_t sequenceNumber;
u_int8_t reserved8bit;
u_int16_t reserved16bit;
} __attribute__((packed));
/**
* A container for Communication Profile Request event
*/
class GeonetCommunicationProfileRequestPacket: public GeonetPacket {
public:
/**
* Constructor for GeonetCommunicationProfileRequestPacket class
*
* @param packetBuffer vector containing packet data
* @param logger Logger object reference
*/
GeonetCommunicationProfileRequestPacket(const vector<unsigned char>& packetBuffer, Logger& logger);
/**
* Destructor for GeonetCommunicationProfileRequestPacket class
*/
~GeonetCommunicationProfileRequestPacket();
public:
/**
* Returns 32-bit requested flag set that actually is the payload of this packet
*
* @return 32-bit requested flag set
*/
u_int32_t getCommunicationProfileRequestSet() const;
/**
* Returns 8-bit sequence number
*
* @return 8-bit sequence number
*/
u_int8_t getSequenceNumber() const;
#ifdef UNUSED
/**
* Returns Transport::BTPA flag's value
*
* @return true if set, false otherwise
*/
bool getTransportBtpA() const;
/**
* Returns Transport::BTPB flag's value
*
* @return true if set, false otherwise
*/
bool getTransportBtpB() const;
/**
* Returns Transport::TCP flag's value
*
* @return true if set, false otherwise
*/
bool getTransportTcp() const;
/**
* Returns Transport::UDP flag's value
*
* @return true if set, false otherwise
*/
bool getTransportUdp() const;
/**
* Returns Transport::RTP flag's value
*
* @return true if set, false otherwise
*/
bool getTransportRtp() const;
/**
* Returns Transport::STCP flag's value
*
* @return true if set, false otherwise
*/
bool getTransportStcp() const;
/**
* Returns Network::GN flag's value
*
* @return true if set, false otherwise
*/
bool getNetworkGn() const;
/**
* Returns Network::IPv6GN flag's value
*
* @return true if set, false otherwise
*/
bool getNetworkIpv6Gn() const;
/**
* Returns Network::IPv6 flag's value
*
* @return true if set, false otherwise
*/
bool getNetworkIpv6() const;
/**
* Returns Network::IPv4 flag's value
*
* @return true if set, false otherwise
*/
bool getNetworkIpv4() const;
/**
* Returns Network::IPv4v6 flag's value
*
* @return true if set, false otherwise
*/
bool getNetworkIpv4v6() const;
/**
* Returns Network::DSMIIPv4v6 flag's value
*
* @return true if set, false otherwise
*/
bool getNetworkDsmiIpv4v6() const;
/**
* Returns Access::ITSG5 flag's value
*
* @return true if set, false otherwise
*/
bool getAccessItsG5() const;
/**
* Returns Access::3G flag's value
*
* @return true if set, false otherwise
*/
bool getAccess3g() const;
/**
* Returns Access::11n flag's value
*
* @return true if set, false otherwise
*/
bool getAccess11n() const;
/**
* Returns Access::Ethernet flag's value
*
* @return true if set, false otherwise
*/
bool getAccessEthernet() const;
/**
* Returns Channel::CCH flag's value
*
* @return true if set, false otherwise
*/
bool getChannelCch() const;
/**
* Returns Channel::SCH1 flag's value
*
* @return true if set, false otherwise
*/
bool getChannelSch1() const;
/**
* Returns Channel::SCH2 flag's value
*
* @return true if set, false otherwise
*/
bool getChannelSch2() const;
/**
* Returns Channel::SCH3 flag's value
*
* @return true if set, false otherwise
*/
bool getChannelSch3() const;
/**
* Returns Channel::SCH4 flag's value
*
* @return true if set, false otherwise
*/
bool getChannelSch4() const;
#endif
/**
* Parses the packet buffer and fills configuration flags
*
* @param packetBuffer Vector containing packet data
* @return true on success, false otherwise
*/
bool parse(const vector<unsigned char>& packetBuffer);
/**
* Returns std::string representation of packet
*
* @return String representation of packet
*/
string toString() const;
private:
/**
* Transport flags
*/
bool transportBtpA, transportBtpB, transportTcp;
bool transportUdp, transportRtp, transportStcp;
/**
* Network flags
*/
bool networkGn, networkIpv6Gn, networkIpv6;
bool networkIpv4, networkIpv4v6, networkDsmIpv4v6;
/**
* Access flags
*/
bool accessItsG5, access3G, access11n, accessEthernet;
/**
* Channel flags
*/
bool channelCch, channelSch1, channelSch2;
bool channelSch3, channelSch4;
/**
* Sequence number
*/
u_int8_t sequenceNumber;
/**
* Communication profile request flag set (packet payload)
*/
u_int32_t communicationProfileRequestSet;
};
#endif /* MGMT_GN_PACKET_COMM_PROFILE_REQUEST_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2010 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_comm_profile_response.cpp
* \brief A container for Communication Profile Response event
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_gn_packet_comm_profile_response.hpp"
#include <boost/lexical_cast.hpp>
#include "../util/mgmt_util.hpp"
GeonetCommunicationProfileResponsePacket::GeonetCommunicationProfileResponsePacket(ManagementInformationBase& mib,
u_int32_t communicationProfileRequest, u_int8_t sequenceNumber, Logger& logger) :
GeonetPacket(false, true, 0x00, 0x00, MGMT_GN_EVENT_CONF_COMM_PROFILE_RESPONSE, logger), mib(mib), logger(logger) {
this->communicationProfileRequest = communicationProfileRequest;
this->sequenceNumber = sequenceNumber;
}
GeonetCommunicationProfileResponsePacket::~GeonetCommunicationProfileResponsePacket() {
}
bool GeonetCommunicationProfileResponsePacket::serialize(vector<unsigned char>& buffer) const {
/**
* Verify incoming buffer size
*/
if (buffer.size() < sizeof(CommunicationProfileResponse))
return false;
/**
* Serialise header first...
*/
GeonetPacket::serialize(buffer);
/**
* Fetch those profiles matching with the incoming bitmap (sent in the COMM_PROFILE_REQ)
*/
map<CommunicationProfileID, CommunicationProfileItem> filteredProfileMap = mib.getCommunicationProfileManager().getProfileMapSubset(communicationProfileRequest);
/**
* Append communication profile item count
*/
u_int8_t payloadIndex = sizeof(MessageHeader);
Util::encode2byteInteger(buffer, payloadIndex, filteredProfileMap.size());
payloadIndex += 2;
/**
* Append sequence number
*/
buffer[payloadIndex++] = sequenceNumber;
/**
* ...and then the `reserved' field
*/
buffer[payloadIndex++] = 0x00;
/**
* ...and communication profile item(s)
*/
map<CommunicationProfileID, CommunicationProfileItem>::const_iterator it = filteredProfileMap.begin();
while (it != filteredProfileMap.end()) {
Util::encode4byteInteger(buffer, payloadIndex, it->second.id);
payloadIndex += 4;
buffer[payloadIndex++] = it->second.transport;
buffer[payloadIndex++] = it->second.network;
buffer[payloadIndex++] = it->second.access;
buffer[payloadIndex++] = it->second.channel;
// Now `payloadIndex' points to the next available place
++it;
}
logger.info("A COMM_PROFILE_RESPONSE packet has been generated having " + boost::lexical_cast<string>(filteredProfileMap.size()) + " profile(s) out of " + boost::lexical_cast<string>((int)mib.getCommunicationProfileManager().getProfileCount()));
/**
* Resize buffer to the number of bytes we've written into it
*/
buffer.resize(sizeof(CommunicationProfileResponse) + filteredProfileMap.size() * sizeof(CommunicationProfileItem));
return true;
}
string GeonetCommunicationProfileResponsePacket::toString() const {
stringstream ss;
ss << GeonetPacket::toString() << endl
<< mib.getCommunicationProfileManager().toString() << endl;
return ss.str();
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_comm_profile_response.hpp
* \brief A container for Communication Profile Response event
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_GN_PACKET_COMM_PROFILE_RESPONSE_HPP_
#define MGMT_GN_PACKET_COMM_PROFILE_RESPONSE_HPP_
#include "mgmt_gn_packet.hpp"
/**
* Communication Profile Response
*/
struct CommunicationProfileResponse {
MessageHeader header;
u_int16_t communicationProfileCount;
u_int8_t sequenceNumber;
u_int8_t reserved;
/* CommunicationProfileItem(s) follow(s)... */
} __attribute__((packed));
/**
* A container for Communication Profile Response event
*/
class GeonetCommunicationProfileResponsePacket : public GeonetPacket {
public:
/**
* Constructor for GeonetCommunicationProfileResponsePacket class
*
* @param mib Management Information Base reference
* @param communicationProfileRequest Communication Profile Request
* @param sequenceNumber 8-bit sequence number
* @param logger Logger object reference
*/
GeonetCommunicationProfileResponsePacket(ManagementInformationBase& mib, u_int32_t communicationProfileRequest, u_int8_t sequenceNumber, Logger& logger);
/**
* Destructor for GeonetCommunicationProfileResponsePacket class
*/
~GeonetCommunicationProfileResponsePacket();
public:
/**
* Serialises the packet into given buffer
*
* @param Vector to be used to serialise the packet into
* @return true on success, false otherwise
*/
bool serialize(vector<unsigned char>& buffer) const;
/**
* Returns std::string representation of packet
*
* @return String representation of packet
*/
string toString() const;
private:
/**
* Management Information Base reference to fetch
* necessary information to build this packet
*/
ManagementInformationBase& mib;
/**
* Logger reference
*/
Logger& logger;
/**
* Sequence number (the one parsed from corresponding Communication Profile Request packet)
*/
u_int8_t sequenceNumber;
/**
* Communication Profile Request flag set to determine
* requested options and respond accordingly
*/
u_int32_t communicationProfileRequest;
};
#endif /* MGMT_GN_PACKET_COMM_PROFILE_RESPONSE_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_configuration_available.cpp
* \brief A container for Configuration Available Event
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_gn_packet_configuration_available.hpp"
#include <boost/lexical_cast.hpp>
#include <iostream>
#include <sstream>
using namespace std;
GeonetConfigurationAvailableEventPacket::GeonetConfigurationAvailableEventPacket(ManagementInformationBase& mib, Logger& logger)
: GeonetPacket(false, true, 0x00, 0x00, MGMT_GN_EVENT_CONF_UPDATE_AVAILABLE, logger), mib(mib) {
}
GeonetConfigurationAvailableEventPacket::~GeonetConfigurationAvailableEventPacket() {
}
bool GeonetConfigurationAvailableEventPacket::serialize(vector<unsigned char>& buffer) {
if (buffer.size() < sizeof(ConfigureAvailableMessage)) {
logger.error("Incoming buffer' size is not sufficient!");
return false;
}
// Get some help from superclass to place header into given buffer
if (!GeonetPacket::serialize(buffer)) {
logger.error("Cannot serialise header into given buffer!");
return false;
}
u_int8_t bodyIndex = sizeof(MessageHeader);
u_int16_t keyCount = mib.getItsKeyManager().getNumberOfKeys();
// encode `reserved' field
buffer[bodyIndex] = 0x00;
buffer[bodyIndex + 1] = 0x00;
// encode `key count' field
buffer[bodyIndex + 2] = ((keyCount >> 8) & 0xff);
buffer[bodyIndex + 3] = (keyCount & 0xff);
/**
* Resize buffer to the number of bytes we've written into it
*/
buffer.resize(sizeof(ConfigureAvailableMessage));
return true;
}
string GeonetConfigurationAvailableEventPacket::toString() const {
return string("Key count: " + boost::lexical_cast<string>(mib.getItsKeyManager().getNumberOfKeys()));
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_configuration_available.hpp
* \brief A container for Configuration Available Event
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_GN_PACKET_CONFIGURATION_AVAILABLE_HPP_
#define MGMT_GN_PACKET_CONFIGURATION_AVAILABLE_HPP_
#include "../mgmt_information_base.hpp"
#include "../util/mgmt_log.hpp"
#include "mgmt_gn_packet.hpp"
#include <vector>
/**
* A container for Configuration Available Event
*/
class GeonetConfigurationAvailableEventPacket : public GeonetPacket {
public:
/**
* Constructor for GeonetConfigurationAvailableEventPacket class
*
* @param mib Management Information Base reference to fetch necessary
* information to build this packet
* @param logger Logger object reference
*/
GeonetConfigurationAvailableEventPacket(ManagementInformationBase& mib, Logger& logger);
/**
* Destructor for GeonetConfigurationAvailableEventPacket class
*/
~GeonetConfigurationAvailableEventPacket();
public:
/**
* Serialises packet header and payload into given buffer
*
* @param buffer Vector buffer that the packet will be serialised into
* @return true on success, false otherwise
*/
bool serialize(vector<unsigned char>& buffer);
/**
* Returns string representation of the packet
*
* @return std::string representation of the packet
*/
string toString() const;
private:
/**
* Management Information Base reference to fetch necessary
* information to build this packet
*/
ManagementInformationBase& mib;
};
#endif /* MGMT_GN_PACKET_CONFIGURATION_AVAILABLE_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_get_configuration.cpp
* \brief A container for Get Configuration Event packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_gn_packet_get_configuration.hpp"
#include <iostream>
#include <sstream>
using namespace std;
GeonetGetConfigurationEventPacket::GeonetGetConfigurationEventPacket(const vector<unsigned char>& packetBuffer, Logger& logger) :
GeonetPacket(packetBuffer, logger) {
parse(packetBuffer);
logger.info(toString());
}
u_int16_t GeonetGetConfigurationEventPacket::getConfID() const {
return packet.configurationId;
}
u_int16_t GeonetGetConfigurationEventPacket::getTxMode() const {
return packet.transmissionMode;
}
string GeonetGetConfigurationEventPacket::toString() const {
stringstream ss;
ss << "[ConfID:" << packet.configurationId << ", txMode:" << packet.transmissionMode << "]";
return ss.str();
}
bool GeonetGetConfigurationEventPacket::parse(const vector<unsigned char>& packetBuffer) {
if (packetBuffer.size() < sizeof(ConfigurationRequestMessage))
return false;
u_int8_t payloadIndex = sizeof(MessageHeader);
packet.configurationId = packetBuffer[payloadIndex];
packet.configurationId <<= 8;
packet.configurationId |= packetBuffer[payloadIndex + 1];
packet.transmissionMode = packetBuffer[payloadIndex + 2];
packet.transmissionMode <<= 8;
packet.transmissionMode |= packetBuffer[payloadIndex + 3];
return true;
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_get_configuration.hpp
* \brief A container for Get Configuration Event packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_GN_PACKET_GET_CONFIGURATION_HPP_
#define MGMT_GN_PACKET_GET_CONFIGURATION_HPP_
#include <string>
#include <vector>
#include "mgmt_gn_packet.hpp"
using namespace std;
/**
* A container for Get Configuration Event packet
*/
class GeonetGetConfigurationEventPacket: public GeonetPacket {
public:
/**
* Constructor of GeonetGetConfigurationEventPacket class
*
* @param packetBuffer Incoming packet buffer that is going to be parsed
* @param logger Logger object reference
*/
GeonetGetConfigurationEventPacket(const vector<unsigned char>& packetBuffer, Logger& logger);
public:
/**
* Returns configuration ID that is requested
*
* @return Requested configuration ID
*/
u_int16_t getConfID() const;
/**
* Returns TX mode that is requested
*
* @return Requested TX mode (bulk or single)
*/
u_int16_t getTxMode() const;
/**
* Returns string representation of this packet
*
* @return std::string representation of this packet
*/
string toString() const;
private:
/**
* Parses incoming packet data and updates `packet' member
*
* @param packetBuffer std::vector carrying packet data
* @return true on success, false otherwise
*/
bool parse(const vector<unsigned char>& packetBuffer);
private:
/**
* Packet that will hold parsed information
*/
ConfigurationRequestMessage packet;
};
#endif /* MGMT_GN_PACKET_GET_CONFIGURATION_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_location_table_request.cpp
* \brief A container for Location Table Request Event packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_gn_packet_location_table_request.hpp"
#include "../util/mgmt_util.hpp"
#include <iostream>
#include <sstream>
using namespace std;
GeonetLocationTableRequestEventPacket::GeonetLocationTableRequestEventPacket(GnAddress address, Logger& logger)
: GeonetPacket(false, true, 0x00, 0x00, MGMT_GN_EVENT_LOCATION_TABLE_REQUEST, logger) {
this->gnAddress = address;
}
bool GeonetLocationTableRequestEventPacket::serialize(vector<unsigned char>& buffer) const {
if (buffer.size() < sizeof(LocationTableRequest))
return false;
// Encode header first
if (!GeonetPacket::serialize(buffer)) {
logger.error("Cannot serialise header into given buffer!");
return false;
}
// Then the GN address follows
if (!Util::encode8byteInteger(buffer, sizeof(MessageHeader), this->gnAddress)) {
logger.error("Cannot serialise GN address into given buffer!");
return false;
}
buffer.resize(sizeof(LocationTableRequest));
return true;
}
string GeonetLocationTableRequestEventPacket::toString() const {
stringstream ss;
ss << GeonetPacket::toString();
ss << "GN Address: " << gnAddress << endl;
return ss.str();
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_location_table_request.hpp
* \brief A container for Location Table Request Event packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_GN_PACKET_LOCATION_TABLE_REQUEST_HPP_
#define MGMT_GN_PACKET_LOCATION_TABLE_REQUEST_HPP_
#include "../util/mgmt_log.hpp"
#include "mgmt_gn_packet.hpp"
#include <string>
using namespace std;
/**
* A container for Location Table Request Event packet
*/
class GeonetLocationTableRequestEventPacket: public GeonetPacket {
public:
/**
* Constructor of GeonetLocationTableRequestEventPacket class
*
* @param address GN Address that is going to be requested
* @param logger Logger object reference
*/
GeonetLocationTableRequestEventPacket(GnAddress address, Logger& logger);
public:
/**
* Serialises packet information into incoming buffer
*
* @param buffer std::vector that packet information will be serialised into
* @return true on success, false otherwise
*/
bool serialize(vector<unsigned char>& buffer) const;
/**
* Returns string representation of this packet
*
* @return std::string representation of this packet
*/
string toString() const;
private:
/**
* GN address that is going to be questioned
*/
GnAddress gnAddress;
};
#endif /* MGMT_GN_PACKET_LOCATION_TABLE_REQUEST_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_location_table_response.hpp
* \brief A container for Location Table Response Event packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_gn_packet_location_table_response.hpp"
#include <boost/lexical_cast.hpp>
#include "../util/mgmt_util.hpp"
#include <sstream>
GeonetLocationTableResponseEventPacket::GeonetLocationTableResponseEventPacket(ManagementInformationBase& mib, const vector<unsigned char>& packetBuffer, Logger& logger)
: GeonetPacket(packetBuffer, logger), mib(mib) {
parse(packetBuffer);
}
string GeonetLocationTableResponseEventPacket::toString() const {
stringstream ss;
return ss.str();
}
bool GeonetLocationTableResponseEventPacket::parse(const vector<unsigned char>& packetBuffer) {
u_int16_t lpvCount = 0;
u_int16_t packetBufferIndex = sizeof(MessageHeader);
// Parse LPV Count...
if (Util::parse2byteInteger(packetBuffer.data() + packetBufferIndex, &lpvCount)) {
logger.info("Location table response has following number of entr{y|ies}: " + boost::lexical_cast<string>(lpvCount));
} else {
logger.error("Cannot parse location table entry count");
return false;
}
// ...and Network Flags
mib.setNetworkFlags(packetBuffer[2]);
/**
* Skip 4-byte part (LPV Count, Network Flags, and Reserved flags) coming immediately after the header
*/
u_int16_t itemIndex = packetBufferIndex + sizeof(u_int32_t);
/**
* Traverse location table items...
*/
for (; lpvCount != 0; lpvCount--) {
LocationTableItem* item = new LocationTableItem();
Util::parse8byteInteger(packetBuffer.data() + itemIndex, &item->gnAddress); itemIndex += sizeof(GnAddress);
Util::parse4byteInteger(packetBuffer.data() + itemIndex, &item->timestamp); itemIndex += sizeof(u_int32_t);
Util::parse4byteInteger(packetBuffer.data() + itemIndex, &item->latitude); itemIndex += sizeof(u_int32_t);
Util::parse4byteInteger(packetBuffer.data() + itemIndex, &item->longitude); itemIndex += sizeof(u_int32_t);
Util::parse2byteInteger(packetBuffer.data() + itemIndex, &item->speed); itemIndex += sizeof(u_int16_t);
Util::parse2byteInteger(packetBuffer.data() + itemIndex, &item->heading); itemIndex += sizeof(u_int16_t);
Util::parse2byteInteger(packetBuffer.data() + itemIndex, &item->altitude); itemIndex += sizeof(u_int16_t);
Util::parse2byteInteger(packetBuffer.data() + itemIndex, &item->acceleration); itemIndex += sizeof(u_int16_t);
Util::parse2byteInteger(packetBuffer.data() + itemIndex, &item->sequenceNumber); itemIndex += sizeof(u_int16_t);
item->lpvFlags = packetBuffer.data()[itemIndex++];
item->reserved = packetBuffer.data()[itemIndex++];
// Update MIB with this record
mib.updateLocationTable(item);
logger.info("Management Information Base has been updated with following location table entry: ");
logger.info(item->toString());
// itemIndex shows the next record now, if there's any
}
return true;
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_location_table_response.hpp
* \brief A container for Location Table Response Event packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_GN_PACKET_LOCATION_TABLE_RESPONSE_HPP_
#define MGMT_GN_PACKET_LOCATION_TABLE_RESPONSE_HPP_
#include "../mgmt_information_base.hpp"
#include "../util/mgmt_log.hpp"
#include "mgmt_gn_packet.hpp"
#include <string>
using namespace std;
/**
* A container for Location Table Response Event packet
*/
class GeonetLocationTableResponseEventPacket: public GeonetPacket {
public:
/**
* Constructor of GeonetLocationTableResponseEventPacket class
*
* @param mib Management Information Base reference to keep it up-to-date
* with incoming information
* @param packetBuffer std::vector containing packet data
* @param logger Logger object reference
*/
GeonetLocationTableResponseEventPacket(ManagementInformationBase& mib,
const vector<unsigned char>& packetBuffer, Logger& logger);
public:
/**
* Returns string representation of this packet
*
* @return std::string representation of this packet
*/
string toString() const;
private:
/**
* Parses incoming packet buffer and updates MIB with this information
*
* @param packetBuffer std::vector containing packet data
* @return true on success, false otherwise
*/
bool parse(const vector<unsigned char>& packetBuffer);
private:
/**
* Management Information Base reference to keep it up-to-date with incoming
* Location Table information
*/
ManagementInformationBase& mib;
};
#endif /* MGMT_GN_PACKET_LOCATION_TABLE_RESPONSE_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_location_update.cpp
* \brief A container for Location Update Event packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_gn_packet_location_update.hpp"
#include <boost/lexical_cast.hpp>
#include <ctime>
GeonetLocationUpdateEventPacket::GeonetLocationUpdateEventPacket(ManagementInformationBase& mib, Logger& logger)
: GeonetPacket(false, true, 0x00, 0x00, MGMT_GN_EVENT_LOCATION_UPDATE, logger), mib(mib), logger(logger) {
}
GeonetLocationUpdateEventPacket::GeonetLocationUpdateEventPacket(ManagementInformationBase& mib, const vector<unsigned char>& packetBuffer, Logger& logger)
: GeonetPacket(packetBuffer, logger), mib(mib), logger(logger) {
parse(packetBuffer);
}
GeonetLocationUpdateEventPacket::~GeonetLocationUpdateEventPacket() {
}
bool GeonetLocationUpdateEventPacket::serialize(vector<unsigned char>& buffer) const {
if (buffer.size() < sizeof(LocationUpdateMessage)) {
logger.warning("Incoming buffer (size:" + boost::lexical_cast<string>(buffer.size()) + ") is not enough to carry a Location Update packet!");
return false;
}
/**
* Serialise header first..
*/
if (!GeonetPacket::serialize(buffer)) {
logger.error("Cannot serialise packet header");
return false;
}
/**
* ..and then the body
*/
u_int8_t payloadIndex = sizeof(MessageHeader);
const LocationInformation& location = mib.getLocationInformation();
logger.info("Following Location Information will be encoded:");
logger.info(location.toString());
Util::encode4byteInteger(buffer, payloadIndex, location.timestamp); payloadIndex += 4;
Util::encode4byteInteger(buffer, payloadIndex, location.latitude); payloadIndex += 4;
Util::encode4byteInteger(buffer, payloadIndex, location.longitude); payloadIndex += 4;
Util::encode2byteInteger(buffer, payloadIndex, location.speed); payloadIndex += 2;
Util::encode2byteInteger(buffer, payloadIndex, location.heading); payloadIndex += 2;
Util::encode2byteInteger(buffer, payloadIndex, location.altitude); payloadIndex += 2;
Util::encode2byteInteger(buffer, payloadIndex, location.acceleration); payloadIndex += 2;
buffer.resize(sizeof(LocationUpdateMessage));
return true;
}
bool GeonetLocationUpdateEventPacket::parse(const vector<unsigned char>& packetBuffer) {
if (packetBuffer.size() != sizeof(LocationUpdateMessage))
return false;
LocationInformation locationUpdate;
/**
* Skip header..
*/
u_int8_t payloadOffset = sizeof(MessageHeader);
/**
* Parse fields..
*/
Util::parse4byteInteger(packetBuffer.data() + payloadOffset, &locationUpdate.timestamp); payloadOffset += sizeof(u_int32_t);
Util::parse4byteInteger(packetBuffer.data() + payloadOffset, &locationUpdate.latitude); payloadOffset += sizeof(u_int32_t);
Util::parse4byteInteger(packetBuffer.data() + payloadOffset, &locationUpdate.longitude); payloadOffset += sizeof(u_int32_t);
Util::parse2byteInteger(packetBuffer.data() + payloadOffset, &locationUpdate.speed); payloadOffset += sizeof(u_int16_t);
Util::parse2byteInteger(packetBuffer.data() + payloadOffset, &locationUpdate.heading); payloadOffset += sizeof(u_int16_t);
Util::parse2byteInteger(packetBuffer.data() + payloadOffset, &locationUpdate.altitude); payloadOffset += sizeof(u_int16_t);
Util::parse2byteInteger(packetBuffer.data() + payloadOffset, &locationUpdate.acceleration); payloadOffset += sizeof(u_int16_t);
logger.info("Following Location Information has been parsed:");
logger.info(locationUpdate.toString());
logger.info("Notifying MIB for this information...");
return mib.setLocationInformation(locationUpdate);
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_location_update.hpp
* \brief A container for Location Update Event packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_GN_PACKET_LOCATION_UPDATE_HPP_
#define MGMT_GN_PACKET_LOCATION_UPDATE_HPP_
#include "../mgmt_types.hpp"
#include "../util/mgmt_log.hpp"
#include "mgmt_gn_packet.hpp"
/**
* A container for Location Update Event packet
*/
class GeonetLocationUpdateEventPacket : public GeonetPacket {
public:
/**
* Constructor for GeonetLocationUpdateEventPacket class
*
* @param mib Management Information Base reference to fetch necessary information
* @param logger Logger object reference
*/
GeonetLocationUpdateEventPacket(ManagementInformationBase& mib, Logger& logger);
/**
* Constructor for GeonetLocationUpdateEventPacket class to parse packet buffer
*
* @param mib Management Information Base reference to keep it up-to-date
* with incoming information
* @param packetBuffer std::vector containing packet data
* @param logger Logger object reference
*/
GeonetLocationUpdateEventPacket(ManagementInformationBase& mib, const vector<unsigned char>& packetBuffer, Logger& logger);
/**
* Destructor for GeonetLocationUpdateEventPacket class
*/
~GeonetLocationUpdateEventPacket();
public:
/**
* Serialises packet information into incoming buffer
*
* @param buffer std::vector that packet information will be serialised into
* @return true on success, false otherwise
*/
bool serialize(vector<unsigned char>& buffer) const;
/**
* Parses incoming packet buffer and updates MIB with this information
*
* @param packetBuffer std::vector containing packet data
* @return true on success, false otherwise
*/
bool parse(const vector<unsigned char>& packetBuffer);
private:
/**
* ManagementInformationBase object to fetch necessary information
*/
ManagementInformationBase& mib;
/**
* Logger object reference
*/
Logger& logger;
/**
* Location Update Event packet to keep relevant set of information
*/
LocationUpdateMessage packet;
};
#endif /* MGMT_GN_PACKET_LOCATION_UPDATE_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_network_state.cpp
* \brief A container for Network State Event packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_gn_packet_network_state.hpp"
#include "../util/mgmt_util.hpp"
#include <sstream>
GeonetNetworkStateEventPacket::GeonetNetworkStateEventPacket(ManagementInformationBase& mib, vector<unsigned char> packetBuffer, Logger& logger)
: GeonetPacket(packetBuffer, logger), mib(mib) {
if (parse(packetBuffer)) {
logger.info(this->toString());
logger.info("MIB is updated with incoming network state information");
}
}
GeonetNetworkStateEventPacket::~GeonetNetworkStateEventPacket() {
}
string GeonetNetworkStateEventPacket::toString() const {
stringstream ss;
ss << "NetworkState[ts:" << mib.getNetworkState().timestamp
<< " TxPackets:" << mib.getNetworkState().rxPackets
<< " RxBytes:" << mib.getNetworkState().rxBytes
<< " TxPackets:" << mib.getNetworkState().txPackets
<< " TxBytes:" << mib.getNetworkState().txBytes
<< " toUpLayer:" << mib.getNetworkState().toUpperLayerPackets
<< " disc.:" << mib.getNetworkState().discardedPackets
<< " dup.:" << mib.getNetworkState().duplicatePackets
<< " forw.:" << mib.getNetworkState().forwardedPackets
<< "]";
return ss.str();
}
bool GeonetNetworkStateEventPacket::parse(const vector<unsigned char>& packetBuffer) {
/**
* Verify that incoming packet's size is sufficient for a Network State packet
*/
if (packetBuffer.size() < sizeof(NetworkStateMessage))
return false;
unsigned int dataIndex = sizeof(MessageHeader);
Util::parse4byteInteger(packetBuffer.data() + dataIndex, &mib.getNetworkState().timestamp); dataIndex += 4;
Util::parse4byteInteger(packetBuffer.data() + dataIndex, &mib.getNetworkState().rxPackets); dataIndex += 4;
Util::parse4byteInteger(packetBuffer.data() + dataIndex, &mib.getNetworkState().rxBytes); dataIndex += 4;
Util::parse4byteInteger(packetBuffer.data() + dataIndex, &mib.getNetworkState().txPackets); dataIndex += 4;
Util::parse4byteInteger(packetBuffer.data() + dataIndex, &mib.getNetworkState().txBytes); dataIndex += 4;
Util::parse4byteInteger(packetBuffer.data() + dataIndex, &mib.getNetworkState().toUpperLayerPackets); dataIndex += 4;
Util::parse4byteInteger(packetBuffer.data() + dataIndex, &mib.getNetworkState().discardedPackets); dataIndex += 4;
Util::parse4byteInteger(packetBuffer.data() + dataIndex, &mib.getNetworkState().duplicatePackets); dataIndex += 4;
Util::parse4byteInteger(packetBuffer.data() + dataIndex, &mib.getNetworkState().forwardedPackets);
return true;
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_network_state.hpp
* \brief A container for Network State Event packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_GN_PACKET_NETWORK_STATE_HPP_
#define MGMT_GN_PACKET_NETWORK_STATE_HPP_
#include "mgmt_gn_packet.hpp"
#include "../mgmt_information_base.hpp"
/**
* A container for Network State Event packet
*/
class GeonetNetworkStateEventPacket: public GeonetPacket {
public:
/**
* Constructor of GeonetNetworkStateEventPacket class
*
* @param mib Management Information Base reference to keep it up-to-date
* with incoming information
* @param packetBuffer Buffer containing Network State Event packet (which
* is going to be parsed using parse())
* @param logger Logger object reference
*/
GeonetNetworkStateEventPacket(ManagementInformationBase& mib, vector<unsigned char> packetBuffer, Logger& logger);
/**
* Destructor of GeonetNetworkStateEventPacket class
*/
~GeonetNetworkStateEventPacket();
public:
/**
* Returns string representation of this packet
*
* @return std::string representation of this packet
*/
string toString() const;
private:
/**
* Parses incoming packet buffer and updates MIB
*
* @param packetBuffer Buffer containing packet data
* @return true on success, false otherwise
*/
bool parse(const vector<unsigned char>& packetBuffer);
private:
/**
* Management Information Base reference to keep it up-to-date with
* incoming information
*/
ManagementInformationBase& mib;
};
#endif /* MGMT_GN_PACKET_NETWORK_STATE_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_set_configuration.cpp
* \brief A container for Set Configuration Event packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_gn_packet_set_configuration.hpp"
#include <boost/lexical_cast.hpp>
#include <sstream>
using namespace std;
GeonetSetConfigurationEventPacket::GeonetSetConfigurationEventPacket(ManagementInformationBase& mib, Logger& logger, ItsKeyID itsKeyID) :
GeonetPacket(false, true, 0x00, 0x00,
((itsKeyID >= MGMT_GN_ITSKEY_SET_NET) ? MGMT_GN_EVENT_CONF_BULK_RESPONSE : MGMT_GN_EVENT_CONF_CONT_RESPONSE), logger), mib(
mib) {
isBulk = (itsKeyID >= MGMT_GN_ITSKEY_SET_NET) ? true : false;
requestedItsKey = itsKeyID;
switch (itsKeyID) {
case MGMT_GN_ITSKEY_SET_FAC:
requestedItsKeyType = ITS_KEY_TYPE_FAC;
break;
case MGMT_GN_ITSKEY_SET_NET:
requestedItsKeyType = ITS_KEY_TYPE_NET;
break;
case MGMT_GN_ITSKEY_ALL:
default:
requestedItsKeyType = ITS_KEY_TYPE_ALL;
break;
}
}
GeonetSetConfigurationEventPacket::~GeonetSetConfigurationEventPacket() {
}
bool GeonetSetConfigurationEventPacket::serialize(vector<unsigned char>& buffer) const {
// Following pointers are used to clarify the code
unsigned char* packetBody = buffer.data() + sizeof(MessageHeader);
unsigned char* packetPayload = packetBody + sizeof(u_int32_t); // `reserved' and `key count' fields are 4-byte in size
// Encode header first...
GeonetPacket::serialize(buffer);
// ...and then the packet-specific fields
if (isBulk) {
unsigned int configurationItemIndex = 0;
/*
* We may be asked all the configuration items but just those for
* FAC or NET layers
*/
u_int16_t configurationItemCount = 0;
/**
* Fetch relevant ITS key subset...
*/
map<ItsKeyID, ItsKeyValue> keyset = mib.getItsKeyManager().getSubset(requestedItsKeyType);
map<ItsKeyID, ItsKeyValue>::const_iterator iterator = keyset.begin();
logger.info(boost::lexical_cast<string>(keyset.size()) + " key(s) found for requested ITS key type");
while (iterator != keyset.end()) {
ConfigurationItem confItem = buildConfigurationItem(iterator->first);
encodeConfigurationItem(packetPayload + configurationItemIndex * sizeof(ConfigurationItem), &confItem);
++configurationItemCount;
++configurationItemIndex;
++iterator;
}
// `reserved' field
packetBody[0] = 0x00;
packetBody[1] = 0x00;
// `key count' field
packetBody[2] = ((configurationItemCount & 0xff00) >> 8);
packetBody[3] = (configurationItemCount & 0xff);
buffer.resize(sizeof(BulkConfigurationResponse) + configurationItemCount * sizeof(ConfigurationItem));
return true;
} else {
// `conf id' field
packetBody[0] = ((requestedItsKey & 0xff00) >> 8);
packetBody[1] = (requestedItsKey & 0xff);
// `length' field
packetBody[2] = ((mib.getLength(requestedItsKey) & 0xff00) >> 8);
packetBody[3] = (mib.getLength(requestedItsKey) & 0xff);
// `conf value' field
u_int32_t configurationValue = mib.getItsKeyValue(requestedItsKey).intValue;
packetBody[4] = (configurationValue >> 24) & 0xff;
packetBody[5] = (configurationValue >> 16) & 0xff;
packetBody[6] = (configurationValue >> 8) & 0xff;
packetBody[7] = (configurationValue & 0xff);
buffer.resize(sizeof(ContinuousConfigurationResponse));
return true;
}
}
bool GeonetSetConfigurationEventPacket::encodeConfigurationItem(unsigned char* buffer,
const ConfigurationItem* configurationItem) {
if (!buffer)
return false;
// Encode `configuration id' field
buffer[0] = (configurationItem->configurationId >> 8);
buffer[1] = configurationItem->configurationId & 0xff;
// Encode `length' field
buffer[2] = (configurationItem->length >> 8);
buffer[3] = configurationItem->length & 0xff;
// Encode `configuration value' field
buffer[4] = (configurationItem->configurationValue >> 24) & 0xff;
buffer[5] = (configurationItem->configurationValue >> 16) & 0xff;
buffer[6] = (configurationItem->configurationValue >> 8) & 0xff;
buffer[7] = configurationItem->configurationValue & 0xff;
return true;
}
ConfigurationItem GeonetSetConfigurationEventPacket::buildConfigurationItem(ItsKeyID itsKey) const {
ConfigurationItem confItem;
confItem.configurationId = itsKey;
/**
* Convert byte length into DWORD length
*/
confItem.length = mib.getLength(itsKey) / 4;
confItem.configurationValue = mib.getItsKeyValue(itsKey).intValue;
return confItem;
}
string GeonetSetConfigurationEventPacket::toString() const {
stringstream ss;
if (isBulk) {
ss << "Key count: " << ((isBulk) ? mib.getItsKeyManager().getNumberOfKeys(requestedItsKeyType) : 1) << endl;
} else {
ss << "Configuration ID: " << requestedItsKey << endl << "Length (in bytes): " << mib.getLength(requestedItsKey) << endl
<< "Value: " << mib.getItsKeyValue(requestedItsKey).intValue << endl;
}
return ss.str();
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_set_configuration.hpp
* \brief A container for Set Configuration Event packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_GN_PACKET_SET_CONFIGURATION_HPP_
#define MGMT_GN_PACKET_SET_CONFIGURATION_HPP_
#include "../util/mgmt_log.hpp"
#include "mgmt_gn_packet.hpp"
/**
* A container for Set Configuration Event packet
*/
class GeonetSetConfigurationEventPacket: public GeonetPacket {
public:
/**
* Constructor for GeonetSetConfigurationEventPacket class
*
* @param mib Management Information Base reference to fetch necessary
* configuration information
* @param logger Logger object reference
* @param itsKeyId Requested ITS key or key set
*/
GeonetSetConfigurationEventPacket(ManagementInformationBase& mib, Logger& logger, ItsKeyID itsKeyID = MGMT_GN_ITSKEY_ALL);
/**
* Destructor of GeonetSetConfigurationEventPacket class
*/
virtual ~GeonetSetConfigurationEventPacket();
public:
/**
* Serialises the packet into given buffer
*
* @param Vector to be used to serialise the packet into
* @return true on success, false otherwise
*/
bool serialize(vector<unsigned char>& buffer) const;
/**
* Returns string (of type std::string) representation of packet
*
* @return String representation of packet
*/
string toString() const;
private:
/**
* Serialises given configuration item into given buffer
*
* @param buffer Unsigned char array of buffer to serialise configuration into
* @param configurationItem Configuration item that'll be serialised into given buffer
* @return true on success, false otherwise
*/
static bool encodeConfigurationItem(unsigned char* buffer, const ConfigurationItem* configurationItem);
/**
* Creates a ConfigurationItem by fetching necessary information from
* Management Information Base
*/
ConfigurationItem buildConfigurationItem(ItsKeyID itsKey) const;
private:
/**
* Boolean for request type: true for bulk request, false for a request
* for a single ITS key
*/
bool isBulk;
/**
* Requested ITS key
*/
ItsKeyID requestedItsKey;
/**
* Requested ITS key type
*/
ItsKeyType requestedItsKeyType;
/**
* Management Information Base reference
*/
ManagementInformationBase& mib;
};
#endif /* MGMT_GN_PACKET_SET_CONFIGURATION_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_wireless_state_request.cpp
* \brief A container for Wireless State Event Request packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_gn_packet_wireless_state_request.hpp"
#include <sstream>
GeonetWirelessStateRequestEventPacket::GeonetWirelessStateRequestEventPacket(Logger& logger)
: GeonetPacket(false, true, 0x00, 0x00, MGMT_GN_EVENT_STATE_WIRELESS_STATE_REQUEST, logger) {
}
GeonetWirelessStateRequestEventPacket::~GeonetWirelessStateRequestEventPacket() {}
bool GeonetWirelessStateRequestEventPacket::serialize(vector<unsigned char>& buffer) const {
/**
* Validate buffer size
*/
if (buffer.size() < sizeof(MessageHeader)) {
logger.warning("Incoming buffer size is smaller than a mere header size!");
return false;
}
/**
* This packet is an only-header packet so serialize only a header
*/
if (!GeonetPacket::serialize(buffer)) {
logger.error("Cannot serialise packet header into a Wireless State Request!");
return false;
}
/**
* Shrink the buffer to the size of data we've written into it
*/
buffer.resize(sizeof(MessageHeader));
return true;
}
string GeonetWirelessStateRequestEventPacket::toString() const {
/* This packet is an only-header packet */
return GeonetPacket::toString();
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_wireless_state_request.hpp
* \brief A container for Wireless State Event Request packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_GN_PACKET_WIRELESS_STATE_REQUEST_HPP_
#define MGMT_GN_PACKET_WIRELESS_STATE_REQUEST_HPP_
#include "mgmt_gn_packet.hpp"
/**
* A container for Wireless State Event Request packet
*/
class GeonetWirelessStateRequestEventPacket : public GeonetPacket {
public:
/**
* Constructor for GeonetWirelessStateRequestEventPacket class
*
* @param logger Logger object reference
*/
GeonetWirelessStateRequestEventPacket(Logger& logger);
/**
* Destructor for GeonetWirelessStateRequestEventPacket class
*/
virtual ~GeonetWirelessStateRequestEventPacket();
public:
/**
* Serialises packet information into incoming buffer
*
* @param buffer std::vector that packet information will be serialised into
* @return true on success, false otherwise
*/
bool serialize(vector<unsigned char>& buffer) const;
/**
* Returns string representation of this packet
*
* @return std::string representation of this packet
*/
string toString() const;
};
#endif /* MGMT_GN_PACKET_WIRELESS_STATE_REQUEST_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_wireless_state.cpp
* \brief A container for Wireless State Event Response packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_gn_packet_wireless_state_response.hpp"
#include <boost/lexical_cast.hpp>
#include "../util/mgmt_util.hpp"
#include <sstream>
GeonetWirelessStateResponseEventPacket::GeonetWirelessStateResponseEventPacket(ManagementInformationBase& mib, const vector<unsigned char>& packetBuffer, Logger& logger)
: GeonetPacket(packetBuffer, logger), mib(mib) {
if (this->parse(packetBuffer)) {
logger.info("MIB is updated with incoming wireless state information");
}
}
GeonetWirelessStateResponseEventPacket::~GeonetWirelessStateResponseEventPacket() {
}
string GeonetWirelessStateResponseEventPacket::toString() const {
stringstream ss;
return ss.str();
}
bool GeonetWirelessStateResponseEventPacket::parse(const vector<unsigned char>& packetBuffer) {
/**
* Validate incoming buffer
*/
if (packetBuffer.size() < sizeof(WirelessStateResponseMessage))
return false;
/**
* Parse interface count first
*/
u_int8_t interfaceCount = packetBuffer.data()[sizeof(MessageHeader)];
logger.info("Number of interfaces is " + boost::lexical_cast<string>((int)interfaceCount));
/**
* Then traverse the buffer to get the state for every interface...
*/
u_int16_t itemIndex = sizeof(WirelessStateResponseMessage);
for (; interfaceCount != 0; interfaceCount--) {
GnWirelessStateResponseItem* item = new GnWirelessStateResponseItem();
Util::parse2byteInteger(packetBuffer.data() + itemIndex, &item->interfaceId); itemIndex += sizeof(InterfaceID);
Util::parse2byteInteger(packetBuffer.data() + itemIndex, &item->accessTechnology); itemIndex += 2;
Util::parse2byteInteger(packetBuffer.data() + itemIndex, &item->channelFrequency); itemIndex += 2;
Util::parse2byteInteger(packetBuffer.data() + itemIndex, &item->bandwidth); itemIndex += 2;
item->channelBusyRatio = static_cast<u_int8_t>(packetBuffer.data()[itemIndex]); ++itemIndex;
item->status = static_cast<u_int8_t>(packetBuffer.data()[itemIndex]); ++itemIndex;
item->averageTxPower = static_cast<u_int8_t>(packetBuffer.data()[itemIndex]); ++itemIndex;
item->reserved = static_cast<u_int8_t>(packetBuffer.data()[itemIndex]); ++itemIndex;
// Update MIB with this record
mib.updateWirelessState(item->interfaceId, item);
logger.info("Management Information Base has been updated with following wireless state entry: ");
logger.info(item->toString());
// itemIndex shows the next record now, if there's any
}
return true;
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_wireless_state.hpp
* \brief A container for Wireless State Event Response packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_GN_PACKET_WIRELESS_STATE_RESPONSE_HPP_
#define MGMT_GN_PACKET_WIRELESS_STATE_RESPONSE_HPP_
#include "../mgmt_information_base.hpp"
#include "../util/mgmt_log.hpp"
#include "mgmt_gn_packet.hpp"
/**
* A container for Wireless State Event Response packet
*/
class GeonetWirelessStateResponseEventPacket : public GeonetPacket {
public:
/**
* Constructor for GeonetWirelessStateResponseEventPacket class
*
* @param mib Management Information Base reference to update it
* with incoming information
* @param packetBuffer Packet data as a vector
* @param logger Logger object reference
*/
GeonetWirelessStateResponseEventPacket(ManagementInformationBase& mib, const vector<unsigned char>& packetBuffer, Logger& logger);
/**
* Destructor for GeonetWirelessStateEventPacket class
*/
~GeonetWirelessStateResponseEventPacket();
public:
/**
* Returns string representation of this packet
*
* @return std::string representation of this packet
*/
string toString() const;
private:
/**
* Parses given buffer and updates Geonet::header and Management Information Base
*
* @param packetBuffer std::vector keeping packet data
* @return true on success, false otherwise
*/
bool parse(const vector<unsigned char>& packetBuffer);
private:
/**
* Management Information Base reference to keep it up-to-date with
* incoming information
*/
ManagementInformationBase& mib;
};
#endif /* MGMT_GN_PACKET_WIRELESS_STATE_RESPONSE_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_lte_packet_wireless_state_request.cpp
* \brief A container for Wireless State Event Request packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_lte_packet_wireless_state_request.hpp"
#include <sstream>
LteWirelessStateRequestEventPacket::LteWirelessStateRequestEventPacket(Logger& logger)
: GeonetPacket(false, true, 0x00, 0x00, MGMT_GN_EVENT_STATE_WIRELESS_STATE_REQUEST, logger) {
}
LteWirelessStateRequestEventPacket::~LteWirelessStateRequestEventPacket() {}
bool LteWirelessStateRequestEventPacket::serialize(vector<unsigned char>& buffer) const {
/**
* Validate buffer size
*/
if (buffer.size() < sizeof(MessageHeader)) {
logger.warning("Incoming buffer size is smaller than a mere header size!");
return false;
}
/**
* This packet is an only-header packet so serialize only a header
*/
if (!GeonetPacket::serialize(buffer)) {
logger.error("Cannot serialise packet header into a Wireless State Request!");
return false;
}
/**
* Shrink the buffer to the size of data we've written into it
*/
buffer.resize(sizeof(MessageHeader));
return true;
}
string LteWirelessStateRequestEventPacket::toString() const {
/* This packet is an only-header packet */
return GeonetPacket::toString();
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_lte_packet_wireless_state_request.hpp
* \brief A container for Wireless State Event Request packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_LTE_PACKET_WIRELESS_STATE_REQUEST_HPP_
#define MGMT_LTE_PACKET_WIRELESS_STATE_REQUEST_HPP_
#include "mgmt_gn_packet.hpp"
/**
* A container for Wireless State Event Request packet
*/
class LteWirelessStateRequestEventPacket : public GeonetPacket {
public:
/**
* Constructor for LteWirelessStateRequestEventPacket class
*
* @param logger Logger object reference
*/
LteWirelessStateRequestEventPacket(Logger& logger);
/**
* Destructor for LteWirelessStateRequestEventPacket class
*/
virtual ~LteWirelessStateRequestEventPacket();
public:
/**
* Serialises packet information into incoming buffer
*
* @param buffer std::vector that packet information will be serialised into
* @return true on success, false otherwise
*/
bool serialize(vector<unsigned char>& buffer) const;
/**
* Returns string representation of this packet
*
* @return std::string representation of this packet
*/
string toString() const;
};
#endif /* MGMT_GN_PACKET_WIRELESS_STATE_REQUEST_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_wireless_state.cpp
* \brief A container for Wireless State Event Response packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_lte_packet_wireless_state_response.hpp"
#include <boost/lexical_cast.hpp>
#include "../util/mgmt_util.hpp"
#include <sstream>
LteWirelessStateResponseEventPacket::LteWirelessStateResponseEventPacket(ManagementInformationBase& mib, const vector<unsigned char>& packetBuffer, Logger& logger)
: GeonetPacket(packetBuffer, logger), mib(mib) {
if (this->parse(packetBuffer)) {
logger.info("MIB is updated with incoming wireless state information");
}
}
LteWirelessStateResponseEventPacket::~LteWirelessStateResponseEventPacket() {
}
string LteWirelessStateResponseEventPacket::toString() const {
stringstream ss;
return ss.str();
}
bool LteWirelessStateResponseEventPacket::parse(const vector<unsigned char>& packetBuffer) {
/**
* Validate the size of incoming buffer
*/
if (packetBuffer.size() < LTE_WIRELESS_STATE_RESPONSE_SIZE) {
logger.warning("Incoming buffer is not large enough to contain an LTE Wireless State Response!");
return false;
}
LteWirelessStateResponse* response = new LteWirelessStateResponse();
/**
* Set the index right after the header
*/
u_int16_t responseIndex = sizeof(MessageHeader);
Util::parse2byteInteger(packetBuffer.data() + responseIndex, &response->interfaceId); responseIndex += 2;
Util::parse2byteInteger(packetBuffer.data() + responseIndex, &response->reservedFirst16bit); responseIndex += 2;
Util::parse2byteInteger(packetBuffer.data() + responseIndex, &response->referenceSignalReceivedPower); responseIndex += 2;
Util::parse2byteInteger(packetBuffer.data() + responseIndex, &response->referenceSignalReceivedQuality); responseIndex += 2;
response->channelQualityIndication = static_cast<u_int8_t>(packetBuffer.data()[responseIndex]); ++responseIndex;
response->status = static_cast<u_int8_t>(packetBuffer.data()[responseIndex]); ++responseIndex;
Util::parse2byteInteger(packetBuffer.data() + responseIndex, &response->reservedSecond16bit); responseIndex += 2;
Util::parse4byteInteger(packetBuffer.data() + responseIndex, &response->packetLossRate); responseIndex += 4;
// Update MIB with this record
mib.updateWirelessState(response->interfaceId, response);
logger.info("Management Information Base has been updated with following wireless state entry: ");
logger.info(response->toString());
return true;
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_gn_packet_wireless_state.hpp
* \brief A container for Wireless State Event Response packet
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_LTE_PACKET_WIRELESS_STATE_RESPONSE_HPP_
#define MGMT_LTE_PACKET_WIRELESS_STATE_RESPONSE_HPP_
#include "../mgmt_information_base.hpp"
#include "../util/mgmt_log.hpp"
#include "mgmt_gn_packet.hpp"
/**
* A container for Wireless State Event Response packet
*/
class LteWirelessStateResponseEventPacket : public GeonetPacket {
public:
/**
* Constructor for LteWirelessStateResponseEventPacket class
*
* @param mib Management Information Base reference to update it
* with incoming information
* @param packetBuffer Packet data as a vector
* @param logger Logger object reference
*/
LteWirelessStateResponseEventPacket(ManagementInformationBase& mib, const vector<unsigned char>& packetBuffer, Logger& logger);
/**
* Destructor for GeonetWirelessStateEventPacket class
*/
~LteWirelessStateResponseEventPacket();
public:
/**
* Returns string representation of this packet
*
* @return std::string representation of this packet
*/
string toString() const;
private:
/**
* Parses given buffer and updates Geonet::header and Management Information Base
*
* @param packetBuffer std::vector keeping packet data
* @return true on success, false otherwise
*/
bool parse(const vector<unsigned char>& packetBuffer);
private:
/**
* Management Information Base reference to keep it up-to-date with
* incoming information
*/
ManagementInformationBase& mib;
};
#endif /* MGMT_LTE_PACKET_WIRELESS_STATE_RESPONSE_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_exception.cpp
* \brief A basic exception class for error handling
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include "mgmt_exception.hpp"
Exception::Exception(const string& message, Logger& logger)
: logger(logger) {
updateStackTrace("~ ~ ~ ~ Stack Trace Information ~ ~ ~ ~");
updateStackTrace(message);
}
Exception::~Exception() throw() {
stackTrace.clear();
}
void Exception::printStackTrace() {
vector<string>::iterator it = stackTrace.begin();
while (it != stackTrace.end()) {
logger.error(" -> " + *it);
++it;
}
}
void Exception::updateStackTrace(const string& message) {
stackTrace.push_back(message);
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_exception.hpp
* \brief A basic exception class for error handling
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_EXCEPTION_HPP_
#define MGMT_EXCEPTION_HPP_
#include "mgmt_log.hpp"
#include <exception>
#include <string>
#include <vector>
using namespace std;
/**
* A basic exception class for error handling
*/
class Exception : public std::exception {
public:
/**
* Constructor for Exception class
*
* @param message Error/warning message
* @param logger Logger object reference
*/
Exception(const string& message, Logger& logger);
/**
* Destructor for Exception class
*/
~Exception() throw();
public:
/**
* Prints messages from every point the trace has been updated
*/
void printStackTrace();
/**
* Adds given message to stack trace to be printed later by printStackTrace()
*
* @param message A message that stack trace will be updated with
*/
void updateStackTrace(const string& message);
private:
/**
* String vector where stack trace messages are hold
*/
vector<string> stackTrace;
/**
* Logger object reference
*/
Logger& logger;
};
#endif /* MGMT_EXCEPTION_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_log.hpp
* \brief A container for a basic logging utility
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include <boost/date_time.hpp>
#include "mgmt_util.hpp"
#include "mgmt_log.hpp"
#include <iostream>
using namespace std;
Logger::Logger(const string& logFileName, Logger::LOG_LEVEL logLevel, Logger::LOG_OUTPUT_CHANNEL logOutputChannel) {
this->logFileName = logFileName;
this->logLevel = logLevel;
this->logOutputChannel = logOutputChannel;
/**
* New name for the log file
*/
string newLogFilePath = "";
/**
* Define string representations of log levels
*/
logLevelString.insert(logLevelString.end(), std::make_pair(TRACE, "TRACE"));
logLevelString.insert(logLevelString.end(), std::make_pair(DEBUG, "DEBUG"));
logLevelString.insert(logLevelString.end(), std::make_pair(INFO, "INFO"));
logLevelString.insert(logLevelString.end(), std::make_pair(WARNING, "WARNING"));
logLevelString.insert(logLevelString.end(), std::make_pair(ERROR, "ERROR"));
/**
* Open log file stream, if the file already exists then rename
* it appending the date and create a new one
*/
if (logOutputChannel == Logger::FILE || logOutputChannel == Logger::BOTH) {
/**
* If we have renamed log file because it exists
*/
bool renamed = false;
logFilePath = boost::filesystem::path(logFileName);
if (boost::filesystem::exists(logFilePath)) {
/**
* Get the current date/time as string and prepend log file name with it
*/
newLogFilePath = logFilePath.string() + Util::getDateAndTime(false);
boost::filesystem::rename(logFilePath, newLogFilePath);
renamed = true;
}
/**
* Open log file stream
*/
logFileStream.open(logFileName.c_str(), ios_base::out);
if (!logFileStream.is_open()){
cerr << "Cannot open log file!" << endl;
}
if (renamed)
this->info("A log file with the same name exists, created one with name '" + newLogFilePath + "'");
}
}
Logger::~Logger() {
logFileStream.flush();
logFileStream.close();
}
void Logger::trace(const string& message, bool logFormatting) {
log(message, TRACE, logFormatting);
}
void Logger::debug(const string& message, bool logFormatting) {
log(message, DEBUG, logFormatting);
}
void Logger::info(const string& message, bool logFormatting) {
log(message, INFO, logFormatting);
}
void Logger::warning(const string& message, bool logFormatting) {
log(message, WARNING, logFormatting);
}
void Logger::error(const string& message, bool logFormatting) {
log(message, ERROR, logFormatting);
}
void Logger::log(const string& message, LOG_LEVEL level, bool logFormatting) {
/**
* Quit if we are asked not to log at all
*/
if (logOutputChannel == Logger::NONE)
return;
/**
* Quit if requested logging level is not allowed in the configuration
*/
if (logLevel > level)
return;
/**
* Ensure that there is only one here at any given time
*/
boost::lock_guard<boost::mutex> lock(logMutex);
/**
* Write to log file first if we are asked to do
*/
if (logOutputChannel == Logger::FILE || logOutputChannel == Logger::BOTH) {
if (logFormatting)
logFileStream << setw(15) << Util::getDateAndTime(true) << setw(7) << logLevelString[level] << ": ";
logFileStream << message;
if (logFormatting)
logFileStream << endl;
}
/**
* And then to standard output
*/
if (logOutputChannel == Logger::STDOUT || logOutputChannel == Logger::BOTH) {
if (logFormatting)
cout << setw(15) << Util::getDateAndTime(true) << setw(7) << logLevelString[level] << ": ";
cout << message;
if (logFormatting)
cout << endl;
}
}
void Logger::setLogLevel(Logger::LOG_LEVEL logLevel) {
this->logLevel = logLevel;
}
string Logger::getCurrentLogLevelName() {
return logLevelString[logLevel];
}
void Logger::setLogOutputChannel(Logger::LOG_OUTPUT_CHANNEL logOutputChannel) {
this->logOutputChannel = logOutputChannel;
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_log.hpp
* \brief A container for a basic logging utility
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_LOG_HPP_
#define MGMT_LOG_HPP_
#include <boost/thread/mutex.hpp>
#include <boost/filesystem.hpp>
#include <fstream>
#include <string>
#include <map>
using namespace std;
/**
* A container for a basic logging utility
*/
class Logger {
public:
enum LOG_LEVEL {
TRACE = 0,
DEBUG = 1,
INFO = 2,
WARNING = 3,
ERROR = 4
};
enum LOG_OUTPUT_CHANNEL {
FILE = 0,
STDOUT = 1,
BOTH = 2,
NONE = 3
};
public:
/**
* Constructor for Logger class
*
* @param logFileName Log file name
* @param logLevel Initial log level (default is INFO)
*/
Logger(const string& logFileName, Logger::LOG_LEVEL logLevel = Logger::INFO, Logger::LOG_OUTPUT_CHANNEL = Logger::BOTH);
/**
* Destructor for Logger class
*/
~Logger();
public:
/**
* Prints given log message at TRACE level
* This is used for finer-grained log messages than DEBUG
*
* @param message Log message
* @param logFormatting Determines if date, log level, etc. will be printed as well
*/
void trace(const string& message, bool logFormatting = true);
/**
* Prints given log message at DEBUG level
*
* @param message Log message
* @param logFormatting Determines if date, log level, etc. will be printed as well
*/
void debug(const string& message, bool logFormatting = true);
/**
* Prints given log message at INFO level
*
* @param message Log message
* @param logFormatting Determines if date, log level, etc. will be printed as well
*/
void info(const string& message, bool logFormatting = true);
/**
* Prints given log message at WARNING level
*
* @param message Log message
* @param logFormatting Determines if date, log level, etc. will be printed as well
*/
void warning(const string& message, bool logFormatting = true);
/**
* Prints given log message at ERROR level
*
* @param message Log message
* @param logFormatting Determines if date, log level, etc. will be printed as well
*/
void error(const string& message, bool logFormatting = true);
/**
* Prints given log message at given level
*
* @param message Log message
* @param level Log level
* @param logFormatting Determines if date, log level, etc. will be printed as well
* @param newline Determines if a '\n' character will be appended to log messages
*/
void log(const string& message, Logger::LOG_LEVEL level, bool logFormatting = true);
/**
* Updates configured log level with incoming information
*
* @param logLevel New log level of type Logger::LOG_LEVEL
*/
void setLogLevel(Logger::LOG_LEVEL logLevel);
/**
* Returns the string name of current log level integer
*/
string getCurrentLogLevelName();
/**
* Updates configured log output channel with given value
*
* @param logOutputChannel New log output channel of type Logger::LOG_OUTPUT_CHANNEL
*/
void setLogOutputChannel(Logger::LOG_OUTPUT_CHANNEL logOutputChannel);
private:
/**
* Log file name
*/
string logFileName;
/**
* Log file path of type boost::filesystem::path
*/
boost::filesystem::path logFilePath;
/**
* Mutex to ensure that log() is called by only one at any given time
*/
boost::mutex logMutex;
/**
* Log file stream of type ofstream
*/
ofstream logFileStream;
/**
* Configured log level
*/
Logger::LOG_LEVEL logLevel;
/**
* Configured log output channel
*/
Logger::LOG_OUTPUT_CHANNEL logOutputChannel;
/**
* Log level string map
*/
map<LOG_LEVEL, string> logLevelString;
};
#endif /* MGMT_LOG_HPP_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file mgmt_udp_server.cpp
* \brief A wrapper container to maintain UDP socket connection
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include <boost/lexical_cast.hpp>
#include "mgmt_udp_socket.hpp"
#include "mgmt_exception.hpp"
#include "mgmt_util.hpp"
#include <iostream>
using namespace std;
UdpSocket::UdpSocket(u_int16_t portNumber, Logger& logger)
: socketType(UdpSocket::SERVER_SOCKET), logger(logger) {
logger.debug("Server socket is being created at port " + boost::lexical_cast<string>(portNumber));
try {
socket = new udp::socket(ioService, udp::endpoint(udp::v4(), portNumber));
socket->set_option(boost::asio::socket_base::reuse_address(true));
} catch (std::exception& e) {
throw Exception(e.what(), logger);
}
logger.info("A UDP socket created for port " + boost::lexical_cast<string>(portNumber));
}
UdpSocket::UdpSocket(const string& address, u_int16_t portNumber, Logger& logger)
: socketType(UdpSocket::CLIENT_SOCKET), logger(logger) {
logger.debug("Client socket is being created to " + address + ":" + boost::lexical_cast<string>(portNumber));
/**
* Convert incoming string address
*/
boost::asio::ip::address_v4 recipientAddress = boost::asio::ip::address_v4::from_string(address);
recipient.address(recipientAddress);
recipient.port(portNumber);
/**
* Create a socket
*/
logger.debug("Creating a socket to " + recipient.address().to_string() + ":" + boost::lexical_cast<string>(recipient.port()));
try {
socket = new udp::socket(ioService, recipient);
socket->set_option(boost::asio::socket_base::reuse_address(true));
} catch (std::exception& e) {
logger.error(e.what());
throw Exception(e.what(), logger);
}
}
UdpSocket::UdpSocket(const UdpSocket& UdpSocket)
: logger(UdpSocket.logger) {
throw Exception("Copy constructor is called for an UdpSocket object!", logger);
}
UdpSocket::~UdpSocket() {
delete socket;
}
unsigned UdpSocket::receive(vector<unsigned char>& rxBuffer) {
boost::system::error_code error;
unsigned bytesRead = 0;
/**
* Ensure there's only one I/O method of UdpSocket running at any given moment
*/
boost::lock_guard<boost::mutex> lock(readMutex);
/**
* Always reset receive buffer size since it's resized after every read
* according to the packet size (and it becomes packet buffer)
*/
rxBuffer.resize(UdpSocket::RX_BUFFER_SIZE);
try {
logger.info("Reading from socket...");
bytesRead = socket->receive_from(boost::asio::buffer(rxBuffer), recipient, 0, error);
} catch (std::exception& e) {
logger.error(e.what());
return 0;
}
if (error && error != boost::asio::error::message_size)
throw boost::system::system_error(error);
rxBuffer.resize(bytesRead);
logger.info(boost::lexical_cast<string>(bytesRead) + " byte(s) received from " + recipient.address().to_string() + ":" + boost::lexical_cast<string>(recipient.port()));
Util::printHexRepresentation(rxBuffer.data(), rxBuffer.size(), logger);
return bytesRead;
}
bool UdpSocket::send(vector<unsigned char>& txBuffer) {
boost::system::error_code error;
/**
* Ensure there's only one I/O method of UdpSocket running at any given moment
*/
boost::lock_guard<boost::mutex> lock(writeMutex);
try {
logger.info("Writing...");
socket->send_to(boost::asio::buffer(txBuffer), recipient, 0, error);
logger.info(boost::lexical_cast<string>(txBuffer.size()) + " byte(s) sent");
Util::printHexRepresentation(txBuffer.data(), txBuffer.size(), logger);
} catch (std::exception& e) {
logger.error(e.what());
return false;
}
return true;
}
bool UdpSocket::send(const GeonetPacket& packet) {
vector<unsigned char> txBuffer(TX_BUFFER_SIZE);
/**
* There's already a check for mutex in the overloaded function so
* we don't do it here
*/
if (packet.serialize(txBuffer))
return send(txBuffer);
return false;
}
const udp::endpoint& UdpSocket::getRecipient() const {
return this->recipient;
}
string UdpSocket::toString() const {
stringstream ss;
ss << "[address: " << recipient.address() << ", port:" << recipient.port() << "]";
return ss.str();
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file mgmt_udp_socket.hpp
* \brief A wrapper container to maintain UDP socket connection
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_UDP_SOCKET_H_
#define MGMT_UDP_SOCKET_H_
#include <vector>
using namespace std;
#include <boost/thread.hpp>
#include <boost/array.hpp>
#include <boost/asio.hpp>
using boost::asio::ip::udp;
#include "../packets/mgmt_gn_packet.hpp"
#include "../util/mgmt_log.hpp"
/**
* A wrapper container to maintain UDP socket connection
*/
class UdpSocket {
public:
/**
* Socket type enumeration
*/
enum SOCKET_TYPE {
CLIENT_SOCKET = 0,
SERVER_SOCKET = 1
};
/**
* Receive buffer size in bytes
*/
static const u_int16_t RX_BUFFER_SIZE = 1024;
/**
* Transmit buffer size in bytes
*/
static const u_int16_t TX_BUFFER_SIZE = 1024;
public:
/**
* Constructor for UdpSocket class used as a server socket
*
* @param portNumber UDP port number that will be listened/connected to
* @param logger Logger object reference for logging purposes
*/
UdpSocket(u_int16_t portNumber, Logger& logger);
/**
* Constructor for UdpSocket class used as a client socket
*
* @param address IP address
* @param portNumber UDP port number that will be listened/connected to
* @param logger Logger object reference for logging purposes
*/
UdpSocket(const string& address, u_int16_t portNumber, Logger& logger);
/**
* Destructor for UdpSocket class
*/
~UdpSocket();
private:
/**
* Copy constructor to prevent the usage of default copy constructor
*/
UdpSocket(const UdpSocket& udpSocket);
public:
/**
* Reads available data from socket into given buffer
*
* @param rxBuffer RX buffer that read data will be put into
* @return Number of bytes read
*/
unsigned receive(vector<unsigned char>& rxBuffer);
/**
* Writes given data through socket
*
* @param txBuffer TX buffer that will be sent
* @return true on success, false otherwise
*/
bool send(vector<unsigned char>& txBuffer);
/**
* Serialises given Geonet packet and writes onto socket
*
* @param packet GeonetPacket reference that will be serialised
* and sent through socket
* @return true on success, false otherwise
*/
bool send(const GeonetPacket& packet);
/**
* Returns the reference of udp::endpoint
*
* @return The reference of udp::endpoint
*/
const udp::endpoint& getRecipient() const;
/**
* Returns string representation of this connection
*
* @return String representation of this class of type std::string
*/
string toString() const;
private:
/**
* Socket type, client or server
*/
UdpSocket::SOCKET_TYPE socketType;
/**
* The io_service object that the datagram socket will use to dispatch
* handlers for any asynchronous operations performed on the socket
*/
boost::asio::io_service ioService;
/**
* Mutexes to coordinate I/O on UDP server socket
*/
boost::mutex readMutex;
boost::mutex writeMutex;
/**
* udp::socket of Boost library
*/
udp::socket* socket;
/**
* UDP recipient
*/
boost::asio::ip::udp::endpoint recipient;
/**
* Logger object reference for logging purposes
*/
Logger& logger;
};
#endif /* MGMT_UDP_SOCKET_H_ */
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2012 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope 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.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fr/openairinterface
Address : EURECOM, Campus SophiaTech, 450 Route des Chappes, 06410 Biot FRANCE
*******************************************************************************/
/*!
* \file util.cpp
* \brief A container for utility methods for bit/byte processing and formatted printing
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#include <boost/date_time/posix_time/posix_time_io.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/locale/boundary/facets.hpp>
#include <boost/filesystem.hpp>
#include <boost/date_time.hpp>
using namespace boost::posix_time;
using namespace boost::filesystem;
#include "mgmt_util.hpp"
#include <iostream>
#include <sstream>
using namespace std;
void Util::resetBuffer(unsigned char* buffer, const size_t bufferSize) {
memset(buffer, 0x00, bufferSize);
}
bool Util::copyBuffer(unsigned char* destinationBuffer, const unsigned char* sourceBuffer, size_t copySize) {
if (!destinationBuffer || !sourceBuffer)
return false;
memcpy(destinationBuffer, sourceBuffer, copySize);
return true;
}
bool Util::printHexRepresentation(const unsigned char* buffer, unsigned long bufferSize, Logger& logger) {
if (!buffer) {
logger.warning("Incoming buffer is empty, won't write any hex data");
return false;
}
stringstream ss;
unsigned long octet_index = 0;
logger.debug("");
logger.debug(" | 0 1 2 3 4 5 6 7 8 9 a b c d e f |");
logger.debug("-----+-------------------------------------------------|");
ss << " 000 |";
for (octet_index = 0; octet_index < bufferSize; ++octet_index) {
/*
* Print every single octet in hexadecimal form
*/
ss << " " << setfill('0') << setw(2) << hex << (int) buffer[octet_index];
/*
* Align newline and pipes according to the octets in groups of 2
*/
if (octet_index != 0 && (octet_index + 1) % 16 == 0) {
ss << " |";
/**
* Print this line and reset std::stringstream afterwards
*/
logger.debug(ss.str());
ss.str(string());
ss.clear();
ss << " " << setfill('0') << setw(3) << octet_index + 1 << " |";
}
}
/*
* Append enough spaces and put final pipe
*/
unsigned char index;
for (index = octet_index; index < 16; ++index)
ss << " ";
ss << " |";
ss << resetiosflags(ios_base::hex);
logger.debug(ss.str());
return true;
}
void Util::printBinaryRepresentation(unsigned char* message, u_int8_t octet, Logger& logger) {
stringstream ss;
ss << message << getBinaryRepresentation(octet) << endl;
logger.debug(ss.str());
}
string Util::getBinaryRepresentation(u_int8_t octet) {
u_int8_t index = 0;
u_int8_t mask = 0x80;
stringstream ss;
for (index = 0; index < 8; ++index) {
if (octet & mask)
ss << "1";
else
ss << "0";
mask /= 2;
}
return ss.str();
}
template <class T>
string Util::stringify(T numerical) {
stringstream ss;
ss << numerical;
return ss.str();
}
bool Util::setBit(u_int8_t& octet, u_int8_t index) {
u_int8_t mask = 0x80;
/**
* Set relevant bit
*/
octet |= (mask >>= index);
return true;
}
bool Util::unsetBit(u_int8_t& octet, u_int8_t index) {
u_int8_t mask = 0x80;
/**
* Unset relevant bit
*/
octet &= ~(mask >>= index);
return true;
}
bool Util::isBitSet(u_int8_t octet, u_int8_t index) {
u_int8_t mask = 0x80;
/*
* Check relevant bit
*/
return octet &= (mask >>= index);
}
bool Util::parse8byteInteger(const unsigned char* buffer, u_int64_t* integer) {
if (!buffer || !integer)
return false;
*integer = 0x00;
*integer |= buffer[0] & 0xff; *integer <<= 8;
*integer |= buffer[1] & 0xff; *integer <<= 8;
*integer |= buffer[2] & 0xff; *integer <<= 8;
*integer |= buffer[3] & 0xff; *integer <<= 8;
*integer |= buffer[4] & 0xff; *integer <<= 8;
*integer |= buffer[5] & 0xff; *integer <<= 8;
*integer |= buffer[6] & 0xff; *integer <<= 8;
*integer |= buffer[7] & 0xff;
return true;
}
bool Util::parse4byteInteger(const unsigned char* buffer, u_int32_t* integer) {
if (!buffer || !integer)
return false;
*integer = (buffer[0] << 24);
*integer |= (buffer[1] << 16);
*integer |= (buffer[2] << 8);
*integer |= buffer[3] & 0xff;
return true;
}
bool Util::parse2byteInteger(const unsigned char* buffer, u_int16_t* integer) {
if (!buffer || !integer)
return false;
*integer = (buffer[0] << 8);
*integer |= (buffer[1] & 0xff);
return true;
}
float Util::parse4byteFloat(const vector<unsigned char>& floatBuffer) {
return *((float*)floatBuffer.data());
}
bool Util::encode8byteInteger(vector<unsigned char>& buffer, u_int16_t bufferIndex, u_int64_t data) {
if (buffer.capacity() < bufferIndex + sizeof(data))
return false;
u_int32_t dataHigherPart = ((data >> 32) & 0xffffffff);
u_int32_t dataLowerPart = (data & 0xffffffff);
return encode4byteInteger(buffer, bufferIndex, dataHigherPart) && \
encode4byteInteger(buffer, bufferIndex + sizeof(u_int32_t), dataLowerPart);
}
bool Util::encode4byteInteger(vector<unsigned char>& buffer, u_int16_t bufferIndex, u_int32_t data) {
if (buffer.capacity() < bufferIndex + sizeof(data))
return false;
buffer[bufferIndex] = ((data >> 24) & 0xff);
buffer[bufferIndex + 1] = ((data >> 16) & 0xff);
buffer[bufferIndex + 2] = ((data >> 8) & 0xff);
buffer[bufferIndex + 3] = (data & 0xff);
return true;
}
bool Util::encode2byteInteger(vector<unsigned char>& buffer, u_int16_t bufferIndex, u_int16_t data) {
if (buffer.capacity() < bufferIndex + sizeof(data))
return false;
buffer[bufferIndex] = ((data >> 8) & 0xff);
buffer[bufferIndex + 1] = (data & 0xff);
return true;
}
bool Util::encodeBits(u_int8_t& octet, u_int8_t index, u_int8_t data, u_int8_t dataSize) {
/**
* Do boundary check
*/
if (index + dataSize > 8)
return false;
/**
* Set/unset bits one by one using setBit() and unsetBit()
*/
u_int8_t sourceIndex = 7 - dataSize, destinationIndex = index;
while (sourceIndex++ != 8) {
if (Util::isBitSet(data, sourceIndex)) {
setBit(octet, destinationIndex);
} else {
unsetBit(octet, destinationIndex);
}
destinationIndex++;
}
return true;
}
vector<string> Util::split(const string& input, char delimiter) {
vector<string> elements;
stringstream inputStream(input);
string item;
while (std::getline(inputStream, item, delimiter))
elements.push_back(item);
return elements;
}
string Util::trim(const string& str, char character) {
string trimmed = str;
trimmed.erase(remove(trimmed.begin(), trimmed.end(), character), trimmed.end());
return trimmed;
}
bool Util::isNumeric(const string& str) {
string::const_iterator it = str.begin();
while (it != str.end() && std::isdigit(*it)) ++it;
return !str.empty() && it == str.end();
}
string Util::getDateAndTime(bool withDelimiters) {
stringstream dateAndTime;
time_facet *facet = NULL;
try {
if (withDelimiters)
facet = new time_facet("%Y/%m/%d-%T");
else
facet = new time_facet("%Y%m%d-%H%M%S");
} catch (...) {
return string("");
}
dateAndTime.imbue(locale(dateAndTime.getloc(), facet));
dateAndTime << second_clock::local_time();
return dateAndTime.str();
}
string Util::stringifyDateAndTime(u_int32_t timestamp, bool withDelimiters) {
stringstream dateAndTime;
time_facet *facet = NULL;
try {
if (withDelimiters)
facet = new time_facet("%Y/%m/%d-%T");
else
facet = new time_facet("%Y%m%d-%H%M%S");
} catch (...) {
return string("");
}
dateAndTime.imbue(locale(dateAndTime.getloc(), facet));
dateAndTime << boost::posix_time::from_time_t(timestamp);
return dateAndTime.str();
}
vector<string> Util::getListOfFiles(const string& directory) {
boost::filesystem::path directoryPath(directory);
vector<string> fileList;
/**
* First check if it exists and then if it really is a directory
*/
if (!exists(directory) && !is_directory(directoryPath))
return fileList;
directory_iterator endIterator;
for (directory_iterator directoryIterator(directoryPath); directoryIterator != endIterator; ++directoryIterator)
fileList.push_back(directoryIterator->path().filename().c_str());
return fileList;
}
string Util::getFileExtension(const string& fileName) {
/**
* If there is no dots then do not let this method to throw an
* exception, just return an empty string
*/
if (fileName.find('.') == string::npos)
return "";
return fileName.substr(fileName.rfind('.'), fileName.length() - fileName.rfind('.'));
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file util.hpp
* \brief A container for utility methods for bit/byte processing and formatted printing
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef MGMT_UTIL_HPP_
#define MGMT_UTIL_HPP_
#include "mgmt_log.hpp"
#include <sys/types.h>
#include <iostream>
#include <cstring>
#include <iomanip>
#include <vector>
using namespace std;
/**
* A container for utility methods for bit/byte processing and formatted printing
*/
class Util {
public:
/**
* Fills incoming buffer with 0x00es
*
* @param buffer Buffer to be reset
* @param bufferSize Size of the buffer
* @return none
*/
static void resetBuffer(unsigned char * buffer, const size_t bufferSize);
/**
* Copies data between given two buffers
*
* @param destinationBuffer Buffer that data will be copied into
* @param sourceBuffer Buffer that data will be copied from
* @param copySize Amount of data to be copied
* @return true on success, false otherwise
*/
static bool copyBuffer(unsigned char* destinationBuffer, const unsigned char* sourceBuffer, size_t copySize);
/**
* Prints hexadecimal representation of given buffer
*
* @param buffer Buffer that will be printed out
* @param bufferSize Size of the buffer
* @param logger Logger object reference
* @return true on success, false otherwise
*/
static bool printHexRepresentation(const unsigned char* buffer, unsigned long bufferSize, Logger& logger);
/**
* Prints binary representation of given octet
*
* @param message Text message that'll be written before writing octet's content
* @param octet Octet to be printed out
* @param logger Logger object reference
* @return none
*/
static void printBinaryRepresentation(unsigned char* message, u_int8_t octet, Logger& logger);
/**
* Returns binary representation of given octet in a string form
*
* @param octet Octet to be stringified
* @return std::string form of binary representation
*/
static string getBinaryRepresentation(u_int8_t octet);
/**
* Returns string representation of given numeric value
*
* @param numeric Numerical value to be 'stringified'
* @return std:string representation of given numerical value
*/
template <class T>
static string stringify(T numerical);
/**
* Sets Nth bit of given octet
* `index' takes value from 0 to 7
*
* @param octet Pointer to the octet
* @param index Index that'll be set
* @return true on success, false otherwise
*/
static bool setBit(u_int8_t& octet, u_int8_t index);
/**
* Unsets `index'th bit of given octet
* `index' takes value from 0 to 7
*
* @param octet Pointer to the octet
* @param index Index that'll be unset
* @return true on success, false otherwise
*/
static bool unsetBit(u_int8_t& octet, u_int8_t index);
/**
* Checks if `index'th bit of given octet is set
* `index' takes value from 0 to 7
*
* @param octet Octet
* @param index Index that'll be checked
* @return true on success, false otherwise
*/
static bool isBitSet(u_int8_t octet, u_int8_t index);
/**
* Parses 8-byte integer data from given buffer
*
* @param buffer Buffer that 8-byte integer will be parsed from
* @param integer Integer buffer that parsed data will be copied
* @return true on success, false otherwise
*/
static bool parse8byteInteger(const unsigned char* buffer, u_int64_t* integer);
/**
* Parses 4-byte integer data from given buffer
*
* @param buffer Buffer that 4-byte integer will be parsed from
* @param integer Integer buffer that parsed data will be copied
* @return true on success, false otherwise
*/
static bool parse4byteInteger(const unsigned char* buffer, u_int32_t* integer);
/**
* Parses 2-byte integer data from given buffer
*
* @param buffer Buffer that 2-byte integer will be parsed from
* @param integer Integer buffer that parsed data will be copied
* @return true on success, false otherwise
*/
static bool parse2byteInteger(const unsigned char* buffer, u_int16_t* integer);
/**
* Parses 4-byte floating point data from given buffer
*
* @param buffer Buffer that 4-byte float will be parsed from
* @return Float value
*/
static float parse4byteFloat(const vector<unsigned char>& floatBuffer);
/**
* Encodes given 8-byte integer data into buffer at given index
*
* @param buffer Vector that 8-byte integer will be encoded into
* @param bufferIndex Index that 8-byte integer will be encoded at
* @param data 8-byte integer data that will be encoded
* @return true on success, false otherwise
*/
static bool encode8byteInteger(vector<unsigned char>& buffer, u_int16_t bufferIndex, u_int64_t data);
/**
* Encodes given 4-byte integer data into buffer at given index
*
* @param buffer Vector that 4-byte integer will be encoded into
* @param bufferIndex Index that 4-byte integer will be encoded at
* @param data 4-byte integer data that will be encoded
* @return true on success, false otherwise
*/
static bool encode4byteInteger(vector<unsigned char>& buffer, u_int16_t bufferIndex, u_int32_t data);
/**
* Encodes given 2-byte integer data into buffer at given index
*
* @param buffer Vector that 2-byte integer will be encoded into
* @param bufferIndex Index that 2-byte integer will be encoded at
* @param data 2-byte integer data that will be encoded
* @return true on success, false otherwise
*/
static bool encode2byteInteger(vector<unsigned char>& buffer, u_int16_t bufferIndex, u_int16_t data);
/**
* Encodes given bits starting from given index into given octet
*
* @param octet Octet that given bits will be encoded into
* @param index Index that this method starts encoding at (indexes are 0 to 7)
* @param data Data to be encoded
* @param dataSize Number of data bits to be encoded
* @return true on success, false otherwise
*/
static bool encodeBits(u_int8_t& octet, u_int8_t index, u_int8_t data, u_int8_t dataSize);
/**
* Splits given string according to given delimiter and returns the
* string list as a vector
*
* @param input Input string that'll be delimited
* @param delimiter Delimiter character
* @return List of delimited sub-strings as a vector<string>
*/
static vector<string> split(const string& input, char delimiter);
/**
* Removes non-printable characters from the end of a string, ie. trims it
*
* @param str std::string that is going to be trimmed
* @param character Character to be trimmed off
* @return trimmed string of type std::string
*/
static string trim(const string& str, char character);
/**
* Checks if incoming string is numerical or not
*
* @param str std::string to be checked
* @return true if it's numerical, false otherwise
*/
static bool isNumeric(const string& str);
/**
* Returns current date/time as string
* This is used for log file rotating and in log messages as a prefix
*
* @param withDelimiters true if asked with delimiters (like YYYY/mm/dd_HH:MM:SS), false otherwise
* @return String representation of current date and time information
*/
static string getDateAndTime(bool withDelimiters);
/**
* Stringifies given timestamp (in milliseconds)
*
* @param withDelimiters true if asked with delimiters (like YYYY/mm/dd_HH:MM:SS), false otherwise
* @return String representation of current date and time information
*/
static string stringifyDateAndTime(u_int32_t timestamp, bool withDelimiters);
/**
* Returns the list of files in given directory
*
* @param directory Directory that'll be traversed
* @return Vector of std::string carrying directory content
*/
static vector<string> getListOfFiles(const string& directory);
/**
* Returns the file extension of given file name
*
* @param fileName File name of type std::string
* @return File extension of type std::string
*/
static string getFileExtension(const string& fileName);
};
#endif /* MGMT_UTIL_HPP_ */
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*!
* \file version.hpp
* \brief This files has only the version information
* \company EURECOM
* \date 2012
* \author Baris Demiray
* \email: baris.demiray@eurecom.fr
* \note none
* \bug none
* \warning none
*/
#ifndef VERSION_HPP_
#define VERSION_HPP_
#define MGMT_VERSION "1.9.0"
#endif /* VERSION_HPP_ */
Files in this directory are test datas, please do not move/rename/delete
since this would cause certain "good" code to go "bad". If you really have
to change something here please run tests afterwards and be sure everything
is alright.
- Baris Demiray <baris.demiray@eurecom.fr>
##########################################################################################
# Comment line comment line comment line comment line comment line comment line comment li
# Comment line comment line comment line comment line comment line comment line comment li
# Comment line comment line comment line comment line comment line comment line comment li
# Comment line comment line comment line comment line comment line comment line comment li
# Comment line comment line comment line comment line comment line comment line comment li
##########################################################################################
MIB_MC002_TEST1|0xC100 = 100
MIB_MC002_TEST2|0xC101 = "TestString"
MIB_MC002_TEST3|0xC103 = 3.14
##########################################################################################
# Comment line comment line comment line comment line comment line comment line comment li
# Comment line comment line comment line comment line comment line comment line comment li
# Comment line comment line comment line comment line comment line comment line comment li
# Comment line comment line comment line comment line comment line comment line comment li
# Comment line comment line comment line comment line comment line comment line comment li
##########################################################################################
##########################################################################################
# Comment line comment line comment line comment line comment line comment line comment li
# Comment line comment line comment line comment line comment line comment line comment li
# Comment line comment line comment line comment line comment line comment line comment li
# Comment line comment line comment line comment line comment line comment line comment li
# Comment line comment line comment line comment line comment line comment line comment li
##########################################################################################
CONF_SERVER_PORT = 9999
CONF_WIRELESS_STATE_UPDATE_INTERVAL = 100
CONF_LOCATION_UPDATE_INTERVAL = 20
##########################################################################################
# Comment line comment line comment line comment line comment line comment line comment li
# Comment line comment line comment line comment line comment line comment line comment li
# Comment line comment line comment line comment line comment line comment line comment li
# Comment line comment line comment line comment line comment line comment line comment li
# Comment line comment line comment line comment line comment line comment line comment li
##########################################################################################
CP1 = BTP,GN,ITSG5,CCH
CP2 = TCP,IPv6_GN,ITSG5,CCH
CP3 = RTP:STCP,IPv4/v6:DSMIPv4/v6,3G
0. Introduction
This directory involves the simulation of GN and FAC to test these interfaces.
1. Dependencies
Python packages should be installed.
2. Building
There is no build for this tool, it's plain Python which is interpreted rather
than to be built, see section 3. Running.
3. Commands
Following commands are supported.
3.1. DEFINE Command Family
3.1.1. DEFINE SERVER_ADDRESS <address>
Defines the destination address (i.e. the MGMT-CORE's address)
3.1.2. DEFINE SERVER_PORT <port>
Defines the destination port (i.e. the MGMT-CORE's port)
3.1.3. DEFINE CLIENT_PORT <port>
Defines the client's port (i.e. source port that is used to send the packets to MGMT-CORE from)
3.1.4. DEFINE CLIENT_TYPE <clientType>
Defines client type and can be 'GN', 'FAC', or 'LTE'
Packets sent will have relevant event types and sub-types based on this client type
3.2. SEND Command Family
3.2.1. SEND COMMUNICATION_PROFILE_REQUEST
Sends a COMMUNICATION_PROFILE_REQUEST packet to MGMT-CORE's given port
NOTICE: Client type has to be defined in advance for this command since event sub-type
changes from client to client for this packet
3.2.2. SEND NETWORK_STATE
Sends a NETWORK_STATE packet to MGMT-CORE's given port
3.2.3. SEND WIRELESS_STATE
Sends a WIRELESS_STATE_RESPONSE packet to MGMT-CORE's given port
NOTICE: Client type has to be defined in advance for this command since event sub-type
changes from client to client for this packet
3.2.4. SEND LOCATION_UPDATE
Sends a LOCATION_UPDATE to MGMT-CORE's given port
3.2.5. SEND CONFIGURATION_NOTIFICATION
Sends a CONFIGURATION_NOTIFICATION to MGMT-CORE's given port
3.2.6. SEND GET_CONFIGURATION
Sends a GET_CONFIGURATION to MGMT-CORE's given port
NOTICE: Client type has to be defined in advance for this command since event sub-type
changes from client to client for this packet
3.3. Util Command Family
3.2.1. WAIT Command
Makes the simulator wait for the specified amount of seconds
4. Running
Since this simulator has been written in Python you need to have the Python interpreter.
In order to run first scenario file, for example, issue the following command,
$ python main.py scenarios/01.sce
5. References
- Baris Demiray <baris.demiray@eurecom.fr>
import sys
import signal
import time
from packet import * # Packet generator for MGMT -> CLIENT packets
from responder import * # Responder for CLIENT -> MGMT packets
# Handle SIGINT to exit nicely
def signal_handler(signal, frame):
print 'CTRL+C caught, exiting...'
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
# Check command-line parameters
if len(sys.argv) == 1:
print "Usage: ", sys.argv[0], " <scenario-file>"
sys.exit()
else:
print "Running scenario file: ", sys.argv[1]
scenarioFile = open(sys.argv[1])
# Server information
serverPort = 1402
serverAddress = "127.0.0.1"
# Client information
clientType = "UNDEFINED"
clientPacketType = ""
clientPort = 8000
# If incoming packets are going to be replied with
# corresponding response packets or simply ignored
# False: Ignore, True: Process and Reply
clientReply = False
# Traverse scenario file line by line
line = scenarioFile.readline()
line = line.strip('\n')
while line:
commands = line.split()
print "DEBUG = ", commands
# We are asked to SEND a packet
if commands[0] == "SEND":
clientPacketType = commands[1]
print clientPacketType, "packet is going to be sent"
# Configuration Request Packet
if clientPacketType == "GET_CONFIGURATION":
# Ignore the command if the client type is not defined
if clientType == "UNDEFINED":
print "ERROR: Client type has to be defined in advance to send a CONFIGURATION_REQUEST"
print "Ignoring this command..."
elif Packet.sendConfigurationRequest(serverAddress, serverPort, clientPort, clientType):
print "CONFIGURATION_REQUEST packet sent successfully"
else:
print "ERROR: Cannot send CONFIGURATION_REQUEST"
# Communication Profile Request Packet
elif clientPacketType == "COMMUNICATION_PROFILE_REQUEST":
# Ignore the command if the client type is not defined
if clientType == "UNDEFINED":
print "ERROR: Client type has to be defined in advance to send a CONFIGURATION_REQUEST"
print "Ignoring this command..."
elif Packet.sendCommunicationProfileRequest(serverAddress, serverPort, clientPort, clientType):
print "COMMUNICATION_PROFILE_REQUEST packet sent successfully"
else:
print "ERROR: Cannot send COMMUNICATION_PROFILE_REQUEST"
# Communication Profile Selection Request Packet
elif clientPacketType == "COMMUNICATION_PROFILE_SELECTION_REQUEST":
# Ignore the command if the client type is not defined
if clientType != "FAC":
print "ERROR: Client type has to be defined in advance to send a CONFIGURATION_REQUEST"
print "Ignoring this command..."
elif Packet.sendCommunicationProfileSelectionRequest(serverAddress, serverPort, clientPort, clientType):
print "COMMUNICATION_PROFILE_REQUEST packet sent successfully"
else:
print "ERROR: Cannot send COMMUNICATION_PROFILE_REQUEST"
# Network State Packet
elif clientPacketType == "NETWORK_STATE":
if Packet.sendNetworkState(serverAddress, serverPort, clientPort):
print "NETWORK_STATE packet sent successfully"
else:
print "ERROR: Cannot send NETWORK_STATE"
# Wireless State Packet
elif clientPacketType == "WIRELESS_STATE":
if Packet.sendWirelessState(serverAddress, serverPort, clientPort, clientType):
print "WIRELESS_STATE packet sent successfully"
else:
print "ERROR: Cannot send WIRELESS_STATE"
# Location Update
elif clientPacketType == "LOCATION_UPDATE":
if Packet.sendLocationUpdate(serverAddress, serverPort, clientPort):
print "LOCATION_UPDATE packet sent successfully"
else:
print "ERROR: Cannot send LOCATION_UPDATE"
# Configuration Notification
elif clientPacketType == "CONFIGURATION_NOTIFICATION":
if Packet.sendConfigurationNotification(serverAddress, serverPort, clientPort):
print "CONFIGURATION_NOTIFICATION packet sent successfully"
else:
print "ERROR: Cannot send CONFIGURATION_NOTIFICATION"
# Unknown packet
else:
print "Sorry dude, I don't know what you mean by", clientPacketType
# Wait command
elif commands[0] == "WAIT":
howManySeconds = int(commands[1])
print "Waiting for", howManySeconds, "seconds"
time.sleep(howManySeconds)
# DEFINE command family
elif commands[0] == "DEFINE":
# Server address is being defined
if commands[1] == "SERVER_ADDRESS":
serverAddress = commands[2]
print "Server address defined as", serverAddress
# Server port is being defined
elif commands[1] == "SERVER_PORT":
serverPort = int(commands[2])
print "Server port defined as", serverPort
# Client port is being defined
elif commands[1] == "CLIENT_PORT":
clientPort = int(commands[2])
print "Client port defined as", clientPort
# Client type is being defined
elif commands[1] == "CLIENT_TYPE":
clientType = commands[2]
print "Client type defined as", clientType
# Are incoming packets going to be responded
elif commands[1] == "REPLY":
clientReply = True if commands[2] == "TRUE" else False
if clientReply:
print "Those incoming messages that require a response will be handled and a response will be sent"
responder = Responder()
# TODO responder.start()
else:
print "Those incoming messages that require a response will be ignored"
# Unknown sub-command
else:
print "Sorry dude, I don't know what you mean by", command[1]
# Unknown command
else:
print "Sorry dude, I don't know what you mean by", command[0], "command"
# Read a new line and remove newline
line = scenarioFile.readline()
line = line.strip('\n')
sys.exit()
import socket
import array
import random
class Packet:
@staticmethod
def sendConfigurationRequest(serverAddress, serverPort, clientPort, clientType):
# Build the packet
configurationRequestPacket = array.array('B')
configurationRequestPacket.append(0x40) # Validity=1, version=0
configurationRequestPacket.append(0x00) # Priority=0
configurationRequestPacket.append(0x03) # EventType=3
# Set the event sub-type according to the client type
if clientType == "GN":
configurationRequestPacket.append(0x01) # EventSubtype=1
configurationRequestPacket.append(0xFF) # ConfigurationId=0xFFFF (all)
configurationRequestPacket.append(0xFF)
elif clientType == "FAC":
configurationRequestPacket.append(0x11) # EventSubtype=11
configurationRequestPacket.append(0xBB) # ConfigurationId=0xBBBB (only FAC)
configurationRequestPacket.append(0xBB)
elif clientType == "LTE":
# This value is not defined yet!
configurationRequestPacket.append(0x12) # EventSubtype=12
configurationRequestPacket.append(0xFF) # ConfigurationId=0xFFFF (all)
configurationRequestPacket.append(0xFF)
configurationRequestPacket.append(0x00) # TransmissionMode=0x0001 (bulk)
configurationRequestPacket.append(0x01)
# Create the socket to send to MGMT
managementSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
managementSocket.bind(('0.0.0.0', clientPort))
sentByteCount = managementSocket.sendto(configurationRequestPacket, (serverAddress, serverPort))
print sentByteCount, "bytes sent"
receivedBytes, sourceAddress = managementSocket.recvfrom(1024)
print receivedBytes.encode('hex'), "bytes received from", sourceAddress
return True
@staticmethod
def sendCommunicationProfileRequest(serverAddress, serverPort, clientPort, clientType):
# Build the packet
communicationProfileRequestPacket = array.array('B')
communicationProfileRequestPacket.append(0x40) # Validity=1, version=0
communicationProfileRequestPacket.append(0x00) # Priority=0
communicationProfileRequestPacket.append(0x03) # EventType=3
# Set the event sub-type according to the client type
if clientType == "GN":
communicationProfileRequestPacket.append(0x04) # EventSubtype=4
elif clientType == "FAC":
communicationProfileRequestPacket.append(0x15) # EventSubtype=15
elif clientType == "LTE":
# This value is not defined yet!
communicationProfileRequestPacket.append(0x16) # EventSubtype=16
communicationProfileRequestPacket.append(0xC0) # Transport (1-byte)
communicationProfileRequestPacket.append(0xC0) # Network (1-byte)
communicationProfileRequestPacket.append(0x80) # Access (1-byte)
communicationProfileRequestPacket.append(0xF8) # Channel (1-byte)
communicationProfileRequestPacket.append(random.randint(1, 100)) # Sequence number (1-byte)
communicationProfileRequestPacket.append(0x00) # Reserved (3-byte)
communicationProfileRequestPacket.append(0x00)
communicationProfileRequestPacket.append(0x00)
# Create the socket to send to MGMT
managementSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
managementSocket.bind(('0.0.0.0', clientPort))
sentByteCount = managementSocket.sendto(communicationProfileRequestPacket, (serverAddress, serverPort))
print sentByteCount, "bytes sent"
receivedBytes, sourceAddress = managementSocket.recvfrom(1024)
print receivedBytes.encode('hex'), "bytes received from", sourceAddress
return True
@staticmethod
def sendCommunicationProfileSelectionRequest(serverAddress, serverPort, clientPort, clientType):
# Build the packet
communicationProfileRequestPacket = array.array('B')
communicationProfileRequestPacket.append(0x40) # Validity=1, version=0
communicationProfileRequestPacket.append(0x00) # Priority=0
communicationProfileRequestPacket.append(0x03) # EventType=3
communicationProfileRequestPacket.append(0x17) # EventSubtype=17
communicationProfileRequestPacket.append(0x01) # Latency (1-byte)
communicationProfileRequestPacket.append(0x05) # Relevance (1-byte)
communicationProfileRequestPacket.append(0x02) # Reliability (1-byte)
communicationProfileRequestPacket.append(random.randint(1, 100)) # Sequence number (1-byte)
# Create the socket to send to MGMT
managementSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
managementSocket.bind(('0.0.0.0', clientPort))
sentByteCount = managementSocket.sendto(communicationProfileRequestPacket, (serverAddress, serverPort))
print sentByteCount, "bytes sent"
receivedBytes, sourceAddress = managementSocket.recvfrom(1024)
print receivedBytes.encode('hex'), "bytes received from", sourceAddress
return True
@staticmethod
def sendNetworkState(serverAddress, serverPort, clientPort):
# Build the packet
networkStatePacket = array.array('B')
networkStatePacket.append(0x40) # Validity=1, version=0
networkStatePacket.append(0x00) # Priority=0
networkStatePacket.append(0x04) # EventType=4
networkStatePacket.append(0x04) # EventSubtype=4
networkStatePacket.append(0x50) # Timestamp (32-bit)
networkStatePacket.append(0xA3)
networkStatePacket.append(0x26)
networkStatePacket.append(0xF3)
networkStatePacket.append(0x00) # RxPackets
networkStatePacket.append(0x00)
networkStatePacket.append(0x01)
networkStatePacket.append(0xF0)
networkStatePacket.append(0x00) # RxBytes
networkStatePacket.append(0x00)
networkStatePacket.append(0x02)
networkStatePacket.append(0x02)
networkStatePacket.append(0x00) # TxPackets
networkStatePacket.append(0x00)
networkStatePacket.append(0x0A)
networkStatePacket.append(0x56)
networkStatePacket.append(0x00) # TxBytes
networkStatePacket.append(0x00)
networkStatePacket.append(0x10)
networkStatePacket.append(0x89)
networkStatePacket.append(0x00) # ToUpperLayerPackets
networkStatePacket.append(0x00)
networkStatePacket.append(0x00)
networkStatePacket.append(0x20)
networkStatePacket.append(0x00) # DiscardedPackets
networkStatePacket.append(0x00)
networkStatePacket.append(0x00)
networkStatePacket.append(0x0A)
networkStatePacket.append(0x00) # DuplicatePackets
networkStatePacket.append(0x00)
networkStatePacket.append(0x00)
networkStatePacket.append(0x0C)
networkStatePacket.append(0x00) # ForwardedPackets
networkStatePacket.append(0x01)
networkStatePacket.append(0x30)
networkStatePacket.append(0x00)
# Create the socket to send to MGMT
managementSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
managementSocket.bind(('0.0.0.0', clientPort))
sentByteCount = managementSocket.sendto(networkStatePacket, (serverAddress, serverPort))
print sentByteCount, "bytes sent"
return True
@staticmethod
def sendWirelessState(serverAddress, serverPort, clientPort, clientType):
random.seed()
# Build the packet
wirelessStatePacket = array.array('B')
wirelessStatePacket.append(0x40) # Validity=1, version=0
wirelessStatePacket.append(0x00) # Priority=0
wirelessStatePacket.append(0x04) # EventType=4
# Set the packet content according to the client type
if clientType == "GN":
wirelessStatePacket.append(0x03) # EventSubtype=3
wirelessStatePacket.append(0x01) # IF Count
wirelessStatePacket.append(0x00) # Reserved
wirelessStatePacket.append(0x00) # Reserved
wirelessStatePacket.append(0x00) # Reserved
wirelessStatePacket.append(0x00) # Interface ID (2-byte)
wirelessStatePacket.append(random.randint(1, 10))
wirelessStatePacket.append(0x00) # Access Technology (2-byte)
wirelessStatePacket.append(random.randint(1, 255))
wirelessStatePacket.append(random.randint(1, 255)) # Channel Frequency (2-byte)
wirelessStatePacket.append(random.randint(1, 255))
wirelessStatePacket.append(0x00) # Bandwidth (2-byte)
wirelessStatePacket.append(random.randint(1, 255))
wirelessStatePacket.append(random.randint(1, 100)) # Channel Busy Ratio (1-byte)
wirelessStatePacket.append(random.randint(1, 10)) # Status (1-byte)
wirelessStatePacket.append(random.randint(1, 100)) # Average TX Power (1-byte)
wirelessStatePacket.append(0x00) # Reserved
elif clientType == "LTE":
wirelessStatePacket.append(0x23) # EventSubtype=23
wirelessStatePacket.append(0x00) # Interface ID (2-byte)
wirelessStatePacket.append(0x02)
wirelessStatePacket.append(0x00) # Reserved
wirelessStatePacket.append(0x00) # Reserved
wirelessStatePacket.append(0x00) # Reference Signal Received Power (2-byte)
wirelessStatePacket.append(random.randint(1, 100))
wirelessStatePacket.append(0x00) # Reference Signal Received Quality (2-byte)
wirelessStatePacket.append(random.randint(1, 100))
wirelessStatePacket.append(random.randint(1, 10)) # Channel Quality Indication (1-byte)
wirelessStatePacket.append(0x01) # Status
wirelessStatePacket.append(0x00) # Reserved
wirelessStatePacket.append(0x00) # Reserved
wirelessStatePacket.append(0x00) # Packet Loss Rate (4-byte)
wirelessStatePacket.append(0x00)
wirelessStatePacket.append(random.randint(1, 10))
wirelessStatePacket.append(random.randint(1, 10))
# Create the socket to send to MGMT
managementSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
managementSocket.bind(('0.0.0.0', clientPort))
sentByteCount = managementSocket.sendto(wirelessStatePacket, (serverAddress, serverPort))
print sentByteCount, "bytes sent"
return True
@staticmethod
def sendLocationUpdate(serverAddress, serverPort, clientPort):
# Build the packet
locationUpdatePacket = array.array('B')
locationUpdatePacket.append(0x40) # Validity=1, version=0
locationUpdatePacket.append(0x00) # Priority=0
locationUpdatePacket.append(0x01) # EventType=1
locationUpdatePacket.append(0x10) # EventSubtype=10
locationUpdatePacket.append(0x01) # Timestamp (4-byte)
locationUpdatePacket.append(0x02)
locationUpdatePacket.append(0x03)
locationUpdatePacket.append(0x04)
locationUpdatePacket.append(0x01) # Latitude (4-byte)
locationUpdatePacket.append(0x02)
locationUpdatePacket.append(0x03)
locationUpdatePacket.append(0x04)
locationUpdatePacket.append(0x01) # Longitude (4-byte)
locationUpdatePacket.append(0x02)
locationUpdatePacket.append(0x03)
locationUpdatePacket.append(0x04)
locationUpdatePacket.append(0x01) # Speed (2-byte)
locationUpdatePacket.append(0x02)
locationUpdatePacket.append(0x01) # Heading (2-byte)
locationUpdatePacket.append(0x02)
locationUpdatePacket.append(0x01) # Altitude (2-byte)
locationUpdatePacket.append(0x02)
locationUpdatePacket.append(0x01) # TAcc, and PodAcc (1-byte)
locationUpdatePacket.append(0x01) # SAcc, Hacc, and AltAcc (1-byte)
# Create the socket to send to MGMT
managementSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
managementSocket.bind(('0.0.0.0', clientPort))
sentByteCount = managementSocket.sendto(locationUpdatePacket, (serverAddress, serverPort))
print sentByteCount, "bytes sent"
return True
@staticmethod
def sendConfigurationNotification(serverAddress, serverPort, clientPort):
# Build the packet
configurationNotificationPacket = array.array('B')
configurationNotificationPacket.append(0x40) # Validity=1, version=0
configurationNotificationPacket.append(0x00) # Priority=0
configurationNotificationPacket.append(0x03) # EventType=3
configurationNotificationPacket.append(0x14) # EventSubtype=14
configurationNotificationPacket.append(0x0B) # Configuration ID (2-byte)
configurationNotificationPacket.append(0xCC) # Configuration ID = LDM Garbage Collection Interval
configurationNotificationPacket.append(0x00) # Length (2-byte)
configurationNotificationPacket.append(0x04) # Length = 4-byte
configurationNotificationPacket.append(0x00) # Configuration Value (variable-size)
configurationNotificationPacket.append(0x00) # configuration Value = 100 (ms)
configurationNotificationPacket.append(0x00)
configurationNotificationPacket.append(0x64)
# Create the socket to send to MGMT
managementSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
managementSocket.bind(('0.0.0.0', clientPort))
sentByteCount = managementSocket.sendto(configurationNotificationPacket, (serverAddress, serverPort))
print sentByteCount, "bytes sent"
return True
@staticmethod
def testConfigurationResponse(address):
# Create the socket to receive from MGMT
managementSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# managementSocket.bind(address)
receivedBytes = managementSocket.recvfrom(1024)
print receivedBytes, "bytes received"
return True
import threading
import socket
class Responder(threading.Thread):
def run(self):
# Create the socket to receive from clients
managementSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
while True:
print "Reading from socket..."
receivedBytes,senderAddress = managementSocket.recvfrom(1024)
print receivedByteCount, "bytes received"
DEFINE SERVER_PORT 1402
DEFINE CLIENT_PORT 1401
DEFINE CLIENT_TYPE GN
DEFINE REPLY TRUE
SEND GET_CONFIGURATION
WAIT 2
SEND COMMUNICATION_PROFILE_REQUEST
WAIT 2
SEND NETWORK_STATE
DEFINE SERVER_PORT 1402
DEFINE CLIENT_PORT 1403
DEFINE CLIENT_TYPE FAC
DEFINE REPLY TRUE
SEND COMMUNICATION_PROFILE_REQUEST
WAIT 2
DEFINE SERVER_PORT 1402
DEFINE CLIENT_PORT 1401
DEFINE CLIENT_TYPE GN
DEFINE REPLY TRUE
SEND COMMUNICATION_PROFILE_REQUEST
WAIT 2
DEFINE SERVER_PORT 1402
DEFINE CLIENT_PORT 1403
DEFINE CLIENT_TYPE FAC
DEFINE REPLY TRUE
SEND COMMUNICATION_PROFILE_SELECTION_REQUEST
WAIT 1
DEFINE SERVER_PORT 1402
DEFINE CLIENT_PORT 1403
DEFINE CLIENT_TYPE FAC
DEFINE REPLY TRUE
SEND CONFIGURATION_NOTIFICATION
WAIT 2
DEFINE SERVER_PORT 1402
DEFINE CLIENT_PORT 1403
DEFINE CLIENT_TYPE FAC
SEND GET_CONFIGURATION
DEFINE SERVER_PORT 1402
DEFINE CLIENT_PORT 1401
DEFINE CLIENT_TYPE GN
SEND GET_CONFIGURATION
DEFINE SERVER_PORT 1402
DEFINE CLIENT_PORT 1403
DEFINE CLIENT_TYPE FAC
SEND GET_CONFIGURATION
DEFINE SERVER_PORT 1402
DEFINE CLIENT_PORT 1403
DEFINE CLIENT_TYPE FAC
DEFINE REPLY TRUE
SEND LOCATION_UPDATE
WAIT 1
DEFINE SERVER_PORT 1402
DEFINE CLIENT_PORT 1401
DEFINE CLIENT_TYPE GN
DEFINE REPLY TRUE
SEND NETWORK_STATE
DEFINE SERVER_PORT 1402
DEFINE CLIENT_PORT 1404
DEFINE CLIENT_TYPE LTE
SEND WIRELESS_STATE
CPP=g++
RM=rm
ECHO=echo
STRIP=strip
CPP_FILES:=$(shell find . -iname '*.cpp')
OBJ_FILES=$(CPP_FILES:.cpp=.o)
# We define the same set of files except 'main()'
# to link test code against SCOREF-MGMT
CPP_SCOREF_FILES:=$(shell find ../../src/ -iname '*.cpp' ! -iname 'main.cpp')
OBJ_SCOREF_FILES=$(CPP_SCOREF_FILES:.cpp=.o)
EXE_FILE=TEST-SCOREF-MGMT
CPPFLAGS=-Wall
LDFLAGS=-lboost_system -lboost_filesystem -lboost_thread -lboost_program_options -lgtest
INCLUDE=-I../../src/ -I../../src/packets/ -I../../src/util/
BUILD_FLAGS=-O3
all: $(CPP_FILES) binary
binary: $(CPP_FILES) $(OBJ_FILES)
cd ../../ && make -f Makefile && cd -
$(CPP) $(OBJ_FILES) $(OBJ_SCOREF_FILES) -o $(EXE_FILE) $(LDFLAGS)
strip:
$(STRIP) $(EXE_FILE) &> /dev/null
clean:
$(RM) -fv $(EXE_FILE)
find . -iname "*.o" -exec rm -fv {} \;
.cpp.o:
$(CPP) -c $(BUILD_FLAGS) $(CPPFLAGS) $< -o $@
0. Introduction
Google C++ Testing Framework is used for SCOREF-MGMT module's
test code.
1. Dependencies
On Ubuntu, libgtest-dev and libgtest0 packages are necessary
to link this code against Google's library. Refer to relevant
documentation on other systems.
On Ubuntu 12.04, though, you cannot find binary libraries and
you have to build them yourself. Do following in order to build
the binary (this directory is installed by libgtest-dev package)
$ cd /usr/src/gtest
# sudo cmake .
# sudo make
# sudo mv libg* /usr/lib/
2. Building
In this directory, running make is enough. Please let me know
if you encounter any compile-time or run-time errors.
$ make
Be informed that you may have to do 'make clean' before you
have an up-to-date binary since test_* files are designated as
header files and a change in them would not trigger a re-build
3. Running
In this directory, running the binary created by the compilation
process is enough. There are no command-line parameters currently.
$ ./TEST-SCOREF-MGMT
4. References
See Google documentation for further details regarding the test
framework,
http://code.google.com/p/googletest/
- Baris Demiray <baris.demiray@eurecom.fr>
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#include <gtest/gtest.h>
#include "main.hpp"
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#ifndef MAIN_HPP_
#define MAIN_HPP_
#include <boost/lexical_cast.hpp>
#include <gtest/gtest.h>
#include "../../src/mgmt_configuration.hpp"
#include "test_configuration.hpp"
#include "test_util.hpp"
namespace ScorefTest {
/*
* The fixture for SCOREF-MGMT testing
*/
class ScorefManagementTest: public ::testing::Test {
protected:
ScorefManagementTest() {
try {
logger = new Logger("test.log", Logger::TRACE, Logger::STDOUT);
} catch (...) {
cerr << "Cannot create a Logger object!" << endl;
throw;
}
try {
vector<string> configurationNameVector;
configuration = new Configuration(configurationNameVector, *logger);
} catch (...) {
cerr << "Cannot create a Configuration object!" << endl;
throw;
}
try {
managementInformationBase = new ManagementInformationBase(*logger);
} catch (...) {
cerr << "Cannot create a ManagementInformationBase object!" << endl;
throw;
}
}
virtual ~ScorefManagementTest() {
// You can do clean-up work that doesn't throw exceptions here.
}
// If the constructor and destructor are not enough for setting up
// and cleaning up each test, you can define the following methods:
/**
* Initialization that'll be done before each test
*
* @param none
* @return none
*/
virtual void SetUp() {
}
/**
* Finalization that'll be done after each test
*
* @param none
* @return none
*/
virtual void TearDown() {
delete logger;
}
// Objects declared here can be used by all tests in the test case for Foo.
Logger* logger;
Configuration* configuration;
ManagementInformationBase* managementInformationBase;
};
/**
* Util class tests
*/
TEST_F(ScorefManagementTest, UtilTest) {
try {
testUtilResetBuffer(*logger);
testUtilCopyBuffer(*logger);
testUtilGetBinaryRepresentation(*logger);
testUtilSetBit(*logger);
testUtilUnsetBit(*logger);
testUtilIsBitSet(*logger);
testUtilParse8byteInteger(*logger);
testUtilParse4byteInteger(*logger);
testUtilParse2byteInteger(*logger);
testUtilEncode8ByteInteger(*logger);
testUtilEncode4ByteInteger(*logger);
testUtilEncode2ByteInteger(*logger);
testUtilEncodeBits(*logger);
testUtilSplit(*logger);
testUtilTrim(*logger);
testUtilIsNumeric(*logger);
testGetListOfFiles(*logger);
testGetFileExtension(*logger);
} catch (std::exception& e) {
cerr << "std::exception.what() = '" << e.what() << "'" << endl;
}
}
/**
* Configuration class tests
*/
TEST_F(ScorefManagementTest, ConfigurationTest) {
try {
testParseConfigurationFiles(*configuration, *managementInformationBase, *logger);
#ifdef PRIVATE
testParseLine(*configuration, *logger);
testParseParameterId(*configuration, *logger);
testSetValue(*configuration, *logger);
#endif
testGetConfigurationFileVector(*configuration, *logger);
testAddConfigurationFile(*configuration, *logger);
testGetServerPort(*configuration, *logger);
testSetServerPort(*configuration, *logger);
testGetWirelessStateUpdateInterval(*configuration, *logger);
testSetWirelessStateUpdateInterval(*configuration, *logger);
testGetLocationUpdateInterval(*configuration, *logger);
testSetLocationUpdateInterval(*configuration, *logger);
testConfiguration(*configuration, *managementInformationBase, *logger);
} catch (std::exception& e) {
cerr << "std::exception.what() = '" << e.what() << "'" << endl;
}
}
}
#endif /* MAIN_HPP_ */
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#include "../../src/mgmt_configuration.hpp"
#include "test_configuration_util.hpp"
#include <gtest/gtest.h>
#define TEST_CONFIGURATION_FILE_1 "../data/confFiles/testConfFile1.conf"
#define TEST_CONFIGURATION_FILE_2 "../data/confFiles/testConfFile2.conf"
#define TEST_CONFIGURATION_FILE_3 "../data/confFiles/testConfFile3.conf"
void testParseConfigurationFiles(Configuration& configuration, ManagementInformationBase& mib, Logger& logger) {
logger.info("Testing Configuration::parseConfigurationFiles() method");
/**
* Verify if this method returns FALSE when no configuration file is given
*/
EXPECT_FALSE(testParseConfigurationFilesNonexistentFile(configuration, logger));
/**
* Verify if configuration parameters are parsed correctly
*/
configuration.addConfigurationFile(TEST_CONFIGURATION_FILE_1);
configuration.addConfigurationFile(TEST_CONFIGURATION_FILE_2);
/**
* Verify number of configuration files and that they are parsed successfully
*/
ASSERT_EQ(2, configuration.getConfigurationFileVector().size());
ASSERT_TRUE(configuration.parseConfigurationFiles(mib));
}
#ifdef PRIVATE
void testParseLine(Configuration& configuration, Logger& logger) {
logger.info("Testing Configuration::parseLine() method");
string line = "parameter = value";
string parameter, value;
EXPECT_TRUE(configuration.parseLine(line, parameter, value));
EXPECT_STREQ("parameter", parameter.c_str());
EXPECT_STREQ("value", value.c_str());
}
void testParseParameterId(Configuration& configuration, Logger& logger) {
logger.info("Testing Configuration::parseParameterId() method");
string testInput = "MIB_MC002_TEST1|0xC100";
string parameterString;
u_int16_t parameterId;
EXPECT_TRUE(configuration.parseParameterId(testInput, parameterString, parameterId));
EXPECT_STREQ("MIB_MC002_TEST1", parameterString.c_str());
EXPECT_EQ(0xC100, parameterId);
}
void testSetValue(Configuration& configuration, Logger& logger) {
logger.info("Testing Configuration::setValue() method");
/**
* Verify that it returns FALSE for a non-existent parameter
*/
EXPECT_FALSE(configuration.setValue("CONF_THIS_DOES_NOT_EXISTS", "1234"));
/**
* Verify that it updates a configuration item's value correctly
*/
EXPECT_TRUE(configuration.setValue("CONF_SERVER_PORT", "9000"));
EXPECT_EQ(9000, configuration.getServerPort());
}
#endif
void testGetConfigurationFileVector(Configuration& configuration, Logger& logger) {
logger.info("Testing Configuration::getConfigurationFileVector() method");
vector<string> configurationFileNameVector = configuration.getConfigurationFileVector();
EXPECT_EQ(2, configurationFileNameVector.size());
EXPECT_STREQ(TEST_CONFIGURATION_FILE_1, configurationFileNameVector[0].c_str());
EXPECT_STREQ(TEST_CONFIGURATION_FILE_2, configurationFileNameVector[1].c_str());
}
void testAddConfigurationFile(Configuration& configuration, Logger& logger) {
logger.info("Testing Configuration::addConfigurationFile() method");
string newConfigurationFile = "../data/confFiles/testConfFile3.conf";
configuration.addConfigurationFile(newConfigurationFile);
vector<string> configurationFileNameVector = configuration.getConfigurationFileVector();
EXPECT_EQ(3, configurationFileNameVector.size());
EXPECT_STREQ(TEST_CONFIGURATION_FILE_1, configurationFileNameVector[0].c_str());
EXPECT_STREQ(TEST_CONFIGURATION_FILE_2, configurationFileNameVector[1].c_str());
EXPECT_STREQ(TEST_CONFIGURATION_FILE_3, configurationFileNameVector[2].c_str());
}
void testGetServerPort(Configuration& configuration, Logger& logger) {
logger.info("Testing Configuration::getServerPort() method");
u_int16_t serverPort = configuration.getServerPort();
EXPECT_EQ(9999, serverPort);
}
void testSetServerPort(Configuration& configuration, Logger& logger) {
logger.info("Testing Configuration::setServerPort() method");
configuration.setServerPort(9999);
EXPECT_EQ(9999, configuration.getServerPort());
}
void testGetWirelessStateUpdateInterval(Configuration& configuration, Logger& logger) {
logger.info("Testing Configuration::getWirelessStateUpdateInterval() method");
EXPECT_EQ(100, configuration.getWirelessStateUpdateInterval());
}
void testSetWirelessStateUpdateInterval(Configuration& configuration, Logger& logger) {
logger.info("Testing Configuration::setWirelessStateUpdateInterval() method");
/**
* Verify that invalid values are not set
*/
configuration.setWirelessStateUpdateInterval(9);
EXPECT_EQ(100, configuration.getWirelessStateUpdateInterval());
configuration.setWirelessStateUpdateInterval(121);
EXPECT_EQ(100, configuration.getWirelessStateUpdateInterval());
/**
* Verify that valid values are set
*/
configuration.setWirelessStateUpdateInterval(120);
EXPECT_EQ(120, configuration.getWirelessStateUpdateInterval());
}
void testGetLocationUpdateInterval(Configuration& configuration, Logger& logger) {
logger.info("Testing Configuration::getLocationUpdateInterval() method");
EXPECT_EQ(20, configuration.getLocationUpdateInterval());
}
void testSetLocationUpdateInterval(Configuration& configuration, Logger& logger) {
logger.info("Testing Configuration::setLocationUpdateInterval() method");
/**
* Verify that invalid values are not set
*/
configuration.setLocationUpdateInterval(19);
EXPECT_EQ(20, configuration.getLocationUpdateInterval());
configuration.setLocationUpdateInterval(121);
EXPECT_EQ(20, configuration.getLocationUpdateInterval());
/**
* Verify that valid values are set
*/
configuration.setLocationUpdateInterval(30);
EXPECT_EQ(30, configuration.getLocationUpdateInterval());
}
/**
* This method tests internal configuration data of Configuration class
*/
void testConfiguration(Configuration& configuration, ManagementInformationBase& mib, Logger& logger) {
/**
* Test ItsKeyManager member of Configuration class
*/
EXPECT_TRUE(testItsKeyManager(configuration, mib, logger));
/**
* Verify Communication Profile information
*/
testCommunicationProfiles(configuration, mib, logger);
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#include "../../src/mgmt_configuration.hpp"
#include <gtest/gtest.h>
bool testParseConfigurationFilesNonexistentFile(Configuration& configuration, Logger& logger) {
ManagementInformationBase mib(logger);
return configuration.parseConfigurationFiles(mib);
}
bool testItsKeyManager(Configuration& configuration, ManagementInformationBase& mib, Logger& logger) {
/**
* Verify the number of keys which should be 6 (3 for IHM, 3 for MGMT)
*/
if (mib.getItsKeyManager().getNumberOfKeys(ITS_KEY_TYPE_ALL) == 3)
return true;
return false;
}
void testCommunicationProfiles(Configuration& configuration, ManagementInformationBase& mib, Logger& logger) {
/**
* Verify the number of communication profiles which should be 3
*/
EXPECT_EQ(3, mib.getCommunicationProfileManager().getProfileMap().size());
/**
* Verify the contents of communication profiles, starting from 1st profile
*/
EXPECT_EQ(1, mib.getCommunicationProfileManager().getProfileMap()[1].id);
EXPECT_EQ(0xC0, mib.getCommunicationProfileManager().getProfileMap()[1].transport);
EXPECT_EQ(0x80, mib.getCommunicationProfileManager().getProfileMap()[1].network);
EXPECT_EQ(0x80, mib.getCommunicationProfileManager().getProfileMap()[1].access);
EXPECT_EQ(0x80, mib.getCommunicationProfileManager().getProfileMap()[1].channel);
// Verify 2nd communication profile
EXPECT_EQ(2, mib.getCommunicationProfileManager().getProfileMap()[2].id);
EXPECT_EQ(0x20, mib.getCommunicationProfileManager().getProfileMap()[2].transport);
EXPECT_EQ(0x40, mib.getCommunicationProfileManager().getProfileMap()[2].network);
EXPECT_EQ(0x80, mib.getCommunicationProfileManager().getProfileMap()[2].access);
EXPECT_EQ(0x80, mib.getCommunicationProfileManager().getProfileMap()[2].channel);
// Verify 3rd and last communication profile
EXPECT_EQ(0x0C, mib.getCommunicationProfileManager().getProfileMap()[3].transport);
EXPECT_EQ(0x0C, mib.getCommunicationProfileManager().getProfileMap()[3].network);
EXPECT_EQ(0x40, mib.getCommunicationProfileManager().getProfileMap()[3].access);
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface 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.
OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06410 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#include "../../src/util/mgmt_util.hpp"
#include <gtest/gtest.h>
#include <iostream>
using namespace std;
void testUtilResetBuffer(Logger& logger) {
logger.info("Testing Util::resetBuffer() method");
unsigned char array[10] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
Util::resetBuffer(array, 10);
for (int i = 0; i < 10; ++i)
EXPECT_EQ(0, array[i]);
}
void testUtilCopyBuffer(Logger& logger) {
logger.info("Testing Util::copyBuffer() method");
unsigned char arrayDestination[10] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
unsigned char arraySource[5] = { 'a', 'b', 'c', 'd', 'e' };
unsigned char arrayExpected[10] = { 'a', 'b', 'c', 'd', 'e', '5', '6', '7', '8', '9' };
/**
* Test for NULL arrays
*/
EXPECT_FALSE(Util::copyBuffer(arrayDestination, NULL, 5));
EXPECT_FALSE(Util::copyBuffer(NULL, arraySource, 5));
/**
* Test actual function
*/
Util::copyBuffer(arrayDestination, arraySource, 5);
for (int i = 0; i < 10; ++i)
EXPECT_EQ(arrayExpected[i], arrayDestination[i]);
}
void testUtilGetBinaryRepresentation(Logger& logger) {
logger.info("Testing Util::getBinaryRepresentation() method");
/**
* Check for 0xFF which should be '11111111'
*/
u_int8_t octet = 0xFF;
string binaryRepresentation = Util::getBinaryRepresentation(octet);
for (int i = 0; i < 8; ++i)
EXPECT_EQ('1', binaryRepresentation.at(i));
/**
* Check for 0xF0 which should be '11110000'
*/
octet = 0xF0;
binaryRepresentation = Util::getBinaryRepresentation(octet);
for (int i = 0; i < 4; ++i)
EXPECT_EQ('1', binaryRepresentation.at(i));
for (int i = 4; i < 8; ++i)
EXPECT_EQ('0', binaryRepresentation.at(i));
}
void testUtilSetBit(Logger& logger) {
logger.info("Testing Util::setBit() method");
/**
* Start with 0b00000000 and test every bit
*/
u_int8_t octet = 0x00;
for (int i = 0; i < 8; ++i) {
Util::setBit(octet, i);
EXPECT_TRUE(Util::isBitSet(octet, i));
}
}
void testUtilUnsetBit(Logger& logger) {
logger.info("Testing Util::unsetBit() method");
/**
* Start with 0b11111111 and test every bit
*/
u_int8_t octet = 0xFF;
for (int i = 0; i < 8; ++i) {
Util::unsetBit(octet, i);
EXPECT_FALSE(Util::isBitSet(octet, i));
}
}
void testUtilIsBitSet(Logger& logger) {
logger.info("Testing Util::isBitSet() method");
/**
* Test with 0b00000000
*/
u_int8_t octet = 0x00;
for (int i = 0; i < 8; ++i)
EXPECT_FALSE(Util::isBitSet(octet, i));
/**
* Test with 0b11111111
*/
octet = 0xFF;
for (int i = 0; i < 8; ++i)
EXPECT_TRUE(Util::isBitSet(octet, i));
}
void testUtilParse8byteInteger(Logger& logger) {
logger.info("Testing Util::parse8byteInteger() method");
unsigned char numerical[10] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99 };
u_int64_t integer = 0x00;
Util::parse8byteInteger(numerical, &integer);
EXPECT_EQ(0x0011223344556677, integer);
}
void testUtilParse4byteInteger(Logger& logger) {
logger.info("Testing Util::parse4byteInteger() method");
unsigned char numerical[10] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99 };
u_int32_t integer = 0x00;
Util::parse4byteInteger(numerical, &integer);
EXPECT_EQ(0x00112233, integer);
}
void testUtilParse2byteInteger(Logger& logger) {
logger.info("Testing Util::parse2byteInteger() method");
unsigned char numerical[10] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99 };
u_int16_t integer = 0x00;
Util::parse2byteInteger(numerical, &integer);
EXPECT_EQ(0x0011, integer);
}
void testUtilEncode8ByteInteger(Logger& logger) {
logger.info("Testing Util::encode8byteInteger() method");
vector<unsigned char> numericalDestination(8);
u_int64_t numericalSource = 0x0011223344556677;
unsigned char numericalExpected[8] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 };
EXPECT_TRUE(Util::encode8byteInteger(numericalDestination, 0, numericalSource));
for (int i = 0; i < 8; ++i)
EXPECT_EQ(numericalExpected[i], numericalDestination.at(i));
}
void testUtilEncode4ByteInteger(Logger& logger) {
logger.info("Testing Util::encode4byteInteger() method");
vector<unsigned char> numericalDestination(4);
u_int32_t numericalSource = 0x00112233;
unsigned char numericalExpected[4] = { 0x00, 0x11, 0x22, 0x33 };
EXPECT_TRUE(Util::encode4byteInteger(numericalDestination, 0, numericalSource));
for (int i = 0; i < 4; ++i)
EXPECT_EQ(numericalExpected[i], numericalDestination.at(i));
}
void testUtilEncode2ByteInteger(Logger& logger) {
logger.info("Testing Util::encode2byteInteger() method");
vector<unsigned char> numericalDestination(2);
u_int16_t numericalSource = 0x0011;
unsigned char numericalExpected[2] = { 0x00, 0x11 };
EXPECT_TRUE(Util::encode2byteInteger(numericalDestination, 0, numericalSource));
for (int i = 0; i < 2; ++i)
EXPECT_EQ(numericalExpected[i], numericalDestination.at(i));
}
void testUtilEncodeBits(Logger& logger) {
logger.info("Testing Util::encodeBits() method");
/**
* Encode '0b1100' (0x0C) into '0b11001100' (0xCC) starting from 3th bit
* and see if you get '0b11110000' (0xF0)
*/
u_int8_t octetSource = 0x0C;
u_int8_t octetDestination = 0xCC;
u_int8_t octetExpected = 0xF0;
EXPECT_TRUE(Util::encodeBits(octetDestination, 2, octetSource, 4));
EXPECT_EQ(octetExpected, octetDestination);
}
void testUtilSplit(Logger& logger) {
logger.info("Testing Util::split() method");
/**
* Check number of tokens and their content
*/
string testInput = "this||is|a|test|string";
vector<string> tokens = Util::split(testInput, '|');
EXPECT_EQ(6, tokens.size());
EXPECT_STREQ("this", tokens[0].c_str());
EXPECT_STREQ("", tokens[1].c_str());
EXPECT_STREQ("is", tokens[2].c_str());
EXPECT_STREQ("a", tokens[3].c_str());
EXPECT_STREQ("test", tokens[4].c_str());
EXPECT_STREQ("string", tokens[5].c_str());
}
void testUtilTrim(Logger& logger) {
logger.info("Testing Util::trim() method");
/**
* Check if given characters can be trimmed off
*/
string testInput = "|test|";
string testOutput = Util::trim(testInput, '|');
EXPECT_STREQ("test", testOutput.c_str());
testInput = " test ";
testOutput = Util::trim(testInput, ' ');
EXPECT_STREQ("test", testOutput.c_str());
}
void testUtilIsNumeric(Logger& logger) {
logger.info("Testing Util::isNumeric() method");
string numerical = "1234";
string notNumerical = "ab34";
EXPECT_TRUE(Util::isNumeric(numerical));
EXPECT_FALSE(Util::isNumeric(notNumerical));
}
void testGetListOfFiles(Logger& logger) {
logger.info("Testing Util::getListOfFiles() method");
vector<string> listOfFiles = Util::getListOfFiles("../data/confFiles/");
/**
* There are currently two configuration files in that directory
* and .svn file, this may change and updates will be necessary then,
* though
*
* We need to sort the vector first in order to ensure that the order
* of our check is correct
*/
std::sort(listOfFiles.begin(), listOfFiles.end());
EXPECT_EQ(3, listOfFiles.size());
EXPECT_STREQ(".svn", listOfFiles[0].c_str());
EXPECT_STREQ("testConfFile1.conf", listOfFiles[1].c_str());
EXPECT_STREQ("testConfFile2.conf", listOfFiles[2].c_str());
}
void testGetFileExtension(Logger& logger) {
logger.info("Testing Util::getFileExtension() method");
vector<string> fileNames;
fileNames.push_back(".svn");
fileNames.push_back("testFile.conf");
fileNames.push_back("testFile.xml.txt");
fileNames.push_back("testFile");
EXPECT_STREQ(".svn", Util::getFileExtension(fileNames[0]).c_str());
EXPECT_STREQ(".conf", Util::getFileExtension(fileNames[1]).c_str());
EXPECT_STREQ(".txt", Util::getFileExtension(fileNames[2]).c_str());
EXPECT_STREQ("", Util::getFileExtension(fileNames[3]).c_str());
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment