moved RAL-LTE from trunk/openair3 to extras/openair3

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7752 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
gauthier
2015-07-27 15:14:25 +00:00
parent 007544e1cd
commit aff0b84964
160 changed files with 0 additions and 44293 deletions
-674
View File
@@ -1,674 +0,0 @@
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>.
@@ -1,42 +0,0 @@
/*******************************************************************************
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
*******************************************************************************/
#define MIH_C_INTERFACE
#define MIH_C_C
#include "MIH_C.h"
//-----------------------------------------------------------------------------
void MIH_C_init(void)
{
//-----------------------------------------------------------------------------
}
//-----------------------------------------------------------------------------
void MIH_C_exit(void)
{
//-----------------------------------------------------------------------------
}
@@ -1,34 +0,0 @@
/*******************************************************************************
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
*******************************************************************************/
#define MIH_C_INTERFACE
#define MIH_C_F13_DATA_TYPES_FOR_INFORMATION_ELEMENTS_C
#include "MIH_C_F13_data_types_for_information_elements_codec.h"
@@ -1,392 +0,0 @@
/*******************************************************************************
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
*******************************************************************************/
#define MIH_C_INTERFACE
#define MIH_C_F1_BASIC_DATA_TYPES_CODEC_C
#include "MIH_C_F1_basic_data_types_codec.h"
#include <inttypes.h>
//-----------------------------------------------------------------------------
unsigned int MIH_C_BITMAP82String(MIH_C_BITMAP8_T* dataP, char* bufP)
{
//-----------------------------------------------------------------------------
return sprintf(bufP, "0x%02X", *dataP);
}
//-----------------------------------------------------------------------------
void MIH_C_BITMAP8_encode(Bit_Buffer_t* bbP, MIH_C_BITMAP8_T* dataP)
{
printf("[MIH_C] %s: %02X\n", __FUNCTION__, *dataP);
BitBuffer_write8(bbP, *dataP);
}
//-----------------------------------------------------------------------------
void MIH_C_BITMAP16_encode(Bit_Buffer_t* bbP, MIH_C_BITMAP16_T* dataP)
{
printf("[MIH_C] %s: %04X\n", __FUNCTION__, *dataP);
BitBuffer_write16(bbP, *dataP);
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_BITMAP162String(MIH_C_BITMAP16_T* dataP, char* bufP)
{
//-----------------------------------------------------------------------------
return sprintf(bufP, "0x%04X", *dataP);
}
//-----------------------------------------------------------------------------
void MIH_C_BITMAP24_encode(Bit_Buffer_t* bbP, MIH_C_BITMAP24_T* dataP)
{
//-----------------------------------------------------------------------------
printf("[MIH_C] %s: %02X%02X%02X\n", __FUNCTION__, dataP->val[0],dataP->val[1], dataP->val[2]);
MIH_C_BITMAP8_encode(bbP, &dataP->val[0]);
MIH_C_BITMAP8_encode(bbP, &dataP->val[1]);
MIH_C_BITMAP8_encode(bbP, &dataP->val[2]);
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_BITMAP242String(MIH_C_BITMAP24_T* dataP, char* bufP)
{
//-----------------------------------------------------------------------------
return sprintf(bufP, "0x%02X%02X%02X", dataP->val[0], dataP->val[1], dataP->val[2]);
}
//-----------------------------------------------------------------------------
void MIH_C_BITMAP32_encode(Bit_Buffer_t* bbP, MIH_C_BITMAP32_T* dataP)
{
printf("[MIH_C] %s: %08X\n", __FUNCTION__, *dataP);
BitBuffer_write32(bbP, *dataP);
}
//-----------------------------------------------------------------------------
void MIH_C_BITMAP64_encode(Bit_Buffer_t* bbP, MIH_C_BITMAP64_T* dataP)
{
//-----------------------------------------------------------------------------
printf("[MIH_C] %s: %16"PRIX64"\n", __FUNCTION__, *dataP);
BitBuffer_write32(bbP, (MIH_C_UNSIGNED_INT4_T)(*dataP>>32));
BitBuffer_write32(bbP, (MIH_C_UNSIGNED_INT4_T)*dataP);
}
//-----------------------------------------------------------------------------
void MIH_C_BITMAP128_encode(Bit_Buffer_t* bbP, MIH_C_BITMAP128_T* dataP)
{
//-----------------------------------------------------------------------------
printf("[MIH_C] %s: %16"PRIX64"%16"PRIX64"\n", __FUNCTION__, dataP->val[0], dataP->val[1]);
MIH_C_BITMAP64_encode(bbP, &dataP->val[0]);
MIH_C_BITMAP64_encode(bbP, &dataP->val[1]);
}
//-----------------------------------------------------------------------------
void MIH_C_BITMAP256_encode(Bit_Buffer_t* bbP, MIH_C_BITMAP256_T* dataP)
{
//-----------------------------------------------------------------------------
printf("[MIH_C] %s: %16"PRIX64"%16"PRIX64"%16"PRIX64"%16"PRIX64"\n", __FUNCTION__, dataP->val[0], dataP->val[1], dataP->val[2], dataP->val[3]);
MIH_C_BITMAP64_encode(bbP, &dataP->val[0]);
MIH_C_BITMAP64_encode(bbP, &dataP->val[1]);
MIH_C_BITMAP64_encode(bbP, &dataP->val[2]);
MIH_C_BITMAP64_encode(bbP, &dataP->val[3]);
}
//-----------------------------------------------------------------------------
void MIH_C_CHOICE_encode(Bit_Buffer_t* bbP, MIH_C_CHOICE_T* dataP)
{
//-----------------------------------------------------------------------------
BitBuffer_write8(bbP, *dataP);
}
//-----------------------------------------------------------------------------
void MIH_C_INTEGER1_encode(Bit_Buffer_t* bbP, MIH_C_INTEGER1_T* dataP)
{
//-----------------------------------------------------------------------------
BitBuffer_write8(bbP, *dataP);
}
//-----------------------------------------------------------------------------
void MIH_C_INTEGER2_encode(Bit_Buffer_t* bbP, MIH_C_INTEGER2_T* dataP)
{
//-----------------------------------------------------------------------------
BitBuffer_write16(bbP, *dataP);
}
//-----------------------------------------------------------------------------
void MIH_C_INTEGER4_encode(Bit_Buffer_t* bbP, MIH_C_INTEGER4_T* dataP)
{
//-----------------------------------------------------------------------------
BitBuffer_write32(bbP, *dataP);
}
//-----------------------------------------------------------------------------
void MIH_C_INTEGER8_encode(Bit_Buffer_t* bbP, MIH_C_INTEGER8_T* dataP)
{
//-----------------------------------------------------------------------------
BitBuffer_write32(bbP, (MIH_C_UNSIGNED_INT4_T)(*dataP>>32));
BitBuffer_write32(bbP, (MIH_C_UNSIGNED_INT4_T)*dataP);
}
//-----------------------------------------------------------------------------
void MIH_C_NULL_encode(Bit_Buffer_t* bbP, MIH_C_NULL_T* dataP)
{
;
}
//-----------------------------------------------------------------------------
void MIH_C_OCTET_encode(Bit_Buffer_t* bbP, MIH_C_F1_Generic_Octet_t *dataP, int lengthP)
{
//-----------------------------------------------------------------------------
BitBuffer_writeMem(bbP, dataP->val, lengthP);
}
//-----------------------------------------------------------------------------
void MIH_C_UNSIGNED_INT1_encode(Bit_Buffer_t* bbP, MIH_C_UNSIGNED_INT1_T* dataP)
{
printf("[MIH_C] %s: %02X\n", __FUNCTION__, *dataP);
BitBuffer_write8(bbP, *dataP);
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_UNSIGNED_INT12String(MIH_C_UNSIGNED_INT1_T* dataP, char* bufP)
{
//-----------------------------------------------------------------------------
return sprintf(bufP, "0x%02X", *dataP);
}
//-----------------------------------------------------------------------------
void MIH_C_UNSIGNED_INT2_encode(Bit_Buffer_t* bbP, MIH_C_UNSIGNED_INT2_T* dataP)
{
//-----------------------------------------------------------------------------
BitBuffer_write16(bbP, *dataP);
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_UNSIGNED_INT22String(MIH_C_UNSIGNED_INT2_T* dataP, char* bufP)
{
//-----------------------------------------------------------------------------
return sprintf(bufP, "0x%04X", *dataP);
}
//-----------------------------------------------------------------------------
void MIH_C_UNSIGNED_INT4_encode(Bit_Buffer_t* bbP, MIH_C_UNSIGNED_INT4_T* dataP)
{
//-----------------------------------------------------------------------------
BitBuffer_write32(bbP, *dataP);
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_UNSIGNED_INT42String(MIH_C_UNSIGNED_INT4_T* dataP, char* bufP)
{
//-----------------------------------------------------------------------------
return sprintf(bufP, "0x%08X", *dataP);
}
//-----------------------------------------------------------------------------
void MIH_C_UNSIGNED_INT8_encode(Bit_Buffer_t* bbP, MIH_C_UNSIGNED_INT8_T* dataP)
{
//-----------------------------------------------------------------------------
BitBuffer_write32(bbP, (MIH_C_UNSIGNED_INT4_T)(*dataP>>32));
BitBuffer_write32(bbP, (MIH_C_UNSIGNED_INT4_T)*dataP);
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_UNSIGNED_INT82String(MIH_C_UNSIGNED_INT8_T* dataP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index = sprintf(bufP, "0x%08x", (MIH_C_UNSIGNED_INT4_T)(*dataP>>32));
buffer_index = sprintf(&bufP[buffer_index], "%08x", (MIH_C_UNSIGNED_INT4_T)(*dataP));
return buffer_index;
\
}
//-----------------------------------------------------------------------------
void MIH_C_BITMAP8_decode(Bit_Buffer_t* bbP, MIH_C_BITMAP8_T* dataP)
{
*dataP = BitBuffer_read(bbP, 8);
}
//-----------------------------------------------------------------------------
void MIH_C_BITMAP16_decode(Bit_Buffer_t* bbP, MIH_C_BITMAP16_T* dataP)
{
*dataP = BitBuffer_read(bbP, 16);
}
//-----------------------------------------------------------------------------
void MIH_C_BITMAP24_decode(Bit_Buffer_t* bbP, MIH_C_BITMAP24_T* dataP)
{
//-----------------------------------------------------------------------------
MIH_C_BITMAP8_decode(bbP, &dataP->val[0]);
MIH_C_BITMAP8_decode(bbP, &dataP->val[1]);
MIH_C_BITMAP8_decode(bbP, &dataP->val[2]);
}
//-----------------------------------------------------------------------------
void MIH_C_BITMAP32_decode(Bit_Buffer_t* bbP, MIH_C_BITMAP32_T* dataP)
{
*dataP = BitBuffer_read(bbP, 32);
}
//-----------------------------------------------------------------------------
void MIH_C_BITMAP64_decode(Bit_Buffer_t* bbP, MIH_C_BITMAP64_T* dataP)
{
//-----------------------------------------------------------------------------
*dataP = BitBuffer_read(bbP, 32);
*dataP = *dataP << 32;
*dataP = *dataP | BitBuffer_read(bbP, 32);
}
//-----------------------------------------------------------------------------
void MIH_C_BITMAP128_decode(Bit_Buffer_t* bbP, MIH_C_BITMAP128_T* dataP)
{
//-----------------------------------------------------------------------------
MIH_C_BITMAP64_decode(bbP, &dataP->val[0]);
MIH_C_BITMAP64_decode(bbP, &dataP->val[1]);
}
//-----------------------------------------------------------------------------
void MIH_C_BITMAP256_decode(Bit_Buffer_t* bbP, MIH_C_BITMAP256_T* dataP)
{
//-----------------------------------------------------------------------------
MIH_C_BITMAP64_decode(bbP, &dataP->val[0]);
MIH_C_BITMAP64_decode(bbP, &dataP->val[1]);
MIH_C_BITMAP64_decode(bbP, &dataP->val[2]);
MIH_C_BITMAP64_decode(bbP, &dataP->val[3]);
}
//-----------------------------------------------------------------------------
void MIH_C_CHOICE_decode(Bit_Buffer_t* bbP, MIH_C_CHOICE_T* dataP)
{
*dataP = BitBuffer_read(bbP, sizeof(MIH_C_CHOICE_T)*8);
}
//-----------------------------------------------------------------------------
void MIH_C_INTEGER1_decode(Bit_Buffer_t* bbP, MIH_C_INTEGER1_T* dataP)
{
*dataP = BitBuffer_read(bbP, sizeof(MIH_C_INTEGER1_T)*8);
}
//-----------------------------------------------------------------------------
void MIH_C_INTEGER2_decode(Bit_Buffer_t* bbP, MIH_C_INTEGER2_T* dataP)
{
*dataP = BitBuffer_read(bbP, sizeof(MIH_C_INTEGER2_T)*8);
}
//-----------------------------------------------------------------------------
void MIH_C_INTEGER4_decode(Bit_Buffer_t* bbP, MIH_C_INTEGER4_T* dataP)
{
*dataP = BitBuffer_read(bbP, sizeof(MIH_C_INTEGER4_T)*8);
}
//-----------------------------------------------------------------------------
void MIH_C_INTEGER8_decode(Bit_Buffer_t* bbP, MIH_C_INTEGER8_T* dataP)
{
//-----------------------------------------------------------------------------
*dataP = BitBuffer_read(bbP, sizeof(MIH_C_INTEGER4_T)*8);
*dataP = *dataP << (sizeof(MIH_C_INTEGER4_T)*8);
*dataP = *dataP | BitBuffer_read(bbP, sizeof(MIH_C_INTEGER4_T)*8);
}
//-----------------------------------------------------------------------------
void MIH_C_NULL_decode(Bit_Buffer_t* bbP)
{
;
}
//-----------------------------------------------------------------------------
void MIH_C_OCTET_decode(Bit_Buffer_t* bbP, MIH_C_F1_Generic_Octet_t *dataP, int lengthP)
{
//-----------------------------------------------------------------------------
BitBuffer_readMem(bbP, dataP->val, lengthP);
}
//-----------------------------------------------------------------------------
void MIH_C_UNSIGNED_INT1_decode(Bit_Buffer_t* bbP, MIH_C_UNSIGNED_INT1_T* dataP)
{
*dataP = BitBuffer_read(bbP, sizeof(MIH_C_UNSIGNED_INT1_T)*8);
}
//-----------------------------------------------------------------------------
void MIH_C_UNSIGNED_INT2_decode(Bit_Buffer_t* bbP, MIH_C_UNSIGNED_INT2_T* dataP)
{
*dataP = BitBuffer_read(bbP, sizeof(MIH_C_UNSIGNED_INT2_T)*8);
}
//-----------------------------------------------------------------------------
void MIH_C_UNSIGNED_INT4_decode(Bit_Buffer_t* bbP, MIH_C_UNSIGNED_INT4_T* dataP)
{
*dataP = BitBuffer_read(bbP, sizeof(MIH_C_UNSIGNED_INT4_T)*8);
}
//-----------------------------------------------------------------------------
void MIH_C_UNSIGNED_INT8_decode(Bit_Buffer_t* bbP, MIH_C_UNSIGNED_INT8_T* dataP)
{
//-----------------------------------------------------------------------------
*dataP = BitBuffer_read(bbP, sizeof(MIH_C_UNSIGNED_INT4_T)*8);
*dataP = *dataP << 32;
*dataP = *dataP | BitBuffer_read(bbP, sizeof(MIH_C_UNSIGNED_INT4_T)*8);
}
//-----------------------------------------------------------------------------
void MIH_C_LIST_LENGTH_encode(Bit_Buffer_t* bbP, u_int16_t lengthP)
{
//-----------------------------------------------------------------------------
unsigned int num_more_bytes;
int length;
if (lengthP <= 128) {
#ifdef DEBUG_TRACE_DETAILS
printf("[MIH_C] %s: Length %02X\n", __FUNCTION__, lengthP);
#endif
BitBuffer_write8(bbP, (MIH_C_UNSIGNED_INT1_T)lengthP);
} else {
num_more_bytes = (lengthP - 128) / 255;
if (((lengthP - 128) % 255) != 0) {
num_more_bytes += 1;
}
printf("[MIH_C] %s: Length %02X on %d more bytes\n", __FUNCTION__, lengthP, num_more_bytes);
BitBuffer_write8(bbP, (MIH_C_UNSIGNED_INT1_T)(128 + num_more_bytes));
length = lengthP - 128;
while (length > 0) {
if (length >= 255) {
BitBuffer_write8(bbP, (MIH_C_UNSIGNED_INT1_T)(255));
length = length - 255;
} else {
BitBuffer_write8(bbP, (MIH_C_UNSIGNED_INT1_T)(length));
length = 0;
}
}
}
}
//-----------------------------------------------------------------------------
u_int16_t MIH_C_LIST_LENGTH_get_encode_num_bytes(u_int16_t lengthP)
{
//-----------------------------------------------------------------------------
unsigned int num_more_bytes;
if (lengthP <= 128) {
return sizeof (MIH_C_UNSIGNED_INT1_T);
} else {
num_more_bytes = (lengthP - 128) / 255;
if (((lengthP - 128) % 255) != 0) {
num_more_bytes += 1;
}
printf("[MIH_C] %s: Length %02X on %d more bytes\n", __FUNCTION__, lengthP, num_more_bytes);
return num_more_bytes + sizeof (MIH_C_UNSIGNED_INT1_T);
}
}
//-----------------------------------------------------------------------------
void MIH_C_LIST_LENGTH_decode(Bit_Buffer_t* bbP, u_int16_t *lengthP)
{
//-----------------------------------------------------------------------------
unsigned int num_more_bytes;
MIH_C_UNSIGNED_INT1_T byte1;
byte1 = BitBuffer_read(bbP, sizeof(MIH_C_UNSIGNED_INT1_T)*8);
if (byte1 >= 128) {
num_more_bytes = byte1 - 128;
*lengthP = 128;
while (num_more_bytes > 0) {
*lengthP = *lengthP + BitBuffer_read(bbP, sizeof(MIH_C_UNSIGNED_INT1_T)*8);
num_more_bytes = num_more_bytes - 1;
}
#ifdef DEBUG_TRACE_DETAILS
printf("[MIH_C] %s: Length %d \n", __FUNCTION__, *lengthP);
#endif
} else {
*lengthP = byte1;
#ifdef DEBUG_TRACE_DETAILS
printf("[MIH_C] %s: Length %d \n", __FUNCTION__, *lengthP);
#endif
}
}
@@ -1,80 +0,0 @@
/*******************************************************************************
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
*******************************************************************************/
#define MIH_C_INTERFACE
#define MIH_C_F2_GENERAL_DATA_TYPES_CODEC_C
#include "MIH_C_F2_general_data_types_codec.h"
//-----------------------------------------------------------------------------
unsigned int MIH_C_BOOLEAN2String(MIH_C_BOOLEAN_T* dataP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
if (*dataP != MIH_C_BOOLEAN_FALSE) {
buffer_index += sprintf(&bufP[buffer_index], "TRUE");
} else {
buffer_index += sprintf(&bufP[buffer_index], "FALSE");
}
return buffer_index;
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_STATUS2String(MIH_C_STATUS_T *statusP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
switch (*statusP) {
case MIH_C_STATUS_SUCCESS:
buffer_index += sprintf(&bufP[buffer_index], "STATUS_SUCCESS");
break;
case MIH_C_STATUS_UNSPECIFIED_FAILURE:
buffer_index += sprintf(&bufP[buffer_index], "STATUS_UNSPECIFIED_FAILURE");
break;
case MIH_C_STATUS_REJECTED:
buffer_index += sprintf(&bufP[buffer_index], "STATUS_REJECTED");
break;
case MIH_C_STATUS_AUTHORIZATION_FAILURE:
buffer_index += sprintf(&bufP[buffer_index], "STATUS_AUTHORIZATION_FAILURE");
break;
case MIH_C_STATUS_NETWORK_ERROR:
buffer_index += sprintf(&bufP[buffer_index], "STATUS_NETWORK_ERROR");
break;
default:
buffer_index += sprintf(&bufP[buffer_index], "UNKNOWN_STATUS");
}
return buffer_index;
}
@@ -1,202 +0,0 @@
/*******************************************************************************
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
*******************************************************************************/
#define MIH_C_INTERFACE
#define MIH_C_F3_DATA_TYPES_FOR_ADDRESS_CODEC_C
#include "MIH_C_F3_data_types_for_address_codec.h"
//-----------------------------------------------------------------------------
unsigned int MIH_C_3GPP_2G_CELL_ID2String(MIH_C_3GPP_2G_CELL_ID_T *dataP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index += sprintf(&bufP[buffer_index], "PLMN_ID = ");
buffer_index += MIH_C_PLMN_ID2String(&dataP->plmn_id, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "LAC = ");
buffer_index += MIH_C_LAC2String(&dataP->lac, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "CI = ");
buffer_index += MIH_C_CI2String(&dataP->ci, &bufP[buffer_index]);
return buffer_index;
}
//-----------------------------------------------------------------------------
void MIH_C_3GPP_2G_CELL_ID_encode(Bit_Buffer_t* bbP, MIH_C_3GPP_2G_CELL_ID_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_PLMN_ID_encode(bbP, &dataP->plmn_id);
MIH_C_LAC_encode(bbP, &dataP->lac);
MIH_C_CI_encode(bbP, &dataP->ci);
}
//-----------------------------------------------------------------------------
void MIH_C_3GPP_2G_CELL_ID_decode(Bit_Buffer_t* bbP, MIH_C_3GPP_2G_CELL_ID_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_PLMN_ID_decode(bbP, &dataP->plmn_id);
MIH_C_LAC_decode(bbP, &dataP->lac);
MIH_C_CI_decode(bbP, &dataP->ci);
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_3GPP_3G_CELL_ID2String(MIH_C_3GPP_3G_CELL_ID_T *dataP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index += MIH_C_PLMN_ID2String(&dataP->plmn_id, &bufP[buffer_index]);
buffer_index += MIH_C_CELL_ID2String(&dataP->cell_id, &bufP[buffer_index]);
return buffer_index;
}
//-----------------------------------------------------------------------------
void MIH_C_3GPP_3G_CELL_ID_encode(Bit_Buffer_t* bbP, MIH_C_3GPP_3G_CELL_ID_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_PLMN_ID_encode(bbP, &dataP->plmn_id);
MIH_C_CELL_ID_encode(bbP, &dataP->cell_id);
}
//-----------------------------------------------------------------------------
void MIH_C_3GPP_3G_CELL_ID_decode(Bit_Buffer_t* bbP, MIH_C_3GPP_3G_CELL_ID_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_PLMN_ID_decode(bbP, &dataP->plmn_id);
MIH_C_CELL_ID_decode(bbP, &dataP->cell_id);
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_LINK_ADDR2String(MIH_C_LINK_ADDR_T *dataP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
switch (dataP->choice) {
case MIH_C_CHOICE_MAC_ADDR:
buffer_index += sprintf(&bufP[buffer_index], "MAC_ADDR = ");
buffer_index += MIH_C_MAC_ADDR2String(&dataP->_union.mac_addr, &bufP[buffer_index]);
break;
case MIH_C_CHOICE_3GPP_3G_CELL_ID:
buffer_index += sprintf(&bufP[buffer_index], "3GPP_3G_CELL_ID = ");
buffer_index = MIH_C_3GPP_3G_CELL_ID2String(&dataP->_union._3gpp_3g_cell_id, &bufP[buffer_index]);
break;
case MIH_C_CHOICE_3GPP_2G_CELL_ID:
buffer_index += sprintf(&bufP[buffer_index], "3GPP_2G_CELL_ID = ");
buffer_index = MIH_C_3GPP_2G_CELL_ID2String(&dataP->_union._3gpp_2g_cell_id, &bufP[buffer_index]);
break;
case MIH_C_CHOICE_3GPP_ADDR:
buffer_index += sprintf(&bufP[buffer_index], "3GPP_ADDR = ");
buffer_index = MIH_C_3GPP_ADDR2String(&dataP->_union._3gpp_addr, &bufP[buffer_index]);
break;
case MIH_C_CHOICE_3GPP2_ADDR:
buffer_index += sprintf(&bufP[buffer_index], "3GPP2_ADDR = ");
buffer_index = MIH_C_3GPP2_ADDR2String(&dataP->_union._3gpp2_addr, &bufP[buffer_index]);
break;
case MIH_C_CHOICE_OTHER_L2_ADDR:
buffer_index += sprintf(&bufP[buffer_index], "OTHER_L2_ADDR = ");
buffer_index = MIH_C_OTHER_L2_ADDR2String(&dataP->_union.other_l2_addr, &bufP[buffer_index]);
break;
default:
buffer_index = sprintf(&bufP[buffer_index], "UNINITIALIZED ADDR");
}
return buffer_index;
}
//-----------------------------------------------------------------------------
void MIH_C_LINK_ADDR_encode(Bit_Buffer_t* bbP, MIH_C_LINK_ADDR_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_CHOICE_encode(bbP, &dataP->choice);
switch (dataP->choice) {
case MIH_C_CHOICE_MAC_ADDR:
MIH_C_MAC_ADDR_encode(bbP, &dataP->_union.mac_addr);
break;
case MIH_C_CHOICE_3GPP_3G_CELL_ID:
MIH_C_3GPP_3G_CELL_ID_encode(bbP, &dataP->_union._3gpp_3g_cell_id);
break;
case MIH_C_CHOICE_3GPP_2G_CELL_ID:
MIH_C_3GPP_2G_CELL_ID_encode(bbP, &dataP->_union._3gpp_2g_cell_id);
break;
case MIH_C_CHOICE_3GPP_ADDR:
MIH_C_3GPP_ADDR_encode(bbP, &dataP->_union._3gpp_addr);
break;
case MIH_C_CHOICE_3GPP2_ADDR:
MIH_C_3GPP2_ADDR_encode(bbP, &dataP->_union._3gpp2_addr);
break;
case MIH_C_CHOICE_OTHER_L2_ADDR:
MIH_C_OTHER_L2_ADDR_encode(bbP, &dataP->_union.other_l2_addr);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_ADDR_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
void MIH_C_LINK_ADDR_decode(Bit_Buffer_t* bbP, MIH_C_LINK_ADDR_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_CHOICE_decode(bbP, &dataP->choice);
switch (dataP->choice) {
case MIH_C_CHOICE_MAC_ADDR:
MIH_C_MAC_ADDR_decode(bbP, &dataP->_union.mac_addr);
break;
case MIH_C_CHOICE_3GPP_3G_CELL_ID:
MIH_C_3GPP_3G_CELL_ID_decode(bbP, &dataP->_union._3gpp_3g_cell_id);
break;
case MIH_C_CHOICE_3GPP_2G_CELL_ID:
MIH_C_3GPP_2G_CELL_ID_decode(bbP, &dataP->_union._3gpp_2g_cell_id);
break;
case MIH_C_CHOICE_3GPP_ADDR:
MIH_C_3GPP_ADDR_decode(bbP, &dataP->_union._3gpp_addr);
break;
case MIH_C_CHOICE_3GPP2_ADDR:
MIH_C_3GPP2_ADDR_decode(bbP, &dataP->_union._3gpp2_addr);
break;
case MIH_C_CHOICE_OTHER_L2_ADDR:
MIH_C_OTHER_L2_ADDR_decode(bbP, &dataP->_union.other_l2_addr);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_ADDR_T %d\n", dataP->choice);
}
}
File diff suppressed because it is too large Load Diff
@@ -1,274 +0,0 @@
/*******************************************************************************
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
*******************************************************************************/
#define MIH_C_INTERFACE
#define MIH_C_F9_DATA_TYPES_FOR_QOS_CODEC_C
#include "MIH_C_F9_data_types_for_qos_codec.h"
//-----------------------------------------------------------------------------
unsigned int MIH_C_MIN_PK_TX_DELAY2String(MIH_C_MIN_PK_TX_DELAY_T *dataP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index += sprintf(&bufP[buffer_index], "COS = ");
buffer_index += MIH_C_COS_ID2String(&dataP->cos_id, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "VAL = ");
buffer_index += MIH_C_UNSIGNED_INT22String(&dataP->value, &bufP[buffer_index]);
return buffer_index;
}
//-----------------------------------------------------------------------------
void MIH_C_MIN_PK_TX_DELAY_encode(Bit_Buffer_t* bbP, MIH_C_MIN_PK_TX_DELAY_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_COS_ID_encode(bbP, &dataP->cos_id);
MIH_C_UNSIGNED_INT2_encode(bbP, &dataP->value);
}
//-----------------------------------------------------------------------------
void MIH_C_MIN_PK_TX_DELAY_decode(Bit_Buffer_t* bbP, MIH_C_MIN_PK_TX_DELAY_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_COS_ID_decode(bbP, &dataP->cos_id);
MIH_C_UNSIGNED_INT2_decode(bbP, &dataP->value);
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_AVG_PK_TX_DELAY2String(MIH_C_AVG_PK_TX_DELAY_T *dataP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index += sprintf(&bufP[buffer_index], "COS = ");
buffer_index += MIH_C_COS_ID2String(&dataP->cos_id, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "VAL = ");
buffer_index += MIH_C_UNSIGNED_INT22String(&dataP->value, &bufP[buffer_index]);
return buffer_index;
}
//-----------------------------------------------------------------------------
void MIH_C_AVG_PK_TX_DELAY_encode(Bit_Buffer_t* bbP, MIH_C_AVG_PK_TX_DELAY_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_COS_ID_encode(bbP, &dataP->cos_id);
MIH_C_UNSIGNED_INT2_encode(bbP, &dataP->value);
}
//-----------------------------------------------------------------------------
void MIH_C_AVG_PK_TX_DELAY_decode(Bit_Buffer_t* bbP, MIH_C_AVG_PK_TX_DELAY_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_COS_ID_decode(bbP, &dataP->cos_id);
MIH_C_UNSIGNED_INT2_decode(bbP, &dataP->value);
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_MAX_PK_TX_DELAY2String(MIH_C_MAX_PK_TX_DELAY_T *dataP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index += sprintf(&bufP[buffer_index], "COS = ");
buffer_index += MIH_C_COS_ID2String(&dataP->cos_id, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "VAL = ");
buffer_index += MIH_C_UNSIGNED_INT22String(&dataP->value, &bufP[buffer_index]);
return buffer_index;
}
//-----------------------------------------------------------------------------
void MIH_C_MAX_PK_TX_DELAY_encode(Bit_Buffer_t* bbP, MIH_C_MAX_PK_TX_DELAY_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_COS_ID_encode(bbP, &dataP->cos_id);
MIH_C_UNSIGNED_INT2_encode(bbP, &dataP->value);
}
//-----------------------------------------------------------------------------
void MIH_C_MAX_PK_TX_DELAY_decode(Bit_Buffer_t* bbP, MIH_C_MAX_PK_TX_DELAY_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_COS_ID_decode(bbP, &dataP->cos_id);
MIH_C_UNSIGNED_INT2_decode(bbP, &dataP->value);
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_PK_DELAY_JITTER2String(MIH_C_PK_DELAY_JITTER_T *dataP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index += sprintf(&bufP[buffer_index], "COS = ");
buffer_index += MIH_C_COS_ID2String(&dataP->cos_id, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "VAL = ");
buffer_index += MIH_C_UNSIGNED_INT22String(&dataP->value, &bufP[buffer_index]);
return buffer_index;
}
//-----------------------------------------------------------------------------
void MIH_C_PK_DELAY_JITTER_encode(Bit_Buffer_t* bbP, MIH_C_PK_DELAY_JITTER_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_COS_ID_encode(bbP, &dataP->cos_id);
MIH_C_UNSIGNED_INT2_encode(bbP, &dataP->value);
}
//-----------------------------------------------------------------------------
void MIH_C_PK_DELAY_JITTER_decode(Bit_Buffer_t* bbP, MIH_C_PK_DELAY_JITTER_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_COS_ID_decode(bbP, &dataP->cos_id);
MIH_C_UNSIGNED_INT2_decode(bbP, &dataP->value);
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_PK_LOSS_RATE2String(MIH_C_PK_LOSS_RATE_T *dataP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index += sprintf(&bufP[buffer_index], "COS = ");
buffer_index += MIH_C_COS_ID2String(&dataP->cos_id, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "VAL = ");
buffer_index += MIH_C_UNSIGNED_INT22String(&dataP->value, &bufP[buffer_index]);
return buffer_index;
}
//-----------------------------------------------------------------------------
void MIH_C_PK_LOSS_RATE_encode(Bit_Buffer_t* bbP, MIH_C_PK_LOSS_RATE_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_COS_ID_encode(bbP, &dataP->cos_id);
MIH_C_UNSIGNED_INT2_encode(bbP, &dataP->value);
}
//-----------------------------------------------------------------------------
void MIH_C_PK_LOSS_RATE_decode(Bit_Buffer_t* bbP, MIH_C_PK_LOSS_RATE_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_COS_ID_decode(bbP, &dataP->cos_id);
MIH_C_UNSIGNED_INT2_decode(bbP, &dataP->value);
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_QOS_PARAM_VAL2String(MIH_C_QOS_PARAM_VAL_T *dataP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
switch (dataP->choice) {
case 0:
buffer_index += sprintf(&bufP[buffer_index], "NUM_QOS_TYPES = ");
buffer_index += MIH_C_NUM_COS_TYPES2String(&dataP->_union.num_qos_types, &bufP[buffer_index]);
break;
case 1:
buffer_index += sprintf(&bufP[buffer_index], "MIN_PK_TX_DELAY_LIST = ");
buffer_index += MIH_C_MIN_PK_TX_DELAY_LIST2String(&dataP->_union.min_pk_tx_delay_list, &bufP[buffer_index]);
break;
case 2:
buffer_index += sprintf(&bufP[buffer_index], "AVG_PK_TX_DELAY_LIST = ");
buffer_index += MIH_C_AVG_PK_TX_DELAY_LIST2String(&dataP->_union.avg_pk_tx_delay_list, &bufP[buffer_index]);
break;
case 3:
buffer_index += sprintf(&bufP[buffer_index], "MAX_PK_TX_DELAY_LIST = ");
buffer_index += MIH_C_MAX_PK_TX_DELAY_LIST2String(&dataP->_union.max_pk_tx_delay_list, &bufP[buffer_index]);
break;
case 4:
buffer_index += sprintf(&bufP[buffer_index], "PK_DELAY_JITTER_LIST = ");
buffer_index += MIH_C_PK_DELAY_JITTER_LIST2String(&dataP->_union.pk_delay_jitter_list, &bufP[buffer_index]);
break;
case 5:
buffer_index += sprintf(&bufP[buffer_index], "PK_LOSS_RATE_LIST = ");
buffer_index += MIH_C_PK_LOSS_RATE_LIST2String(&dataP->_union.pk_loss_rate_list, &bufP[buffer_index]);
break;
default:
buffer_index += sprintf(&bufP[buffer_index], "QOS_PARAM_VAL UNITIALIZED");
}
return buffer_index;
}
//-----------------------------------------------------------------------------
void MIH_C_QOS_PARAM_VAL_encode(Bit_Buffer_t* bbP, MIH_C_QOS_PARAM_VAL_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_CHOICE_encode(bbP, &dataP->choice);
switch (dataP->choice) {
case 0:
MIH_C_NUM_COS_TYPES_encode(bbP, &dataP->_union.num_qos_types);
break;
case 1:
MIH_C_MIN_PK_TX_DELAY_LIST_encode(bbP, &dataP->_union.min_pk_tx_delay_list);
break;
case 2:
MIH_C_AVG_PK_TX_DELAY_LIST_encode(bbP, &dataP->_union.avg_pk_tx_delay_list);
break;
case 3:
MIH_C_MAX_PK_TX_DELAY_LIST_encode(bbP, &dataP->_union.max_pk_tx_delay_list);
break;
case 4:
MIH_C_PK_DELAY_JITTER_LIST_encode(bbP, &dataP->_union.pk_delay_jitter_list);
break;
case 5:
MIH_C_PK_LOSS_RATE_LIST_encode(bbP, &dataP->_union.pk_loss_rate_list);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_QOS_PARAM_VAL_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
void MIH_C_QOS_PARAM_VAL_decode(Bit_Buffer_t* bbP, MIH_C_QOS_PARAM_VAL_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_CHOICE_decode(bbP, &dataP->choice);
switch (dataP->choice) {
case 0:
MIH_C_NUM_COS_TYPES_encode(bbP, &dataP->_union.num_qos_types);
break;
case 1:
MIH_C_MIN_PK_TX_DELAY_LIST_encode(bbP, &dataP->_union.min_pk_tx_delay_list);
break;
case 2:
MIH_C_AVG_PK_TX_DELAY_LIST_decode(bbP, &dataP->_union.avg_pk_tx_delay_list);
break;
case 3:
MIH_C_MAX_PK_TX_DELAY_LIST_decode(bbP, &dataP->_union.max_pk_tx_delay_list);
break;
case 4:
MIH_C_PK_DELAY_JITTER_LIST_decode(bbP, &dataP->_union.pk_delay_jitter_list);
break;
case 5:
MIH_C_PK_LOSS_RATE_LIST_decode(bbP, &dataP->_union.pk_loss_rate_list);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_QOS_PARAM_VAL_T %d\n", dataP->choice);
}
}
@@ -1,356 +0,0 @@
/*******************************************************************************
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
*******************************************************************************/
#define MIH_C_INTERFACE
#define MIH_C_L2_TYPE_VALUES_FOR_TLV_ENCODING_C
#include "MIH_C_L2_type_values_for_tlv_encoding.h"
//-----------------------------------------------------------------------------
unsigned int MIH_C_TLV2String(MIH_C_TLV_TYPE_T *typeP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
switch(*typeP) {
case MIH_C_TLV_SOURCE_MIHF_ID:
buffer_index += sprintf(&bufP[buffer_index], "TLV_SOURCE_MIHF_ID");
break;
case MIH_C_TLV_DESTINATION_MIHF_ID:
buffer_index += sprintf(&bufP[buffer_index], "TLV_DESTINATION_MIHF_ID");
break;
case MIH_C_TLV_STATUS:
buffer_index += sprintf(&bufP[buffer_index], "TLV_STATUS");
break;
case MIH_C_TLV_LINK_TYPE:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_TYPE");
break;
case MIH_C_TLV_MIH_EVENT_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_MIH_EVENT_LIST");
break;
case MIH_C_TLV_MIH_COMMAND_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_MIH_COMMAND_LIST");
break;
case MIH_C_TLV_MIIS_QUERY_TYPE_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_MIIS_QUERY_TYPE_LIST");
break;
case MIH_C_TLV_TRANSPORT_OPTION_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_TRANSPORT_OPTION_LIST");
break;
case MIH_C_TLV_LINK_ADDRESS_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_ADDRESS_LIST");
break;
case MIH_C_TLV_MBB_HANDOVER_SUPPORT:
buffer_index += sprintf(&bufP[buffer_index], "TLV_MBB_HANDOVER_SUPPORT");
break;
case MIH_C_TLV_REGISTER_REQUEST_CODE:
buffer_index += sprintf(&bufP[buffer_index], "TLV_REGISTER_REQUEST_CODE");
break;
case MIH_C_TLV_VALID_TIME_INTERVAL:
buffer_index += sprintf(&bufP[buffer_index], "TLV_VALID_TIME_INTERVAL");
break;
case MIH_C_TLV_LINK_IDENTIFIER:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_IDENTIFIER");
break;
case MIH_C_TLV_NEW_LINK_IDENTIFIER:
buffer_index += sprintf(&bufP[buffer_index], "TLV_NEW_LINK_IDENTIFIER");
break;
case MIH_C_TLV_OLD_ACCESS_ROUTER:
buffer_index += sprintf(&bufP[buffer_index], "TLV_OLD_ACCESS_ROUTER");
break;
case MIH_C_TLV_NEW_ACCESS_ROUTER:
buffer_index += sprintf(&bufP[buffer_index], "TLV_NEW_ACCESS_ROUTER");
break;
case MIH_C_TLV_IP_RENEWAL_FLAG:
buffer_index += sprintf(&bufP[buffer_index], "TLV_IP_RENEWAL_FLAG");
break;
case MIH_C_TLV_MOBILITY_MANAGEMENT_SUPPORT:
buffer_index += sprintf(&bufP[buffer_index], "TLV_MOBILITY_MANAGEMENT_SUPPORT");
break;
case MIH_C_TLV_IP_ADDRESS_CONFIGURATION_METHODS:
buffer_index += sprintf(&bufP[buffer_index], "TLV_IP_ADDRESS_CONFIGURATION_METHODS");
break;
case MIH_C_TLV_LINK_DOWN_REASON_CODE:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_DOWN_REASON_CODE");
break;
case MIH_C_TLV_LINK_TIME_INTERVAL:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_TIME_INTERVAL");
break;
case MIH_C_TLV_LINK_GOING_DOWN_REASON_CODE:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_GOING_DOWN_REASON_CODE");
break;
case MIH_C_TLV_LINK_PARAMETER_REPORT_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_PARAMETER_REPORT_LIST");
break;
case MIH_C_TLV_DEVICE_STATES_REQUEST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_DEVICE_STATES_REQUEST");
break;
case MIH_C_TLV_LINK_IDENTIFIER_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_IDENTIFIER_LIST");
break;
case MIH_C_TLV_DEVICE_STATES_RESPONSE_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_DEVICE_STATES_RESPONSE_LIST");
break;
case MIH_C_TLV_GET_STATUS_REQUEST_SET:
buffer_index += sprintf(&bufP[buffer_index], "TLV_GET_STATUS_REQUEST_SET");
break;
case MIH_C_TLV_GET_STATUS_RESPONSE_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_GET_STATUS_RESPONSE_LIST");
break;
case MIH_C_TLV_CONFIGURE_REQUEST_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_CONFIGURE_REQUEST_LIST");
break;
case MIH_C_TLV_CONFIGURE_RESPONSE_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_CONFIGURE_RESPONSE_LIST");
break;
case MIH_C_TLV_LIST_OF_LINK_POA_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LIST_OF_LINK_POA_LIST");
break;
case MIH_C_TLV_PREFERRED_LINK_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_PREFERRED_LINK_LIST");
break;
case MIH_C_TLV_HANDOVER_RESOURCE_QUERY_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_HANDOVER_RESOURCE_QUERY_LIST");
break;
case MIH_C_TLV_HANDOVER_STATUS:
buffer_index += sprintf(&bufP[buffer_index], "TLV_HANDOVER_STATUS");
break;
case MIH_C_TLV_ACCESS_ROUTER_ADDRESS:
buffer_index += sprintf(&bufP[buffer_index], "TLV_ACCESS_ROUTER_ADDRESS");
break;
case MIH_C_TLV_DHCP_SERVER_ADDRESS:
buffer_index += sprintf(&bufP[buffer_index], "TLV_DHCP_SERVER_ADDRESS");
break;
case MIH_C_TLV_FA_ADDRESS:
buffer_index += sprintf(&bufP[buffer_index], "TLV_FA_ADDRESS");
break;
case MIH_C_TLV_LINK_ACTIONS_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_ACTIONS_LIST");
break;
case MIH_C_TLV_LINK_ACTIONS_RESULT_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_ACTIONS_RESULT_LIST");
break;
case MIH_C_TLV_HANDOVER_RESULT:
buffer_index += sprintf(&bufP[buffer_index], "TLV_HANDOVER_RESULT");
break;
case MIH_C_TLV_RESOURCE_STATUS:
buffer_index += sprintf(&bufP[buffer_index], "TLV_RESOURCE_STATUS");
break;
case MIH_C_TLV_RESOURCE_RETENTION_STATUS:
buffer_index += sprintf(&bufP[buffer_index], "TLV_RESOURCE_RETENTION_STATUS");
break;
case MIH_C_TLV_INFO_QUERY_BINARY_DATA_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_INFO_QUERY_BINARY_DATA_LIST");
break;
case MIH_C_TLV_INFO_QUERY_RDF_DATA_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_INFO_QUERY_RDF_DATA_LIST");
break;
case MIH_C_TLV_INFO_QUERY_RDF_SCHEMA_URL:
buffer_index += sprintf(&bufP[buffer_index], "TLV_INFO_QUERY_RDF_SCHEMA_URL");
break;
case MIH_C_TLV_INFO_QUERY_RDF_SCHEMA_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_INFO_QUERY_RDF_SCHEMA_LIST");
break;
case MIH_C_TLV_MAX_RESPONSE_SIZE:
buffer_index += sprintf(&bufP[buffer_index], "TLV_MAX_RESPONSE_SIZE");
break;
case MIH_C_TLV_INFO_RESPONSE_BINARY_DATA_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_INFO_RESPONSE_BINARY_DATA_LIST");
break;
case MIH_C_TLV_INFO_RESPONSE_RDF_DATA_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_INFO_RESPONSE_RDF_DATA_LIST");
break;
case MIH_C_TLV_INFO_RESPONSE_RDF_SCHEMA_URL_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_INFO_RESPONSE_RDF_SCHEMA_URL_LIST");
break;
case MIH_C_TLV_INFO_RESPONSE_RDF_SCHEMA_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_INFO_RESPONSE_RDF_SCHEMA_LIST");
break;
case MIH_C_TLV_MOBILE_NODE_MIHF_ID:
buffer_index += sprintf(&bufP[buffer_index], "TLV_MOBILE_NODE_MIHF_ID");
break;
case MIH_C_TLV_QUERY_RESOURCE_REPORT_FLAG:
buffer_index += sprintf(&bufP[buffer_index], "TLV_QUERY_RESOURCE_REPORT_FLAG");
break;
case MIH_C_TLV_EVENT_CONFIGURATION_INFO_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_EVENT_CONFIGURATION_INFO_LIST");
break;
case MIH_C_TLV_TARGET_NETWORK_INFO:
buffer_index += sprintf(&bufP[buffer_index], "TLV_TARGET_NETWORK_INFO");
break;
case MIH_C_TLV_LIST_OF_TARGET_NETWORK_INFO:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LIST_OF_TARGET_NETWORK_INFO");
break;
case MIH_C_TLV_ASSIGNED_RESOURCE_SET:
buffer_index += sprintf(&bufP[buffer_index], "TLV_ASSIGNED_RESOURCE_SET");
break;
case MIH_C_TLV_LINK_DETECTED_INFO_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_DETECTED_INFO_LIST");
break;
case MIH_C_TLV_MN_LINK_ID:
buffer_index += sprintf(&bufP[buffer_index], "TLV_MN_LINK_ID");
break;
case MIH_C_TLV_POA:
buffer_index += sprintf(&bufP[buffer_index], "TLV_POA");
break;
case MIH_C_TLV_UNAUTHENTICATED_INFORMATION_REQUEST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_UNAUTHENTICATED_INFORMATION_REQUEST");
break;
case MIH_C_TLV_NETWORK_TYPE:
buffer_index += sprintf(&bufP[buffer_index], "TLV_NETWORK_TYPE");
break;
case MIH_C_TLV_REQUESTED_RESOURCE_SET:
buffer_index += sprintf(&bufP[buffer_index], "TLV_REQUESTED_RESOURCE_SET");
break;
#ifdef MIH_C_MEDIEVAL_EXTENSIONS
case MIH_C_TLV_LINK_EVENT_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_EVENT_LIST");
break;
case MIH_C_TLV_LINK_CMD_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_CMD_LIST");
break;
case MIH_C_TLV_LINK_PARAM_TYPE_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_PARAM_TYPE_LIST");
break;
case MIH_C_TLV_LINK_PARAMETERS_STATUS_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_PARAMETERS_STATUS_LIST");
break;
case MIH_C_TLV_LINK_STATES_REQ:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_STATES_REQ");
break;
case MIH_C_TLV_LINK_STATES_RSP_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_STATES_RSP_LIST");
break;
case MIH_C_TLV_LINK_DESC_REQ:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_DESC_REQ");
break;
case MIH_C_TLV_LINK_DESC_RSP_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_DESC_RSP_LIST");
break;
case MIH_C_TLV_LINK_ACTION:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_ACTION");
break;
case MIH_C_TLV_LINK_AC_RESULT:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_AC_RESULT");
break;
case MIH_C_TLV_LINK_SCAN_RSP_LIST:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_SCAN_RSP_LIST");
break;
case MIH_C_TLV_LINK_DET_INFO:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_DET_INFO");
break;
case MIH_C_TLV_LINK_INTERFACE_TYPE_ADDR:
buffer_index += sprintf(&bufP[buffer_index], "TLV_LINK_INTERFACE_TYPE_ADDR");
break;
case MIH_C_TLV_MOS_DSCV:
buffer_index += sprintf(&bufP[buffer_index], "TLV_MOS_DSCV");
break;
#endif
default:
buffer_index += sprintf(&bufP[buffer_index], "UNKNOWN TLV");
}
return buffer_index;
}
@@ -1,671 +0,0 @@
/*******************************************************************************
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
*******************************************************************************/
#ifdef MIH_C_MEDIEVAL_EXTENSIONS
#define MIH_C_INTERFACE
#define MIH_C_MEDIEVAL_EXTENSIONS_C
#include "MIH_C_Medieval_extensions.h"
//-----------------------------------------------------------------------------
unsigned int MIH_C_PROTO2String(MIH_C_PROTO_T *protoP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
switch (*protoP) {
case MIH_C_PROTO_TCP:
buffer_index += sprintf(&bufP[buffer_index], "TCP");
break;
case MIH_C_PROTO_UDP:
buffer_index += sprintf(&bufP[buffer_index], "UDP");
break;
default:
buffer_index += sprintf(&bufP[buffer_index], "UNKNOWN_PROTO");
}
return buffer_index;
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_IP_TUPLE2String(MIH_C_IP_TUPLE_T *dataP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index += sprintf(&bufP[buffer_index], "IP_ADDR = ");
buffer_index += MIH_C_IP_ADDR2String(&dataP->ip_addr, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nPORT = ");
buffer_index += MIH_C_PORT2String(&dataP->port, &bufP[buffer_index]);
return buffer_index;
}
//-----------------------------------------------------------------------------
void MIH_C_IP_TUPLE_encode(Bit_Buffer_t* bbP, MIH_C_IP_TUPLE_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_IP_ADDR_encode(bbP, &dataP->ip_addr);
MIH_C_PORT_encode(bbP, &dataP->port);
}
//-----------------------------------------------------------------------------
void MIH_C_IP_TUPLE_decode(Bit_Buffer_t* bbP, MIH_C_IP_TUPLE_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_IP_ADDR_decode(bbP, &dataP->ip_addr);
MIH_C_PORT_decode(bbP, &dataP->port);
}
/*//-----------------------------------------------------------------------------
unsigned int MIH_C_FLOW_ID2String(MIH_C_FLOW_ID_T *dataP, char* bufP) {
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index += sprintf(&bufP[buffer_index], "IP_TUPLE SRC = ");
buffer_index += MIH_C_IP_TUPLE2String(&dataP->source_addr, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nIP_TUPLE DEST = ");
buffer_index += MIH_C_IP_TUPLE2String(&dataP->dest_addr, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nPROTO = ");
buffer_index += MIH_C_PROTO2String(&dataP->transport_protocol, &bufP[buffer_index]);
return buffer_index;
}
//-----------------------------------------------------------------------------
inline void MIH_C_FLOW_ID_encode(Bit_Buffer_t* bbP, MIH_C_FLOW_ID_T *dataP) {
//-----------------------------------------------------------------------------
MIH_C_IP_TUPLE_encode(bbP, &dataP->source_addr);
MIH_C_IP_TUPLE_encode(bbP, &dataP->dest_addr);
MIH_C_PROTO_encode(bbP, &dataP->transport_protocol);
}
//-----------------------------------------------------------------------------
inline void MIH_C_FLOW_ID_decode(Bit_Buffer_t* bbP, MIH_C_FLOW_ID_T *dataP) {
//-----------------------------------------------------------------------------
MIH_C_IP_TUPLE_decode(bbP, &dataP->source_addr);
MIH_C_IP_TUPLE_decode(bbP, &dataP->dest_addr);
MIH_C_PROTO_decode(bbP, &dataP->transport_protocol);
}*/
//-----------------------------------------------------------------------------
unsigned int MIH_C_MARK2String(MIH_C_MARK_T *dataP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
switch (dataP->choice) {
case 0:
buffer_index += sprintf(&bufP[buffer_index], "DSCP MASK = ");
buffer_index += MIH_C_BITMAP82String(&dataP->_union.dscp_mask, &bufP[buffer_index]);
break;
case 1:
buffer_index += sprintf(&bufP[buffer_index], "FLOW LABEL = ");
buffer_index += MIH_C_BITMAP242String(&dataP->_union.flow_label_mask, &bufP[buffer_index]);
break;
default:
buffer_index += sprintf(&bufP[buffer_index], "MARK UNINITIALIZED ");
}
return buffer_index;
}
//-----------------------------------------------------------------------------
void MIH_C_MARK_encode(Bit_Buffer_t* bbP, MIH_C_MARK_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_CHOICE_encode(bbP, &dataP->choice);
switch (dataP->choice) {
case 0:
MIH_C_BITMAP8_encode(bbP, &dataP->_union.dscp_mask);
break;
case 1:
MIH_C_BITMAP24_encode(bbP, &dataP->_union.flow_label_mask);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_MARK_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
void MIH_C_MARK_decode(Bit_Buffer_t* bbP, MIH_C_MARK_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_CHOICE_decode(bbP, &dataP->choice);
switch (dataP->choice) {
case 0:
MIH_C_BITMAP8_decode(bbP, &dataP->_union.dscp_mask);
break;
case 1:
MIH_C_BITMAP24_decode(bbP, &dataP->_union.flow_label_mask);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_MARK_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_QOS2String(MIH_C_QOS_T *dataP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
switch (dataP->choice) {
case 0:
buffer_index += sprintf(&bufP[buffer_index], "MAX_DELAY = ");
buffer_index += MIH_C_MAX_DELAY2String(&dataP->_union.mark_qos.max_delay, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "BITRATE = ");
buffer_index += MIH_C_BITRATE2String(&dataP->_union.mark_qos.bitrate, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "JITTER = ");
buffer_index += MIH_C_JITTER2String(&dataP->_union.mark_qos.jitter, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "PKT_LOSS_RATE = ");
buffer_index += MIH_C_PKT_LOSS_RATE2String(&dataP->_union.mark_qos.pkt_loss, &bufP[buffer_index]);
break;
case 1:
buffer_index += sprintf(&bufP[buffer_index], "COS = ");
buffer_index += MIH_C_COS2String(&dataP->_union.cos, &bufP[buffer_index]);
break;
default:
buffer_index += sprintf(&bufP[buffer_index], "QOS UNINITIALIZED ");
}
return buffer_index;
}
//-----------------------------------------------------------------------------
void MIH_C_QOS_encode(Bit_Buffer_t* bbP, MIH_C_QOS_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_CHOICE_encode(bbP, &dataP->choice);
switch (dataP->choice) {
case 0:
MIH_C_MAX_DELAY_encode(bbP, &dataP->_union.mark_qos.max_delay);
MIH_C_BITRATE_encode(bbP, &dataP->_union.mark_qos.bitrate);
MIH_C_JITTER_encode(bbP, &dataP->_union.mark_qos.jitter);
MIH_C_PKT_LOSS_RATE_encode(bbP, &dataP->_union.mark_qos.pkt_loss);
break;
case 1:
MIH_C_COS_encode(bbP, &dataP->_union.cos);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_QOS_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
void MIH_C_QOS_decode(Bit_Buffer_t* bbP, MIH_C_QOS_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_CHOICE_decode(bbP, &dataP->choice);
switch (dataP->choice) {
case 0:
MIH_C_MAX_DELAY_decode(bbP, &dataP->_union.mark_qos.max_delay);
MIH_C_BITRATE_decode(bbP, &dataP->_union.mark_qos.bitrate);
MIH_C_JITTER_decode(bbP, &dataP->_union.mark_qos.jitter);
MIH_C_PKT_LOSS_RATE_decode(bbP, &dataP->_union.mark_qos.pkt_loss);
break;
case 1:
MIH_C_COS_decode(bbP, &dataP->_union.cos);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_QOS_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_RESOURCE_DESC2String(MIH_C_RESOURCE_DESC_T *dataP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index += sprintf(&bufP[buffer_index], "LINK_ID = ");
buffer_index += MIH_C_LINK_ID2String(&dataP->link_id, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nFLOW_ID = ");
buffer_index += MIH_C_FLOW_ID2String(&dataP->flow_id, &bufP[buffer_index]);
switch (dataP->choice_link_data_rate) {
case 0:
buffer_index += sprintf(&bufP[buffer_index], "\nLINK_DATA_RATE = NULL");
break;
case 1:
buffer_index += sprintf(&bufP[buffer_index], "\nLINK_DATA_RATE = ");
buffer_index += MIH_C_LINK_DATA_RATE2String(&dataP->_union_link_data_rate.link_data_rate, &bufP[buffer_index]);
break;
default:
buffer_index += sprintf(&bufP[buffer_index], "\nLINK_DATA_RATE UNINITIALIZED ");
}
switch (dataP->choice_qos) {
case 0:
buffer_index += sprintf(&bufP[buffer_index], "\nQOS = NULL");
break;
case 1:
buffer_index += sprintf(&bufP[buffer_index], "\nQOS = ");
buffer_index += MIH_C_QOS2String(&dataP->_union_qos.qos, &bufP[buffer_index]);
break;
default:
buffer_index += sprintf(&bufP[buffer_index], "\nQOS UNINITIALIZED ");
}
switch (dataP->choice_jumbo_enable) {
case 0:
buffer_index += sprintf(&bufP[buffer_index], "\nJUMBO_ENABLE = NULL");
break;
case 1:
buffer_index += sprintf(&bufP[buffer_index], "\nJUMBO_ENABLE = ");
buffer_index += MIH_C_JUMBO_ENABLE2String(&dataP->_union_jumbo_enable.jumbo_enable, &bufP[buffer_index]);
break;
default:
buffer_index += sprintf(&bufP[buffer_index], "\nJUMBO_ENABLE UNINITIALIZED ");
}
switch (dataP->choice_multicast_enable) {
case 0:
buffer_index += sprintf(&bufP[buffer_index], "\nMULTICAST_ENABLE = NULL");
break;
case 1:
buffer_index += sprintf(&bufP[buffer_index], "\nMULTICAST_ENABLE = ");
buffer_index += MIH_C_MULTICAST_ENABLE2String(&dataP->_union_multicast_enable.multicast_enable, &bufP[buffer_index]);
break;
default:
buffer_index += sprintf(&bufP[buffer_index], "\nMULTICAST_ENABLE UNINITIALIZED ");
}
return buffer_index;
}
//-----------------------------------------------------------------------------
void MIH_C_RESOURCE_DESC_encode(Bit_Buffer_t* bbP, MIH_C_RESOURCE_DESC_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_LINK_ID_encode(bbP, &dataP->link_id);
MIH_C_FLOW_ID_encode(bbP, &dataP->flow_id);
MIH_C_CHOICE_encode(bbP, &dataP->choice_link_data_rate);
switch (dataP->choice_link_data_rate) {
case 0:
break;
case 1:
MIH_C_LINK_DATA_RATE_encode(bbP, &dataP->_union_link_data_rate.link_data_rate);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE choice_link_data_rate OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_link_data_rate);
}
MIH_C_CHOICE_encode(bbP, &dataP->choice_qos);
switch (dataP->choice_qos) {
case 0:
break;
case 1:
MIH_C_QOS_encode(bbP, &dataP->_union_qos.qos);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE choice_qos OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_qos);
}
MIH_C_CHOICE_encode(bbP, &dataP->choice_jumbo_enable);
switch (dataP->choice_jumbo_enable) {
case 0:
break;
case 1:
MIH_C_JUMBO_ENABLE_encode(bbP, &dataP->_union_jumbo_enable.jumbo_enable);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE choice_jumbo_enable OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_jumbo_enable);
}
MIH_C_CHOICE_encode(bbP, &dataP->choice_multicast_enable);
switch (dataP->choice_multicast_enable) {
case 0:
break;
case 1:
MIH_C_MULTICAST_ENABLE_encode(bbP, &dataP->_union_multicast_enable.multicast_enable);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE choice_multicast_enable OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_multicast_enable);
}
}
//-----------------------------------------------------------------------------
void MIH_C_RESOURCE_DESC_decode(Bit_Buffer_t* bbP, MIH_C_RESOURCE_DESC_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_LINK_ID_decode(bbP, &dataP->link_id);
MIH_C_FLOW_ID_decode(bbP, &dataP->flow_id);
MIH_C_CHOICE_decode(bbP, &dataP->choice_link_data_rate);
switch (dataP->choice_link_data_rate) {
case 0:
break;
case 1:
MIH_C_LINK_DATA_RATE_decode(bbP, &dataP->_union_link_data_rate.link_data_rate);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE choice_link_data_rate OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_link_data_rate);
}
MIH_C_CHOICE_decode(bbP, &dataP->choice_qos);
switch (dataP->choice_qos) {
case 0:
break;
case 1:
MIH_C_QOS_decode(bbP, &dataP->_union_qos.qos);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE choice_qos OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_qos);
}
MIH_C_CHOICE_decode(bbP, &dataP->choice_jumbo_enable);
switch (dataP->choice_jumbo_enable) {
case 0:
break;
case 1:
MIH_C_JUMBO_ENABLE_decode(bbP, &dataP->_union_jumbo_enable.jumbo_enable);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE choice_jumbo_enable OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_jumbo_enable);
}
MIH_C_CHOICE_decode(bbP, &dataP->choice_multicast_enable);
switch (dataP->choice_multicast_enable) {
case 0:
break;
case 1:
MIH_C_MULTICAST_ENABLE_decode(bbP, &dataP->_union_multicast_enable.multicast_enable);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE choice_multicast_enable OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_multicast_enable);
}
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_FLOW_ATTRIBUTE2String(MIH_C_FLOW_ATTRIBUTE_T *dataP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
switch (dataP->choice_multicast_enable) {
case 0:
buffer_index += sprintf(&bufP[buffer_index], "MULTICAST_ENABLE = NULL");
break;
case 1:
buffer_index += sprintf(&bufP[buffer_index], "MULTICAST_ENABLE = ");
buffer_index += MIH_C_MULTICAST_ENABLE2String(&dataP->_union_multicast_enable.multicast_enable, &bufP[buffer_index]);
break;
default:
buffer_index += sprintf(&bufP[buffer_index], "MULTICAST_ENABLE UNINITIALIZED ");
}
switch (dataP->choice_mark_qos) {
case 0:
buffer_index += sprintf(&bufP[buffer_index], "\nMARK_QOS = NULL");
break;
case 1:
buffer_index += sprintf(&bufP[buffer_index], "\nMARK = ");
buffer_index += MIH_C_MARK2String(&dataP->_union_mark_qos.mark_qos.mark, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nQOS = ");
buffer_index += MIH_C_QOS2String(&dataP->_union_mark_qos.mark_qos.qos, &bufP[buffer_index]);
break;
default:
buffer_index += sprintf(&bufP[buffer_index], "\nMARK_QOS UNINITIALIZED ");
}
switch (dataP->choice_mark_drop_eligibility) {
case 0:
buffer_index += sprintf(&bufP[buffer_index], "\nMARK_DROP_ELIGIBILITY = NULL");
break;
case 1:
buffer_index += sprintf(&bufP[buffer_index], "\nMARK = ");
buffer_index += MIH_C_MARK2String(&dataP->_union_mark_drop_eligibility.mark_drop_eligibility.mark, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nDROP_ELIGIBILITY = ");
buffer_index += MIH_C_DROP_ELIGIBILITY2String(&dataP->_union_mark_drop_eligibility.mark_drop_eligibility.drop_eligibility, &bufP[buffer_index]);
break;
default:
buffer_index += sprintf(&bufP[buffer_index], "\nMARK_DROP_ELIGIBILITY UNINITIALIZED ");
}
return buffer_index;
}
//-----------------------------------------------------------------------------
void MIH_C_FLOW_ATTRIBUTE_encode(Bit_Buffer_t* bbP, MIH_C_FLOW_ATTRIBUTE_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_FLOW_ID_encode(bbP, &dataP->flow_id);
MIH_C_CHOICE_encode(bbP, &dataP->choice_multicast_enable);
switch (dataP->choice_multicast_enable) {
case 0:
break;
case 1:
MIH_C_MULTICAST_ENABLE_encode(bbP, &dataP->_union_multicast_enable.multicast_enable);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE choice_multicast_enable OF MIH_C_FLOW_ATTRIBUTE_T %d\n", dataP->choice_multicast_enable);
}
MIH_C_CHOICE_encode(bbP, &dataP->choice_mark_qos);
switch (dataP->choice_mark_qos) {
case 0:
break;
case 1:
MIH_C_MARK_encode(bbP, &dataP->_union_mark_qos.mark_qos.mark);
MIH_C_QOS_encode(bbP, &dataP->_union_mark_qos.mark_qos.qos);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE choice_mark_qos OF MIH_C_FLOW_ATTRIBUTE_T %d\n", dataP->choice_mark_qos);
}
MIH_C_CHOICE_encode(bbP, &dataP->choice_mark_drop_eligibility);
switch (dataP->choice_mark_drop_eligibility) {
case 0:
break;
case 1:
MIH_C_MARK_encode(bbP, &dataP->_union_mark_drop_eligibility.mark_drop_eligibility.mark);
MIH_C_DROP_ELIGIBILITY_encode(bbP, &dataP->_union_mark_drop_eligibility.mark_drop_eligibility.drop_eligibility);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE choice_mark_drop_eligibility OF MIH_C_FLOW_ATTRIBUTE_T %d\n", dataP->choice_mark_drop_eligibility);
}
}
//-----------------------------------------------------------------------------
void MIH_C_FLOW_ATTRIBUTE_decode(Bit_Buffer_t* bbP, MIH_C_FLOW_ATTRIBUTE_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_FLOW_ID_decode(bbP, &dataP->flow_id);
MIH_C_CHOICE_decode(bbP, &dataP->choice_multicast_enable);
switch (dataP->choice_multicast_enable) {
case 0:
break;
case 1:
MIH_C_MULTICAST_ENABLE_decode(bbP, &dataP->_union_multicast_enable.multicast_enable);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE choice_multicast_enable OF MIH_C_FLOW_ATTRIBUTE_T %d\n", dataP->choice_multicast_enable);
}
MIH_C_CHOICE_decode(bbP, &dataP->choice_mark_qos);
switch (dataP->choice_mark_qos) {
case 0:
break;
case 1:
MIH_C_MARK_decode(bbP, &dataP->_union_mark_qos.mark_qos.mark);
MIH_C_QOS_decode(bbP, &dataP->_union_mark_qos.mark_qos.qos);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE choice_mark_qos OF MIH_C_FLOW_ATTRIBUTE_T %d\n", dataP->choice_mark_qos);
}
MIH_C_CHOICE_decode(bbP, &dataP->choice_mark_drop_eligibility);
switch (dataP->choice_mark_drop_eligibility) {
case 0:
break;
case 1:
MIH_C_MARK_decode(bbP, &dataP->_union_mark_drop_eligibility.mark_drop_eligibility.mark);
MIH_C_DROP_ELIGIBILITY_decode(bbP, &dataP->_union_mark_drop_eligibility.mark_drop_eligibility.drop_eligibility);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE choice_mark_drop_eligibility OF MIH_C_FLOW_ATTRIBUTE_T %d\n", dataP->choice_mark_drop_eligibility);
}
}
//-----------------------------------------------------------------------------
unsigned int MIH_C_LINK_AC_PARAM2String(MIH_C_LINK_AC_PARAM_T *dataP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
switch (dataP->choice) {
case 0:
buffer_index += sprintf(&bufP[buffer_index], "NULL");
break;
case 1:
buffer_index += sprintf(&bufP[buffer_index], "FLOW_ATTRIBUTE=");
buffer_index += MIH_C_FLOW_ATTRIBUTE2String(&dataP->_union.flow_attribute, &bufP[buffer_index]);
break;
case 2:
buffer_index += sprintf(&bufP[buffer_index], "RESOURCE_DESC=");
buffer_index += MIH_C_RESOURCE_DESC2String(&dataP->_union.resource_desc, &bufP[buffer_index]);
break;
default:
buffer_index += sprintf(&bufP[buffer_index], "UNINITIALIZED ");
}
return buffer_index;
}
//-----------------------------------------------------------------------------
void MIH_C_LINK_AC_PARAM_encode(Bit_Buffer_t* bbP, MIH_C_LINK_AC_PARAM_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_CHOICE_encode(bbP, &dataP->choice);
switch (dataP->choice) {
case 0:
break;
case 1:
MIH_C_FLOW_ATTRIBUTE_encode(bbP, &dataP->_union.flow_attribute);
break;
case 2:
MIH_C_RESOURCE_DESC_encode(bbP, &dataP->_union.resource_desc);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_AC_PARAM_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
void MIH_C_LINK_AC_PARAM_decode(Bit_Buffer_t* bbP, MIH_C_LINK_AC_PARAM_T *dataP)
{
//-----------------------------------------------------------------------------
MIH_C_CHOICE_decode(bbP, &dataP->choice);
switch (dataP->choice) {
case 0:
break;
case 1:
MIH_C_FLOW_ATTRIBUTE_decode(bbP, &dataP->_union.flow_attribute);
break;
case 2:
MIH_C_RESOURCE_DESC_decode(bbP, &dataP->_union.resource_desc);
break;
default:
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_AC_PARAM_T %d\n", dataP->choice);
}
}
#endif
@@ -1,528 +0,0 @@
/*******************************************************************************
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
*******************************************************************************/
#define MIH_C_INTERFACE
#define MRALLTEINT_BIT_BUFFER_C
//-----------------------------------------------------------------------------
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <arpa/inet.h>
#include <stdio.h>
//-----------------------------------------------------------------------------
#include "MIH_C_bit_buffer.h"
//-----------------------------------------------------------------------------
Bit_Buffer_t* new_BitBuffer_0(void)
//-----------------------------------------------------------------------------
{
Bit_Buffer_t* bb = malloc(sizeof(Bit_Buffer_t));
bb->m_buffer_allocated_by_this = BIT_BUFFER_FALSE;
bb->m_buffer = 0;
bb->m_byte_position = 0;
bb->m_bit_mod_8_position = 0;
bb->m_capacity = 0;
bb->m_limit = 0;
return bb;
}
//-----------------------------------------------------------------------------
Bit_Buffer_t* new_BitBuffer_1(unsigned int capacityP)
//-----------------------------------------------------------------------------
{
Bit_Buffer_t* bb = malloc(sizeof(Bit_Buffer_t));
bb->m_buffer_allocated_by_this = BIT_BUFFER_TRUE;
bb->m_buffer = malloc(capacityP);
memset(bb->m_buffer, 0, capacityP);
bb->m_byte_position = 0;
bb->m_bit_mod_8_position = 0;
bb->m_capacity = capacityP;
bb->m_limit = 0;
return bb;
}
//-----------------------------------------------------------------------------
Bit_Buffer_t* new_BitBuffer_2(unsigned char* bufferP, unsigned int capacityP)
//-----------------------------------------------------------------------------
{
Bit_Buffer_t* bb = malloc(sizeof(Bit_Buffer_t));
bb->m_buffer_allocated_by_this = BIT_BUFFER_FALSE;
bb->m_buffer = bufferP;
bb->m_byte_position = 0;
bb->m_bit_mod_8_position = 0;
bb->m_limit = 0;
bb->m_capacity = capacityP;
return bb;
}
//-----------------------------------------------------------------------------
void BitBuffer_wrap(Bit_Buffer_t* bbP, unsigned char* bufferP, unsigned int capacityP)
//-----------------------------------------------------------------------------
{
if ((bbP->m_buffer != 0) && (bbP->m_buffer != bufferP)) {
free(bbP->m_buffer);
}
bbP->m_buffer_allocated_by_this = BIT_BUFFER_FALSE;
bbP->m_buffer = bufferP;
bbP->m_byte_position = 0;
bbP->m_bit_mod_8_position = 0;
bbP->m_limit = capacityP;
bbP->m_capacity = capacityP;
}
//-----------------------------------------------------------------------------
u_int32_t BitBuffer_read32(Bit_Buffer_t* bbP)
//-----------------------------------------------------------------------------
{
return (u_int32_t)(BitBuffer_read(bbP, 32));
}
//-----------------------------------------------------------------------------
u_int32_t BitBuffer_read32littleendian(Bit_Buffer_t* bbP)
//-----------------------------------------------------------------------------
{
return (u_int32_t)(ntohl(BitBuffer_read(bbP,32)));
}
//-----------------------------------------------------------------------------
u_int16_t BitBuffer_read16(Bit_Buffer_t* bbP)
//-----------------------------------------------------------------------------
{
return (u_int16_t)(BitBuffer_read(bbP,16));
}
//-----------------------------------------------------------------------------
u_int16_t BitBuffer_read16littleendian(Bit_Buffer_t* bbP)
//-----------------------------------------------------------------------------
{
return (u_int16_t)(ntohs((u_int16_t)(BitBuffer_read(bbP, 16))));
}
//-----------------------------------------------------------------------------
unsigned char BitBuffer_read8(Bit_Buffer_t* bbP)
//-----------------------------------------------------------------------------
{
return (u_int8_t)(BitBuffer_read(bbP,8));
}
//-----------------------------------------------------------------------------
u_int8_t BitBuffer_readBool(Bit_Buffer_t* bbP)
//-----------------------------------------------------------------------------
{
return (u_int8_t)(BitBuffer_read(bbP,1));
}
//-----------------------------------------------------------------------------
u_int32_t BitBuffer_read(Bit_Buffer_t* bbP, const unsigned int nb_bitsP)
//-----------------------------------------------------------------------------
{
u_int64_t data_l = 0;
u_int32_t mask = 0xFFFFFFFFL;
u_int32_t bit_index_l = bbP->m_bit_mod_8_position;
int32_t bit_length_l = nb_bitsP;
u_int32_t byte_index_l = bbP->m_byte_position;
u_int32_t rotate_l = 0;
//cout << dec << "BitBuffer_read(" << nb_bitsP << ")"<< endl;
if (BitBuffer_isCheckReadOverflowOK(bbP, nb_bitsP)) {
if (nb_bitsP > (sizeof(unsigned long)*8)) {
printf("[MIH_C] ERROR BitBuffer_read nb bits too large - must be <= sizeof(long int)*8");
} else {
do {
data_l = data_l << 8;
data_l = data_l | (unsigned long long int)(bbP->m_buffer[byte_index_l++]);
//cout << hex << "data_l= " << data_l << endl;
bit_length_l -= (8- bit_index_l);
bit_index_l = 0;
rotate_l += 8;
} while (bit_length_l > 0);
//cout << dec << "data_l rotated >> by " << rotate_l - bbP->m_bit_mod_8_position - nb_bitsP << " bits " << endl;
//cout << hex << "data_l masked >> by " << (mask >> (sizeof(unsigned long)*8 - nb_bitsP)) << endl;
data_l = (data_l >> (rotate_l - bbP->m_bit_mod_8_position - nb_bitsP)) &
(mask >> (sizeof(unsigned long)*8 - nb_bitsP));
bbP->m_bit_mod_8_position = (bbP->m_bit_mod_8_position + nb_bitsP) % 8;
if (bbP->m_bit_mod_8_position == 0) {
bbP->m_byte_position = byte_index_l;
} else {
bbP->m_byte_position = byte_index_l - 1;
}
}
return (u_int32_t)(data_l);
}
return (u_int32_t)(data_l);
}
//-----------------------------------------------------------------------------
u_int32_t BitBuffer_readlittleendian(Bit_Buffer_t* bbP, const unsigned int nb_bitsP)
//-----------------------------------------------------------------------------
{
if (nb_bitsP > 24) {
return ntohl(BitBuffer_read(bbP,nb_bitsP));
} else if (nb_bitsP > 16) {
return ntohl(BitBuffer_read(bbP,nb_bitsP) << 8);
} else if (nb_bitsP > 8) {
return ntohl(BitBuffer_read(bbP,nb_bitsP) << 16);
} else {
return ntohl(BitBuffer_read(bbP,nb_bitsP) << 24);
}
}
//-----------------------------------------------------------------------------
void BitBuffer_readMem(Bit_Buffer_t* bbP, u_int8_t* destP, unsigned int nb_bytesP)
//-----------------------------------------------------------------------------
{
assert (bbP->m_bit_mod_8_position == 0); // TO DO
if (BitBuffer_isCheckReadOverflowOK(bbP,nb_bytesP *8)) {
memcpy(destP, &bbP->m_buffer[bbP->m_byte_position], nb_bytesP);
bbP->m_byte_position += nb_bytesP;
}
}
//-----------------------------------------------------------------------------
void BitBuffer_write32(Bit_Buffer_t* bbP, u_int32_t valueP)
//-----------------------------------------------------------------------------
{
if (BitBuffer_isCheckWriteOverflowOK(bbP, sizeof(u_int32_t)*8)) {
BitBuffer_write8(bbP,(u_int8_t)(valueP >> 24));
BitBuffer_write8(bbP,(u_int8_t)(valueP >> 16));
BitBuffer_write8(bbP,(u_int8_t)(valueP >> 8));
BitBuffer_write8(bbP,(u_int8_t)(valueP));
}
}
//-----------------------------------------------------------------------------
void BitBuffer_write32littleendian(Bit_Buffer_t* bbP, u_int32_t valueP)
//-----------------------------------------------------------------------------
{
if (BitBuffer_isCheckWriteOverflowOK(bbP,sizeof(u_int32_t)*8)) {
BitBuffer_write8(bbP,(u_int8_t)(valueP));
BitBuffer_write8(bbP,(u_int8_t)(valueP >> 8));
BitBuffer_write8(bbP,(u_int8_t)(valueP >> 16));
BitBuffer_write8(bbP,(u_int8_t)(valueP >> 24));
}
}
//-----------------------------------------------------------------------------
void BitBuffer_write16littleendian(Bit_Buffer_t* bbP, u_int16_t valueP)
//-----------------------------------------------------------------------------
{
if (BitBuffer_isCheckWriteOverflowOK(bbP,sizeof(u_int16_t)*8)) {
BitBuffer_write8(bbP,(u_int8_t)(valueP));
BitBuffer_write8(bbP,(u_int8_t)(valueP >> 8));
}
}
//-----------------------------------------------------------------------------
void BitBuffer_write16(Bit_Buffer_t* bbP, u_int16_t valueP)
//-----------------------------------------------------------------------------
{
if (BitBuffer_isCheckWriteOverflowOK(bbP,sizeof(u_int16_t)*8)) {
BitBuffer_write8(bbP,(u_int8_t)(valueP >> 8));
BitBuffer_write8(bbP,(u_int8_t)(valueP));
}
}
//-----------------------------------------------------------------------------
void BitBuffer_write8(Bit_Buffer_t* bbP, u_int8_t valueP)
//-----------------------------------------------------------------------------
{
if (BitBuffer_isCheckWriteOverflowOK(bbP,sizeof(u_int8_t)*8)) {
if (bbP->m_bit_mod_8_position == 0) {
bbP->m_buffer[bbP->m_byte_position++] = valueP;
} else {
bbP->m_buffer[bbP->m_byte_position] = (valueP >> bbP->m_bit_mod_8_position) | bbP->m_buffer[bbP->m_byte_position];
bbP->m_byte_position++;
bbP->m_buffer[bbP->m_byte_position] = valueP << (8 - bbP->m_bit_mod_8_position);
}
}
}
//-----------------------------------------------------------------------------
void BitBuffer_writeBool(Bit_Buffer_t* bbP, u_int8_t valueP)
//-----------------------------------------------------------------------------
{
if (BitBuffer_isCheckWriteOverflowOK(bbP,1)) {
if (valueP) {
BitBuffer_write8b(bbP,(u_int8_t)(0x01), 1);
} else {
BitBuffer_write8b(bbP,(u_int8_t)(0x00), 1);
}
}
}
//-----------------------------------------------------------------------------
void BitBuffer_writeMem(Bit_Buffer_t* bbP, u_int8_t* startP, unsigned int nb_bytesP)
//-----------------------------------------------------------------------------
{
assert (bbP->m_bit_mod_8_position == 0); // TO DO
if (BitBuffer_isCheckWriteOverflowOK(bbP,nb_bytesP *8)) {
memcpy(&bbP->m_buffer[bbP->m_byte_position], startP, nb_bytesP);
bbP->m_byte_position += nb_bytesP;
}
}
//-----------------------------------------------------------------------------
void BitBuffer_write8b(Bit_Buffer_t* bbP, u_int8_t valueP, unsigned int nb_bitsP)
//-----------------------------------------------------------------------------
{
assert(nb_bitsP <= 8);
if (nb_bitsP == 0) return;
if (BitBuffer_isCheckWriteOverflowOK(bbP,nb_bitsP)) {
valueP = valueP & ((u_int8_t)(0xFF) >> (8 - nb_bitsP));
//std::cout << "BitBuffer_write char " << (u_int32_t)(valueP) << " " << nb_bitsP << " bits" << std::endl;
if (nb_bitsP > (sizeof(unsigned char)*8)) {
printf("[MIH_C] ERROR BitBuffer_write nb bits too large - must be <= sizeof(char)*8");
} else {
if (bbP->m_bit_mod_8_position == 0) {
if (nb_bitsP == (sizeof(unsigned char)*8)) {
BitBuffer_write8(bbP, valueP);
} else {
bbP->m_buffer[bbP->m_byte_position] = valueP << (8 - nb_bitsP);
bbP->m_bit_mod_8_position += nb_bitsP;
}
} else {
bbP->m_buffer[bbP->m_byte_position] = ((valueP << (8 - nb_bitsP)) >> bbP->m_bit_mod_8_position) | bbP->m_buffer[bbP->m_byte_position];
if ((bbP->m_bit_mod_8_position + nb_bitsP)>= (sizeof(unsigned char)*8)) {
bbP->m_byte_position++;
bbP->m_buffer[bbP->m_byte_position] = valueP << (16 - bbP->m_bit_mod_8_position - nb_bitsP);
}
bbP->m_bit_mod_8_position = (nb_bitsP + bbP->m_bit_mod_8_position) % (sizeof(unsigned char)*8);
}
}
}
}
//-----------------------------------------------------------------------------
void BitBuffer_writelittleendian(Bit_Buffer_t* bbP, u_int8_t valueP, unsigned int nb_bitsP)
//-----------------------------------------------------------------------------
{
BitBuffer_write8b(bbP,valueP, nb_bitsP);
}
//-----------------------------------------------------------------------------
void BitBuffer_write16b(Bit_Buffer_t* bbP, u_int16_t valueP, unsigned int nb_bitsP)
//-----------------------------------------------------------------------------
{
assert(nb_bitsP <= 16);
if (BitBuffer_isCheckWriteOverflowOK(bbP,nb_bitsP)) {
valueP = valueP & ((u_int16_t)(0xFFFF) >> (16 - nb_bitsP));
if (nb_bitsP > (sizeof (u_int16_t)*8)) {
printf("[MIH_C] ERROR BitBuffer_write nb bits too large - must be <= sizeof (short)*8");
} else {
if (nb_bitsP > 8) {
//BitBuffer_write8b(bbP,(u_int8_t)(valueP >> (8 - (16-nb_bitsP))), nb_bitsP - 8);
BitBuffer_write8b(bbP,(u_int8_t)(valueP >> 8), nb_bitsP - 8);
BitBuffer_write8(bbP,(u_int8_t)(valueP));
} else if (nb_bitsP > 0) {
BitBuffer_write8b(bbP,(u_int8_t)(valueP), nb_bitsP);
}
}
}
}
//-----------------------------------------------------------------------------
void BitBuffer_writelittleendian16b(Bit_Buffer_t* bbP, u_int16_t valueP, unsigned int nb_bitsP)
//-----------------------------------------------------------------------------
{
assert(nb_bitsP <= 16);
if (BitBuffer_isCheckWriteOverflowOK(bbP,nb_bitsP)) {
valueP = valueP & ((u_int16_t)(0xFFFF) >> (16 - nb_bitsP));
if (nb_bitsP > (sizeof (u_int16_t)*8)) {
printf("[MIH_C] ERROR BitBuffer_write nb bits too large - must be <= sizeof (short)*8");
} else {
if (nb_bitsP > 8) {
BitBuffer_write8(bbP,(u_int8_t)(valueP));
//BitBuffer_write8b(bbP,(u_int8_t)(valueP >> (8 - (16-nb_bitsP))), nb_bitsP - 8);
BitBuffer_write8b(bbP,(u_int8_t)(valueP >> 8), nb_bitsP - 8);
} else if (nb_bitsP > 0) {
BitBuffer_write8b(bbP,(u_int8_t)(valueP), nb_bitsP);
}
}
}
}
//-----------------------------------------------------------------------------
void BitBuffer_write32b(Bit_Buffer_t* bbP, u_int32_t valueP, unsigned int nb_bitsP)
//-----------------------------------------------------------------------------
{
assert(nb_bitsP <= 32);
if (BitBuffer_isCheckWriteOverflowOK(bbP,nb_bitsP)) {
valueP = valueP & ((u_int32_t)(0xFFFFFFFF) >> (32 - nb_bitsP));
if (nb_bitsP > (sizeof (u_int32_t)*8)) {
printf("[MIH_C] ERROR BitBuffer_write nb bits too large - must be <= sizeof (int)*8");
} else {
if (nb_bitsP > 24) {
//BitBuffer_write8b(bbP,(u_int8_t)(valueP >> (24 - (32-nb_bitsP))), nb_bitsP - 24);
BitBuffer_write8b(bbP,(u_int8_t)(valueP >> 24), nb_bitsP - 24);
BitBuffer_write8(bbP,(u_int8_t)(valueP >> 16));
BitBuffer_write8(bbP,(u_int8_t)(valueP >> 8));
BitBuffer_write8(bbP,(u_int8_t)(valueP));
} else if (nb_bitsP > 16) {
//BitBuffer_write8b(bbP,(u_int8_t)(valueP >> (16 - (24-nb_bitsP))), nb_bitsP - 16);
BitBuffer_write8b(bbP,(u_int8_t)(valueP >> 16), nb_bitsP - 16);
BitBuffer_write8(bbP,(u_int8_t)(valueP >> 8));
BitBuffer_write8(bbP,(u_int8_t)(valueP));
} else if (nb_bitsP > 8) {
//BitBuffer_write8b(bbP,(u_int8_t)(valueP >> (8 - (16-nb_bitsP))), nb_bitsP - 8);
BitBuffer_write8b(bbP,(u_int8_t)(valueP >> 8), nb_bitsP - 8);
BitBuffer_write8(bbP,(u_int8_t)(valueP));
} else if (nb_bitsP > 0) {
BitBuffer_write8b(bbP,(u_int8_t)(valueP), nb_bitsP);
}
}
}
}
//-----------------------------------------------------------------------------
void BitBuffer_writelittleendian32b(Bit_Buffer_t* bbP, u_int32_t valueP, unsigned int nb_bitsP)
//-----------------------------------------------------------------------------
{
assert(nb_bitsP <= 32);
if (BitBuffer_isCheckWriteOverflowOK(bbP,nb_bitsP)) {
valueP = valueP & ((u_int32_t)(0xFFFFFFFF) >> (32 - nb_bitsP));
if (nb_bitsP > (sizeof (u_int32_t)*8)) {
printf("[MIH_C] ERROR BitBuffer_write nb bits too large - must be <= sizeof (int)*8");
} else {
if (nb_bitsP > 24) {
BitBuffer_write8(bbP,(u_int8_t)(valueP));
BitBuffer_write8(bbP,(u_int8_t)(valueP >> 8));
BitBuffer_write8(bbP,(u_int8_t)(valueP >> 16));
BitBuffer_write8b(bbP,(u_int8_t)(valueP >> 24), nb_bitsP - 24);
//BitBuffer_write8b(bbP,(u_int8_t)(valueP >> (24 - (32-nb_bitsP))), nb_bitsP - 24);
} else if (nb_bitsP > 16) {
BitBuffer_write8(bbP,(u_int8_t)(valueP));
BitBuffer_write8(bbP,(u_int8_t)(valueP >> 8));
BitBuffer_write8b(bbP,(u_int8_t)(valueP >> 16), nb_bitsP - 16);
//BitBuffer_write8b(bbP,(u_int8_t)(valueP >> (16 - (24-nb_bitsP))), nb_bitsP - 16);
} else if (nb_bitsP > 8) {
BitBuffer_write8(bbP,(u_int8_t)(valueP));
BitBuffer_write8b(bbP,(u_int8_t)(valueP >> 8), nb_bitsP - 8);
//BitBuffer_write8b(bbP,(u_int8_t)(valueP >> (8 - (16-nb_bitsP))), nb_bitsP - 8);
} else if (nb_bitsP > 0) {
BitBuffer_write8b(bbP,(u_int8_t)(valueP), nb_bitsP);
}
}
}
}
//-----------------------------------------------------------------------------
void BitBuffer_rewind(Bit_Buffer_t* bbP)
//-----------------------------------------------------------------------------
{
bbP->m_byte_position = 0;
bbP->m_bit_mod_8_position = 0;
}
//-----------------------------------------------------------------------------
void BitBuffer_rewind_to(Bit_Buffer_t* bbP, unsigned int byte_positionP)
//-----------------------------------------------------------------------------
{
bbP->m_byte_position = byte_positionP;
bbP->m_bit_mod_8_position = 0;
}
//-----------------------------------------------------------------------------
void BitBuffer_write_shift_last_n_bytes_right(Bit_Buffer_t* bbP, unsigned int nb_bytes_to_shiftP, unsigned int hole_sizeP)
//-----------------------------------------------------------------------------
{
unsigned int index = 0;
if (nb_bytes_to_shiftP >= bbP->m_byte_position) return;
if ((bbP->m_byte_position + hole_sizeP) > bbP->m_capacity) return;
while (index < nb_bytes_to_shiftP) {
bbP->m_buffer[bbP->m_byte_position -1 - index + hole_sizeP] = bbP->m_buffer[bbP->m_byte_position -1 - index];
index += 1;
}
}
//-----------------------------------------------------------------------------
void BitBuffer_reset(Bit_Buffer_t* bbP)
//-----------------------------------------------------------------------------
{
BitBuffer_rewind(bbP);
bbP->m_limit = 0;
if (bbP->m_buffer != 0) {
memset(bbP->m_buffer, 0, bbP->m_capacity);
}
}
//-----------------------------------------------------------------------------
unsigned char* BitBuffer_getNextFreePosition(Bit_Buffer_t* bbP)
//-----------------------------------------------------------------------------
{
return &(bbP->m_buffer[bbP->m_byte_position]);
}
//-----------------------------------------------------------------------------
unsigned int BitBuffer_getPosition(Bit_Buffer_t* bbP)
//-----------------------------------------------------------------------------
{
return (bbP->m_byte_position + (bbP->m_bit_mod_8_position +7)/8);
}
//-----------------------------------------------------------------------------
void BitBuffer_addLimitOffset(Bit_Buffer_t* bbP, unsigned int offsetP)
//-----------------------------------------------------------------------------
{
bbP->m_limit += offsetP;
}
//-----------------------------------------------------------------------------
unsigned int BitBuffer_getNumFreeBytes(Bit_Buffer_t* bbP)
//-----------------------------------------------------------------------------
{
return bbP->m_capacity - (bbP->m_byte_position + (bbP->m_bit_mod_8_position +7)/8);
}
//-----------------------------------------------------------------------------
u_int8_t BitBuffer_isCheckWriteOverflowOK(Bit_Buffer_t* bbP, unsigned int nb_bitsP)
//-----------------------------------------------------------------------------
{
if ((bbP->m_byte_position + (bbP->m_bit_mod_8_position + nb_bitsP+7)/8) < bbP->m_capacity) {
return BIT_BUFFER_TRUE;
} else {
//throw std::out_of_range("Exception in class BitBuffer cannot write more, no more space available");
return BIT_BUFFER_FALSE;
}
}
//-----------------------------------------------------------------------------
u_int8_t BitBuffer_isCheckReadOverflowOK(Bit_Buffer_t* bbP, unsigned int nb_bitsP)
//-----------------------------------------------------------------------------
{
if ((bbP->m_byte_position + (bbP->m_bit_mod_8_position + nb_bitsP)/8) <= bbP->m_limit) {
return BIT_BUFFER_TRUE;
} else {
//throw std::out_of_range("Exception in class BitBuffer cannot read more - end of buffer reached");
return BIT_BUFFER_FALSE;
}
}
//-----------------------------------------------------------------------------
void free_BitBuffer(Bit_Buffer_t* bbP)
//-----------------------------------------------------------------------------
{
//std::cout << "~BitBuffer()" << std::endl;
if (bbP->m_buffer_allocated_by_this == BIT_BUFFER_TRUE) {
free(bbP->m_buffer);
}
free(bbP);
}
@@ -1,163 +0,0 @@
/*******************************************************************************
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
*******************************************************************************/
#define MIH_C_INTERFACE
#define MIH_C_HEADER_CODEC_C
#include "MIH_C_header_codec.h"
//-----------------------------------------------------------------------------
int MIH_C_HEADER2String(MIH_C_HEADER_T* headerP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index += sprintf(&bufP[buffer_index], "HEADER.version: ");
buffer_index += MIH_C_VERSION2String(&headerP->version, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nHEADER.ack_req: ");
buffer_index += MIH_C_ACK_REQ2String(&headerP->ack_req, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nHEADER.ack_rsp: ");
buffer_index += MIH_C_ACK_RSP2String(&headerP->ack_rsp, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nHEADER.uir: ");
buffer_index += MIH_C_UIR2String(&headerP->uir, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nHEADER.more_fragment: ");
buffer_index += MIH_C_M2String(&headerP->more_fragment, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nHEADER.fragment_number: ");
buffer_index += MIH_C_FN2String(&headerP->more_fragment, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nHEADER.service_identifier: ");
buffer_index += MIH_C_SID2String(&headerP->service_identifier, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nHEADER.operation_code: ");
buffer_index += MIH_C_OPCODE2String(&headerP->operation_code, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nHEADER.action_identifier: ");
buffer_index += MIH_C_AID2String(&headerP->action_identifier, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nHEADER.transaction_id: ");
buffer_index += MIH_C_TRANSACTION_ID2String(&headerP->transaction_id, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nHEADER.payload_length: ");
buffer_index += MIH_C_VARIABLE_PAYLOAD_LENGTH2String(&headerP->payload_length, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\n");
return buffer_index;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Header_Encode(Bit_Buffer_t* bbP, MIH_C_HEADER_T* headerP)
{
//-----------------------------------------------------------------------------
u_int8_t reserved = 0;
int status ;
if ((bbP != NULL) && (headerP != NULL)) {
status = MIH_HEADER_ENCODE_OK;
BitBuffer_write8b (bbP, headerP->version, 4);
BitBuffer_writeBool (bbP, headerP->ack_req);
BitBuffer_writeBool (bbP, headerP->ack_rsp);
BitBuffer_writeBool (bbP, headerP->uir);
BitBuffer_writeBool (bbP, headerP->more_fragment);
BitBuffer_write8b (bbP, headerP->fragment_number, 7);
BitBuffer_writeBool (bbP, reserved);
BitBuffer_write8b (bbP, headerP->service_identifier, 4);
BitBuffer_write8b (bbP, headerP->operation_code, 2);
BitBuffer_write16b (bbP, headerP->action_identifier, 10);
BitBuffer_write8b (bbP, reserved, 4);
BitBuffer_write16b (bbP, headerP->transaction_id, 12);
BitBuffer_write16 (bbP, headerP->payload_length);
/*DEBUG_ENCODE("%s: version 0x%02X\n", __FUNCTION__, headerP->version);
DEBUG_ENCODE("%s: ack_req 0x%02X\n", __FUNCTION__, headerP->ack_req);
DEBUG_ENCODE("%s: ack_rsp 0x%02X\n", __FUNCTION__, headerP->ack_rsp);
DEBUG_ENCODE("%s: uir 0x%02X\n", __FUNCTION__, headerP->uir);
DEBUG_ENCODE("%s: more_fragment 0x%02X\n", __FUNCTION__, headerP->more_fragment);
DEBUG_ENCODE("%s: reserved 0x%02X\n", __FUNCTION__, reserved);
DEBUG_ENCODE("%s: service_identifier 0x%02X\n", __FUNCTION__, headerP->service_identifier);
DEBUG_ENCODE("%s: operation_code 0x%02X\n", __FUNCTION__, headerP->operation_code);
DEBUG_ENCODE("%s: action_identifier 0x%04X\n", __FUNCTION__, headerP->action_identifier);
DEBUG_ENCODE("%s: reserved 0x%02X\n", __FUNCTION__, reserved);
DEBUG_ENCODE("%s: transaction_id 0x%04X\n", __FUNCTION__, headerP->transaction_id);
DEBUG_ENCODE("%s: payload_length 0x%02X\n", __FUNCTION__, headerP->payload_length);*/
// may be check for validity of header field -> set MIH_HEADER_DECODE_FAILURE
if (BitBuffer_isCheckWriteOverflowOK(bbP, 0) == BIT_BUFFER_FALSE) {
memset(headerP, 0, sizeof(MIH_C_HEADER_T));
return MIH_HEADER_ENCODE_TOO_SHORT;
} else if (status == MIH_HEADER_ENCODE_FAILURE) {
memset(headerP, 0, sizeof(MIH_C_HEADER_T));
return MIH_HEADER_ENCODE_FAILURE;
} else {
return MIH_HEADER_ENCODE_OK;
}
} else {
memset(headerP, 0, sizeof(MIH_C_HEADER_T));
return MIH_HEADER_ENCODE_BAD_PARAMETER;
}
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Header_Decode(Bit_Buffer_t* bbP, MIH_C_HEADER_T* headerP)
{
//-----------------------------------------------------------------------------
u_int8_t reserved ;
int status ;
if ((bbP != NULL) && (headerP != NULL)) {
status = MIH_HEADER_DECODE_OK;
headerP->version = (MIH_C_VERSION_T)BitBuffer_read(bbP, 4);
headerP->ack_req = (MIH_C_ACK_REQ_T)BitBuffer_readBool(bbP);
headerP->ack_rsp = (MIH_C_ACK_RSP_T)BitBuffer_readBool(bbP);
headerP->uir = (MIH_C_UIR_T)BitBuffer_readBool(bbP);
headerP->more_fragment = (MIH_C_M_T)BitBuffer_readBool(bbP);
headerP->fragment_number = (MIH_C_FN_T)BitBuffer_read(bbP, 7);
reserved = BitBuffer_readBool(bbP);
headerP->service_identifier = (MIH_C_SID_T) BitBuffer_read(bbP, 4);
headerP->operation_code = (MIH_C_OPCODE_T) BitBuffer_read(bbP, 2);
headerP->action_identifier = (MIH_C_AID_T) BitBuffer_read(bbP, 10);
reserved = BitBuffer_read(bbP, 4);
headerP->transaction_id = (MIH_C_TRANSACTION_ID_T) BitBuffer_read(bbP, 12);
headerP->payload_length = (MIH_C_VARIABLE_PAYLOAD_LENGTH_T)BitBuffer_read16(bbP);
/*DEBUG_DECODE("%s: version 0x%02X\n", __FUNCTION__, headerP->version);
DEBUG_DECODE("%s: ack_req 0x%02X\n", __FUNCTION__, headerP->ack_req);
DEBUG_DECODE("%s: ack_rsp 0x%02X\n", __FUNCTION__, headerP->ack_rsp);
DEBUG_DECODE("%s: uir 0x%02X\n", __FUNCTION__, headerP->uir);
DEBUG_DECODE("%s: more_fragment 0x%02X\n", __FUNCTION__, headerP->more_fragment);
DEBUG_DECODE("%s: reserved 0x%02X\n", __FUNCTION__, reserved);
DEBUG_DECODE("%s: service_identifier 0x%02X\n", __FUNCTION__, headerP->service_identifier);
DEBUG_DECODE("%s: operation_code 0x%02X\n", __FUNCTION__, headerP->operation_code);
DEBUG_DECODE("%s: action_identifier 0x%04X\n", __FUNCTION__, headerP->action_identifier);
DEBUG_DECODE("%s: reserved 0x%02X\n", __FUNCTION__, reserved);
DEBUG_DECODE("%s: transaction_id 0x%04X\n", __FUNCTION__, headerP->transaction_id);
DEBUG_DECODE("%s: payload_length 0x%02X\n", __FUNCTION__, headerP->payload_length);*/
// may be check for validity of header field -> set MIH_HEADER_DECODE_FAILURE
if (BitBuffer_isCheckReadOverflowOK(bbP, 0) == BIT_BUFFER_FALSE) {
memset(headerP, 0, sizeof(MIH_C_HEADER_T));
return MIH_HEADER_DECODE_TOO_SHORT;
} else if (status == MIH_HEADER_DECODE_FAILURE) {
memset(headerP, 0, sizeof(MIH_C_HEADER_T));
return MIH_HEADER_DECODE_FAILURE;
} else {
return MIH_HEADER_DECODE_OK;
}
} else {
memset(headerP, 0, sizeof(MIH_C_HEADER_T));
return MIH_HEADER_DECODE_BAD_PARAMETER;
}
}
@@ -1,190 +0,0 @@
/*******************************************************************************
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
*******************************************************************************/
#define MIH_C_INTERFACE
#define MIH_C_LOG_C
/*
//-----------------------------------------------------------------------------
#include "MIH_C_log.h"
//-----------------------------------------------------------------------------
#define LOG_BUFF_SIZE 2048
static char g_log_buffer_time[24];
static char g_log_buffer[LOG_BUFF_SIZE];
static int g_bypass_header;
//-----------------------------------------------------------------------------
char* getTimeStamp4Log()
//-----------------------------------------------------------------------------
{
int len;
struct timespec time_spec;
unsigned int time_now_micros;
unsigned int time_now_s;
clock_gettime (CLOCK_REALTIME, &time_spec);
time_now_s = (unsigned int) time_spec.tv_sec % 3600;
time_now_micros = (unsigned int) time_spec.tv_nsec/1000;
//len=snprintf(g_log_buffer_time,24, "%06d:%06d", time_now_s, time_now_micros);
len=snprintf(g_log_buffer_time,24, "%03d:%03d", time_now_s, time_now_micros);
return g_log_buffer_time;
}
//-----------------------------------------------------------------------------
int is_newline( char *str, int size){
//-----------------------------------------------------------------------------
int i;
for ( i = 0; i < size; i++ ) {
if ( str[i] == '\n' )
return 1;
}
// if we get all the way to here, there must not have been a newline!
return 0;
}
// Initialize logging system
int MIH_C_log_init(unsigned int log_outputP) {
//-----------------------------------------------------------------------------
g_mih_c_log_output = log_outputP;
g_log_level2string[LOG_EMERG] = "EMERG";
g_log_level2string[LOG_ALERT] = "ALERT";
g_log_level2string[LOG_CRIT] = "CRIT ";
g_log_level2string[LOG_ERR] = "ERR ";
g_log_level2string[LOG_WARNING] = "WARN ";
g_log_level2string[LOG_NOTICE] = "NOTCE";
g_log_level2string[LOG_INFO] = "INFO ";
g_log_level2string[LOG_DEBUG] = "DEBUG";
g_bypass_header = 0;
switch (g_mih_c_log_output){
case LOG_TO_CONSOLE:
printf("***** mRAL V%s logging \n\n",MIH_C_VERSION);
break;
case LOG_TO_FILE:
g_mih_c_log_file = fopen(MIH_C_LOGFILE_NAME,"w"); //start over new file
if (g_mih_c_log_file == NULL){
perror ("MIH_C_log_init - error opening file");
exit(1);
}
fprintf(g_mih_c_log_file, "***** V%s starting logging \n\n",MIH_C_VERSION);
fflush(g_mih_c_log_file);
break;
case LOG_TO_SYSTEM:
openlog(MIH_C_SYSLOG_NAME, LOG_PID, LOG_LOCAL7);
syslog(LOG_NOTICE, "***** V%s starting logging \n\n",MIH_C_VERSION);
break;
default:
printf("MIH_C_log_init: log_outputP error %d", log_outputP);
}
return 0;
}
//-----------------------------------------------------------------------------
// Log messages according to user settings
int MIH_C_log_record(int levelP, const char * log_msgP, ...) {
//-----------------------------------------------------------------------------
struct timespec time_spec;
unsigned int time_now_micros;
unsigned int time_now_s;
va_list log_ap;
int len;
switch (g_mih_c_log_output){
case LOG_TO_CONSOLE:
va_start(log_ap, log_msgP);
len = vsnprintf(g_log_buffer, LOG_BUFF_SIZE-1, log_msgP, log_ap);
va_end(log_ap);
if (g_bypass_header == 0) {
clock_gettime (CLOCK_REALTIME, &time_spec);
time_now_s = (unsigned int) time_spec.tv_sec;
time_now_micros = (unsigned int) time_spec.tv_nsec/1000;
printf("[%06d:%06d][%s][%s] ", time_now_s, time_now_micros, MIH_C_SYSLOG_NAME, g_log_level2string[levelP]);
}
printf("%s",g_log_buffer);
fflush(stdout);
fflush(stderr);
if (is_newline(g_log_buffer,len) == 0 ){
g_bypass_header = 1;
} else {
g_bypass_header = 0;
}
break;
case LOG_TO_FILE:
va_start(log_ap, log_msgP);
len = vsnprintf(g_log_buffer, LOG_BUFF_SIZE-1, log_msgP, log_ap);
va_end(log_ap);
if (g_bypass_header == 0) {
clock_gettime (CLOCK_REALTIME, &time_spec);
time_now_s = (unsigned int) time_spec.tv_sec;
time_now_micros = (unsigned int) time_spec.tv_nsec/1000;
fprintf(g_mih_c_log_file, "[%06d:%06d][%s][%s] ", time_now_s, time_now_micros, MIH_C_SYSLOG_NAME, g_log_level2string[levelP]);
}
fprintf(g_mih_c_log_file, "%s", g_log_buffer);
fflush(g_mih_c_log_file);
if (is_newline(g_log_buffer,len) == 0 ){
g_bypass_header = 1;
} else {
g_bypass_header = 0;
}
break;
case LOG_TO_SYSTEM:
va_start(log_ap, log_msgP);
syslog(levelP, log_msgP, log_ap);
va_end(log_ap);
return 0;
break;
default:
printf("MIH_C_log_record: level error %d", levelP);
}
return 0;
}
//-----------------------------------------------------------------------------
// Close logging system
int MIH_C_log_exit(void) {
//-----------------------------------------------------------------------------
switch (g_mih_c_log_output){
case LOG_TO_CONSOLE:
printf("***** stopping logging \n\n");
break;
case LOG_TO_FILE:
fprintf(g_mih_c_log_file, "***** stopping logging \n\n");
fflush(g_mih_c_log_file);
fclose(g_mih_c_log_file);
break;
case LOG_TO_SYSTEM:
syslog(LOG_NOTICE, "***** stopping logging \n\n");
closelog();
break;
default:
printf("MIH_C_log_exit: output unrecognized error %d", g_mih_c_log_output);
}
return 0;
}
*/
File diff suppressed because it is too large Load Diff
@@ -1,892 +0,0 @@
/*******************************************************************************
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
*******************************************************************************/
#define MIH_C_INTERFACE
#define MIH_C_PRIMITIVE_CODEC_C
#include <assert.h>
#include "MIH_C_primitive_codec.h"
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Decode_Link_Capability_Discover_request(Bit_Buffer_t* bbP, MIH_C_Link_Capability_Discover_request_t *primitiveP)
{
//-----------------------------------------------------------------------------
return MIH_PRIMITIVE_DECODE_OK;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Link_Capability_Discover_request2String(MIH_C_Link_Capability_Discover_request_t *primitiveP, char* bufP)
{
//-----------------------------------------------------------------------------
return 0;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Decode_Link_Event_Subscribe_request(Bit_Buffer_t* bbP, MIH_C_Link_Event_Subscribe_request_t *primitiveP)
{
//-----------------------------------------------------------------------------
MIH_C_TLV_TYPE_T tlv;
u_int16_t length;
MIH_C_TLV_TYPE_decode(bbP, &tlv);
MIH_C_LIST_LENGTH_decode(bbP, &length);
MIH_C_LINK_EVENT_LIST_decode(bbP, &primitiveP->RequestedLinkEventList);
#if MIH_C_DEBUG_DESERIALIZATION
if (primitiveP->RequestedLinkEventList & MIH_C_BIT_LINK_DETECTED) printf("SUBSCRIBE_REQUEST LINK_DETECTED\n");
if (primitiveP->RequestedLinkEventList & MIH_C_BIT_LINK_UP) printf("SUBSCRIBE_REQUEST LINK_UP\n");
if (primitiveP->RequestedLinkEventList & MIH_C_BIT_LINK_DOWN) printf("SUBSCRIBE_REQUEST LINK_DOWN\n");
if (primitiveP->RequestedLinkEventList & MIH_C_BIT_LINK_PARAMETERS_REPORT) printf("SUBSCRIBE_REQUEST LINK_PARAMETERS_REPORT\n");
if (primitiveP->RequestedLinkEventList & MIH_C_BIT_LINK_GOING_DOWN) printf("SUBSCRIBE_REQUEST LINK_GOING_DOWN\n");
if (primitiveP->RequestedLinkEventList & MIH_C_BIT_LINK_HANDOVER_IMMINENT) printf("SUBSCRIBE_REQUEST LINK_HANDOVER_IMMINENT\n");
if (primitiveP->RequestedLinkEventList & MIH_C_BIT_LINK_HANDOVER_COMPLETE) printf("SUBSCRIBE_REQUEST LINK_HANDOVER_COMPLETE\n");
if (primitiveP->RequestedLinkEventList & MIH_C_BIT_LINK_PDU_TRANSMIT_STATUS) printf("SUBSCRIBE_REQUEST LINK_PDU_TRANSMIT_STATUS\n");
#endif
if (BitBuffer_isCheckReadOverflowOK(bbP, 0) == BIT_BUFFER_TRUE) {
return MIH_PRIMITIVE_DECODE_OK;
} else {
return MIH_PRIMITIVE_DECODE_TOO_SHORT;
}
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Link_Event_Subscribe_request2String(MIH_C_Link_Event_Subscribe_request_t *primitiveP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index += sprintf(&bufP[buffer_index], "--------------------------------------------------\n");
buffer_index += sprintf(&bufP[buffer_index], "- PRIMITIVE Link_Event_Subscribe.request -\n");
buffer_index += sprintf(&bufP[buffer_index], "--------------------------------------------------\n");
buffer_index += MIH_C_LINK_EVENT_LIST2String(&primitiveP->RequestedLinkEventList, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\n");
return buffer_index;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Decode_Link_Event_Unsubscribe_request(Bit_Buffer_t* bbP, MIH_C_Link_Event_Unsubscribe_request_t *primitiveP)
{
//-----------------------------------------------------------------------------
MIH_C_LINK_EVENT_LIST_decode(bbP, &primitiveP->RequestedLinkEventList);
if (BitBuffer_isCheckReadOverflowOK(bbP, 0) == BIT_BUFFER_TRUE) {
return MIH_PRIMITIVE_DECODE_OK;
} else {
return MIH_PRIMITIVE_DECODE_TOO_SHORT;
}
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Link_Event_Unsubscribe_request2String(MIH_C_Link_Event_Unsubscribe_request_t *primitiveP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index += sprintf(&bufP[buffer_index], "--------------------------------------------------\n");
buffer_index += sprintf(&bufP[buffer_index], "- PRIMITIVE Link_Event_Unsubscribe.request -\n");
buffer_index += sprintf(&bufP[buffer_index], "--------------------------------------------------\n");
buffer_index += MIH_C_LINK_EVENT_LIST2String(&primitiveP->RequestedLinkEventList, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\n");
return buffer_index;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Decode_Link_Get_Parameters_request(Bit_Buffer_t* bbP, MIH_C_Link_Get_Parameters_request_t *primitiveP)
{
//-----------------------------------------------------------------------------
MIH_C_TLV_TYPE_T tlv;
u_int16_t length;
MIH_C_TLV_TYPE_decode(bbP, &tlv);
assert(tlv == MIH_C_TLV_LINK_PARAM_TYPE_LIST);
MIH_C_LIST_LENGTH_decode(bbP, &length);
MIH_C_LINK_PARAM_TYPE_LIST_decode(bbP, &primitiveP->LinkParametersRequest_list);
MIH_C_TLV_TYPE_decode(bbP, &tlv);
assert(tlv == MIH_C_TLV_LINK_STATES_REQ);
MIH_C_LIST_LENGTH_decode(bbP, &length);
MIH_C_LINK_STATES_REQ_decode(bbP, &primitiveP->LinkStatesRequest);
MIH_C_TLV_TYPE_decode(bbP, &tlv);
assert(tlv == MIH_C_TLV_LINK_DESC_REQ);
MIH_C_LIST_LENGTH_decode(bbP, &length);
MIH_C_LINK_DESC_REQ_decode(bbP, &primitiveP->LinkDescriptorsRequest);
if (BitBuffer_isCheckReadOverflowOK(bbP, 0) == BIT_BUFFER_TRUE) {
return MIH_PRIMITIVE_DECODE_OK;
} else {
return MIH_PRIMITIVE_DECODE_TOO_SHORT;
}
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Link_Get_Parameters_request2String(MIH_C_Link_Get_Parameters_request_t *primitiveP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index += sprintf(&bufP[buffer_index], "--------------------------------------------------\n");
buffer_index += sprintf(&bufP[buffer_index], "- PRIMITIVE Link_Get_Parameters.request -\n");
buffer_index += sprintf(&bufP[buffer_index], "--------------------------------------------------\n");
buffer_index += sprintf(&bufP[buffer_index], "LINK_PARAM_TYPE_LIST = ");
buffer_index += MIH_C_LINK_PARAM_TYPE_LIST2String(&primitiveP->LinkParametersRequest_list, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nLINK_STATES_REQ = ");
buffer_index += MIH_C_LINK_STATES_REQ2String(&primitiveP->LinkStatesRequest, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nLINK_DESC_REQ = ");
buffer_index += MIH_C_LINK_DESC_REQ2String(&primitiveP->LinkDescriptorsRequest, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\n");
return buffer_index;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Decode_Link_Configure_Thresholds_request(Bit_Buffer_t* bbP, MIH_C_Link_Configure_Thresholds_request_t *primitiveP)
{
//-----------------------------------------------------------------------------
MIH_C_TLV_TYPE_T tlv;
u_int16_t length;
MIH_C_TLV_TYPE_decode(bbP, &tlv);
MIH_C_LIST_LENGTH_decode(bbP, &length);
MIH_C_LINK_CFG_PARAM_LIST_decode(bbP, &primitiveP->LinkConfigureParameterList_list);
if (BitBuffer_isCheckReadOverflowOK(bbP, 0) == BIT_BUFFER_TRUE) {
return MIH_PRIMITIVE_DECODE_OK;
} else {
return MIH_PRIMITIVE_DECODE_TOO_SHORT;
}
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Link_Configure_Thresholds_request2String(MIH_C_Link_Configure_Thresholds_request_t *primitiveP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index += sprintf(&bufP[buffer_index], "--------------------------------------------------\n");
buffer_index += sprintf(&bufP[buffer_index], "- PRIMITIVE Link_Configure_Threshold.request -\n");
buffer_index += sprintf(&bufP[buffer_index], "--------------------------------------------------\n");
buffer_index += MIH_C_LINK_CFG_PARAM_LIST2String(&primitiveP->LinkConfigureParameterList_list, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\n");
return buffer_index;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Decode_Link_Action_request(Bit_Buffer_t* bbP, MIH_C_Link_Action_request_t *primitiveP)
{
//-----------------------------------------------------------------------------
MIH_C_LINK_ADDR_T *PoALinkAddress = NULL;
MIH_C_TLV_TYPE_T tlv;
u_int16_t length;
MIH_C_TLV_TYPE_decode(bbP, &tlv);
assert(tlv == MIH_C_TLV_LINK_ACTION);
MIH_C_LIST_LENGTH_decode(bbP, &length);
// Patch MW 03/05/2013
if (length >2) {
MIH_C_LINK_ACTION_decode(bbP, &primitiveP->LinkAction);
} else {
MIH_C_LINK_ACTION_short_decode(bbP, &primitiveP->LinkAction) ;
}
MIH_C_TLV_TYPE_decode(bbP, &tlv);
assert(tlv == MIH_C_TLV_LINK_TIME_INTERVAL);
MIH_C_LIST_LENGTH_decode(bbP, &length);
MIH_C_UNSIGNED_INT2_decode(bbP, &primitiveP->ExecutionDelay);
if (BitBuffer_isCheckReadOverflowOK(bbP, 0) == BIT_BUFFER_FALSE) {
return MIH_PRIMITIVE_DECODE_TOO_SHORT;
}
MIH_C_TLV_TYPE_decode(bbP, &tlv);
if (tlv == MIH_C_TLV_POA) {
PoALinkAddress = malloc(sizeof(MIH_C_LINK_ADDR_T));
MIH_C_LINK_ADDR_decode(bbP, PoALinkAddress);
primitiveP->PoALinkAddress = PoALinkAddress;
} else {
primitiveP->PoALinkAddress = NULL;
}
if (BitBuffer_isCheckReadOverflowOK(bbP, 0) == BIT_BUFFER_FALSE) {
free(PoALinkAddress);
return MIH_PRIMITIVE_DECODE_TOO_SHORT;
}
return MIH_PRIMITIVE_DECODE_OK;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Link_Action_request2String(MIH_C_Link_Action_request_t *primitiveP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index += sprintf(&bufP[buffer_index], "--------------------------------------------------\n");
buffer_index += sprintf(&bufP[buffer_index], "- PRIMITIVE Link_Action.request -\n");
buffer_index += sprintf(&bufP[buffer_index], "--------------------------------------------------\n");
buffer_index += MIH_C_LINK_ACTION2String(&primitiveP->LinkAction, &bufP[buffer_index]);
buffer_index += MIH_C_UNSIGNED_INT22String(&primitiveP->ExecutionDelay, &bufP[buffer_index]);
if (primitiveP->PoALinkAddress != NULL) {
buffer_index += MIH_C_LINK_ADDR2String(primitiveP->PoALinkAddress, &bufP[buffer_index]);
}
buffer_index += sprintf(&bufP[buffer_index], "\n");
return buffer_index;
}
#ifdef MIH_C_MEDIEVAL_EXTENSIONS
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Encode_Link_Register_indication(Bit_Buffer_t* bbP, MIH_C_Link_Register_indication_t *primitiveP)
{
//-----------------------------------------------------------------------------
MIH_C_TLV_TYPE_T tlv;
unsigned int saved_byte_position;
unsigned int end_byte_position;
unsigned int hole_size;
u_int16_t encode_length;
// TYPE
tlv = MIH_C_TLV_LINK_INTERFACE_TYPE_ADDR;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// VALUE
saved_byte_position = BitBuffer_getPosition(bbP);
MIH_C_LINK_ID_encode(bbP, &primitiveP->Link_Id);
end_byte_position = BitBuffer_getPosition(bbP);
// LENGTH
encode_length = end_byte_position - saved_byte_position;
hole_size = MIH_C_LIST_LENGTH_get_encode_num_bytes(encode_length);
BitBuffer_write_shift_last_n_bytes_right(bbP, encode_length, hole_size);
BitBuffer_rewind_to(bbP, saved_byte_position);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
BitBuffer_rewind_to(bbP, end_byte_position + hole_size);
return MIH_PRIMITIVE_ENCODE_OK;
}
#endif
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Link_Register_indication2String(MIH_C_Link_Register_indication_t *primitiveP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index += sprintf(&bufP[buffer_index], "--------------------------------------------------\n");
buffer_index += sprintf(&bufP[buffer_index], "- PRIMITIVE Link_Register.indication -\n");
buffer_index += sprintf(&bufP[buffer_index], "--------------------------------------------------\n");
buffer_index += MIH_C_LINK_ID2String(&primitiveP->Link_Id, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\n");
return buffer_index;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Encode_Link_Detected_indication(Bit_Buffer_t* bbP, MIH_C_Link_Detected_indication_t *primitiveP)
{
//-----------------------------------------------------------------------------
MIH_C_TLV_TYPE_T tlv;
unsigned int saved_byte_position;
unsigned int end_byte_position;
unsigned int hole_size;
u_int16_t encode_length;
// TYPE
tlv = MIH_C_TLV_LINK_DET_INFO;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// VALUE
saved_byte_position = BitBuffer_getPosition(bbP);
MIH_C_LINK_DET_INFO_encode(bbP, &primitiveP->LinkDetectedInfo);
end_byte_position = BitBuffer_getPosition(bbP);
// LENGTH
encode_length = end_byte_position - saved_byte_position;
hole_size = MIH_C_LIST_LENGTH_get_encode_num_bytes(encode_length);
BitBuffer_write_shift_last_n_bytes_right(bbP, encode_length, hole_size);
BitBuffer_rewind_to(bbP, saved_byte_position);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
BitBuffer_rewind_to(bbP, end_byte_position + hole_size);
return MIH_PRIMITIVE_ENCODE_OK;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Encode_Link_Up_indication(Bit_Buffer_t* bbP, MIH_C_Link_Up_indication_t *primitiveP)
{
//-----------------------------------------------------------------------------
MIH_C_TLV_TYPE_T tlv;
unsigned int saved_byte_position;
unsigned int end_byte_position;
unsigned int hole_size;
u_int16_t encode_length;
// TYPE
tlv = MIH_C_TLV_LINK_IDENTIFIER;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// VALUE
saved_byte_position = BitBuffer_getPosition(bbP);
MIH_C_LINK_TUPLE_ID_encode(bbP, &primitiveP->LinkIdentifier);
end_byte_position = BitBuffer_getPosition(bbP);
// LENGTH
encode_length = end_byte_position - saved_byte_position;
hole_size = MIH_C_LIST_LENGTH_get_encode_num_bytes(encode_length);
BitBuffer_write_shift_last_n_bytes_right(bbP, encode_length, hole_size);
BitBuffer_rewind_to(bbP, saved_byte_position);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
BitBuffer_rewind_to(bbP, end_byte_position + hole_size);
if (primitiveP->OldAccessRouter) {
// TYPE
tlv = MIH_C_TLV_OLD_ACCESS_ROUTER;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// VALUE
saved_byte_position = BitBuffer_getPosition(bbP);
MIH_C_LINK_ADDR_encode(bbP, primitiveP->OldAccessRouter);
end_byte_position = BitBuffer_getPosition(bbP);
// LENGTH
encode_length = end_byte_position - saved_byte_position;
hole_size = MIH_C_LIST_LENGTH_get_encode_num_bytes(encode_length);
BitBuffer_write_shift_last_n_bytes_right(bbP, encode_length, hole_size);
BitBuffer_rewind_to(bbP, saved_byte_position);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
BitBuffer_rewind_to(bbP, end_byte_position + hole_size);
}
if (primitiveP->NewAccessRouter) {
// TYPE
tlv = MIH_C_TLV_NEW_ACCESS_ROUTER;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// VALUE
saved_byte_position = BitBuffer_getPosition(bbP);
MIH_C_LINK_ADDR_encode(bbP, primitiveP->NewAccessRouter);
end_byte_position = BitBuffer_getPosition(bbP);
// LENGTH
encode_length = end_byte_position - saved_byte_position;
hole_size = MIH_C_LIST_LENGTH_get_encode_num_bytes(encode_length);
BitBuffer_write_shift_last_n_bytes_right(bbP, encode_length, hole_size);
BitBuffer_rewind_to(bbP, saved_byte_position);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
BitBuffer_rewind_to(bbP, end_byte_position + hole_size);
}
if (primitiveP->IPRenewalFlag) {
// TYPE
tlv = MIH_C_TLV_IP_RENEWAL_FLAG;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// VALUE
saved_byte_position = BitBuffer_getPosition(bbP);
MIH_C_IP_RENEWAL_FLAG_encode(bbP, primitiveP->IPRenewalFlag);
end_byte_position = BitBuffer_getPosition(bbP);
// LENGTH
encode_length = end_byte_position - saved_byte_position;
hole_size = MIH_C_LIST_LENGTH_get_encode_num_bytes(encode_length);
BitBuffer_write_shift_last_n_bytes_right(bbP, encode_length, hole_size);
BitBuffer_rewind_to(bbP, saved_byte_position);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
BitBuffer_rewind_to(bbP, end_byte_position + hole_size);
}
if (primitiveP->MobilityManagementSupport) {
// TYPE
tlv = MIH_C_TLV_MOBILITY_MANAGEMENT_SUPPORT;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// VALUE
saved_byte_position = BitBuffer_getPosition(bbP);
MIH_C_IP_MOB_MGMT_encode(bbP, primitiveP->MobilityManagementSupport);
end_byte_position = BitBuffer_getPosition(bbP);
// LENGTH
encode_length = end_byte_position - saved_byte_position;
hole_size = MIH_C_LIST_LENGTH_get_encode_num_bytes(encode_length);
BitBuffer_write_shift_last_n_bytes_right(bbP, encode_length, hole_size);
BitBuffer_rewind_to(bbP, saved_byte_position);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
BitBuffer_rewind_to(bbP, end_byte_position + hole_size);
}
return MIH_PRIMITIVE_ENCODE_OK;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Encode_Link_Parameters_Report_indication(Bit_Buffer_t* bbP, MIH_C_Link_Parameters_Report_indication_t *primitiveP)
{
//-----------------------------------------------------------------------------
MIH_C_TLV_TYPE_T tlv;
unsigned int saved_byte_position;
unsigned int end_byte_position;
unsigned int hole_size;
u_int16_t encode_length;
// ------- LinkIdentifier--------
// TYPE
tlv = MIH_C_TLV_LINK_IDENTIFIER;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// VALUE
saved_byte_position = BitBuffer_getPosition(bbP);
MIH_C_LINK_TUPLE_ID_encode(bbP, &primitiveP->LinkIdentifier);
end_byte_position = BitBuffer_getPosition(bbP);
// LENGTH
encode_length = end_byte_position - saved_byte_position;
hole_size = MIH_C_LIST_LENGTH_get_encode_num_bytes(encode_length);
BitBuffer_write_shift_last_n_bytes_right(bbP, encode_length, hole_size);
BitBuffer_rewind_to(bbP, saved_byte_position);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
BitBuffer_rewind_to(bbP, end_byte_position + hole_size);
// ------- LinkParametersReportList_list--------
// TYPE
tlv = MIH_C_TLV_LINK_PARAMETER_REPORT_LIST;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// VALUE
saved_byte_position = BitBuffer_getPosition(bbP);
MIH_C_LINK_PARAM_RPT_LIST_encode(bbP, &primitiveP->LinkParametersReportList_list);
end_byte_position = BitBuffer_getPosition(bbP);
// LENGTH
encode_length = end_byte_position - saved_byte_position;
hole_size = MIH_C_LIST_LENGTH_get_encode_num_bytes(encode_length);
BitBuffer_write_shift_last_n_bytes_right(bbP, encode_length, hole_size);
BitBuffer_rewind_to(bbP, saved_byte_position);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
BitBuffer_rewind_to(bbP, end_byte_position + hole_size);
return MIH_PRIMITIVE_ENCODE_OK;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Encode_Link_Going_Down_indication(Bit_Buffer_t* bbP, MIH_C_Link_Going_Down_indication_t *primitiveP)
{
//-----------------------------------------------------------------------------
MIH_C_TLV_TYPE_T tlv;
unsigned int saved_byte_position;
unsigned int end_byte_position;
unsigned int hole_size;
u_int16_t encode_length;
// ------- LinkIdentifier--------
// TYPE
tlv = MIH_C_TLV_LINK_IDENTIFIER;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// VALUE
saved_byte_position = BitBuffer_getPosition(bbP);
MIH_C_LINK_TUPLE_ID_encode(bbP, &primitiveP->LinkIdentifier);
end_byte_position = BitBuffer_getPosition(bbP);
// LENGTH
encode_length = end_byte_position - saved_byte_position;
hole_size = MIH_C_LIST_LENGTH_get_encode_num_bytes(encode_length);
BitBuffer_write_shift_last_n_bytes_right(bbP, encode_length, hole_size);
BitBuffer_rewind_to(bbP, saved_byte_position);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
BitBuffer_rewind_to(bbP, end_byte_position + hole_size);
// ------- TimeInterval--------
// TYPE
tlv = MIH_C_TLV_LINK_TIME_INTERVAL;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
MIH_C_LIST_LENGTH_encode(bbP, sizeof(MIH_C_UNSIGNED_INT2_T));
// VALUE
MIH_C_UNSIGNED_INT2_encode(bbP, &primitiveP->TimeInterval);
// ------- LinkGoingDownReason--------
// TYPE
tlv = MIH_C_TLV_LINK_GOING_DOWN_REASON_CODE;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
MIH_C_LIST_LENGTH_encode(bbP, sizeof(MIH_C_LINK_GD_REASON_T));
// VALUE
MIH_C_LINK_GD_REASON_encode(bbP, &primitiveP->LinkGoingDownReason);
return MIH_PRIMITIVE_ENCODE_OK;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Encode_Link_Down_indication(Bit_Buffer_t* bbP, MIH_C_Link_Down_indication_t *primitiveP)
{
//-----------------------------------------------------------------------------
MIH_C_TLV_TYPE_T tlv;
unsigned int saved_byte_position;
unsigned int end_byte_position;
unsigned int hole_size;
u_int16_t encode_length;
// ------- LinkIdentifier--------
// TYPE
tlv = MIH_C_TLV_LINK_IDENTIFIER;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// VALUE
saved_byte_position = BitBuffer_getPosition(bbP);
MIH_C_LINK_TUPLE_ID_encode(bbP, &primitiveP->LinkIdentifier);
end_byte_position = BitBuffer_getPosition(bbP);
// LENGTH
encode_length = end_byte_position - saved_byte_position;
hole_size = MIH_C_LIST_LENGTH_get_encode_num_bytes(encode_length);
BitBuffer_write_shift_last_n_bytes_right(bbP, encode_length, hole_size);
BitBuffer_rewind_to(bbP, saved_byte_position);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
BitBuffer_rewind_to(bbP, end_byte_position + hole_size);
// ------- OldAccessRouter--------
if (primitiveP->OldAccessRouter != NULL) {
// TYPE
tlv = MIH_C_TLV_OLD_ACCESS_ROUTER;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// VALUE
saved_byte_position = BitBuffer_getPosition(bbP);
MIH_C_LINK_ADDR_encode(bbP, primitiveP->OldAccessRouter);
end_byte_position = BitBuffer_getPosition(bbP);
// LENGTH
encode_length = end_byte_position - saved_byte_position;
hole_size = MIH_C_LIST_LENGTH_get_encode_num_bytes(encode_length);
BitBuffer_write_shift_last_n_bytes_right(bbP, encode_length, hole_size);
BitBuffer_rewind_to(bbP, saved_byte_position);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
BitBuffer_rewind_to(bbP, end_byte_position + hole_size);
}
// ------- ReasonCode--------
// TYPE
tlv = MIH_C_TLV_LINK_DOWN_REASON_CODE;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
MIH_C_LIST_LENGTH_encode(bbP, sizeof(MIH_C_LINK_DN_REASON_T));
// VALUE
MIH_C_LINK_DN_REASON_encode(bbP, &primitiveP->ReasonCode);
return MIH_PRIMITIVE_ENCODE_OK;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Encode_Link_Capability_Discover_confirm(Bit_Buffer_t* bbP, MIH_C_Link_Capability_Discover_confirm_t *primitiveP)
{
//-----------------------------------------------------------------------------
MIH_C_TLV_TYPE_T tlv;
u_int16_t encode_length;
//--------- Status ------------
// TYPE
tlv = MIH_C_TLV_STATUS;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// LENGTH
encode_length = sizeof(MIH_C_STATUS_T);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
// VALUE
MIH_C_STATUS_encode(bbP, &primitiveP->Status);
//--------- SupportedLinkEventList ------------
if (primitiveP->SupportedLinkEventList != NULL) {
// TYPE
tlv = MIH_C_TLV_LINK_EVENT_LIST;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// LENGTH
encode_length = sizeof(MIH_C_LINK_EVENT_LIST_T);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
// VALUE
MIH_C_LINK_EVENT_LIST_encode(bbP, primitiveP->SupportedLinkEventList);
}
//--------- SupportedLinkCommandList ------------
if (primitiveP->SupportedLinkCommandList != NULL) {
// TYPE
tlv = MIH_C_TLV_LINK_CMD_LIST;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// LENGTH
encode_length = sizeof(MIH_C_LINK_CMD_LIST_T);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
// VALUE
MIH_C_LINK_CMD_LIST_encode(bbP, primitiveP->SupportedLinkCommandList);
}
return MIH_PRIMITIVE_ENCODE_OK;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Link_Capability_Discover_confirm2String(MIH_C_Link_Capability_Discover_confirm_t *primitiveP, char* bufP)
{
//-----------------------------------------------------------------------------
unsigned int buffer_index = 0;
buffer_index += sprintf(&bufP[buffer_index], "--------------------------------------------------\n");
buffer_index += sprintf(&bufP[buffer_index], "- PRIMITIVE Capability_Discover.confirm -\n");
buffer_index += sprintf(&bufP[buffer_index], "--------------------------------------------------\n");
buffer_index += sprintf(&bufP[buffer_index], "STATUS = ");
buffer_index += MIH_C_STATUS2String(&primitiveP->Status, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nLINK_EVENT_LIST = ");
buffer_index += MIH_C_LINK_EVENT_LIST2String(primitiveP->SupportedLinkEventList, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\nLINK_CMD_LIST = ");
buffer_index += MIH_C_LINK_CMD_LIST2String(primitiveP->SupportedLinkEventList, &bufP[buffer_index]);
buffer_index += sprintf(&bufP[buffer_index], "\n");
return buffer_index;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Encode_Link_Event_Subscribe_confirm(Bit_Buffer_t* bbP, MIH_C_Link_Event_Subscribe_confirm_t *primitiveP)
{
//-----------------------------------------------------------------------------
MIH_C_TLV_TYPE_T tlv;
u_int16_t encode_length;
//--------- Status ------------
// TYPE
tlv = MIH_C_TLV_STATUS;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// LENGTH
encode_length = sizeof(MIH_C_STATUS_T);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
// VALUE
MIH_C_STATUS_encode(bbP, &primitiveP->Status);
//--------- SupportedLinkEventList ------------
if (primitiveP->ResponseLinkEventList != NULL) {
// TYPE
tlv = MIH_C_TLV_LINK_EVENT_LIST;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// LENGTH
// Bitmap
encode_length = sizeof(MIH_C_LINK_EVENT_LIST_T);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
// VALUE
MIH_C_LINK_EVENT_LIST_encode(bbP, primitiveP->ResponseLinkEventList);
}
return MIH_PRIMITIVE_ENCODE_OK;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Encode_Link_Event_Unsubscribe_confirm(Bit_Buffer_t* bbP, MIH_C_Link_Event_Unsubscribe_confirm_t *primitiveP)
{
//-----------------------------------------------------------------------------
MIH_C_TLV_TYPE_T tlv;
u_int16_t encode_length;
//--------- Status ------------
// TYPE
tlv = MIH_C_TLV_STATUS;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// LENGTH
encode_length = sizeof(MIH_C_STATUS_T);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
// VALUE
MIH_C_STATUS_encode(bbP, &primitiveP->Status);
//--------- SupportedLinkEventList ------------
if (primitiveP->ResponseLinkEventList != NULL) {
// TYPE
tlv = MIH_C_TLV_LINK_EVENT_LIST;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// LENGTH
// Bitmap
encode_length = sizeof(MIH_C_LINK_EVENT_LIST_T);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
// VALUE
MIH_C_LINK_EVENT_LIST_encode(bbP, primitiveP->ResponseLinkEventList);
}
return MIH_PRIMITIVE_ENCODE_OK;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Encode_Link_Configure_Thresholds_confirm(Bit_Buffer_t* bbP, MIH_C_Link_Configure_Thresholds_confirm_t *primitiveP)
{
//-----------------------------------------------------------------------------
MIH_C_TLV_TYPE_T tlv;
u_int16_t encode_length;
//--------- Status ------------
// TYPE
tlv = MIH_C_TLV_STATUS;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// LENGTH
encode_length = sizeof(MIH_C_STATUS_T);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
// VALUE
MIH_C_STATUS_encode(bbP, &primitiveP->Status);
//--------- SupportedLinkEventList ------------
if (primitiveP->LinkConfigureStatusList_list != NULL) {
// TYPE
tlv = MIH_C_TLV_CONFIGURE_RESPONSE_LIST;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// LENGTH
encode_length = sizeof(MIH_C_LINK_CFG_STATUS_T) * primitiveP->LinkConfigureStatusList_list->length;
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
// VALUE
MIH_C_LINK_CFG_STATUS_LIST_encode(bbP, primitiveP->LinkConfigureStatusList_list);
}
return MIH_PRIMITIVE_ENCODE_OK;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Encode_Link_Get_Parameters_confirm(Bit_Buffer_t* bbP, MIH_C_Link_Get_Parameters_confirm_t *primitiveP)
{
//-----------------------------------------------------------------------------
MIH_C_TLV_TYPE_T tlv;
unsigned int saved_byte_position;
unsigned int end_byte_position;
unsigned int hole_size;
u_int16_t encode_length;
//--------- Status ------------
// TYPE
tlv = MIH_C_TLV_STATUS;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// LENGTH
encode_length = sizeof(MIH_C_STATUS_T);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
// VALUE
MIH_C_STATUS_encode(bbP, &primitiveP->Status);
//--------- LinkParametersStatusList_list ------------
// TYPE
tlv = MIH_C_TLV_LINK_PARAMETERS_STATUS_LIST;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// VALUE
saved_byte_position = BitBuffer_getPosition(bbP);
MIH_C_LINK_PARAM_LIST_encode(bbP, primitiveP->LinkParametersStatusList_list);
end_byte_position = BitBuffer_getPosition(bbP);
// LENGTH (BECAUSE LinkParametersStatusList_list contains a list)
encode_length = end_byte_position - saved_byte_position;
hole_size = MIH_C_LIST_LENGTH_get_encode_num_bytes(encode_length);
BitBuffer_write_shift_last_n_bytes_right(bbP, encode_length, hole_size);
BitBuffer_rewind_to(bbP, saved_byte_position);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
BitBuffer_rewind_to(bbP, end_byte_position + hole_size);
//--------- LinkStatesResponse_list ------------
// TYPE
tlv = MIH_C_TLV_LINK_STATES_RSP_LIST;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// VALUE
saved_byte_position = BitBuffer_getPosition(bbP);
MIH_C_LINK_STATES_RSP_LIST_encode(bbP, primitiveP->LinkStatesResponse_list);
end_byte_position = BitBuffer_getPosition(bbP);
// LENGTH (DONE AFTER BECAUSE CONTAINS CHOICES OF NOT EQUAL SIZES)
encode_length = end_byte_position - saved_byte_position;
hole_size = MIH_C_LIST_LENGTH_get_encode_num_bytes(encode_length);
BitBuffer_write_shift_last_n_bytes_right(bbP, encode_length, hole_size);
BitBuffer_rewind_to(bbP, saved_byte_position);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
BitBuffer_rewind_to(bbP, end_byte_position + hole_size);
//--------- LinkDescriptorsResponse_list ------------
// TYPE
tlv = MIH_C_TLV_LINK_DESC_RSP_LIST;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// VALUE
saved_byte_position = BitBuffer_getPosition(bbP);
MIH_C_LINK_DESC_RSP_LIST_encode(bbP, primitiveP->LinkDescriptorsResponse_list);
end_byte_position = BitBuffer_getPosition(bbP);
// LENGTH
encode_length = end_byte_position - saved_byte_position;
hole_size = MIH_C_LIST_LENGTH_get_encode_num_bytes(encode_length);
BitBuffer_write_shift_last_n_bytes_right(bbP, encode_length, hole_size);
BitBuffer_rewind_to(bbP, saved_byte_position);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
BitBuffer_rewind_to(bbP, end_byte_position + hole_size);
return MIH_PRIMITIVE_ENCODE_OK;
}
//-----------------------------------------------------------------------------
int MIH_C_Link_Primitive_Encode_Link_Action_confirm(Bit_Buffer_t* bbP, MIH_C_Link_Action_confirm_t *primitiveP)
{
//-----------------------------------------------------------------------------
MIH_C_TLV_TYPE_T tlv;
unsigned int saved_byte_position;
unsigned int end_byte_position;
unsigned int hole_size;
u_int16_t encode_length;
//--------- Status ------------
// TYPE
tlv = MIH_C_TLV_STATUS;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// LENGTH
encode_length = sizeof(MIH_C_STATUS_T);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
// VALUE
MIH_C_STATUS_encode(bbP, &primitiveP->Status);
if (primitiveP->Status == MIH_C_STATUS_SUCCESS) {
if (primitiveP->ScanResponseSet_list != NULL) {
//--------- ScanResponseSet_list ------------
// TYPE
tlv = MIH_C_TLV_LINK_SCAN_RSP_LIST;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// VALUE
saved_byte_position = BitBuffer_getPosition(bbP);
MIH_C_LINK_SCAN_RSP_LIST_encode(bbP, primitiveP->ScanResponseSet_list);
end_byte_position = BitBuffer_getPosition(bbP);
// LENGTH
encode_length = end_byte_position - saved_byte_position;
hole_size = MIH_C_LIST_LENGTH_get_encode_num_bytes(encode_length);
BitBuffer_write_shift_last_n_bytes_right(bbP, encode_length, hole_size);
BitBuffer_rewind_to(bbP, saved_byte_position);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
BitBuffer_rewind_to(bbP, end_byte_position + hole_size);
}
//--------- LinkActionResult ------------
// TYPE
tlv = MIH_C_TLV_LINK_AC_RESULT;
MIH_C_TLV_TYPE_encode(bbP, &tlv);
// VALUE
saved_byte_position = BitBuffer_getPosition(bbP);
MIH_C_LINK_AC_RESULT_encode(bbP, primitiveP->LinkActionResult);
end_byte_position = BitBuffer_getPosition(bbP);
// LENGTH
encode_length = end_byte_position - saved_byte_position;
hole_size = MIH_C_LIST_LENGTH_get_encode_num_bytes(encode_length);
BitBuffer_write_shift_last_n_bytes_right(bbP, encode_length, hole_size);
BitBuffer_rewind_to(bbP, saved_byte_position);
MIH_C_LIST_LENGTH_encode(bbP, encode_length);
BitBuffer_rewind_to(bbP, end_byte_position + hole_size);
}
return MIH_PRIMITIVE_ENCODE_OK;
}
File diff suppressed because it is too large Load Diff
@@ -1,16 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
<html xml:lang="en">
<head>
<title> </title>
</head>
<body>-->
&nbsp;
&nbsp;
<DIV ALIGN=CENTER>
<img alt="EURECOM - PMIP6D" src="http://mmsp01.eurecom.fr/EURECOM_logo.gif" height="90" width="270" />
</DIV>
</body>
</html>
@@ -1,63 +0,0 @@
/*******************************************************************************
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 MIH_C.h
* \brief This file must be the only file to be included in code dealing with the MIH_C interface.
* \author BRIZZOLA Davide, GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
#ifndef __MIH_C_H__
# define __MIH_C_H__
#include "MIH_C_bit_buffer.h"
#include "UTIL/LOG/log.h"
#include "MIH_C_Link_Constants.h"
#include "MIH_C_Types.h"
#include "MIH_C_header_codec.h"
#include "MIH_C_F1_basic_data_types_codec.h"
#include "MIH_C_F2_general_data_types_codec.h"
#include "MIH_C_F3_data_types_for_address_codec.h"
#include "MIH_C_F4_data_types_for_links_codec.h"
#include "MIH_C_F9_data_types_for_qos_codec.h"
#include "MIH_C_F13_data_types_for_information_elements_codec.h"
#include "MIH_C_L2_type_values_for_tlv_encoding.h"
#include "MIH_C_Medieval_extensions.h"
#include "MIH_C_Link_Primitives.h"
#include "MIH_C_Link_Messages.h"
#include "MIH_C_primitive_codec.h"
#include "MIH_C_msg_codec.h"
void MIH_C_init(void);
void MIH_C_exit(void);
#define DEBUG_TRACE_DETAILS
#endif
@@ -1,75 +0,0 @@
/*******************************************************************************
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 MIH_C_F13_data_types_for_information_elements_codec.h
* \brief This file defines the prototypes of the functions for coding and decoding Data type for information elements defined in Std 802.21-2008 Table F13.
* \author BRIZZOLA Davide, GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
/** \defgroup MIH_C_F13_DATA_TYPES_FOR_INFORMATION_ELEMENTS F13 Data types for information elements
* \ingroup MIH_C_INTERFACE
*
* @{
*/
#ifndef __MIH_C_F13_DATA_TYPES_FOR_INFORMATION_ELEMENTS_H__
# define __MIH_C_F13_DATA_TYPES_FOR_INFORMATION_ELEMENTS_H__
//-----------------------------------------------------------------------------
# ifdef MIH_C_F13_DATA_TYPES_FOR_INFORMATION_ELEMENTS_C
# define private_F13_codec(x) x
# define protected_F13_codec(x) x
# define public_F13_codec(x) x
# else
# ifdef MIH_C_INTERFACE
# define private_F13_codec(x)
# define protected_F13_codec(x) extern x
# define public_F13_codec(x) extern x
# else
# define private_F13_codec(x)
# define protected_F13_codec(x)
# define public_F13_codec(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <ctype.h>
//-----------------------------------------------------------------------------
#include "MIH_C.h"
//-----------------------------------------------------------------------------
#endif
/** @}*/
@@ -1,133 +0,0 @@
/*******************************************************************************
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 MIH_C_F1_basic_data_types_codec.h
* \brief This file defines the prototypes of the functions for coding and decoding basic data types defined in Std 802.21-2008 Table F1.
* \author BRIZZOLA Davide, GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
/** \defgroup MIH_C_F1_BASIC_DATA_TYPES F1 Basic data types codec
* \ingroup MIH_C_INTERFACE
*
* @{
*/
#ifndef __MIH_C_F1_BASIC_DATA_TYPES_CODEC_H__
# define __MIH_C_F1_BASIC_DATA_TYPES_CODEC_H__
//-----------------------------------------------------------------------------
# ifdef MIH_C_F1_BASIC_DATA_TYPES_CODEC_C
# define private_F1_codec(x) x
# define protected_F1_codec(x) x
# define public_F1_codec(x) x
# else
# ifdef MIH_C_INTERFACE
# define private_F1_codec(x)
# define protected_F1_codec(x) extern x
# define public_F1_codec(x) extern x
# else
# define private_F1_codec(x)
# define protected_F1_codec(x)
# define public_F1_codec(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <ctype.h>
//-----------------------------------------------------------------------------
#include "MIH_C.h"
//-----------------------------------------------------------------------------
typedef struct MIH_C_F1_Generic_List {
u_int16_t length;
u_int8_t val[2];
} MIH_C_F1_Generic_List_t;
//-----------------------------------------------------------------------------
typedef struct MIH_C_F1_Generic_Octet {
u_int8_t val[2];
} MIH_C_F1_Generic_Octet_t;
//-----------------------------------------------------------------------------
public_F1_codec( void MIH_C_BITMAP8_encode (Bit_Buffer_t* bbP, MIH_C_BITMAP8_T* dataP);)
public_F1_codec( void MIH_C_BITMAP16_encode (Bit_Buffer_t* bbP, MIH_C_BITMAP16_T* dataP);)
public_F1_codec( void MIH_C_BITMAP24_encode (Bit_Buffer_t* bbP, MIH_C_BITMAP24_T* dataP);)
public_F1_codec( void MIH_C_BITMAP32_encode (Bit_Buffer_t* bbP, MIH_C_BITMAP32_T* dataP);)
public_F1_codec( void MIH_C_BITMAP64_encode (Bit_Buffer_t* bbP, MIH_C_BITMAP64_T* dataP);)
public_F1_codec( void MIH_C_BITMAP128_encode (Bit_Buffer_t* bbP, MIH_C_BITMAP128_T* dataP);)
public_F1_codec( void MIH_C_BITMAP256_encode (Bit_Buffer_t* bbP, MIH_C_BITMAP256_T* dataP);)
public_F1_codec( void MIH_C_CHOICE_encode (Bit_Buffer_t* bbP, MIH_C_CHOICE_T* dataP);)
public_F1_codec( void MIH_C_INTEGER1_encode (Bit_Buffer_t* bbP, MIH_C_INTEGER1_T* dataP);)
public_F1_codec( void MIH_C_INTEGER2_encode (Bit_Buffer_t* bbP, MIH_C_INTEGER2_T* dataP);)
public_F1_codec( void MIH_C_INTEGER4_encode (Bit_Buffer_t* bbP, MIH_C_INTEGER4_T* dataP);)
public_F1_codec( void MIH_C_INTEGER8_encode (Bit_Buffer_t* bbP, MIH_C_INTEGER8_T* dataP);)
public_F1_codec( void MIH_C_NULL_encode (Bit_Buffer_t* bbP, MIH_C_NULL_T* dataP);)
public_F1_codec( void MIH_C_OCTET_encode (Bit_Buffer_t* bbP, MIH_C_F1_Generic_Octet_t *dataP, int lengthP);)
public_F1_codec( void MIH_C_UNSIGNED_INT1_encode(Bit_Buffer_t* bbP, MIH_C_UNSIGNED_INT1_T* dataP);)
public_F1_codec( void MIH_C_UNSIGNED_INT2_encode(Bit_Buffer_t* bbP, MIH_C_UNSIGNED_INT2_T* dataP);)
public_F1_codec( void MIH_C_UNSIGNED_INT4_encode(Bit_Buffer_t* bbP, MIH_C_UNSIGNED_INT4_T* dataP);)
public_F1_codec( void MIH_C_UNSIGNED_INT8_encode(Bit_Buffer_t* bbP, MIH_C_UNSIGNED_INT8_T* dataP);)
public_F1_codec( void MIH_C_LIST_LENGTH_encode (Bit_Buffer_t* bbP, u_int16_t lengthP);)
//-----------------------------------------------------------------------------
public_F1_codec( void MIH_C_BITMAP8_decode (Bit_Buffer_t* bbP, MIH_C_BITMAP8_T* dataP);)
public_F1_codec( void MIH_C_BITMAP16_decode (Bit_Buffer_t* bbP, MIH_C_BITMAP16_T* dataP);)
public_F1_codec( void MIH_C_BITMAP24_decode (Bit_Buffer_t* bbP, MIH_C_BITMAP24_T* dataP);)
public_F1_codec( void MIH_C_BITMAP32_decode (Bit_Buffer_t* bbP, MIH_C_BITMAP32_T* dataP);)
public_F1_codec( void MIH_C_BITMAP64_decode (Bit_Buffer_t* bbP, MIH_C_BITMAP64_T* dataP);)
public_F1_codec( void MIH_C_BITMAP128_decode (Bit_Buffer_t* bbP, MIH_C_BITMAP128_T* dataP);)
public_F1_codec( void MIH_C_BITMAP256_decode (Bit_Buffer_t* bbP, MIH_C_BITMAP256_T* dataP);)
public_F1_codec( void MIH_C_CHOICE_decode (Bit_Buffer_t* bbP, MIH_C_CHOICE_T* dataP);)
public_F1_codec( void MIH_C_INTEGER1_decode (Bit_Buffer_t* bbP, MIH_C_INTEGER1_T* dataP);)
public_F1_codec( void MIH_C_INTEGER2_decode (Bit_Buffer_t* bbP, MIH_C_INTEGER2_T* dataP);)
public_F1_codec( void MIH_C_INTEGER4_decode (Bit_Buffer_t* bbP, MIH_C_INTEGER4_T* dataP);)
public_F1_codec( void MIH_C_INTEGER8_decode (Bit_Buffer_t* bbP, MIH_C_INTEGER8_T* dataP);)
public_F1_codec( void MIH_C_NULL_decode (Bit_Buffer_t* bbP);)
public_F1_codec( void MIH_C_OCTET_decode (Bit_Buffer_t* bbP, MIH_C_F1_Generic_Octet_t *dataP, int lengthP);)
public_F1_codec( void MIH_C_UNSIGNED_INT1_decode (Bit_Buffer_t* bbP, MIH_C_UNSIGNED_INT1_T* dataP);)
public_F1_codec( void MIH_C_UNSIGNED_INT2_decode (Bit_Buffer_t* bbP, MIH_C_UNSIGNED_INT2_T* dataP);)
public_F1_codec( void MIH_C_UNSIGNED_INT4_decode (Bit_Buffer_t* bbP, MIH_C_UNSIGNED_INT4_T* dataP);)
public_F1_codec( void MIH_C_UNSIGNED_INT8_decode (Bit_Buffer_t* bbP, MIH_C_UNSIGNED_INT8_T* dataP);)
public_F1_codec( void MIH_C_LIST_LENGTH_decode (Bit_Buffer_t* bbP, u_int16_t *lengthP);)
//-----------------------------------------------------------------------------
public_F1_codec( unsigned int MIH_C_BITMAP82String(MIH_C_BITMAP8_T* dataP, char* bufP);)
public_F1_codec( unsigned int MIH_C_BITMAP162String(MIH_C_BITMAP16_T* dataP, char* bufP);)
public_F1_codec( unsigned int MIH_C_BITMAP242String(MIH_C_BITMAP24_T* dataP, char* bufP);)
public_F1_codec( unsigned int MIH_C_UNSIGNED_INT12String(MIH_C_UNSIGNED_INT1_T* dataP, char* bufP);)
public_F1_codec( unsigned int MIH_C_UNSIGNED_INT22String(MIH_C_UNSIGNED_INT2_T* dataP, char* bufP);)
public_F1_codec( unsigned int MIH_C_UNSIGNED_INT42String(MIH_C_UNSIGNED_INT4_T* dataP, char* bufP);)
public_F1_codec( unsigned int MIH_C_UNSIGNED_INT82String(MIH_C_UNSIGNED_INT8_T* dataP, char* bufP);)
//-----------------------------------------------------------------------------
public_F1_codec(u_int16_t MIH_C_LIST_LENGTH_get_encode_num_bytes(u_int16_t lengthP);)
#endif
/** @}*/
@@ -1,77 +0,0 @@
/*******************************************************************************
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 MIH_C_F2_general_data_types_codec.h
* \brief This file defines the prototypes of the functions for coding and decoding general data types defined in Std 802.21-2008 Table F2.
* \author BRIZZOLA Davide, GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
/** \defgroup MIH_C_F2_GENERAL_DATA_TYPES_CODEC F2 General data types codec
* \ingroup MIH_C_INTERFACE
*
* @{
*/
#ifndef __MIH_C_F2_GENERAL_DATA_TYPES_CODEC_H__
# define __MIH_C_F2_GENERAL_DATA_TYPES_CODEC_H__
//-----------------------------------------------------------------------------
# ifdef MIH_C_F2_GENERAL_DATA_TYPES_CODEC_C
# define private_F2_codec(x) x
# define protected_F2_codec(x) x
# define public_F2_codec(x) x
# else
# ifdef MIH_C_INTERFACE
# define private_F2_codec(x)
# define protected_F2_codec(x) extern x
# define public_F2_codec(x) extern x
# else
# define private_F2_codec(x)
# define protected_F2_codec(x)
# define public_F2_codec(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <ctype.h>
//-----------------------------------------------------------------------------
#include "MIH_C.h"
//-----------------------------------------------------------------------------
public_F2_codec( unsigned int MIH_C_BOOLEAN2String(MIH_C_BOOLEAN_T* dataP, char* bufP);)
public_F2_codec( unsigned int MIH_C_STATUS2String(MIH_C_STATUS_T *statusP, char* bufP);)
#endif
/** @}*/
@@ -1,83 +0,0 @@
/*******************************************************************************
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 MIH_C_F3_data_types_for_address_codec.h
* \brief This file defines the prototypes of the functions for coding and decoding data types for addresses defined in Std 802.21-2008 Table F3.
* \author BRIZZOLA Davide, GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
/** \defgroup MIH_C_F3_DATA_TYPES_FOR_ADDRESS_CODEC F3 Data types for address codec
* \ingroup MIH_C_INTERFACE
*
* @{
*/
#ifndef __MIH_C_F3_DATA_TYPES_FOR_ADDRESS_CODEC_H__
# define __MIH_C_F3_DATA_TYPES_FOR_ADDRESS_CODEC_H__
//-----------------------------------------------------------------------------
# ifdef MIH_C_F3_DATA_TYPES_FOR_ADDRESS_CODEC_C
# define private_F3_codec(x) x
# define protected_F3_codec(x) x
# define public_F3_codec(x) x
# else
# ifdef MIH_C_INTERFACE
# define private_F3_codec(x)
# define protected_F3_codec(x) extern x
# define public_F3_codec(x) extern x
# else
# define private_F3_codec(x)
# define protected_F3_codec(x)
# define public_F3_codec(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <ctype.h>
//-----------------------------------------------------------------------------
#include "MIH_C.h"
//-----------------------------------------------------------------------------
public_F3_codec(unsigned int MIH_C_3GPP_2G_CELL_ID2String(MIH_C_3GPP_2G_CELL_ID_T *dataP, char* bufP);)
public_F3_codec(void MIH_C_3GPP_2G_CELL_ID_encode (Bit_Buffer_t* bbP, MIH_C_3GPP_2G_CELL_ID_T *dataP);)
public_F3_codec(void MIH_C_3GPP_2G_CELL_ID_decode (Bit_Buffer_t* bbP, MIH_C_3GPP_2G_CELL_ID_T *dataP);)
public_F3_codec(unsigned int MIH_C_3GPP_3G_CELL_ID2String(MIH_C_3GPP_3G_CELL_ID_T *dataP, char* bufP);)
public_F3_codec(void MIH_C_3GPP_3G_CELL_ID_encode (Bit_Buffer_t* bbP, MIH_C_3GPP_3G_CELL_ID_T *dataP);)
public_F3_codec(void MIH_C_3GPP_3G_CELL_ID_decode (Bit_Buffer_t* bbP, MIH_C_3GPP_3G_CELL_ID_T *dataP);)
public_F3_codec(unsigned int MIH_C_LINK_ADDR2String(MIH_C_LINK_ADDR_T *dataP, char* bufP);)
public_F3_codec(void MIH_C_LINK_ADDR_encode (Bit_Buffer_t* bbP, MIH_C_LINK_ADDR_T *dataP);)
public_F3_codec(void MIH_C_LINK_ADDR_decode (Bit_Buffer_t* bbP, MIH_C_LINK_ADDR_T *dataP);)
#endif
/** @}*/
@@ -1,137 +0,0 @@
/*******************************************************************************
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 MIH_C_F4_data_types_for_links_codec.h
* \brief This file defines the prototypes of the functions for coding and decoding data types for links defined in Std 802.21-2008 Table F4.
* \author BRIZZOLA Davide, GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
/** \defgroup MIH_C_F4_DATA_TYPES_FOR_LINKS_CODEC F4 Data types for links codec
* \ingroup MIH_C_INTERFACE
*
* @{
*/
#ifndef __MIH_C_F4_DATA_TYPES_FOR_LINKS_CODEC_H__
# define __MIH_C_F4_DATA_TYPES_FOR_LINKS_CODEC_H__
//-----------------------------------------------------------------------------
# ifdef MIH_C_F4_DATA_TYPES_FOR_LINKS_CODEC_C
# define private_F4_codec(x) x
# define protected_F4_codec(x) x
# define public_F4_codec(x) x
# else
# ifdef MIH_C_INTERFACE
# define private_F4_codec(x)
# define protected_F4_codec(x) extern x
# define public_F4_codec(x) extern x
# else
# define private_F4_codec(x)
# define protected_F4_codec(x)
# define public_F4_codec(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <ctype.h>
//-----------------------------------------------------------------------------
#include "MIH_C.h"
//-----------------------------------------------------------------------------
public_F4_codec(unsigned int MIH_C_OPMODE2String2(MIH_C_OPMODE_T *dataP, char* bufP);)
public_F4_codec(void MIH_C_DEV_STATE_RSP_encode(Bit_Buffer_t* bbP, MIH_C_DEV_STATE_RSP_T *dataP);)
public_F4_codec(void MIH_C_DEV_STATE_RSP_decode(Bit_Buffer_t* bbP, MIH_C_DEV_STATE_RSP_T *dataP);)
public_F4_codec(unsigned int MIH_C_LINK_EVENT_LIST2String2(MIH_C_LINK_EVENT_LIST_T *dataP, char* bufP);)
public_F4_codec(unsigned int MIH_C_LINK_CMD_LIST2String2(MIH_C_LINK_CMD_LIST_T *dataP, char* bufP);)
public_F4_codec(unsigned int MIH_C_LINK_TYPE2String2(MIH_C_LINK_TYPE_T *dataP, char* bufP);)
public_F4_codec(unsigned int MIH_C_LINK_ID2String(MIH_C_LINK_ID_T *dataP, char* bufP);)
public_F4_codec(void MIH_C_LINK_ID_encode(Bit_Buffer_t* bbP, MIH_C_LINK_ID_T *dataP);)
public_F4_codec(void MIH_C_LINK_ID_decode(Bit_Buffer_t* bbP, MIH_C_LINK_ID_T *dataP);)
public_F4_codec(void MIH_C_LINK_ACTION_REQ_encode(Bit_Buffer_t* bbP, MIH_C_LINK_ACTION_REQ_T *dataP);)
public_F4_codec(void MIH_C_LINK_ACTION_REQ_decode(Bit_Buffer_t* bbP, MIH_C_LINK_ACTION_REQ_T *dataP);)
public_F4_codec(unsigned int MIH_C_SIG_STRENGTH2String(MIH_C_SIG_STRENGTH_T *dataP, char* bufP);)
public_F4_codec(void MIH_C_SIG_STRENGTH_encode(Bit_Buffer_t* bbP, MIH_C_SIG_STRENGTH_T *dataP);)
public_F4_codec(void MIH_C_SIG_STRENGTH_decode(Bit_Buffer_t* bbP, MIH_C_SIG_STRENGTH_T *dataP);)
public_F4_codec(unsigned int MIH_C_LINK_SCAN_RSP2String(MIH_C_LINK_SCAN_RSP_T *dataP, char* bufP);)
public_F4_codec(void MIH_C_LINK_SCAN_RSP_encode(Bit_Buffer_t* bbP, MIH_C_LINK_SCAN_RSP_T *dataP);)
public_F4_codec(void MIH_C_LINK_SCAN_RSP_decode(Bit_Buffer_t* bbP, MIH_C_LINK_SCAN_RSP_T *dataP);)
public_F4_codec(void MIH_C_LINK_ACTION_RSP_encode(Bit_Buffer_t* bbP, MIH_C_LINK_ACTION_RSP_T *dataP);)
public_F4_codec(void MIH_C_LINK_ACTION_RSP_decode(Bit_Buffer_t* bbP, MIH_C_LINK_ACTION_RSP_T *dataP);)
public_F4_codec(unsigned int MIH_C_THRESHOLD2String(MIH_C_THRESHOLD_T *dataP, char* bufP);)
public_F4_codec(void MIH_C_THRESHOLD_encode(Bit_Buffer_t* bbP, MIH_C_THRESHOLD_T *dataP);)
public_F4_codec(void MIH_C_THRESHOLD_decode(Bit_Buffer_t* bbP, MIH_C_THRESHOLD_T *dataP);)
public_F4_codec(unsigned int MIH_C_LINK_PARAM_TYPE2String( MIH_C_LINK_PARAM_TYPE_T *dataP, char* bufP);)
public_F4_codec(void MIH_C_LINK_PARAM_TYPE_encode(Bit_Buffer_t* bbP, MIH_C_LINK_PARAM_TYPE_T *dataP);)
public_F4_codec(void MIH_C_LINK_PARAM_TYPE_decode(Bit_Buffer_t* bbP, MIH_C_LINK_PARAM_TYPE_T *dataP);)
public_F4_codec(unsigned int MIH_C_LINK_CFG_PARAM2String(MIH_C_LINK_CFG_PARAM_T *dataP, char* bufP);)
public_F4_codec(void MIH_C_LINK_CFG_PARAM_encode(Bit_Buffer_t* bbP, MIH_C_LINK_CFG_PARAM_T *dataP);)
public_F4_codec(void MIH_C_LINK_CFG_PARAM_decode(Bit_Buffer_t* bbP, MIH_C_LINK_CFG_PARAM_T *dataP);)
public_F4_codec(unsigned int MIH_C_LINK_CFG_STATUS2String(MIH_C_LINK_CFG_STATUS_T *dataP, char* bufP);)
public_F4_codec(void MIH_C_LINK_CFG_STATUS_encode(Bit_Buffer_t* bbP, MIH_C_LINK_CFG_STATUS_T *dataP);)
public_F4_codec(void MIH_C_LINK_CFG_STATUS_decode(Bit_Buffer_t* bbP, MIH_C_LINK_CFG_STATUS_T *dataP);)
public_F4_codec(unsigned int MIH_C_LINK_DESC_RSP2String(MIH_C_LINK_DESC_RSP_T *dataP, char* bufP);)
public_F4_codec(void MIH_C_LINK_DESC_RSP_encode(Bit_Buffer_t* bbP, MIH_C_LINK_DESC_RSP_T *dataP);)
public_F4_codec(void MIH_C_LINK_DESC_RSP_decode(Bit_Buffer_t* bbP, MIH_C_LINK_DESC_RSP_T *dataP);)
public_F4_codec(unsigned int MIH_C_LINK_PARAM2String(MIH_C_LINK_PARAM_T *dataP, char* bufP);)
public_F4_codec(void MIH_C_LINK_PARAM_encode(Bit_Buffer_t* bbP, MIH_C_LINK_PARAM_T *dataP);)
public_F4_codec(void MIH_C_LINK_PARAM_decode(Bit_Buffer_t* bbP, MIH_C_LINK_PARAM_T *dataP);)
public_F4_codec(unsigned int MIH_C_LINK_PARAM_RPT2String(MIH_C_LINK_PARAM_RPT_T *dataP, char* bufP);)
public_F4_codec(void MIH_C_LINK_PARAM_RPT_encode(Bit_Buffer_t* bbP, MIH_C_LINK_PARAM_RPT_T *dataP);)
public_F4_codec(void MIH_C_LINK_PARAM_RPT_decode(Bit_Buffer_t* bbP, MIH_C_LINK_PARAM_RPT_T *dataP);)
public_F4_codec(void MIH_C_LINK_POA_LIST_encode(Bit_Buffer_t* bbP, MIH_C_LINK_POA_LIST_T *dataP);)
public_F4_codec(void MIH_C_LINK_POA_LIST_decode(Bit_Buffer_t* bbP, MIH_C_LINK_POA_LIST_T *dataP);)
public_F4_codec(unsigned int MIH_C_LINK_STATES_RSP2String(MIH_C_LINK_STATES_RSP_T *dataP, char* bufP);)
public_F4_codec(void MIH_C_LINK_STATES_RSP_encode(Bit_Buffer_t* bbP, MIH_C_LINK_STATES_RSP_T *dataP);)
public_F4_codec(void MIH_C_LINK_STATES_RSP_decode(Bit_Buffer_t* bbP, MIH_C_LINK_STATES_RSP_T *dataP);)
public_F4_codec(void MIH_C_LINK_STATUS_REQ_encode(Bit_Buffer_t* bbP, MIH_C_LINK_STATUS_REQ_T *dataP);)
public_F4_codec(void MIH_C_LINK_STATUS_REQ_decode(Bit_Buffer_t* bbP, MIH_C_LINK_STATUS_REQ_T *dataP);)
public_F4_codec(void MIH_C_LINK_STATUS_RSP_encode(Bit_Buffer_t* bbP, MIH_C_LINK_STATUS_RSP_T *dataP);)
public_F4_codec(void MIH_C_LINK_STATUS_RSP_decode(Bit_Buffer_t* bbP, MIH_C_LINK_STATUS_RSP_T *dataP);)
public_F4_codec(unsigned int MIH_C_LINK_STATES_REQ2String2(MIH_C_LINK_STATES_REQ_T *dataP, char* bufP);)
public_F4_codec(unsigned int MIH_C_LINK_DESC_REQ2String2(MIH_C_LINK_DESC_REQ_T *dataP, char* bufP);)
public_F4_codec(void MIH_C_LINK_TUPLE_ID_encode(Bit_Buffer_t* bbP, MIH_C_LINK_TUPLE_ID_T *dataP);)
public_F4_codec(void MIH_C_LINK_TUPLE_ID_decode(Bit_Buffer_t* bbP, MIH_C_LINK_TUPLE_ID_T *dataP);)
public_F4_codec(void MIH_C_LINK_DET_INFO_encode(Bit_Buffer_t* bbP, MIH_C_LINK_DET_INFO_T *dataP);)
public_F4_codec(void MIH_C_LINK_DET_INFO_decode(Bit_Buffer_t* bbP, MIH_C_LINK_DET_INFO_T *dataP);)
public_F4_codec(unsigned int MIH_C_LINK_AC_ATTR2String2(MIH_C_LINK_AC_ATTR_T *dataP, char* bufP);)
public_F4_codec(unsigned int MIH_C_TH_ACTION2String2(MIH_C_TH_ACTION_T *actionP, char* bufP);)
public_F4_codec(unsigned int MIH_C_LINK_AC_TYPE2String2(MIH_C_LINK_AC_TYPE_T *dataP, char* bufP);)
public_F4_codec(unsigned int MIH_C_THRESHOLD_XDIR2String2(MIH_C_THRESHOLD_XDIR_T *valP, char* bufP);)
public_F4_codec(unsigned int MIH_C_LINK_PARAM_GEN2String2(MIH_C_LINK_PARAM_GEN_T *valP, char* bufP);)
public_F4_codec(unsigned int MIH_C_LINK_AC_RESULT2String2(MIH_C_LINK_AC_RESULT_T *dataP, char* bufP);)
#endif
/** @}*/
@@ -1,98 +0,0 @@
/*******************************************************************************
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 MIH_C_F9_data_types_for_qos_codec.h
* \brief This file defines the prototypes of the functions for coding and decoding Data type for QOS defined in Std 802.21-2008 Table F9.
* \author BRIZZOLA Davide, GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
/** \defgroup MIH_C_F9_DATA_TYPES_FOR_QOS F9 Data types for QOS
* \ingroup MIH_C_INTERFACE
*
* @{
*/
#ifndef __MIH_C_F9_DATA_TYPES_FOR_QOS_CODEC_H__
# define __MIH_C_F9_DATA_TYPES_FOR_QOS_CODEC_H__
//-----------------------------------------------------------------------------
# ifdef MIH_C_F9_DATA_TYPES_FOR_QOS_CODEC_C
# define private_F9_codec(x) x
# define protected_F9_codec(x) x
# define public_F9_codec(x) x
# else
# ifdef MIH_C_INTERFACE
# define private_F9_codec(x)
# define protected_F9_codec(x) extern x
# define public_F9_codec(x) extern x
# else
# define private_F9_codec(x)
# define protected_F9_codec(x)
# define public_F9_codec(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <ctype.h>
//-----------------------------------------------------------------------------
#include "MIH_C.h"
//-----------------------------------------------------------------------------
public_F9_codec(unsigned int MIH_C_MIN_PK_TX_DELAY2String(MIH_C_MIN_PK_TX_DELAY_T *dataP, char* bufP);)
public_F9_codec(void MIH_C_MIN_PK_TX_DELAY_encode(Bit_Buffer_t* bbP, MIH_C_MIN_PK_TX_DELAY_T *dataP);)
public_F9_codec(void MIH_C_MIN_PK_TX_DELAY_decode(Bit_Buffer_t* bbP, MIH_C_MIN_PK_TX_DELAY_T *dataP);)
public_F9_codec(unsigned int MIH_C_AVG_PK_TX_DELAY2String(MIH_C_AVG_PK_TX_DELAY_T *dataP, char* bufP);)
public_F9_codec(void MIH_C_AVG_PK_TX_DELAY_encode(Bit_Buffer_t* bbP, MIH_C_AVG_PK_TX_DELAY_T *dataP);)
public_F9_codec(void MIH_C_AVG_PK_TX_DELAY_decode(Bit_Buffer_t* bbP, MIH_C_AVG_PK_TX_DELAY_T *dataP);)
public_F9_codec(unsigned int MIH_C_MAX_PK_TX_DELAY2String(MIH_C_MAX_PK_TX_DELAY_T *dataP, char* bufP);)
public_F9_codec(void MIH_C_MAX_PK_TX_DELAY_encode(Bit_Buffer_t* bbP, MIH_C_MAX_PK_TX_DELAY_T *dataP);)
public_F9_codec(void MIH_C_MAX_PK_TX_DELAY_decode(Bit_Buffer_t* bbP, MIH_C_MAX_PK_TX_DELAY_T *dataP);)
public_F9_codec(unsigned int MIH_C_PK_DELAY_JITTER2String(MIH_C_PK_DELAY_JITTER_T *dataP, char* bufP);)
public_F9_codec(void MIH_C_PK_DELAY_JITTER_encode(Bit_Buffer_t* bbP, MIH_C_PK_DELAY_JITTER_T *dataP);)
public_F9_codec(void MIH_C_PK_DELAY_JITTER_decode(Bit_Buffer_t* bbP, MIH_C_PK_DELAY_JITTER_T *dataP);)
public_F9_codec(unsigned int MIH_C_PK_LOSS_RATE2String(MIH_C_PK_LOSS_RATE_T *dataP, char* bufP);)
public_F9_codec(void MIH_C_PK_LOSS_RATE_encode(Bit_Buffer_t* bbP, MIH_C_PK_LOSS_RATE_T *dataP);)
public_F9_codec(void MIH_C_PK_LOSS_RATE_decode(Bit_Buffer_t* bbP, MIH_C_PK_LOSS_RATE_T *dataP);)
public_F9_codec(unsigned int MIH_C_QOS_PARAM_VAL2String(MIH_C_QOS_PARAM_VAL_T *dataP, char* bufP);)
public_F9_codec(void MIH_C_QOS_PARAM_VAL_encode(Bit_Buffer_t* bbP, MIH_C_QOS_PARAM_VAL_T *dataP);)
public_F9_codec(void MIH_C_QOS_PARAM_VAL_decode(Bit_Buffer_t* bbP, MIH_C_QOS_PARAM_VAL_T *dataP);)
#endif
/** @}*/
@@ -1,76 +0,0 @@
/*******************************************************************************
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 MIH_C_L2_type_values_for_tlv_encoding.h
* \brief This file defines the prototypes of the functions for coding and decoding Data type for MIHF identification defined in Std 802.21-2008 Table L2.
* \author BRIZZOLA Davide, GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
/** \defgroup MIH_C_L2_TYPE_VALUES_FOR_TLV_ENCODING L2 Type values for TLV encoding.
* \ingroup MIH_C_INTERFACE
*
* @{
*/
#ifndef __MIH_C_L2_TYPE_VALUES_FOR_TLV_ENCODING_H__
# define __MIH_C_L2_TYPE_VALUES_FOR_TLV_ENCODING_H__
//-----------------------------------------------------------------------------
# ifdef MIH_C_L2_TYPE_VALUES_FOR_TLV_ENCODING_C
# define private_L2_codec(x) x
# define protected_L2_codec(x) x
# define public_L2_codec(x) x
# else
# ifdef MIH_C_INTERFACE
# define private_L2_codec(x)
# define protected_L2_codec(x) extern x
# define public_L2_codec(x) extern x
# else
# define private_L2_codec(x)
# define protected_L2_codec(x)
# define public_L2_codec(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <ctype.h>
//-----------------------------------------------------------------------------
#include "MIH_C.h"
//-----------------------------------------------------------------------------
public_L2_codec(unsigned int MIH_C_TLV2String(MIH_C_TLV_TYPE_T *typeP, char* bufP);)
/** @}*/
#endif
@@ -1,110 +0,0 @@
/*******************************************************************************
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 MIH_C_Link_Constants.h
* \brief This file defines constants, for the MIH Link SAP.
* \author BRIZZOLARA Davide, GAUTHIER Lionel, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
#ifndef __MIH_C_LINK_CONSTANTS_H__
#define __MIH_C_LINK_CONSTANTS_H__
#define MIH_C_BIT_0_VALUE 0x01
#define MIH_C_BIT_1_VALUE 0x02
#define MIH_C_BIT_2_VALUE 0x04
#define MIH_C_BIT_3_VALUE 0x08
#define MIH_C_BIT_4_VALUE 0x10
#define MIH_C_BIT_5_VALUE 0x20
#define MIH_C_BIT_6_VALUE 0x40
#define MIH_C_BIT_7_VALUE 0x80
#define MIH_C_BIT_8_VALUE 0x100
#define MIH_C_BIT_9_VALUE 0x200
#define MIH_C_BIT_10_VALUE 0x400
#define MIH_C_BIT_11_VALUE 0x800
#define MIH_C_BIT_12_VALUE 0x1000
#define MIH_C_BIT_13_VALUE 0x2000
#define MIH_C_BIT_14_VALUE 0x4000
#define MIH_C_BIT_15_VALUE 0x8000
#define MIH_C_BIT_16_VALUE 0x10000
#define MIH_C_BIT_17_VALUE 0x20000
#define MIH_C_BIT_18_VALUE 0x40000
#define MIH_C_BIT_19_VALUE 0x80000
#define MIH_C_BIT_20_VALUE 0x100000
#define MIH_C_BIT_21_VALUE 0x200000
#define MIH_C_BIT_22_VALUE 0x400000
#define MIH_C_BIT_23_VALUE 0x800000
#define MIH_C_BIT_24_VALUE 0x1000000
#define MIH_C_BIT_25_VALUE 0x2000000
#define MIH_C_BIT_26_VALUE 0x4000000
#define MIH_C_BIT_27_VALUE 0x8000000
#define MIH_C_BIT_28_VALUE 0x10000000
#define MIH_C_BIT_29_VALUE 0x20000000
#define MIH_C_BIT_30_VALUE 0x40000000
#define MIH_C_BIT_31_VALUE 0x80000000
#define MIH_C_3GPP_ADDR_LENGTH 16
#define MIH_C_3GPP2_ADDR_LENGTH 8
#define MIH_C_OTHER_L2_ADDR_LENGTH 64
#define MIH_C_LINK_SCAN_RSP_LENGTH 8
#define MIH_C_THRESHOLD_LIST_LENGTH 8
#define MIH_C_LINK_ADDR_LIST_LENGTH 8
#define MIH_C_QOS_LIST_LENGTH 255
#define MIH_C_LINK_STATUS_REQ_LIST_LENGTH 32
#define MIH_C_LINK_CFG_PARAM_LIST_LENGTH 16
#endif
#ifndef __MIH_C_IANA_CONSTANTS_H__
#define __MIH_C_IANA_CONSTANTS_H__
#define IANA_ADDR_FAMILY_RESERVED 0
#define IANA_ADDR_FAMILY_IP 1
#define IANA_ADDR_FAMILY_IP6 2
#define IANA_ADDR_FAMILY_NSAP 3
#define IANA_ADDR_FAMILY_HDLC 4
#define IANA_ADDR_FAMILY_BBN_1822 5
#define IANA_ADDR_FAMILY_802 6
#define IANA_ADDR_FAMILY_E_163 7
#define IANA_ADDR_FAMILY_E_164 8
#define IANA_ADDR_FAMILY_F_69 9
#define IANA_ADDR_FAMILY_X_121 10
#define IANA_ADDR_FAMILY_IPX 11
#define IANA_ADDR_FAMILY_Appletalk 12
#define IANA_ADDR_FAMILY_Decnet_IV 13
#define IANA_ADDR_FAMILY_Banyan_Vines 14
#define IANA_ADDR_FAMILY_E_164_with_NSAP 15
#define IANA_ADDR_FAMILY_DNS 16
// More defined values, see http://www.iana.org/assignments/address-family-numbers/address-family-numbers.xml
#endif
@@ -1,315 +0,0 @@
/*******************************************************************************
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 MIH_C_Link_Messages.h
* \brief This file defines the messages of the MIH Link SAP.
* \author BRIZZOLARA Davide, GAUTHIER Lionel, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
/** \defgroup MIH_C_LINK_MESSAGES 802.21 Link Messages
* \ingroup MIH_C_INTERFACE
*
* @{
*/
#ifndef __MIH_C_LINK_MESSAGES_H__
#define __MIH_C_LINK_MESSAGES_H__
#include <sys/types.h>
//-----------------------------------------------------------------------------
#include "MIH_C.h"
//-----------------------------------------------------------------------------
#define MIH_C_PROTOCOL_VERSION 1
#define MIH_C_MESSAGE_ID(SID, OC, AID) ((u_int16_t)SID << 12) | ((u_int16_t)OC << 10) | ((u_int16_t)AID)
#ifdef MIH_C_MEDIEVAL_EXTENSIONS
#define MIH_C_MESSAGE_LINK_REGISTER_INDICATION_ID MIH_C_MESSAGE_ID(1, 3, 6)
#endif
#define MIH_C_MESSAGE_LINK_DETECTED_INDICATION_ID MIH_C_MESSAGE_ID(2, 3, 1)
#define MIH_C_MESSAGE_LINK_UP_INDICATION_ID MIH_C_MESSAGE_ID(2, 3, 2)
#define MIH_C_MESSAGE_LINK_DOWN_INDICATION_ID MIH_C_MESSAGE_ID(2, 3, 3)
#define MIH_C_MESSAGE_LINK_PARAMETERS_REPORT_INDICATION_ID MIH_C_MESSAGE_ID(2, 3, 5)
#define MIH_C_MESSAGE_LINK_GOING_DOWN_INDICATION_ID MIH_C_MESSAGE_ID(2, 3, 6)
#define MIH_C_MESSAGE_LINK_HANDOVER_IMMINENT_INDICATION_ID MIH_C_MESSAGE_ID(2, 3, 7)
#define MIH_C_MESSAGE_LINK_HANDOVER_COMPLETE_INDICATION_ID MIH_C_MESSAGE_ID(2, 3, 8)
#define MIH_C_MESSAGE_LINK_PDU_TRANSMIT_STATUS_INDICATION_ID MIH_C_MESSAGE_ID(2, 3, 9)
#define MIH_C_MESSAGE_LINK_CAPABILITY_DISCOVER_REQUEST_ID MIH_C_MESSAGE_ID(1, 1, 1)
#define MIH_C_MESSAGE_LINK_CAPABILITY_DISCOVER_CONFIRM_ID MIH_C_MESSAGE_ID(1, 0, 1)
#define MIH_C_MESSAGE_LINK_EVENT_SUBSCRIBE_REQUEST_ID MIH_C_MESSAGE_ID(1, 1, 4)
#define MIH_C_MESSAGE_LINK_EVENT_SUBSCRIBE_CONFIRM_ID MIH_C_MESSAGE_ID(1, 0, 4)
#define MIH_C_MESSAGE_LINK_EVENT_UNSUBSCRIBE_REQUEST_ID MIH_C_MESSAGE_ID(1, 1, 5)
#define MIH_C_MESSAGE_LINK_EVENT_UNSUBSCRIBE_CONFIRM_ID MIH_C_MESSAGE_ID(1, 0, 5)
#define MIH_C_MESSAGE_LINK_GET_PARAMETERS_REQUEST_ID MIH_C_MESSAGE_ID(3, 1, 1)
#define MIH_C_MESSAGE_LINK_GET_PARAMETERS_CONFIRM_ID MIH_C_MESSAGE_ID(3, 0, 1)
#define MIH_C_MESSAGE_LINK_CONFIGURE_THRESHOLDS_REQUEST_ID MIH_C_MESSAGE_ID(3, 1, 2)
#define MIH_C_MESSAGE_LINK_CONFIGURE_THRESHOLDS_CONFIRM_ID MIH_C_MESSAGE_ID(3, 0, 2)
#define MIH_C_MESSAGE_LINK_ACTION_REQUEST_ID MIH_C_MESSAGE_ID(3, 1, 3)
#define MIH_C_MESSAGE_LINK_ACTION_CONFIRM_ID MIH_C_MESSAGE_ID(3, 0, 3)
//-----------------------------------------------------------------------------
#ifdef MIH_C_MEDIEVAL_EXTENSIONS
/*! \struct MIH_C_Message_Link_Register_indication
* \brief Structure defining the message Link_Register.indication, ODTONE specific.
*/
typedef struct MIH_C_Message_Link_Register_indication {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Register_indication_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Register_indication_t;
#endif
/*! \struct MIH_C_Message_Link_Detected_indication
* \brief Structure defining the message Link_Detected.indication
*/
typedef struct MIH_C_Message_Link_Detected_indication {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Detected_indication_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Detected_indication_t;
/*! \struct MIH_C_Message_Link_Up_indication
* \brief Structure defining the message Link_Up.indication.
*/
typedef struct MIH_C_Message_Link_Up_indication {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Up_indication_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Up_indication_t;
/*! \struct MIH_C_Message_Link_Down_indication
* \brief Structure defining the message Link_Down.indication.
*/
typedef struct MIH_C_Message_Link_Down_indication {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Down_indication_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Down_indication_t;
/*! \struct MIH_C_Message_Link_Parameters_Report_indication
* \brief Structure defining the message Link_Parameters_Report.indication.
*/
typedef struct MIH_C_Message_Link_Parameters_Report_indication {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Parameters_Report_indication_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Parameters_Report_indication_t;
/*! \struct MIH_C_Message_Link_Going_Down_indication
* \brief Structure defining the message Link_Going_Down.indication.
*/
typedef struct MIH_C_Message_Link_Going_Down_indication {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Going_Down_indication_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Going_Down_indication_t;
/*! \struct MIH_C_Message_Link_Handover_Imminent_indication
* \brief Structure defining the message Link_Handover_Imminent.indication.
*/
typedef struct MIH_C_Message_Link_Handover_Imminent_indication {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Handover_Imminent_indication_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Handover_Imminent_indication_t;
/*! \struct MIH_C_Message_Link_Handover_Complete_indication
* \brief Structure defining the message Link_Handover_Complete.indication.
*/
typedef struct MIH_C_Message_Link_Handover_Complete_indication {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Handover_Complete_indication_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Handover_Complete_indication_t;
/*! \struct MIH_C_Message_Link_PDU_Transmit_Status_indication
* \brief Structure defining the message Link_PDU_Transmit_Status.indication.
*/
typedef struct MIH_C_Message_Link_PDU_Transmit_Status_indication {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_PDU_Transmit_Status_indication_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_PDU_Transmit_Status_indication_t;
/*! \struct MIH_C_Message_Link_Capability_Discover_request
* \brief Structure defining the message Link_Capability_Discover.request.
*/
typedef struct MIH_C_Message_Link_Capability_Discover_request {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Capability_Discover_request_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Capability_Discover_request_t;
/*! \struct MIH_C_Message_Link_Capability_Discover_confirm
* \brief Structure defining the message Link_Capability_Discover.confirm.
*/
typedef struct MIH_C_Message_Link_Capability_Discover_confirm {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Capability_Discover_confirm_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Capability_Discover_confirm_t;
/*! \struct MIH_C_Message_Link_Event_Subscribe_request
* \brief Structure defining the message Link_Event_Subscribe.request.
*/
typedef struct MIH_C_Message_Link_Event_Subscribe_request {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Event_Subscribe_request_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Event_Subscribe_request_t;
/*! \struct MIH_C_Message_Link_Event_Subscribe_confirm
* \brief Structure defining the message Link_Event_Subscribe.confirm.
*/
typedef struct MIH_C_Message_Link_Event_Subscribe_confirm {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Event_Subscribe_confirm_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Event_Subscribe_confirm_t;
/*! \struct MIH_C_Message_Link_Event_Unsubscribe_request
* \brief Structure defining the message Link_Event_Unsubscribe.request.
*/
typedef struct MIH_C_Message_Link_Event_Unsubscribe_request {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Event_Unsubscribe_request_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Event_Unsubscribe_request_t;
/*! \struct MIH_C_Message_Link_Event_Unsubscribe_confirm
* \brief Structure defining the message Link_Event_Unsubscribe.confirm.
*/
typedef struct MIH_C_Message_Link_Event_Unsubscribe_confirm {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Event_Unsubscribe_confirm_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Event_Unsubscribe_confirm_t;
/*! \struct MIH_C_Message_Link_Get_Parameters_request
* \brief Structure defining the message Link_Get_Parameters.request.
*/
typedef struct MIH_C_Message_Link_Get_Parameters_request {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Get_Parameters_request_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Get_Parameters_request_t;
/*! \struct MIH_C_Message_Link_Get_Parameters_confirm
* \brief Structure defining the message Link_Get_Parameters.confirm.
*/
typedef struct MIH_C_Message_Link_Get_Parameters_confirm {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Get_Parameters_confirm_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Get_Parameters_confirm_t;
/*! \struct MIH_C_Message_Link_Configure_Thresholds_request
* \brief Structure defining the message Link_Configure_Thresholds.request.
*/
typedef struct MIH_C_Message_Link_Configure_Thresholds_request {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Configure_Thresholds_request_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Configure_Thresholds_request_t;
/*! \struct MIH_C_Message_Link_Configure_Thresholds_confirm
* \brief Structure defining the message Link_Configure_Thresholds.confirm.
*/
typedef struct MIH_C_Message_Link_Configure_Thresholds_confirm {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Configure_Thresholds_confirm_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Configure_Thresholds_confirm_t;
/*! \struct MIH_C_Message_Link_Action_request
* \brief Structure defining the message Link_Action.request.
*/
typedef struct MIH_C_Message_Link_Action_request {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Action_request_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Action_request_t;
/*! \struct MIH_C_Message_Link_Action_confirm
* \brief Structure defining the message Link_Action.confirm.
*/
typedef struct MIH_C_Message_Link_Action_confirm {
MIH_C_HEADER_T header; /*!< \brief Header of the message. */
MIH_C_MIHF_ID_T source; /*!< \brief Source of the message. */
MIH_C_MIHF_ID_T destination; /*!< \brief Destination of the message. */
MIH_C_Link_Action_confirm_t primitive; /*!< \brief Primitive. */
} __attribute__((__packed__))MIH_C_Message_Link_Action_confirm_t;
#endif
/** @}*/
@@ -1,231 +0,0 @@
/***************************************************************************
MIH_C_Link_Primitives.h - description
-------------------
copyright : (C) 2012 by Eurecom
email : davide.brizzolara@eurecom.fr; michelle.wetterwald@eurecom.fr
***************************************************************************
Type definition and structure for ODTONE interface
***************************************************************************/
/** \defgroup MIH_C_LINK_PRIMITIVES 802.21 Link Primitives
* \ingroup MIH_C_INTERFACE
*
* @{
*/
#ifndef __MIH_C_LINK_PRIMITIVES_H__
#define __MIH_C_LINK_PRIMITIVES_H__
#include <sys/types.h>
//-----------------------------------------------------------------------------
#include "MIH_C_Types.h"
//-----------------------------------------------------------------------------
/*! \struct MIH_C_Link_Detected_indication
* \brief Structure defining the Link_Detected.indication MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.1 Link_Detected.indication)
*/
typedef struct MIH_C_Link_Detected_indication {
MIH_C_LINK_DET_INFO_T LinkDetectedInfo; /*!< \brief Information of a detected link. */
} __attribute__((__packed__))MIH_C_Link_Detected_indication_t;
//-----------------------------------------------------------------------------
/*! \struct MIH_C_Link_Up_indication
* \brief Structure defining the Link_Up.indication MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.2 Link_Up.indication)
*/
typedef struct MIH_C_Link_Up_indication {
MIH_C_LINK_TUPLE_ID_T LinkIdentifier; /*!< \brief Identifier of the link associated with the event. */
MIH_C_LINK_ADDR_T *OldAccessRouter; /*!< \brief (Optional) Old Access Router link address.*/
MIH_C_LINK_ADDR_T *NewAccessRouter; /*!< \brief (Optional) New Access Router link address. */
MIH_C_IP_RENEWAL_FLAG_T *IPRenewalFlag; /*!< \brief (Optional) Indicates whether the MN needs to changeIP Address in the new PoA. */
MIH_C_IP_MOB_MGMT_T *MobilityManagementSupport;/*!< \brief (Optional) Indicates the type of Mobility Management Protocol supported by the new PoA. */
} __attribute__((__packed__))MIH_C_Link_Up_indication_t;
/*! \struct MIH_C_Link_Down_indication
* \brief Structure defining the Link_Down.indication MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.3 Link_Down.indication)
*/
typedef struct MIH_C_Link_Down_indication {
MIH_C_LINK_TUPLE_ID_T LinkIdentifier; /*!< \brief Identifier of the link associated with the event. */
MIH_C_LINK_ADDR_T *OldAccessRouter; /*!< \brief (Optional) Old Access Router link address.*/
MIH_C_LINK_DN_REASON_T ReasonCode; /*!< \brief Reason why the link went down. */
} __attribute__((__packed__))MIH_C_Link_Down_indication_t;
TYPEDEF_LIST(MIH_C_LINK_PARAM_RPT, 16);
/*! \struct MIH_C_Link_Parameters_Report_indication
* \brief Structure defining the Link_Parameters_Report.indication MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.4 Link_Parameters_Report.indication)
*/
typedef struct MIH_C_Link_Parameters_Report_indication {
MIH_C_LINK_TUPLE_ID_T LinkIdentifier; /*!< \brief Identifier of the link associated with the event. */
LIST(MIH_C_LINK_PARAM_RPT, LinkParametersReportList) /*!< \brief A list of Link Parameter Report.*/
} __attribute__((__packed__))MIH_C_Link_Parameters_Report_indication_t;
/*! \struct MIH_C_Link_Going_Down_indication
* \brief Structure defining the Link_Going_Down.indication MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.5 Link_Going_Down.indication)
*/
typedef struct MIH_C_Link_Going_Down_indication {
MIH_C_LINK_TUPLE_ID_T LinkIdentifier; /*!< \brief Identifier of the link associated with the event. */
UNSIGNED_INT2(
TimeInterval) /*!< \brief Time Interval (in milliseconds) specifies the time interval at which the link is expected to go down. A value of "0" is specified if the time interval is unknown.*/
MIH_C_LINK_GD_REASON_T LinkGoingDownReason; /*!< \brief The reason why the link is going to be down. */
} __attribute__((__packed__))MIH_C_Link_Going_Down_indication_t;
/*! \struct MIH_C_Link_Handover_Imminent_indication
* \brief Structure defining the Link_Handover_Imminent.indication MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.6 Link_Handover_Imminent.indication)
*/
typedef struct MIH_C_Link_Handover_Imminent_indication {
MIH_C_LINK_TUPLE_ID_T OldLinkIdentifier; /*!< \brief Identifier of the old link. */
MIH_C_LINK_TUPLE_ID_T NewLinkIdentifier; /*!< \brief Identifier of the new link. */
MIH_C_LINK_ADDR_T *OldAccessRouter; /*!< \brief (Optional) Link address of old Access Router.*/
MIH_C_LINK_ADDR_T *NewAccessRouter; /*!< \brief (Optional) Link address of new Access Router.*/
} __attribute__((__packed__))MIH_C_Link_Handover_Imminent_indication_t;
/*! \struct MIH_C_Link_Handover_Complete_indication
* \brief Structure defining the Link_Handover_Complete.indication MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.7 Link_Handover_Complete.indication)
*/
typedef struct MIH_C_Link_Handover_Complete_indication {
MIH_C_LINK_TUPLE_ID_T OldLinkIdentifier; /*!< \brief Identifier of the old link. */
MIH_C_LINK_TUPLE_ID_T NewLinkIdentifier; /*!< \brief Identifier of the new link. */
MIH_C_LINK_ADDR_T *OldAccessRouter; /*!< \brief (Optional) Link address of old Access Router.*/
MIH_C_LINK_ADDR_T *NewAccessRouter; /*!< \brief (Optional) Link address of new Access Router.*/
MIH_C_STATUS_T LinkHandoverStatus; /*!< \brief Status of the link handover.*/
} __attribute__((__packed__))MIH_C_Link_Handover_Complete_indication_t;
/*! \struct MIH_C_Link_PDU_Transmit_Status_indication
* \brief Structure defining the Link_PDU_Transmit_Status.indication MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.8 Link_PDU_Transmit_Status.indication)
*/
typedef struct MIH_C_Link_PDU_Transmit_Status_indication {
MIH_C_LINK_TUPLE_ID_T LinkIdentifier; /*!< \brief Identifier of the link associated with the event. */
UNSIGNED_INT2(PacketIdentifier) /*!< \brief Identifier for higher layer PDU on which this notification is generated. */
BOOLEAN(TransmissionStatus) /*!< \brief Status of the transmitted packet. True: Success, False: Failure*/
} __attribute__((__packed__))MIH_C_Link_PDU_Transmit_Status_indication_t;
/*! \struct MIH_C_Link_Capability_Discover_request
* \brief Structure defining the Link_Capability_Discover.request MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.9.1 Link_Capability_Discover.request)
*/
typedef struct MIH_C_Link_Capability_Discover_request {
} __attribute__((__packed__))MIH_C_Link_Capability_Discover_request_t;
/*! \struct MIH_C_Link_Capability_Discover_confirm
* \brief Structure defining the Link_Capability_Discover.confirm MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.9.2 Link_Capability_Discover.confirm)
*/
typedef struct MIH_C_Link_Capability_Discover_confirm {
MIH_C_STATUS_T Status; /*!< \brief Status of operation. Code 3 (Authorization Failure) is not applicable.*/
MIH_C_LINK_EVENT_LIST_T
*SupportedLinkEventList; /*!< \brief List of link-layer events supported by the link layer. This parameter is not included if Status does not indicate “Success.” */
MIH_C_LINK_CMD_LIST_T
*SupportedLinkCommandList; /*!< \brief List of link-layer commands supported by the link layer. This parameter is not included if Status does not indicate “Success.” */
} __attribute__((__packed__))MIH_C_Link_Capability_Discover_confirm_t;
/*! \struct MIH_C_Link_Event_Subscribe_request
* \brief Structure defining the Link_Event_Subscribe.request MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.10.1 Link_Event_Subscribe.request)
*/
typedef struct MIH_C_Link_Event_Subscribe_request {
MIH_C_LINK_EVENT_LIST_T RequestedLinkEventList; /*!< \brief List of link-layer events that for which the subscriber would like to receive indications. */
} __attribute__((__packed__))MIH_C_Link_Event_Subscribe_request_t;
/*! \struct MIH_C_Link_Event_Subscribe_confirm
* \brief Structure defining the Link_Event_Subscribe.confirm MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.10.2 Link_Event_Subscribe.confirm)
*/
typedef struct MIH_C_Link_Event_Subscribe_confirm {
MIH_C_STATUS_T Status; /*!< \brief Status of operation. Code 3 (Authorization Failure) is not applicable.*/
MIH_C_LINK_EVENT_LIST_T *ResponseLinkEventList; /*!< \brief List of successfully subscribed link events. This parameter is not included if Status does not indicate "Success".*/
} __attribute__((__packed__))MIH_C_Link_Event_Subscribe_confirm_t;
/*! \struct MIH_C_Link_Event_Unsubscribe_request
* \brief Structure defining the Link_Event_Unsubscribe.request MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.11.1 Link_Event_Unsubscribe.request)
*/
typedef struct MIH_C_Link_Event_Unsubscribe_request {
MIH_C_LINK_EVENT_LIST_T RequestedLinkEventList; /*!< \brief List of link-layer events for which indications need to be unsubscribed from the Event Source.*/
} __attribute__((__packed__))MIH_C_Link_Event_Unsubscribe_request_t;
/*! \struct MIH_C_Link_Event_Unsubscribe_confirm
* \brief Structure defining the Link_Event_Unsubscribe.confirm MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.11.2 Link_Event_Unsubscribe.confirm)
*/
typedef struct MIH_C_Link_Event_Unsubscribe_confirm {
MIH_C_STATUS_T Status; /*!< \brief Status of operation. Code 3 (Authorization Failure) is not applicable.*/
MIH_C_LINK_EVENT_LIST_T *ResponseLinkEventList; /*!< \brief List of successfully unsubscribed link events. This parameter is not included if Status does not indicate “Success.” */
} __attribute__((__packed__))MIH_C_Link_Event_Unsubscribe_confirm_t;
/*! \struct MIH_C_Link_Get_Parameters_request
* \brief Structure defining the Link_Get_Parameters.request MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.12.1 Link_Get_Parameters.request)
*/
typedef struct MIH_C_Link_Get_Parameters_request {
LIST(MIH_C_LINK_PARAM_TYPE, LinkParametersRequest) /*!< \brief A list of link parameters for which status is requested.*/
MIH_C_LINK_STATES_REQ_T LinkStatesRequest; /*!< \brief The link states to be requested.*/
MIH_C_LINK_DESC_REQ_T LinkDescriptorsRequest; /*!< \brief The link descriptors to be requested. */
} __attribute__((__packed__))MIH_C_Link_Get_Parameters_request_t;
/*! \struct MIH_C_Link_Get_Parameters_confirm
* \brief Structure defining the Link_Get_Parameters.confirm MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.12.1 Link_Get_Parameters.confirm)
*/
typedef struct MIH_C_Link_Get_Parameters_confirm {
MIH_C_STATUS_T Status; /*!< \brief Status of operation. Code 3 (Authorization Failure) is not applicable.*/
LIST(MIH_C_LINK_PARAM, *LinkParametersStatusList) /*!< \brief A list of measurable link parameters and their current values.*/
LIST(MIH_C_LINK_STATES_RSP, *LinkStatesResponse) /*!< \brief The current link state information.*/
LIST(MIH_C_LINK_DESC_RSP, *LinkDescriptorsResponse) /*!< \brief The descriptors of a link.*/
} __attribute__((__packed__))MIH_C_Link_Get_Parameters_confirm_t;
TYPEDEF_LIST(MIH_C_LINK_CFG_PARAM, MIH_C_LINK_CFG_PARAM_LIST_LENGTH);
/*! \struct MIH_C_Link_Configure_Thresholds_request
* \brief Structure defining the Link_Configure_Thresholds.request MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.13.1 Link_Configure_Thresholds.request)
*/
typedef struct MIH_C_Link_Configure_Thresholds_request {
LIST(MIH_C_LINK_CFG_PARAM, LinkConfigureParameterList) /*!< \brief A list of link threshold parameters.*/
} __attribute__((__packed__))MIH_C_Link_Configure_Thresholds_request_t;
#define MIH_C_LINK_CFG_STATUS_LIST_LENGTH 16
TYPEDEF_LIST(MIH_C_LINK_CFG_STATUS, MIH_C_LINK_CFG_STATUS_LIST_LENGTH);
/*! \struct MIH_C_Link_Configure_Thresholds_confirm
* \brief Structure defining the Link_Configure_Thresholds.confirm MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.13.2 Link_Configure_Thresholds.confirm)
*/
typedef struct MIH_C_Link_Configure_Thresholds_confirm {
MIH_C_STATUS_T Status; /*!< \brief Status of operation. Code 3 (Authorization Failure) is not applicable.*/
LIST(MIH_C_LINK_CFG_STATUS, *LinkConfigureStatusList) /*!< \brief A list of Link Configure Status. This parameter is not included if Status does not indicate “Success.”*/
} __attribute__((__packed__))MIH_C_Link_Configure_Thresholds_confirm_t;
/*! \struct MIH_C_Link_Action_request
* \brief Structure defining the Link_Action.request MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.14.1 Link_Action.request)
*/
typedef struct MIH_C_Link_Action_request {
// MIH_C_LINK_ACTION_REQ_T
MIH_C_LINK_ACTION_T LinkAction; /*!< \brief Specifies the action to perform. */
UNSIGNED_INT2(
ExecutionDelay) /*!< \brief Time (in ms) to elapse before the action needs to be taken. A value of 0 indicates that the action is taken immediately. Time elapsed is calculated from the instance the request arrives until the time when the execution of the action is carried out. */
MIH_C_LINK_ADDR_T *PoALinkAddress; /*!< \brief (Optional) The PoA link address to forward data to. This parameter is used when DATA_FWD_REQ action is requested. */
} __attribute__((__packed__))MIH_C_Link_Action_request_t;
/*! \struct MIH_C_Link_Action_confirm
* \brief Structure defining the Link_Action.confirm MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.14.2 Link_Action.confirm)
*/
typedef struct MIH_C_Link_Action_confirm {
MIH_C_STATUS_T Status; /*!< \brief Status of operation. Code 3 (Authorization Failure) is not applicable.*/
LIST(MIH_C_LINK_SCAN_RSP,
*ScanResponseSet) /*!< \brief (Optional) A list of discovered links and related information. This parameter is not included if Status does not indicate “Success.” */
MIH_C_LINK_AC_RESULT_T *LinkActionResult; /*!< \brief Specifies whether the link action was successful. This parameter is not included if Status does not indicate “Success.” */
} __attribute__((__packed__))MIH_C_Link_Action_confirm_t;
/*! \struct MIH_C_Link_Register_indication
* \brief Structure defining the MIH_C_Link_Register.indication MIH_LINK_SAP primitive (ODTONE specific Link_Register - 101)
*/
typedef struct {
MIH_C_LINK_ID_T Link_Id;
} __attribute__((__packed__))MIH_C_Link_Register_indication_t;
#endif
/** @}*/
@@ -1,104 +0,0 @@
/*******************************************************************************
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 MIH_C_Medieval_extensions.h
* \brief This file defines the prototypes of the functions for coding and decoding data types defined by the Medieval project.
* \author BRIZZOLA Davide, GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
/** \defgroup MIH_C_MEDIEVAL_EXTENSIONS Extensions to 802.21 defined by MEDIVAL IST Project.
* \ingroup MIH_C_INTERFACE
*
* @{
*/
#ifndef __MIH_C_MEDIEVAL_EXTENSIONS_H__
# define __MIH_C_MEDIEVAL_EXTENSIONS_H__
//-----------------------------------------------------------------------------
# ifdef MIH_C_MEDIEVAL_EXTENSIONS_C
# define private_Medieval_extensions(x) x
# define protected_Medieval_extensions(x) x
# define public_Medieval_extensions(x) x
# else
# ifdef MIH_C_INTERFACE
# define private_Medieval_extensions(x)
# define protected_Medieval_extensions(x) extern x
# define public_Medieval_extensions(x) extern x
# else
# define private_Medieval_extensions(x)
# define protected_Medieval_extensions(x)
# define public_Medieval_extensions(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <ctype.h>
//-----------------------------------------------------------------------------
#include "MIH_C.h"
//-----------------------------------------------------------------------------
#ifdef MIH_C_MEDIEVAL_EXTENSIONS
public_Medieval_extensions(unsigned int MIH_C_PROTO2String (MIH_C_PROTO_T *protoP,char* bufP);)
public_Medieval_extensions(unsigned int MIH_C_IP_TUPLE2String(MIH_C_IP_TUPLE_T *dataP, char* bufP);)
public_Medieval_extensions(void MIH_C_IP_TUPLE_encode(Bit_Buffer_t* bbP, MIH_C_IP_TUPLE_T *dataP);)
public_Medieval_extensions(void MIH_C_IP_TUPLE_decode(Bit_Buffer_t* bbP, MIH_C_IP_TUPLE_T *dataP);)
public_Medieval_extensions(unsigned int MIH_C_FLOW_ID2String(MIH_C_FLOW_ID_T *dataP, char* bufP);)
public_Medieval_extensions(void MIH_C_FLOW_ID_encode(Bit_Buffer_t* bbP, MIH_C_FLOW_ID_T *dataP);)
public_Medieval_extensions(void MIH_C_FLOW_ID_decode(Bit_Buffer_t* bbP, MIH_C_FLOW_ID_T *dataP);)
public_Medieval_extensions(unsigned int MIH_C_MARK2String(MIH_C_MARK_T *dataP, char* bufP);)
public_Medieval_extensions(void MIH_C_MARK_encode(Bit_Buffer_t* bbP, MIH_C_MARK_T *dataP);)
public_Medieval_extensions(void MIH_C_MARK_decode(Bit_Buffer_t* bbP, MIH_C_MARK_T *dataP);)
public_Medieval_extensions(unsigned int MIH_C_QOS2String(MIH_C_QOS_T *dataP, char* bufP);)
public_Medieval_extensions(void MIH_C_QOS_encode(Bit_Buffer_t* bbP, MIH_C_QOS_T *dataP);)
public_Medieval_extensions(void MIH_C_QOS_decode(Bit_Buffer_t* bbP, MIH_C_QOS_T *dataP);)
public_Medieval_extensions(unsigned int MIH_C_RESOURCE_DESC2String(MIH_C_RESOURCE_DESC_T *dataP, char* bufP);)
public_Medieval_extensions(void MIH_C_RESOURCE_DESC_encode(Bit_Buffer_t* bbP, MIH_C_RESOURCE_DESC_T *dataP);)
public_Medieval_extensions(void MIH_C_RESOURCE_DESC_decode(Bit_Buffer_t* bbP, MIH_C_RESOURCE_DESC_T *dataP);)
public_Medieval_extensions(unsigned int MIH_C_FLOW_ATTRIBUTE2String(MIH_C_FLOW_ATTRIBUTE_T *dataP, char* bufP);)
public_Medieval_extensions(void MIH_C_FLOW_ATTRIBUTE_encode(Bit_Buffer_t* bbP, MIH_C_FLOW_ATTRIBUTE_T *dataP);)
public_Medieval_extensions(void MIH_C_FLOW_ATTRIBUTE_decode(Bit_Buffer_t* bbP, MIH_C_FLOW_ATTRIBUTE_T *dataP);)
public_Medieval_extensions(unsigned int MIH_C_LINK_AC_PARAM2String(MIH_C_LINK_AC_PARAM_T *dataP, char* bufP);)
public_Medieval_extensions(void MIH_C_LINK_AC_PARAM_encode(Bit_Buffer_t* bbP, MIH_C_LINK_AC_PARAM_T *dataP);)
public_Medieval_extensions(void MIH_C_LINK_AC_PARAM_decode(Bit_Buffer_t* bbP, MIH_C_LINK_AC_PARAM_T *dataP);)
public_Medieval_extensions(unsigned int MIH_C_LINK_ACTION2String(MIH_C_LINK_ACTION_T *dataP, char* bufP);)
public_Medieval_extensions(void MIH_C_LINK_ACTION_encode(Bit_Buffer_t* bbP, MIH_C_LINK_ACTION_T *dataP);)
public_Medieval_extensions(void MIH_C_LINK_ACTION_decode(Bit_Buffer_t* bbP, MIH_C_LINK_ACTION_T *dataP);)
public_Medieval_extensions(void MIH_C_LINK_ACTION_short_decode(Bit_Buffer_t* bbP, MIH_C_LINK_ACTION_T *dataP);)
#endif
#endif
/** @}*/
File diff suppressed because it is too large Load Diff
@@ -1,151 +0,0 @@
/*******************************************************************************
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 MIH_C_bit_buffer.h
* \brief This file defines the prototypes of the functions for coding and decoding of bit fields.
* \author GAUTHIER Lionel
* \date 2012
* \version
* \note
* \bug
* \warning
*/
#ifndef __MIH_C_BIT_BUFFER_H__
# define __MIH_C_BIT_BUFFER_H__
//-----------------------------------------------------------------------------
# ifdef MIH_C_BIT_BUFFER_C
# define private_bit_buffer(x) x
# define protected_bit_buffer(x) x
# define public_bit_buffer(x) x
# else
# ifdef MIH_C_INTERFACE
# define private_bit_buffer(x)
# define protected_bit_buffer(x) extern x
# define public_bit_buffer(x) extern x
# else
# define private_bit_buffer(x)
# define protected_bit_buffer(x)
# define public_bit_buffer(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include <sys/types.h>
//-----------------------------------------------------------------------------
#define BIT_BUFFER_FALSE 0
#define BIT_BUFFER_TRUE 1
typedef struct BitBuffer {
unsigned int m_buffer_allocated_by_this;
u_int8_t *m_buffer;
// size allocated for buffer
unsigned int m_capacity;
// amount of bytes written
unsigned int m_limit;
unsigned int m_byte_position;
unsigned int m_bit_mod_8_position;
} Bit_Buffer_t;
//-----------------------------------------------------------------------------
public_bit_buffer(Bit_Buffer_t* new_BitBuffer_0(void);)
public_bit_buffer(Bit_Buffer_t* new_BitBuffer_1(unsigned int capacityP);)
public_bit_buffer(Bit_Buffer_t* new_BitBuffer_2(unsigned char* bufferP, unsigned int capacityP);)
public_bit_buffer(void BitBuffer_wrap(Bit_Buffer_t* bbP, unsigned char* bufferP, unsigned int capacityP);)
public_bit_buffer(u_int32_t BitBuffer_read32(Bit_Buffer_t* bbP);)
public_bit_buffer(u_int32_t BitBuffer_read32littleendian(Bit_Buffer_t* bbP);)
public_bit_buffer(u_int16_t BitBuffer_read16(Bit_Buffer_t* bbP);)
public_bit_buffer(u_int16_t BitBuffer_read16littleendian(Bit_Buffer_t* bbP);)
public_bit_buffer(u_int8_t BitBuffer_read8(Bit_Buffer_t* bbP);)
public_bit_buffer(u_int8_t BitBuffer_readBool(Bit_Buffer_t* bbP);)
public_bit_buffer(u_int32_t BitBuffer_read(Bit_Buffer_t* bbP, const unsigned int nb_bitsP);)
public_bit_buffer(u_int32_t BitBuffer_readlittleendian(Bit_Buffer_t* bbP, const unsigned int nb_bitsP);)
public_bit_buffer(void BitBuffer_readMem(Bit_Buffer_t* bbP, u_int8_t* destP, unsigned int nb_bytesP);)
public_bit_buffer(void BitBuffer_write32(Bit_Buffer_t* bbP, u_int32_t valueP);)
public_bit_buffer(void BitBuffer_write32littleendian(Bit_Buffer_t* bbP, u_int32_t valueP);)
public_bit_buffer(void BitBuffer_write16littleendian(Bit_Buffer_t* bbP, u_int16_t valueP);)
public_bit_buffer(void BitBuffer_write16(Bit_Buffer_t* bbP, u_int16_t valueP);)
public_bit_buffer(void BitBuffer_write8(Bit_Buffer_t* bbP, u_int8_t valueP);)
public_bit_buffer(void BitBuffer_writeBool(Bit_Buffer_t* bbP, u_int8_t valueP);)
public_bit_buffer(void BitBuffer_writeMem(Bit_Buffer_t* bbP, u_int8_t* startP, unsigned int nb_bytesP);)
public_bit_buffer(void BitBuffer_write8b(Bit_Buffer_t* bbP, u_int8_t valueP, unsigned int nb_bitsP);)
public_bit_buffer(void BitBuffer_writelittleendian(Bit_Buffer_t* bbP, u_int8_t valueP, unsigned int nb_bitsP);)
public_bit_buffer(void BitBuffer_write16b(Bit_Buffer_t* bbP, u_int16_t valueP, unsigned int nb_bitsP);)
public_bit_buffer(void BitBuffer_writelittleendian16b(Bit_Buffer_t* bbP, u_int16_t valueP, unsigned int nb_bitsP);)
public_bit_buffer(void BitBuffer_write32b(Bit_Buffer_t* bbP, u_int32_t valueP, unsigned int nb_bitsP);)
public_bit_buffer(void BitBuffer_writelittleendian32b(Bit_Buffer_t* bbP, u_int32_t valueP, unsigned int nb_bitsP);)
public_bit_buffer(void BitBuffer_rewind(Bit_Buffer_t* bbP);)
public_bit_buffer(void BitBuffer_rewind_to(Bit_Buffer_t* bbP, unsigned int byte_positionP);)
public_bit_buffer(void BitBuffer_write_shift_last_n_bytes_right(Bit_Buffer_t* bbP, unsigned int nb_bytes_to_shiftP, unsigned int hole_sizeP);)
public_bit_buffer(void BitBuffer_reset(Bit_Buffer_t* bbP);)
public_bit_buffer(unsigned char* BitBuffer_getNextFreePosition(Bit_Buffer_t* bbP);)
public_bit_buffer(unsigned int BitBuffer_getPosition(Bit_Buffer_t* bbP);)
public_bit_buffer(void BitBuffer_addLimitOffset(Bit_Buffer_t* bbP, unsigned int offsetP);)
public_bit_buffer(unsigned int BitBuffer_getNumFreeBytes(Bit_Buffer_t* bbP);)
public_bit_buffer(u_int8_t BitBuffer_isCheckWriteOverflowOK(Bit_Buffer_t* bbP, unsigned int nb_bitsP);)
public_bit_buffer(u_int8_t BitBuffer_isCheckReadOverflowOK(Bit_Buffer_t* bbP, unsigned int nb_bitsP);)
public_bit_buffer(void free_BitBuffer(Bit_Buffer_t* bbP);)
#endif
@@ -1,121 +0,0 @@
/*******************************************************************************
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 MIH_C_header_codec.h
* \brief This file defines the prototypes of the functions for coding and decoding of MIH header messages.
* \author BRIZZOLA Davide, GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
#ifndef __MIH_C_HEADER_CODEC_H__
# define __MIH_C_HEADER_CODEC_H__
//-----------------------------------------------------------------------------
# ifdef MIH_C_HEADER_CODEC_C
# define private_header_codec(x) x
# define protected_header_codec(x) x
# define public_header_codec(x) x
# else
# ifdef MIH_C_INTERFACE
# define private_header_codec(x)
# define protected_header_codec(x) extern x
# define public_header_codec(x) extern x
# else
# define private_header_codec(x)
# define protected_header_codec(x)
# define public_header_codec(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
//#include <netdb.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/time.h>
#include <ctype.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <getopt.h>
#include <libgen.h>
//-----------------------------------------------------------------------------
#include "MIH_C_bit_buffer.h"
#include "MIH_C_Types.h"
//-----------------------------------------------------------------------------
#define MIH_HEADER_ENCODE_OK 0
#define MIH_HEADER_DECODE_OK 0
#define MIH_HEADER_ENCODE_TOO_SHORT -1
#define MIH_HEADER_DECODE_TOO_SHORT -1
#define MIH_HEADER_ENCODE_FAILURE -2
#define MIH_HEADER_DECODE_FAILURE -2
#define MIH_HEADER_ENCODE_BAD_PARAMETER -3
#define MIH_HEADER_DECODE_BAD_PARAMETER -3
TYPEDEF_INTEGER1(MIH_C_VERSION);
TYPEDEF_INTEGER1(MIH_C_ACK_REQ);
TYPEDEF_INTEGER1(MIH_C_ACK_RSP);
TYPEDEF_INTEGER1(MIH_C_UIR);
TYPEDEF_INTEGER1(MIH_C_M);
TYPEDEF_INTEGER1(MIH_C_FN);
TYPEDEF_INTEGER1(MIH_C_SID);
TYPEDEF_INTEGER1(MIH_C_OPCODE);
TYPEDEF_INTEGER2(MIH_C_AID);
TYPEDEF_INTEGER2(MIH_C_TRANSACTION_ID);
TYPEDEF_INTEGER2(MIH_C_VARIABLE_PAYLOAD_LENGTH);
TYPEDEF_INTEGER1(MIH_C_TLV_TYPE);
/*! \struct MIH_C_HEADER
* \brief Structure defining the header of messages exchanged between MIH entities.
*/
typedef struct MIH_C_HEADER {
MIH_C_VERSION_T version;
MIH_C_ACK_REQ_T ack_req;
MIH_C_ACK_RSP_T ack_rsp;
MIH_C_UIR_T uir;
MIH_C_M_T more_fragment;
MIH_C_FN_T fragment_number;
MIH_C_SID_T service_identifier;
MIH_C_OPCODE_T operation_code;
MIH_C_AID_T action_identifier;
MIH_C_TRANSACTION_ID_T transaction_id;
MIH_C_VARIABLE_PAYLOAD_LENGTH_T payload_length;
} MIH_C_HEADER_T;
//-----------------------------------------------------------------------------
public_header_codec(int MIH_C_HEADER2String(MIH_C_HEADER_T* headerP, char* bufP);)
public_header_codec(int MIH_C_Link_Header_Encode(Bit_Buffer_t* message_serializedP, MIH_C_HEADER_T* headerP);)
public_header_codec(int MIH_C_Link_Header_Decode(Bit_Buffer_t* message_serializedP, MIH_C_HEADER_T* headerP);)
//-----------------------------------------------------------------------------
#endif
@@ -1,128 +0,0 @@
/*******************************************************************************
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 MIH_C_log.h
* \brief This file defines the prototypes of the functions for logging.
* \author BRIZZOLA Davide, GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
#error "To be removed"
#ifndef __MIH_C_LOG_H__
# define __MIH_C_LOG_H__
//-----------------------------------------------------------------------------
# ifdef MIH_C_LOG_C
# define private_mih_c_log(x) x
# define protected_mih_c_log(x) x
# define public_mih_c_log(x) x
# else
# ifdef MIH_C_INTERFACE
# define private_mih_c_log(x)
# define protected_mih_c_log(x) extern x
# define public_mih_c_log(x) extern x
# else
# define private_mih_c_log(x)
# define protected_mih_c_log(x)
# define public_mih_c_log(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <syslog.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <sys/types.h>
//-----------------------------------------------------------------------------
#define LOG_CONST 0
#define LOG_TO_CONSOLE 0
#define LOG_TO_FILE 1
#define LOG_TO_SYSTEM 2
//default value
#define LOG_TO_DEFAULT LOG_TO_CONSOLE
#define MIH_C_LOGFILE_NAME "/tmp/MIH_C_log.txt"
#define MIH_C_SYSLOG_NAME "LTE"
#define MIH_C_VERSION "1.0" //Release date : see readme
#define EMERG(args...) MIH_C_log_record( (LOG_EMERG), ##args)
#define ALERT(args...) MIH_C_log_record( (LOG_ALERT), ##args)
#define CRIT(args...) MIH_C_log_record( (LOG_CRIT), ##args)
#define ERR(args...) MIH_C_log_record( (LOG_ERR), ##args)
#define WARNING(args...) MIH_C_log_record( (LOG_WARNING), ##args)
#define NOTICE(args...) MIH_C_log_record( (LOG_NOTICE), ##args)
#define INFO(args...) MIH_C_log_record( (LOG_INFO), ##args)
#define DEBUG(args...) MIH_C_log_record( (LOG_DEBUG), ##args)
//-----------------------------------------------------------------------------
private_mih_c_log(FILE *g_mih_c_log_file;)
private_mih_c_log(int g_mih_c_log_output;)
private_mih_c_log(const char* g_log_level2string[LOG_DEBUG+1];)
/*! \fn char* getTimeStamp4Log(void)
* \brief Get a formated string of current time.
* \return a char string of current time in seconds and micro seconds.
*/
public_mih_c_log( char* getTimeStamp4Log(void);)
/*! \fn int mih_c_log_init(unsigned int log_outputP)
* \brief Initialize log module.
* \param[in] log_outputP Identifier of output where logs go are sent.
*/
protected_mih_c_log( int MIH_C_log_init(unsigned int log_outputP);)
/*! \fn int MIH_C_log_record(unsigned int levelP, char * log_msgP, ...)
* \brief Set log parameters.
* \param[in] levelP Level of log (ERROR, DEBUG).
* \param[in] log_msgP Message to log.
*/
public_mih_c_log( int MIH_C_log_record(int level, const char * log_msg, ...);)
/*! \fn int MIH_C_log_exit(void)
* \brief Close, and clean properly the log module.
*/
protected_mih_c_log( int MIH_C_log_exit(void);)
#endif
@@ -1,167 +0,0 @@
/*******************************************************************************
*
* Eurecom OpenAirInterface 3
* Copyright(c) 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 MIH_C_msg_codec.h
* \brief This file defines the prototypes of the functions for coding and decoding of MIH Link messages.
* \author BRIZZOLA Davide, GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
#ifndef __MIH_C_MSG_CODEC_H__
# define __MIH_C_MSG_CODEC_H__
//-----------------------------------------------------------------------------
# ifdef MIH_C_MSG_CODEC_C
# define private_mih_c_msg_codec(x) x
# define protected_mih_c_msg_codec(x) x
# define public_mih_c_msg_codec(x) x
# else
# ifdef MIH_C_INTERFACE
# define private_mih_c_msg_codec(x)
# define protected_mih_c_msg_codec(x) extern x
# define public_mih_c_msg_codec(x) extern x
# else
# define private_mih_c_msg_codec(x)
# define protected_mih_c_msg_codec(x)
# define public_mih_c_msg_codec(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <errno.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
*******************************************************************************/
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <ctype.h>
#include <libgen.h>
//-----------------------------------------------------------------------------
#include "MIH_C.h"
//-----------------------------------------------------------------------------
#define MIH_MESSAGE_DECODE_OK 0
#define MIH_MESSAGE_DECODE_TOO_SHORT -1
#define MIH_MESSAGE_DECODE_FAILURE -2
#define MIH_MESSAGE_DECODE_BAD_PARAMETER -3
//-----------------------------------------------------------------------------
#define MSG_MIH_HEADER_SIZE_IN_BYTES 8
//-----------------------------------------------------------------------------
typedef u_int16_t MIH_C_Message_Id_t;
typedef struct MIH_C_Message_Wrapper {
MIH_C_Message_Id_t message_id;
union {
#ifdef MIH_C_MEDIEVAL_EXTENSIONS
MIH_C_Message_Link_Register_indication_t link_register_indication;
#endif
MIH_C_Message_Link_Detected_indication_t link_detected_indication;
MIH_C_Message_Link_Up_indication_t link_up_indication;
MIH_C_Message_Link_Down_indication_t link_down_indication;
MIH_C_Message_Link_Parameters_Report_indication_t link_parameters_report_indication;
MIH_C_Message_Link_Going_Down_indication_t link_going_down_indication;
MIH_C_Message_Link_Handover_Imminent_indication_t link_handover_imminent_indication;
MIH_C_Message_Link_Handover_Complete_indication_t link_handover_complete_indication;
MIH_C_Message_Link_PDU_Transmit_Status_indication_t link_pdu_transmit_status_indication;
MIH_C_Message_Link_Capability_Discover_request_t link_capability_discover_request;
MIH_C_Message_Link_Capability_Discover_confirm_t link_capability_discover_confirm;
MIH_C_Message_Link_Event_Subscribe_request_t link_event_subscribe_request;
MIH_C_Message_Link_Event_Subscribe_confirm_t link_event_subscribe_confirm;
MIH_C_Message_Link_Event_Unsubscribe_request_t link_event_unsubscribe_request;
MIH_C_Message_Link_Event_Unsubscribe_confirm_t link_event_unsubscribe_confirm;
MIH_C_Message_Link_Get_Parameters_request_t link_get_parameters_request;
MIH_C_Message_Link_Get_Parameters_confirm_t link_get_parameters_confirm;
MIH_C_Message_Link_Configure_Thresholds_request_t link_configure_thresholds_request;
MIH_C_Message_Link_Configure_Thresholds_confirm_t link_configure_thresholds_confirm;
MIH_C_Message_Link_Action_request_t link_action_request;
MIH_C_Message_Link_Action_confirm_t link_action_confirm;
} _union_message;
} MIH_C_Message_Wrapper_t;
//-----------------------------------------------------------------------------
private_mih_c_msg_codec(MIH_C_TRANSACTION_ID_T g_transaction_id_generator;)
//-----------------------------------------------------------------------------
public_mih_c_msg_codec( MIH_C_TRANSACTION_ID_T MIH_C_get_new_transaction_id(void);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Decode_Link_Capability_Discover_request( Bit_Buffer_t* bbP, MIH_C_Message_Link_Capability_Discover_request_t *messageP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Link_Capability_Discover_request2String( MIH_C_Message_Link_Capability_Discover_request_t *messageP, char* bufP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Decode_Link_Event_Subscribe_request( Bit_Buffer_t* bbP, MIH_C_Message_Link_Event_Subscribe_request_t *messageP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Link_Event_Subscribe_request2String( MIH_C_Message_Link_Event_Subscribe_request_t *messageP, char* bufP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Decode_Link_Event_Unsubscribe_request( Bit_Buffer_t* bbP, MIH_C_Message_Link_Event_Unsubscribe_request_t *messageP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Link_Event_Unsubscribe_request2String( MIH_C_Message_Link_Event_Unsubscribe_request_t *messageP, char* bufP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Decode_Link_Get_Parameters_request( Bit_Buffer_t* bbP, MIH_C_Message_Link_Get_Parameters_request_t *messageP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Link_Get_Parameters_request2String( MIH_C_Message_Link_Get_Parameters_request_t *messageP, char* bufP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Decode_Link_Configure_Thresholds_request( Bit_Buffer_t* bbP, MIH_C_Message_Link_Configure_Thresholds_request_t *messageP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Link_Configure_Thresholds_request2String( MIH_C_Message_Link_Configure_Thresholds_request_t *messageP, char* bufP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Decode_Link_Action_request( Bit_Buffer_t* bbP, MIH_C_Message_Link_Action_request_t *messageP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Link_Action_request2String( MIH_C_Message_Link_Action_request_t *messageP, char* bufP);)
#ifdef MIH_C_MEDIEVAL_EXTENSIONS
public_mih_c_msg_codec( int MIH_C_Link_Message_Encode_Link_Register_indication( Bit_Buffer_t* bbP, MIH_C_Message_Link_Register_indication_t *messageP);)
#endif
public_mih_c_msg_codec( int MIH_C_Link_Message_Encode_Link_Detected_indication( Bit_Buffer_t* bbP, MIH_C_Message_Link_Detected_indication_t *messageP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Encode_Link_Up_indication( Bit_Buffer_t* bbP, MIH_C_Message_Link_Up_indication_t *messageP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Encode_Link_Parameters_Report_indication( Bit_Buffer_t* bbP, MIH_C_Message_Link_Parameters_Report_indication_t *messageP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Encode_Link_Going_Down_indication( Bit_Buffer_t* bbP, MIH_C_Message_Link_Going_Down_indication_t *messageP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Encode_Link_Down_indication( Bit_Buffer_t* bbP, MIH_C_Message_Link_Down_indication_t *messageP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Encode_Link_Action_confirm( Bit_Buffer_t* bbP, MIH_C_Message_Link_Action_confirm_t *messageP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Encode_Capability_Discover_confirm( Bit_Buffer_t* bbP, MIH_C_Message_Link_Capability_Discover_confirm_t *messageP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Encode_Event_Subscribe_confirm( Bit_Buffer_t* bbP, MIH_C_Message_Link_Event_Subscribe_confirm_t *messageP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Encode_Event_Unsubscribe_confirm( Bit_Buffer_t* bbP, MIH_C_Message_Link_Event_Unsubscribe_confirm_t *messageP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Encode_Configure_Thresholds_confirm( Bit_Buffer_t* bbP, MIH_C_Message_Link_Configure_Thresholds_confirm_t *messageP);)
public_mih_c_msg_codec( int MIH_C_Link_Message_Encode_Get_Parameters_confirm( Bit_Buffer_t* bbP, MIH_C_Message_Link_Get_Parameters_confirm_t *messageP);)
#endif
@@ -1,115 +0,0 @@
/*******************************************************************************
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 MIH_C_primitive_codec.h
* \brief This file defines the prototypes of the functions for coding and decoding of MIH Link messages.
* \author BRIZZOLA Davide, GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
#ifndef __MIH_C_PRIMITIVE_CODEC_H__
# define __MIH_C_PRIMITIVE_CODEC_H__
//-----------------------------------------------------------------------------
# ifdef mih_c_primitive_codec_C
# define private_mih_c_primitive_codec(x) x
# define protected_mih_c_primitive_codec(x) x
# define public_mih_c_primitive_codec(x) x
# else
# ifdef MIH_C_INTERFACE
# define private_mih_c_primitive_codec(x)
# define protected_mih_c_primitive_codec(x) extern x
# define public_mih_c_primitive_codec(x) extern x
# else
# define private_mih_c_primitive_codec(x)
# define protected_mih_c_primitive_codec(x)
# define public_mih_c_primitive_codec(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <netdb.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/time.h>
#include <ctype.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <getopt.h>
#include <libgen.h>
//-----------------------------------------------------------------------------
#include "MIH_C.h"
//-----------------------------------------------------------------------------
#define MIH_PRIMITIVE_DECODE_OK 0
#define MIH_PRIMITIVE_DECODE_TOO_SHORT -1
#define MIH_PRIMITIVE_DECODE_FAILURE -2
#define MIH_PRIMITIVE_DECODE_BAD_PARAMETER -3
#define MIH_PRIMITIVE_ENCODE_OK 0
#define MIH_PRIMITIVE_ENCODE_TOO_SHORT -1
#define MIH_PRIMITIVE_ENCODE_FAILURE -2
#define MIH_PRIMITIVE_ENCODE_BAD_PARAMETER -3
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Decode_Link_Capability_Discover_request (Bit_Buffer_t* bbP, MIH_C_Link_Capability_Discover_request_t *primitiveP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Link_Capability_Discover_request2String (MIH_C_Link_Capability_Discover_request_t *primitiveP, char* bufP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Decode_Link_Event_Subscribe_request (Bit_Buffer_t* bbP, MIH_C_Link_Event_Subscribe_request_t *primitiveP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Link_Event_Subscribe_request2String (MIH_C_Link_Event_Subscribe_request_t *primitiveP, char* bufP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Decode_Link_Event_Unsubscribe_request (Bit_Buffer_t* bbP, MIH_C_Link_Event_Unsubscribe_request_t *primitiveP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Link_Event_Unsubscribe_request2String (MIH_C_Link_Event_Unsubscribe_request_t *primitiveP, char* bufP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Decode_Link_Get_Parameters_request (Bit_Buffer_t* bbP, MIH_C_Link_Get_Parameters_request_t *primitiveP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Link_Get_Parameters_request2String (MIH_C_Link_Get_Parameters_request_t *primitiveP, char* bufP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Decode_Link_Configure_Thresholds_request(Bit_Buffer_t* bbP, MIH_C_Link_Configure_Thresholds_request_t *primitiveP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Link_Configure_Thresholds_request2String(MIH_C_Link_Configure_Thresholds_request_t *primitiveP, char* bufP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Decode_Link_Action_request (Bit_Buffer_t* bbP, MIH_C_Link_Action_request_t *primitiveP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Link_Action_request2String (MIH_C_Link_Action_request_t *primitiveP, char* bufP);)
#ifdef MIH_C_MEDIEVAL_EXTENSIONS
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Encode_Link_Register_indication (Bit_Buffer_t* bbP, MIH_C_Link_Register_indication_t *primitiveP);)
#endif
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Encode_Link_Detected_indication (Bit_Buffer_t* bbP, MIH_C_Link_Detected_indication_t *primitiveP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Encode_Link_Up_indication (Bit_Buffer_t* bbP, MIH_C_Link_Up_indication_t *primitiveP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Encode_Link_Parameters_Report_indication(Bit_Buffer_t* bbP, MIH_C_Link_Parameters_Report_indication_t *primitiveP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Encode_Link_Going_Down_indication (Bit_Buffer_t* bbP, MIH_C_Link_Going_Down_indication_t *primitiveP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Encode_Link_Down_indication (Bit_Buffer_t* bbP, MIH_C_Link_Down_indication_t *primitiveP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Link_Register_indication2String (MIH_C_Link_Register_indication_t *primitiveP, char* bufP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Encode_Link_Capability_Discover_confirm (Bit_Buffer_t* bbP, MIH_C_Link_Capability_Discover_confirm_t *primitiveP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Link_Capability_Discover_confirm2String (MIH_C_Link_Capability_Discover_confirm_t *primitiveP, char* bufP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Encode_Link_Event_Subscribe_confirm (Bit_Buffer_t* bbP, MIH_C_Link_Event_Subscribe_confirm_t *primitiveP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Encode_Link_Event_Unsubscribe_confirm (Bit_Buffer_t* bbP, MIH_C_Link_Event_Unsubscribe_confirm_t *primitiveP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Encode_Link_Configure_Thresholds_confirm(Bit_Buffer_t* bbP, MIH_C_Link_Configure_Thresholds_confirm_t *primitiveP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Encode_Link_Get_Parameters_confirm (Bit_Buffer_t* bbP, MIH_C_Link_Get_Parameters_confirm_t *primitiveP);)
protected_mih_c_primitive_codec(int MIH_C_Link_Primitive_Encode_Link_Action_confirm (Bit_Buffer_t* bbP, MIH_C_Link_Action_confirm_t *primitiveP);)
#endif
@@ -1,68 +0,0 @@
# lines starting with the pound sign are comments.
#
# These things are options that you might need
# to tweak.
# You can modify the below as well, but probably
# won't need to.
CODE_DIR=C
INCLUDE_DIR=INCLUDE
LIB_DIR=LIB
CC = gcc
# include directories
INCLUDES = -I$(INCLUDE_DIR)
# C compiler flags (-g -O2 -Wall)
CFLAGS = -g -Wall -DMIH_C_MEDIEVAL_EXTENSIONS
SRC = $(CODE_DIR)/MIH_C_header_codec.c
SRC += $(CODE_DIR)/MIH_C_msg_codec.c
SRC += $(CODE_DIR)/MIH_C_primitive_codec.c
SRC += $(CODE_DIR)/MIH_C_F1_basic_data_types_codec.c
SRC += $(CODE_DIR)/MIH_C_F2_general_data_types_codec.c
SRC += $(CODE_DIR)/MIH_C_F3_data_types_for_address_codec.c
SRC += $(CODE_DIR)/MIH_C_F4_data_types_for_links_codec.c
SRC += $(CODE_DIR)/MIH_C_F9_data_types_for_qos_codec.c
SRC += $(CODE_DIR)/MIH_C_F13_data_types_for_information_elements_codec.c
SRC += $(CODE_DIR)/MIH_C_L2_type_values_for_tlv_encoding.c
SRC += $(CODE_DIR)/MIH_C_Medieval_extensions.c
SRC += $(CODE_DIR)/MIH_C_log.c
SRC += $(CODE_DIR)/MIH_C_bit_buffer.c
SRC += $(CODE_DIR)/MIH_C.c
OBJ = $(SRC:.c=.o)
LIBS = -L/usr/local/lib -lrt
OUT = $(LIB_DIR)/libmih_c-802.21.a
LDFLAGS = -g
.SUFFIXES: .c
default: $(OUT)
.c.o:
$(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
$(OUT): $(OBJ)
ar rcs $(OUT) $(OBJ)
clean:
-find . -name "*.o" -delete
-find . -name "*.*~" -delete
-find . -name "*~" -delete
-rm -Rf DOXYGEN/html
-rm -f $(OUT)
@@ -1,14 +0,0 @@
Doc updated on 11 June 2012
README file for INTERFACE-802.21 Interface
******************
Release dates
Beta 0 : 06.11.2012
******************
The mih_c-802.21.a library is compiled in the INTERFACE-802.21 directory .
This library can be linked with any C module dealing with 802.21 link interface.
@@ -1,48 +0,0 @@
/*******************************************************************************
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
*******************************************************************************/
#ifndef __LTE_RAL_ENB_H__
#define __LTE_RAL_ENB_H__
#include "MIH_C.h"
#include "openair_types.h"
#include "platform_constants.h"
#include "platform_types.h"
#include "lteRALenb_constants.h"
#include "lteRALenb_variables.h"
#include "lteRALenb_action.h"
#include "lteRALenb_main.h"
#include "lteRALenb_mih_msg.h"
#include "lteRALenb_rrc_msg.h"
#include "lteRALenb_parameters.h"
#include "lteRALenb_process.h"
#include "lteRALenb_subscribe.h"
#include "lteRALenb_thresholds.h"
#endif
@@ -1,118 +0,0 @@
/*******************************************************************************
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 lteRALenb_action.h
* \brief
* \author GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
#ifndef __LTE_RAL_ENB_ACTION_H__
#define __LTE_RAL_ENB_ACTION_H__
//-----------------------------------------------------------------------------
# ifdef LTE_RAL_ENB_ACTION_C
# define private_lteralenb_action(x) x
# define protected_lteralenb_action(x) x
# define public_lteralenb_action(x) x
# else
# ifdef LTE_RAL_ENB
# define private_lteralenb_action(x)
# define protected_lteralenb_action(x) extern x
# define public_lteralenb_action(x) extern x
# else
# define private_lteralenb_action(x)
# define protected_lteralenb_action(x)
# define public_lteralenb_action(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include "lteRALenb.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
/****************************************************************************/
#ifdef MIH_C_MEDIEVAL_EXTENSIONS
/*
* ---------------------------------------------------------------------------
* Flow identifier management:
* Radio Bearer data flows are identified by a source address, a destination
* address and a port number for a particular IP transport protocol (UDP,
* TCP). A private data structure is used to map upper-layer flow identifiers
* to lower-layer RB channel identifiers. It is handled by private functions.
* ---------------------------------------------------------------------------
*/
/* Structure of the destination data flow */
typedef struct Data_flow {
unsigned char addr[16]; // IP address
unsigned int l2id[2]; // L2 identifier
unsigned int port; // IP port identifier
int proto; // IP protocol
int cnxid; // Data flow identifier
} data_flow_t;
#define ACTION_MAX_FLOW ((RAL_MAX_MT)*(RAL_MAX_RB))
typedef struct eRAL_action_DataFlowList {
int n_flows;
data_flow_t flow [ACTION_MAX_FLOW];
int flow_id [ACTION_MAX_FLOW]; //added TEMP MW 23/05/13
} eRAL_action_DataFlowList_t;
private_lteralenb_action(eRAL_action_DataFlowList_t g_flows = {};)
#endif // MIH_C_MEDIEVAL_EXTENSIONS
/****************************************************************************/
/******************** G L O B A L V A R I A B L E S ********************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
protected_lteralenb_action(void eRAL_action_request (ral_enb_instance_t instanceP, MIH_C_Message_Link_Action_request_t* msgP);)
protected_lteralenb_action(int eRAL_action_save_flow_id (ral_enb_instance_t instanceP, MIH_C_FLOW_ID_T* flowId, int cnxid);)
private_lteralenb_action( int eRAL_action_set_channel_id (ral_enb_instance_t instanceP, MIH_C_FLOW_ID_T* flowId, int cnxid);)
private_lteralenb_action( int eRAL_action_get_channel_id (ral_enb_instance_t instanceP, MIH_C_FLOW_ID_T* flowId, int* cnxid);)
private_lteralenb_action( int eRAL_action_del_channel_id (ral_enb_instance_t instanceP, int fix);)
private_lteralenb_action( int eRAL_action_is_in_progress (ral_enb_instance_t instanceP, MIH_C_STATUS_T* status, MIH_C_LINK_AC_RESULT_T* ac_status, MIH_C_LINK_AC_TYPE_T action);)
#ifdef MIH_C_MEDIEVAL_EXTENSIONS
private_lteralenb_action( MIH_C_LINK_AC_RESULT_T eRAL_action_link_flow_attr(ral_enb_instance_t instanceP);)
private_lteralenb_action( MIH_C_LINK_AC_RESULT_T eRAL_action_link_activate_resources(ral_enb_instance_t instanceP);)
private_lteralenb_action( MIH_C_LINK_AC_RESULT_T eRAL_action_link_deactivate_resources(ral_enb_instance_t instanceP);)
#endif // MIH_C_MEDIEVAL_EXTENSIONS
#endif
@@ -1,58 +0,0 @@
/*******************************************************************************
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
*******************************************************************************/
#ifndef __LTE_RAL_ENB_CONSTANTS_H__
#define __LTE_RAL_ENB_CONSTANTS_H__
#include <sys/types.h>
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
//-----------------------------------------------------------------------------
#define ENB_DEFAULT_LOCAL_PORT_RAL "1235"
#define ENB_DEFAULT_REMOTE_PORT_MIHF "1025"
#define ENB_DEFAULT_IP_ADDRESS_MIHF "127.0.0.1"
#define ENB_DEFAULT_IP_ADDRESS_RAL "127.0.0.1"
#define ENB_DEFAULT_LINK_ID_RAL "enb_lte_link"
#define ENB_DEFAULT_LINK_ADDRESS_RAL "060080149150"
#define ENB_DEFAULT_MIHF_ID "mihf_enb"
#define ENB_DEFAULT_3GPP_ADDRESS "0000000000000000"
//-----------------------------------------------------------------------------
// Constants for scenario
#define PREDEFINED_MIH_NETWORK_ID "eurecom"
#define PREDEFINED_MIH_NETAUX_ID "netaux"
#define PREDEFINED_CHANNEL_ID 2
#define PREDEFINED_CLASSES_SERVICE_SUPPORTED 2
#define PREDEFINED_QUEUES_SUPPORTED 2
#endif
@@ -1,218 +0,0 @@
/*******************************************************************************
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 lteRALenb_main.h
* \brief
* \author GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
#ifndef __LTE_RAL_ENB_MAIN_H__
#define __LTE_RAL_ENB_MAIN_H__
//-----------------------------------------------------------------------------
# ifdef LTE_RAL_ENB_MAIN_C
# define private_lteralenb_main(x) x
# define protected_lteralenb_main(x) x
# define public_lteralenb_main(x) x
# else
# ifdef LTE_RAL_ENB
# define private_lteralenb_main(x)
# define protected_lteralenb_main(x) extern x
# define public_lteralenb_main(x) extern x
# else
# define private_lteralenb_main(x)
# define protected_lteralenb_main(x)
# define public_lteralenb_main(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include "lteRALenb.h"
#include "commonDef.h"
#include "hashtable.h"
//#include "collection/hashtable/hashtable.h"
public_lteralenb_main(char* g_conf_enb_ral_listening_port;)
public_lteralenb_main(char* g_conf_enb_ral_ip_address;)
public_lteralenb_main(char* g_conf_enb_ral_link_id;)
public_lteralenb_main(char* g_conf_enb_ral_link_address;)
public_lteralenb_main(char* g_conf_enb_mihf_remote_port;)
public_lteralenb_main(char* g_conf_enb_mihf_ip_address;)
public_lteralenb_main(char* g_conf_enb_mihf_id;)
/*
* Radio Bearer data
*/
typedef struct ral_lte_channel {
uint32_t cnx_id;
uint8_t multicast;
// MIHF parameters ix=0 UPLINK, ix=1 DOWNLINK
uint16_t flowId[2];
uint16_t classId[2];
float resBitrate[2];
float meanBitrate[2];
float bktDepth[2];
float pkBitrate[2];
float MTU[2];
// #if ! defined(ENABLE_USE_MME)
//IP driver parameters
uint16_t rbId;
uint16_t RadioQoSclass;
uint16_t dscpUL;
uint16_t dscpDL;
uint16_t nas_state;
uint16_t status;
// #endif
} ral_lte_channel_t;
/*
* Mobile Terminal data
*/
typedef struct ral_lte_mt_s {
/* The identifier of the link that is associated with a PoA */
MIH_C_LINK_TUPLE_ID_T ltid;
uint8_t ipv6_addr[16];
uint32_t ipv6_l2id[2];
uint32_t ue_id;
struct ral_lte_channel radio_channel[RAL_MAX_RB];
int num_rbs;
int num_class;
int nas_state;
int mt_state;
} ral_lte_mt_t;
/*
* Multicast data // TEMP MW A supprimer!!!!
*/
typedef struct ral_lte_mcast_s {
/* The identifier of the multicast link that is associated with a PoA */
MIH_C_LINK_TUPLE_ID_T ltid;
struct ral_lte_channel radio_channel;
uint8_t mc_group_addr[16];
} ral_lte_mcast_t;
/*
* RAL LTE internal data
*/
typedef struct lte_ral_enb_object {
//------------------------
// CONFIG PARAMETERS
//------------------------
char* ral_listening_port;
char* ral_ip_address;
char* ral_link_address;
char* mihf_remote_port;
char* mihf_ip_address;
char* link_id;
char* mihf_id;
MIH_C_LINK_MIHCAP_FLAG_T link_mihcap_flag; // hardcoded parameters
MIH_C_NET_CAPS_T net_caps;// hardcoded parameters
// provided by RRC with RRC_RAL_SYSTEM_CONFIGURATION_IND message
plmn_t plmn_id;
unsigned int cell_id:28;
int num_connected_mts;
uint8_t pending_req_flag;
uint8_t pending_req_mt_ix;
uint8_t pending_req_ch_ix;
uint8_t pending_req_multicast;
// uint16_t pending_req_transaction_id;
// uint8_t pending_req_status;
MIH_C_FLOW_ID_T pending_req_fid;
ral_lte_mt_t pending_mt;
int pending_mt_timer;
int pending_mt_flag;
ral_lte_mt_t mt[RAL_MAX_MT];
ral_lte_mcast_t mcast;
// measurements for MEDIEVAL project
//MIH_C_TIMER_INTERVAL_T measurement_timer_interval; // This timer value (ms) is used to set the interval between
// periodic reports. Valid Range: 0..65535
//long measurement_timer_id;
//uint16_t num_UEs;
//uint32_t rlcBufferOccupancy[RAL_MAX_MT];
//uint32_t scheduledPRB[RAL_MAX_MT];
//uint32_t totalDataVolume[RAL_MAX_MT];
//uint32_t totalNumPRBs;
//int congestion_flag;
//int congestion_threshold;
//int measures_triggered_flag;
//int requested_period;
// MIH-INTERFACE data
int mih_sock_desc;
MIH_C_LINK_AC_TYPE_LIST_T mih_supported_link_action_list;
MIH_C_LINK_EVENT_LIST_T mih_supported_link_event_list;
MIH_C_LINK_CMD_LIST_T mih_supported_link_command_list;
MIH_C_LINK_EVENT_LIST_T mih_subscribe_req_event_list;
//LIST(MIH_C_LINK_CFG_PARAM, mih_link_cfg_param_thresholds);
// to tell what are the configured thresholds in mih_link_cfg_param_thresholds_list
//MIH_C_BOOLEAN_T active_mih_link_cfg_param_threshold[MIH_C_LINK_CFG_PARAM_LIST_LENGTH];
MIH_C_LINK_AC_TYPE_T pending_req_action;
MIH_C_STATUS_T pending_req_status;
MIH_C_LINK_AC_RESULT_T pending_req_ac_result;
MIH_C_TRANSACTION_ID_T pending_req_transaction_id;
hash_table_t *ue_htbl;
MIH_C_TRANSACTION_ID_T transaction_id;
char buffer[800];
} lte_ral_enb_object_t;
/* RAL LTE internal data */
protected_lteralenb_main(lte_ral_enb_object_t g_enb_ral_obj[MAX_MODULES];)
private_lteralenb_main(hash_table_t *g_enb_ral_fd2instance;)
private_lteralenb_main(void eRAL_get_IPv6_addr (const char* if_name);)
public_lteralenb_main( void eRAL_init_default_values (void);)
private_lteralenb_main(int eRAL_initialize (void);)
private_lteralenb_main(void eRAL_process_file_descriptors(struct epoll_event *events, int nb_events);)
public_lteralenb_main( void* eRAL_task (void *args_p);)
#endif
@@ -1,202 +0,0 @@
/*******************************************************************************
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 lteRALenb_mih_msg.h
* \brief
* \author GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
#ifndef __LTE_RAL_ENB_MIH_MSG_H__
#define __LTE_RAL_ENB_MIH_MSG_H__
//-----------------------------------------------------------------------------
# ifdef LTE_RAL_ENB_MIH_MSG_C
# define private_lteralenb_mih_msg(x) x
# define protected_lteralenb_mih_msg(x) x
# define public_lteralenb_mih_msg(x) x
# else
# ifdef LTE_RAL_ENB
# define private_lteralenb_mih_msg(x)
# define protected_lteralenb_mih_msg(x) extern x
# define public_lteralenb_mih_msg(x) extern x
# else
# define private_lteralenb_mih_msg(x)
# define protected_lteralenb_mih_msg(x)
# define public_lteralenb_mih_msg(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include "lteRALenb.h"
#include "MIH_C_Types.h"
#include "MIH_C_header_codec.h"
#include "MIH_C_Link_Primitives.h"
/****************************************************************************/
/******************** G L O B A L V A R I A B L E S ********************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
protected_lteralenb_mih_msg(void eRAL_MIH_C_3GPP_ADDR_load_3gpp_str_address(ral_enb_instance_t instanceP, MIH_C_3GPP_ADDR_T* _3gpp_addr_pP, u_int8_t* str_pP));
protected_lteralenb_mih_msg(int eRAL_mihf_connect(ral_enb_instance_t instanceP);)
protected_lteralenb_mih_msg(int eRAL_mih_link_process_message(ral_enb_instance_t instanceP);)
private_lteralenb_mih_msg(void eRAL_print_buffer(const u_int8_t * bufferP, int lenP);)
/*
* --------------------------------------------------------------------------
* MIH service management messages
* --------------------------------------------------------------------------
*/
/* MIH_C_MESSAGE_LINK_REGISTER_INDICATION_ID */
protected_lteralenb_mih_msg(void eRAL_send_link_register_indication(\
ral_enb_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP);)
/* MIH_C_MESSAGE_LINK_CAPABILITY_DISCOVER_CONFIRM_ID */
private_lteralenb_mih_msg(void eRAL_send_capability_discover_confirm(\
ral_enb_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *tidP,\
MIH_C_STATUS_T *statusP,\
MIH_C_LINK_EVENT_LIST_T *link_evt_listP,\
MIH_C_LINK_CMD_LIST_T *link_cmd_listP);)
/* MIH_C_MESSAGE_LINK_EVENT_SUBSCRIBE_CONFIRM_ID */
protected_lteralenb_mih_msg(void eRAL_send_event_subscribe_confirm(\
ral_enb_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_STATUS_T *statusP,\
MIH_C_LINK_EVENT_LIST_T *link_event_listP);)
/* MIH_C_MESSAGE_LINK_EVENT_UNSUBSCRIBE_CONFIRM_ID */
protected_lteralenb_mih_msg(void eRAL_send_event_unsubscribe_confirm(\
ral_enb_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_STATUS_T *statusP,\
MIH_C_LINK_EVENT_LIST_T *link_event_listP);)
/*
* --------------------------------------------------------------------------
* MIH event messages
* --------------------------------------------------------------------------
*/
/* MIH_C_MESSAGE_LINK_DETECTED_INDICATION_ID */
protected_lteralenb_mih_msg(void eRAL_send_link_detected_indication(\
ral_enb_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_LINK_DET_INFO_T *link_detected_infoP);)
/* MIH_C_MESSAGE_LINK_UP_INDICATION_ID */
protected_lteralenb_mih_msg(void eRAL_send_link_up_indication(\
ral_enb_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_LINK_TUPLE_ID_T *link_identifierP,\
MIH_C_LINK_ADDR_T *old_access_routerP,\
MIH_C_LINK_ADDR_T *new_access_routerP,\
MIH_C_IP_RENEWAL_FLAG_T *ip_renewal_flagP,\
MIH_C_IP_MOB_MGMT_T *mobility_mngtP);)
/* MIH_C_MESSAGE_LINK_DOWN_INDICATION_ID */
private_lteralenb_mih_msg(void eRAL_send_link_down_indication(\
ral_enb_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_LINK_TUPLE_ID_T *link_identifierP,\
MIH_C_LINK_ADDR_T *old_access_routerP,\
MIH_C_LINK_DN_REASON_T *reason_codeP);)
/* MIH_C_MESSAGE_LINK_PARAMETERS_REPORT_INDICATION_ID */
protected_lteralenb_mih_msg(void eRAL_send_link_parameters_report_indication(\
ral_enb_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_LINK_TUPLE_ID_T *link_identifierP,\
MIH_C_LINK_PARAM_RPT_LIST_T *link_parameters_report_listP);)
/* MIH_C_MESSAGE_LINK_GOING_DOWN_INDICATION_ID */
private_lteralenb_mih_msg(void eRAL_send_link_going_down_indication(\
ral_enb_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_LINK_TUPLE_ID_T *link_identifierP,\
MIH_C_UNSIGNED_INT2_T *time_intervalP,\
MIH_C_LINK_GD_REASON_T *link_going_down_reasonP);)
/* MIH_C_MESSAGE_LINK_HANDOVER_IMMINENT_INDICATION_ID */
/* MIH_C_MESSAGE_LINK_HANDOVER_COMPLETE_INDICATION_ID */
/* MIH_C_MESSAGE_LINK_PDU_TRANSMIT_STATUS_INDICATION_ID */
/*
* --------------------------------------------------------------------------
* MIH command messages
* --------------------------------------------------------------------------
*/
/* MIH_C_MESSAGE_LINK_GET_PARAMETERS_CONFIRM_ID */
protected_lteralenb_mih_msg(void eRAL_send_get_parameters_confirm(\
ral_enb_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_STATUS_T *statusP,\
MIH_C_LINK_PARAM_LIST_T *link_parameters_status_listP,\
MIH_C_LINK_STATES_RSP_LIST_T *link_states_response_listP,\
MIH_C_LINK_DESC_RSP_LIST_T *link_descriptors_response_listP);)
/* MIH_C_MESSAGE_LINK_CONFIGURE_THRESHOLDS_CONFIRM_ID */
protected_lteralenb_mih_msg(void eRAL_send_configure_thresholds_confirm(\
ral_enb_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_STATUS_T *statusP,\
MIH_C_LINK_CFG_STATUS_LIST_T *link_configure_status_listP);)
/* MIH_C_MESSAGE_LINK_ACTION_CONFIRM_ID */
protected_lteralenb_mih_msg(void eRAL_send_link_action_confirm(\
ral_enb_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_STATUS_T *statusP,\
MIH_C_LINK_SCAN_RSP_LIST_T *scan_response_setP,\
MIH_C_LINK_AC_RESULT_T *link_action_resultP);)
/*
* --------------------------------------------------------------------------
* MIH information messages
* --------------------------------------------------------------------------
*/
protected_lteralenb_mih_msg(int eRAL_mihf_connect (ral_enb_instance_t instanceP);)
private_lteralenb_mih_msg( int eRAL_send_to_mih (ral_enb_instance_t instanceP, const u_int8_t *bufferP, int lenP);)
private_lteralenb_mih_msg( int eRAL_mih_link_msg_decode(ral_enb_instance_t instanceP, Bit_Buffer_t* bbP, MIH_C_Message_Wrapper_t *message_wrapperP);)
/****************************************************************************/
#endif
@@ -1,78 +0,0 @@
/*******************************************************************************
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 lteRALenb_parameters.h
* \brief
* \author GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
#ifndef __LTE_RAL_ENB_PARAMETERS_H__
#define __LTE_RAL_ENB_PARAMETERS_H__
//-----------------------------------------------------------------------------
# ifdef LTE_RAL_ENB_PARAMETERS_C
# define private_lteralenb_parameters(x) x
# define protected_lteralenb_parameters(x) x
# define public_lteralenb_parameters(x) x
# else
# ifdef LTE_RAL_ENB
# define private_lteralenb_parameters(x)
# define protected_lteralenb_parameters(x) extern x
# define public_lteralenb_parameters(x) extern x
# else
# define private_lteralenb_parameters(x)
# define protected_lteralenb_parameters(x)
# define public_lteralenb_parameters(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include "lteRALenb.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
/****************************************************************************/
/****************************************************************************/
/******************** G L O B A L V A R I A B L E S ********************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
void eRAL_get_parameters_request(ral_enb_instance_t instanceP, MIH_C_Message_Link_Get_Parameters_request_t* messageP);
#endif
@@ -1,76 +0,0 @@
/*******************************************************************************
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 lteRALenb_process.h
* \brief
* \author GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
#ifndef __LTE_RAL_ENB_PROCESS_H__
#define __LTE_RAL_ENB_PROCESS_H__
//-----------------------------------------------------------------------------
# ifdef LTE_RAL_ENB_PROCESS_C
# define private_lteralenb_process(x) x
# define protected_lteralenb_process(x) x
# define public_lteralenb_process(x) x
# else
# ifdef LTE_RAL_ENB
# define private_lteralenb_process(x)
# define protected_lteralenb_process(x) extern x
# define public_lteralenb_process(x) extern x
# else
# define private_lteralenb_process(x)
# define protected_lteralenb_process(x)
# define public_lteralenb_process(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include "lteRALenb.h"
protected_lteralenb_process(int eRAL_process_find_channel (ral_enb_instance_t instanceP, unsigned int cnxid, int* mt_ix, int* ch_ix);)
protected_lteralenb_process(int eRAL_process_find_new_channel (ral_enb_instance_t instanceP, int mt_ix);)
private_lteralenb_process( void eRAL_process_clean_channel (struct ral_lte_channel* channel);)
protected_lteralenb_process(char* eRAL_process_mt_addr_to_string (const unsigned char* ip_addr);)
protected_lteralenb_process(void eRAL_process_mt_addr_to_l2id (const unsigned char* mt_addr, unsigned int* l2id);)
private_lteralenb_process( int eRAL_process_cmp_mt_addr (const char* mt_addr, const char* l2id);)
protected_lteralenb_process(int eRAL_process_find_mt_by_addr (ral_enb_instance_t instanceP, const char* mt_addr);)
private_lteralenb_process( void eRAL_process_verify_pending_mt_status(ral_enb_instance_t instanceP);)
protected_lteralenb_process(int eRAL_process_map_qos (ral_enb_instance_t instanceP, int mt_ix, int ch_ix);)
private_lteralenb_process( void eRAL_process_waiting_RB (ral_enb_instance_t instanceP, int mt_ix);)
private_lteralenb_process( void eRAL_process_clean_pending_mt (ral_enb_instance_t instanceP);)
protected_lteralenb_process(void RAL_printInitStatus (ral_enb_instance_t instanceP);)
private_lteralenb_process( void RAL_NAS_measures_polling (ral_enb_instance_t instanceP);)
private_lteralenb_process( void RAL_NAS_report_congestion (ral_enb_instance_t instanceP, int ix);)
private_lteralenb_process( void RAL_NAS_measures_analyze (ral_enb_instance_t instanceP);)
#endif
@@ -1,82 +0,0 @@
/*******************************************************************************
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 lteRALenb_proto.h
* \brief This file defines the prototypes of the common functions
* \author WETTERWALD Michelle, GAUTHIER Lionel, MAUREL Frederic
* \date 2013
* \company EURECOM
* \email: michelle.wetterwald@eurecom.fr, lionel.gauthier@eurecom.fr, frederic.maurel@eurecom.fr
*/
/*******************************************************************************/
#ifndef __LTE_RAL_ENB_PROTO_H__
#define __LTE_RAL_ENB_PROTO_H__
# error "Remove inclusion"
//#include "lteRALenb_variables.h"
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/*
* Functions defined in eRALlte_NAS.c
*/
//void eRALlte_NAS_get_MTs_list(void);
//int eRALlte_NAS_update_MTs_list(void);
//int eRALlte_NAS_process_message(void);
//int eRALlte_NAS_send_rb_establish_request(int mt_ix, int ch_ix);
//int eRALlte_NAS_send_rb_release_request(int mt_ix, int ch_ix);
//int eRALlte_NAS_send_measure_request(void);
//#ifdef RAL_REALTIME
//int RAL_process_NAS_message(int ioctl_obj, int ioctl_cmd, int mt_ix, int ch_ix);
//#endif
/*
* Functions defined in eRALlte_process.c
*/
//int eRALlte_process_find_channel(unsigned int cnxid, int* mt_ix, int* ch_ix);
//int eRALlte_process_find_new_channel(int mt_ix);
//void eRALlte_process_clean_channel(struct ral_lte_channel* pchannel);
//void eRALlte_process_verify_pending_mt_status(void);
//char* eRALlte_process_mt_addr_to_string(const unsigned char* mt_addr);
//void eRALlte_process_mt_addr_to_l2id(const unsigned char* mt_addr, unsigned int* l2id);
//int eRALlte_process_cmp_mt_addr(const char* mt_addr, const char* l2id);
//int eRALlte_process_find_mt_by_addr(const char* mt_addr);
//int eRALlte_process_map_qos(int mt_ix, int ch_ix);
// MW Added
//void RAL_printInitStatus(void);
//void RAL_NAS_measures_polling(void);
//void RAL_NAS_measures_analyze(void);
//void RAL_NAS_report_congestion(int ix);
//void* ral_enb_task(void *args_p);
#endif
@@ -1,69 +0,0 @@
/*******************************************************************************
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 lteRALenb_rrc_msg.h
* \brief
* \author GAUTHIER Lionel
* \date 2013
* \version
* \note
* \bug
* \warning
*/
#ifndef __LTE_RAL_ENB_RRC_MSG_H__
#define __LTE_RAL_ENB_RRC_MSG_H__
//-----------------------------------------------------------------------------
# ifdef LTE_RAL_ENB_RRC_MSG_C
# define private_lteralenb_rrc_msg(x) x
# define protected_lteralenb_rrc_msg(x) x
# define public_lteralenb_rrc_msg(x) x
# else
# ifdef LTE_RAL_ENB
# define private_lteralenb_rrc_msg(x)
# define protected_lteralenb_rrc_msg(x) extern x
# define public_lteralenb_rrc_msg(x) extern x
# else
# define private_lteralenb_rrc_msg(x)
# define protected_lteralenb_rrc_msg(x)
# define public_lteralenb_rrc_msg(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include "lteRALenb.h"
#include "intertask_interface.h"
protected_lteralenb_rrc_msg(void eRAL_rx_rrc_ral_system_configuration_indication (instance_t instance, MessageDef *msg_p);)
protected_lteralenb_rrc_msg(void eRAL_rx_rrc_ral_connection_establishment_indication (instance_t instance, MessageDef *msg_p);)
protected_lteralenb_rrc_msg(void eRAL_rx_rrc_ral_connection_reestablishment_indication (instance_t instance, MessageDef *msg_p);)
protected_lteralenb_rrc_msg(void eRAL_rx_rrc_ral_connection_reconfiguration_indication (instance_t instance, MessageDef *msg_p);)
protected_lteralenb_rrc_msg(void eRAL_rx_rrc_ral_measurement_report_indication (instance_t instance, MessageDef *msg_p);)
protected_lteralenb_rrc_msg(void eRAL_rx_rrc_ral_connection_release_indication (instance_t instance, MessageDef *msg_p);)
#endif
@@ -1,80 +0,0 @@
/*******************************************************************************
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 lteRALenb_subscribe.h
* \brief
* \author GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
#ifndef __LTE_RAL_ENB_SUBSCRIBE_H__
#define __LTE_RAL_ENB_SUBSCRIBE_H__
//-----------------------------------------------------------------------------
# ifdef LTE_RAL_ENB_PROCESS_C
# define private_lteralenb_subscribe(x) x
# define protected_lteralenb_subscribe(x) x
# define public_lteralenb_subscribe(x) x
# else
# ifdef LTE_RAL_ENB
# define private_lteralenb_subscribe(x)
# define protected_lteralenb_subscribe(x) extern x
# define public_lteralenb_subscribe(x) extern x
# else
# define private_lteralenb_subscribe(x)
# define protected_lteralenb_subscribe(x)
# define public_lteralenb_subscribe(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include "lteRALenb.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
/****************************************************************************/
/****************************************************************************/
/******************** G L O B A L V A R I A B L E S ********************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
protected_lteralenb_subscribe(void eRAL_subscribe_request(ral_enb_instance_t instanceP, MIH_C_Message_Link_Event_Subscribe_request_t* msgP);)
protected_lteralenb_subscribe(void eRAL_unsubscribe_request(ral_enb_instance_t instanceP, MIH_C_Message_Link_Event_Unsubscribe_request_t* msgP);)
#endif
@@ -1,82 +0,0 @@
/*******************************************************************************
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 lteRALenb_thresholds.h
* \brief
* \author GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
#ifndef __LTE_RAL_ENB_THRESHOLDS_H__
#define __LTE_RAL_ENB_THRESHOLDS_H__
//-----------------------------------------------------------------------------
# ifdef LTE_RAL_ENB_PROCESS_C
# define private_lteralenb_thresholds(x) x
# define protected_lteralenb_thresholds(x) x
# define public_lteralenb_thresholds(x) x
# else
# ifdef LTE_RAL_ENB
# define private_lteralenb_thresholds(x)
# define protected_lteralenb_thresholds(x) extern x
# define public_lteralenb_thresholds(x) extern x
# else
# define private_lteralenb_thresholds(x)
# define protected_lteralenb_thresholds(x)
# define public_lteralenb_thresholds(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include "lteRALenb.h"
#include "intertask_interface.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
/****************************************************************************/
/****************************************************************************/
/******************** G L O B A L V A R I A B L E S ********************/
/****************************************************************************/
//LIST(MIH_C_LINK_CFG_PARAM, g_link_cfg_param_thresholds);
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
protected_lteralenb_thresholds(void eRAL_configure_thresholds_request(ral_enb_instance_t instanceP, MIH_C_Message_Link_Configure_Thresholds_request_t* messageP);)
protected_lteralenb_thresholds(void eRAL_rx_rrc_ral_configure_threshold_conf(instance_t instance, MessageDef *msg_p);)
#endif
@@ -1,166 +0,0 @@
/*******************************************************************************
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
*******************************************************************************/
#ifndef __LTE_RAL_ENB_VARIABLES_H__
#define __LTE_RAL_ENB_VARIABLES_H__
// Define working mode : Dummy or Realtime
//#define RAL_DUMMY
#define RAL_REALTIME
//#define ENABLE_MEDIEVAL_DEMO3
//#define MUSER_CONTROL // in demo3, for triggering the congestion report manually
//flag to reduce the logs
#define DEBUG_RAL_DETAILS
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
#ifdef RAL_REALTIME
/*Arguments ioctl command
*/
//arg[0]
//LG#define IO_OBJ_STATS 0
//LG#define IO_OBJ_CNX 1
//LG#define IO_OBJ_RB 2
//LG#define IO_OBJ_MEAS 3
//LG#define IO_OBJ_MC 4 // multicast
//arg[1]
//LG#define IO_CMD_ADD 0
//LG#define IO_CMD_DEL 1
//LG#define IO_CMD_LIST 2
#define NAS_CONNECTED 1 //same as NAS interface
#define NAS_DISCONNECTED 0
#endif // RAL_REALTIME
/* Radio Bearer attachment status; must be the same as NAS interface */
#define RB_CONNECTED NAS_CONNECTED
#define RB_DISCONNECTED NAS_DISCONNECTED
#define RAL_TRUE 1
#define RAL_FALSE 0
/*Access Router configuration
*/
#ifdef RAL_REALTIME
//#define NAS_RG_NETL_MAX_RABS 27 //spec value
#define NAS_RG_NETL_MAX_RABS 5 //test value
#define NAS_RG_NETL_MAX_MEASURE_NB 5
#define NAS_RG_NETL_MAX_MTs 3
#endif
/* Maximum number of supported Radio Bearers */
#define RAL_MAX_RB NAS_RG_NETL_MAX_RABS
/* Maximum number of supported Mobile Terminals */
#define RAL_MAX_MT NAS_RG_NETL_MAX_MTs
/* Maximum number of Radio Bearers per User Equipment */
#define RAL_MAX_RB_PER_UE 32
/* Default Radio Bearer identifier */
#define RAL_DEFAULT_MC_RAB_ID 5
#define RAL_DEFAULT_RAB_ID 6 // RBID 5 => MBMS, 6 => DEFAULTRAB, 7+ => others
/* Default Radio Bearer QoS value */
#define RAL_DEFAULT_RAB_QoS 2 // RRC_QOS_CONV_64_64
/* Default current cell identifier */
#define RAL_DEFAULT_CELL_ID 5
// Constants for Measures
#define RAL_DEFAULT_MEAS_POLLING_INTERVAL 51
#define RAL_DEFAULT_CONGESTION_THRESHOLD 80
/* Default bit rates */
#define RAL_BITRATE_32k 32000
#define RAL_BITRATE_64k 64000
#define RAL_BITRATE_128k 128000
#define RAL_BITRATE_256k 256000
#define RAL_BITRATE_320k 320000
#define RAL_BITRATE_384k 384000
#define RAL_BITRATE_440k 440000
/* Public Land Mobile Network */
#define DEFAULT_PLMN_SIZE 3
#ifdef DEFINE_GLOBAL_CONSTANTS
const u_int8_t DefaultPLMN[DEFAULT_PLMN_SIZE] = {0x20, 0x80, 0x20};
#else
extern const u_int8_t DefaultPLMN[DEFAULT_PLMN_SIZE];
#endif
/*Destination addresses
*/
enum {
ADDR_MT1 = 0,
ADDR_MT2,
ADDR_MBMS,
ADDR_MT3,
ADDR_MAX
};
#ifdef DEFINE_GLOBAL_CONSTANTS // Modified MW 23/05/13
const char DestIpv6Addr[ADDR_MAX][16] = { // DUMMY
// MT1 - 2001:660:382:14:335:600:8014:9150
{0x20,0x01,0x06,0x60,0x03,0x82,0x00,0x14,0x03,0x35,0x06,0x00,0x80,0x14,0x91,0x50},
// MT2 - 2001:660:382:14:335:600:8014:9151
{0x20,0x01,0x06,0x60,0x03,0x82,0x00,0x14,0x03,0x35,0x06,0x00,0x80,0x14,0x91,0x51},
// Multicast - FF3E:20:2001:DB8::43
{0xFF,0x3E,0x00,0x20,0x20,0x01,0x0D,0xB8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x43},
// MT3 - 2001:660:382:14:335:600:8014:9153
{0x20,0x01,0x06,0x60,0x03,0x82,0x00,0x14,0x03,0x35,0x06,0x00,0x80,0x14,0x91,0x53}
};
#else
extern const char DestIpv6Addr[ADDR_MAX][16];
#endif
typedef int ral_enb_instance_t;
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
/****************************************************************************/
/* List of link action types */
TYPEDEF_BITMAP8(MIH_C_LINK_AC_TYPE_LIST);
/****************************************************************************/
/******************** G L O B A L V A R I A B L E S ********************/
/****************************************************************************/
//extern struct ral_lte_priv *ralpriv;
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
#endif
@@ -1,38 +0,0 @@
/*******************************************************************************
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
*******************************************************************************/
#ifndef __RRC_DTYPES_H__
#define __RRC_DTYPES_H__
# error "Remove inclusion"
//typedef unsigned char uint8_t;
//typedef unsigned short uint16_t;
//typedef unsigned int uint32_t;
#endif
@@ -1,40 +0,0 @@
#===============================================================================
# Brief : MIH-User configuration file
# Authors : Carlos Guimaraes <cguimaraes@av.it.pt>
# Bruno Santos <bsantos@av.it.pt>
#-------------------------------------------------------------------------------
# ODTONE - Open Dot Twenty One
#
# Copyright (C) 2009-2012 Universidade Aveiro
# Copyright (C) 2009-2012 Instituto de Telecomunicações - Pólo Aveiro
#
# This software is distributed under a license. The full license
# agreement can be found in the file LICENSE in this distribution.
# This software may not be copied, modified, sold or distributed
# other than expressed in the named license agreement.
#
# This software is distributed without any warranty.
#===============================================================================
##
## User id
##
[user]
id = user
##
## Commands supported by the MIH-User
##
commands = mih_link_get_parameters, mih_link_configure_thresholds, mih_link_actions, mih_net_ho_candidate_query, mih_net_ho_commit, mih_n2n_ho_query_resources, mih_n2n_ho_commit, mih_n2n_ho_complete, mih_mn_ho_candidate_query, mih_mn_ho_commit, mih_mn_ho_complete
##
## Port used for communication with MIHF
##
[conf]
port = 1234
##
## MIHF configuration. For the default demonstration leave as is.
##
[mihf]
local_port = 1025
@@ -1,47 +0,0 @@
#===============================================================================
# Brief : Link SAP configuration file
# Authors : Carlos Guimaraes <cguimaraes@av.it.pt>
# Bruno Santos <bsantos@av.it.pt>
#-------------------------------------------------------------------------------
# ODTONE - Open Dot Twenty One
#
# Copyright (C) 2009-2012 Universidade Aveiro
# Copyright (C) 2009-2012 Instituto de Telecomunicações - Pólo Aveiro
#
# This software is distributed under a license. The full license
# agreement can be found in the file LICENSE in this distribution.
# This software may not be copied, modified, sold or distributed
# other than expressed in the named license agreement.
#
# This software is distributed without any warranty.
#===============================================================================
[link]
##
## Link SAP identifier
##
id=link1
##
## Link SAP listening
##
port = 1235
##
## Link SAP interface technology
##
tec = LTE
##
## Link SAP interface address
##
link_addr = 00:11:22:33:44:55
##
## Comma separated list of the Link SAP supported events
##
event_list = link_detected, link_up, link_down, link_parameters_report, link_going_down, link_handover_imminent, link_handover_complete
[mihf]
ip=127.0.0.1
local_port=1025
-71
View File
@@ -1,71 +0,0 @@
#===============================================================================
# Brief : MIHF configuration file
# Authors : Carlos Guimaraes <cguimaraes@av.it.pt>
#-------------------------------------------------------------------------------
# ODTONE - Open Dot Twenty One
#
# Copyright (C) 2009-2012 Universidade Aveiro
# Copyright (C) 2009-2012 Instituto de Telecomunicações - Pólo Aveiro
#
# This software is distributed under a license. The full license
# agreement can be found in the file LICENSE in this distribution.
# This software may not be copied, modified, sold or distributed
# other than expressed in the named license agreement.
#
# This software is distributed without any warranty.
#===============================================================================
[mihf]
##
## This mihf's id
##
## Usage: id = <MIHF ID>
##
id = mihf1
##
## Port on localhost that MIH Users and MIH Link SAPs connect to.
##
## Usage: local_port = <port>
##
local_port = 1025
##
## Port to which remote peer MIHF connect to
##
## Usage: remote_port = <port>
##
#remote_port = 4551
##
## Comma seperated list of remote MIHF's
##
## If you want to test remote MIHF communication add an entry here
## with the IP address of the remote MIHF.
##
## Usage: peers = <mihf id> <ip> <port>, ...
##
#peers = mihf2 0.0.0.0 4552
##
## Comma separated list of local MIH User SAPs id's and ports
##
## Usage: users = <user sap id> <port> [<supported commands> <supported queries>], ...
## Note: If no command is specified, the MIHF will assume that the MIH-User
## supports all MIH_***_HO_*** commands and the MIH_Get_Information
## Note: If no query is specified, the MIHF will assume that the MIH-User does
## not support the MIH_Get_Information command.
##
users = user 1234
##
## Comma separated list of local MIH Link SAPs id's and ports.
##
## Usage: links = <link sap id> <port> <techonoly type> <interface> [<supported events list> <supported commands list>], ...
##
#links = wifi 1235 802_11 00:11:22:33:44:55, lte 1234 LTE 00:11:22 5
##
## Comma separated list of the MIHF's transport protocol
##
transport = udp
@@ -1,33 +0,0 @@
#===============================================================================
# Brief : MIH-User SAP Application Sample Project Build
# Authors : Carlos Guimaraes <cguimaraes@av.it.pt>
# Bruno Santos <bsantos@av.it.pt>
#-------------------------------------------------------------------------------
# ODTONE - Open Dot Twenty One
#
# Copyright (C) 2009-2012 Universidade Aveiro
# Copyright (C) 2009-2012 Instituto de Telecomunicações - Pólo Aveiro
#
# This software is distributed under a license. The full license
# agreement can be found in the file LICENSE in this distribution.
# This software may not be copied, modified, sold or distributed
# other than expressed in the named license agreement.
#
# This software is distributed without any warranty.
#===============================================================================
project eNB_lte_user
;
exe eNB_lte_user
: rg_mih_usr.cpp
../../lib/odtone//odtone_base
../../lib/odtone/mih//odtone_mih
../../lib/odtone/sap//odtone_sap
;
install install
: eNB_lte_user
eNB_lte_user.conf
: <location>../../dist
;
@@ -1,40 +0,0 @@
#===============================================================================
# Brief : MIH-User configuration file
# Authors : Carlos Guimaraes <cguimaraes@av.it.pt>
# Bruno Santos <bsantos@av.it.pt>
#-------------------------------------------------------------------------------
# ODTONE - Open Dot Twenty One
#
# Copyright (C) 2009-2012 Universidade Aveiro
# Copyright (C) 2009-2012 Instituto de Telecomunicações - Pólo Aveiro
#
# This software is distributed under a license. The full license
# agreement can be found in the file LICENSE in this distribution.
# This software may not be copied, modified, sold or distributed
# other than expressed in the named license agreement.
#
# This software is distributed without any warranty.
#===============================================================================
##
## User id
##
[user]
id = user
##
## Commands supported by the MIH-User
##
commands = mih_link_get_parameters, mih_link_configure_thresholds, mih_link_actions, mih_net_ho_candidate_query, mih_net_ho_commit, mih_n2n_ho_query_resources, mih_n2n_ho_commit, mih_n2n_ho_complete, mih_mn_ho_candidate_query, mih_mn_ho_commit, mih_mn_ho_complete
##
## Port used for communication with MIHF
##
[conf]
port = 1234
##
## MIHF configuration. For the default demonstration leave as is.
##
[mihf]
local_port = 1025
File diff suppressed because it is too large Load Diff
-69
View File
@@ -1,69 +0,0 @@
# lines starting with the pound sign are comments.
#
# These things are options that you might need
# to tweak.
# You can modify the below as well, but probably
# won't need to.
INTERFACE_DIR=../INTERFACE-802.21
INCLUDE_DIR=INCLUDE
SRC_DIR=SRC
# external directories for ioctl
RRC_DIR := $(OPENAIR2_DIR)/RRC/CELLULAR
NAS_DIR := $(OPENAIR2_DIR)/NAS/DRIVER/CELLULAR/NASRG
# SVN version
#SVNREV = -D'SVN_REV="$(shell svnversion -n .)"'
SVNREV = -D'SVN_REV="1"'
CC = gcc
#CFLAGS = -Wall -g -I$(SRC_DIR) -I$(INTERFACE_DIR)/INCLUDE -I$(INCLUDE_DIR) \
# -DMIH_C_MEDIEVAL_EXTENSIONS -DMSCGEN_PYTOOL -DMIH_USER_CONTROL $(SVNREV)
CFLAGS = -Wall -g -I$(SRC_DIR) -I$(INTERFACE_DIR)/INCLUDE -I$(INCLUDE_DIR) -DMIH_C_MEDIEVAL_EXTENSIONS -DMIH_USER_CONTROL $(SVNREV)
CFLAGS += -I$(NAS_DIR) -I$(RRC_DIR)
LDFLAGS = -L$(INTERFACE_DIR)/LIB -lmih_c-802.21 -lrt
ERAL_OBJS += $(SRC_DIR)/lteRALenb_mih_msg.o
ERAL_OBJS += $(SRC_DIR)/lteRALenb_rrc_msg.o
ERAL_OBJS += $(SRC_DIR)/lteRALenb_thresholds.o
ERAL_OBJS += $(SRC_DIR)/lteRALenb_parameters.o
ERAL_OBJS += $(SRC_DIR)/lteRALenb_action.o
ERAL_OBJS += $(SRC_DIR)/lteRALenb_subscribe.o
ERAL_OBJS += $(SRC_DIR)/lteRALenb_process.o
ERAL_OBJS += $(SRC_DIR)/lteRALenb_main.o
OBJS = $(ERAL_OBJS)
E_RAL_EXE = LTE_RAL_ENB
EXECUTABLE = interface $(E_RAL_EXE)
# "all" is the default target. Simply make it point to myprogram.
all: $(EXECUTABLE)
interface :
# -(cd $(INTERFACE_DIR) && make clean && make)
-(cd $(INTERFACE_DIR) && make)
cleaninterface :
-(cd $(INTERFACE_DIR) && make clean)
$(E_RAL_EXE) : $(ERAL_OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
%.o: %.c Makefile
@echo Compiling $<
@$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $<
clean:
-find . -name "*.o" -delete
-find . -name "*.*~" -delete
-find . -name "*~" -delete
# -rm -f $(M_RAL_EXE) $(M_NAS_EXE)
# -rm -f $(E_RAL_EXE) $(E_NAS_EXE)
@@ -1,890 +0,0 @@
/*****************************************************************************
* Eurecom OpenAirInterface 3
* Copyright(c) 2012 Eurecom
*
* Source eRAL_action.c
*
* Version 0.1
*
* Date 07/03/2012
*
* Product MIH RAL LTE
*
* Subsystem MIH link action request messages processing
*
* Authors Michelle Wetterwald, Lionel Gauthier, Frederic Maurel
*
* Description
*
*****************************************************************************/
#define LTE_RAL_ENB
#define LTE_RAL_ENB_ACTION_C
#include <assert.h>
#include "lteRALenb.h"
/****************************************************************************/
/******************* G L O C A L D E F I N I T I O N S *****************/
/****************************************************************************/
/****************************************************************************/
/******************* L O C A L D E F I N I T I O N S *******************/
/****************************************************************************/
static MIH_C_LINK_ACTION_T g_link_action;
static const char* g_link_action_type_str[] = {
"MIH_C_LINK_AC_TYPE_NONE",
"MIH_C_LINK_AC_TYPE_LINK_DISCONNECT",
"MIH_C_LINK_AC_TYPE_LINK_LOW_POWER",
"MIH_C_LINK_AC_TYPE_LINK_POWER_DOWN",
"MIH_C_LINK_AC_TYPE_LINK_POWER_UP",
#ifdef MIH_C_MEDIEVAL_EXTENSIONS
"MIH_C_LINK_AC_TYPE_LINK_FLOW_ATTR",
"MIH_C_LINK_AC_TYPE_LINK_ACTIVATE_RESOURCES",
"MIH_C_LINK_AC_TYPE_LINK_DEACTIVATE_RESOURCES"
#endif
};
/****************************************************************************
** **
** Name: eRAL_action_request() **
** **
** Description: Processes the Link_Action.request message and sends a **
** Link_Action.confirm message to the MIHF. **
** **
** Inputs: msgP: Pointer to the received message **
** Others: ralpriv **
** **
** Outputs: None **
** Return: None **
** Others: g_link_action **
** **
***************************************************************************/
void eRAL_action_request(ral_enb_instance_t instanceP, MIH_C_Message_Link_Action_request_t* msgP)
{
MIH_C_STATUS_T status;
MIH_C_LINK_AC_TYPE_T link_action_type;
MIH_C_LINK_AC_RESULT_T link_action_result;
int link_action_done = 0;
rrc_ral_connection_reconfiguration_req_t connection_reconfiguration_req_t;
MessageDef *message_p = NULL;
message_p = itti_alloc_new_message (TASK_RAL_ENB, RRC_RAL_CONNECTION_RECONFIGURATION_REQ);
memset(&connection_reconfiguration_req_t, 0, sizeof(rrc_ral_connection_reconfiguration_req_t));
// copy transaction id
// connection_reconfiguration_req_t.transaction_id = msgP->header.transaction_id;
memcpy(&g_link_action, &msgP->primitive.LinkAction, sizeof(MIH_C_LINK_ACTION_T));
status = MIH_C_STATUS_SUCCESS;
link_action_type = msgP->primitive.LinkAction.link_ac_type;
link_action_result = MIH_C_LINK_AC_RESULT_SUCCESS;
/*
* Read link action attributs
* --------------------------
*/
// if (msgP->primitive.LinkAction.link_ac_attr & MIH_C_BIT_LINK_AC_ATTR_LINK_SCAN)
// {
// /*
// * Link scan operation request - Not supported by the network side:
// * No measurements
// */
// LOG_D(RAL_ENB, " ACTION ATTRIBUTE MIH_C_BIT_LINK_AC_ATTR_LINK_SCAN: REFUSED\n");
// link_action_result = MIH_C_LINK_AC_RESULT_REFUSED;
// eRAL_send_link_action_confirm(instanceP, &msgP->header.transaction_id,
// &status,
// NULL,
// &link_action_result);
// }
// if (msgP->primitive.LinkAction.link_ac_attr & MIH_C_BIT_LINK_AC_ATTR_LINK_RES_RETAIN)
// {
// /*
// * Link resource retain operation request - Not supported by the
// * network side.
// */
// LOG_D(RAL_ENB, " ACTION ATTRIBUTE MIH_C_BIT_LINK_AC_ATTR_LINK_RES_RETAIN: REFUSED\n");
// link_action_result = MIH_C_LINK_AC_RESULT_REFUSED;
// eRAL_send_link_action_confirm(instanceP, &msgP->header.transaction_id,
// &status,
// NULL,
// &link_action_result);
// }
// if (msgP->primitive.LinkAction.link_ac_attr & MIH_C_BIT_LINK_AC_ATTR_DATA_FWD_REQ)
// {
// /*
// * Data forward operation request - Not supported by the network side.
// */
// LOG_D(RAL_ENB, " ACTION ATTRIBUTE MIH_C_BIT_LINK_AC_ATTR_DATA_FWD_REQ: REFUSED\n");
// link_action_result = MIH_C_LINK_AC_RESULT_REFUSED;
// eRAL_send_link_action_confirm(instanceP, &msgP->header.transaction_id,
// &status,
// NULL,
// &link_action_result);
// }
/*
* Read link action request
* ------------------------
* Requested actions that are not supported or currently in progress
* are refused.
*/
if (eRAL_action_is_in_progress(instanceP, &status,
&link_action_result,
link_action_type)) {
LOG_D(RAL_ENB, " Link action request %s is not supported or currently in progress\n", g_link_action_type_str[link_action_type]);
} else {
LOG_D(RAL_ENB, " %s ACTION REQUESTED: %s\n", __FUNCTION__, g_link_action_type_str[link_action_type]);
switch (link_action_type) {
case MIH_C_LINK_AC_TYPE_NONE:
LOG_D(RAL_ENB, " %s ACTION REQUESTED: MIH_C_LINK_AC_TYPE_NONE: NO ACTION\n", __FUNCTION__);
break;
#ifdef MIH_C_MEDIEVAL_EXTENSIONS
case MIH_C_LINK_AC_TYPE_LINK_FLOW_ATTR:
/*
* Provide the mark and multicast configuration to be set up
* for the data flow
*/
g_enb_ral_obj[instanceP].pending_req_ac_result = eRAL_action_link_flow_attr(instanceP);
link_action_done = 1;
break;
case MIH_C_LINK_AC_TYPE_LINK_ACTIVATE_RESOURCES:
/*
* Configure and activate a data flow
*/
g_enb_ral_obj[instanceP].pending_req_ac_result = eRAL_action_link_activate_resources(instanceP);
link_action_done = 1;
break;
case MIH_C_LINK_AC_TYPE_LINK_DEACTIVATE_RESOURCES:
/*
* Deactivate a previously activated data flow
*/
g_enb_ral_obj[instanceP].pending_req_ac_result = eRAL_action_link_deactivate_resources(instanceP);
link_action_done = 1;
break;
#endif // MIH_C_MEDIEVAL_EXTENSIONS
case MIH_C_LINK_AC_TYPE_LINK_DISCONNECT:
/*
* Disconnect the link connection directly
*/
case MIH_C_LINK_AC_TYPE_LINK_LOW_POWER:
/*
* Cause the link to adjust its battery power level to be
* low power consumption - Not supported by the network side
*/
case MIH_C_LINK_AC_TYPE_LINK_POWER_DOWN:
/*
* Cause the link to power down and turn off the radio
* - Not supported by the network side
*/
case MIH_C_LINK_AC_TYPE_LINK_POWER_UP:
LOG_D(RAL_ENB, "%s ACTION REQUESTED: MIH_C_LINK_AC_TYPE_LINK_POWER_UP\n", __FUNCTION__);
if (g_enb_ral_obj[instanceP].mih_supported_link_action_list & (1 << MIH_C_LINK_AC_TYPE_LINK_POWER_UP)) {
// Activation requested - check it is not already active
if(g_enb_ral_obj[instanceP].pending_req_action & MIH_C_LINK_AC_TYPE_LINK_POWER_UP) {
// if (g_enb_ral_obj[instanceP].state == CONNECTED) {
// LOG_D(RAL_ENB, "Activation requested, but interface already active ==> NO OP\n");
// mRAL_send_link_action_confirm(instanceP, &messageP->header.transaction_id, &status, &scan_response_set_list, &link_action_result);
// } else {
g_enb_ral_obj[instanceP].pending_req_action = g_enb_ral_obj[instanceP].pending_req_action | MIH_C_LINK_AC_TYPE_LINK_POWER_UP;
// g_enb_ral_obj[instanceP].cell_id = g_enb_ral_obj[instanceP].meas_cell_id[0]; // Default cell #0 - Next, choose cell with best conditions
LOG_D(RAL_ENB, "Activation requested to NAS interface on cell %d\n", g_enb_ral_obj[instanceP].cell_id);
// RAL_process_NAS_message(IO_OBJ_CNX, IO_CMD_ADD, g_enb_ral_obj[instanceP].cell_id);
// }
} else {
g_enb_ral_obj[instanceP].pending_req_action |= MIH_C_LINK_AC_TYPE_LINK_POWER_UP;
/* g_enb_ral_obj[instanceP].cell_id = g_enb_ral_obj[instanceP].meas_cell_id[0];*/ // Default cell #0 - Next, choose cell with best conditions
message_p = itti_alloc_new_message (TASK_RAL_ENB, RRC_RAL_CONNECTION_RECONFIGURATION_REQ);
memset(&connection_reconfiguration_req_t, 0, sizeof(rrc_ral_connection_reconfiguration_req_t));
// copy transaction id
connection_reconfiguration_req_t.transaction_id = msgP->header.transaction_id;
connection_reconfiguration_req_t.link_action.link_ac_type = msgP->primitive.LinkAction.link_ac_type;
connection_reconfiguration_req_t.link_action.link_ac_attr = msgP->primitive.LinkAction.link_ac_attr;
connection_reconfiguration_req_t.link_action.link_ac_param = msgP->primitive.LinkAction.link_ac_param;
memcpy (&message_p->ittiMsg, (void *) &connection_reconfiguration_req_t, sizeof(rrc_ral_connection_reconfiguration_req_t));
itti_send_msg_to_task (TASK_RRC_ENB, instanceP, message_p);
/* LOG_D(RAL_ENB, "Total data volume0 %d\n", (g_enb_ral_obj[instanceP].totalDataVolume[0]/1000));
LOG_D(RAL_ENB, "Total data volume1 %d\n", (g_enb_ral_obj[instanceP].totalDataVolume[1]/1000));
LOG_D(RAL_ENB, "RLC Buffer Occupancy 0 %d\n", (g_enb_ral_obj[instanceP].rlcBufferOccupancy[0]));
LOG_D(RAL_ENB, "RLC Buffer Occupancy 1 %d\n", (g_enb_ral_obj[instanceP].rlcBufferOccupancy[1]));
*/
}
} else {
LOG_D(RAL_ENB, "[mRAL]: command POWER UP not available \n\n");
// link_action_result = MIH_C_LINK_AC_RESULT_INCAPABLE;
// mRAL_send_link_action_confirm(instanceP, &msgP->header.transaction_id, &status, &scan_response_set_list, &link_action_result);
}
break;
default:
LOG_E(RAL_ENB, "%s Invalid LinkAction.link_ac_type %d\n",
__FUNCTION__, link_action_type);
status = MIH_C_STATUS_UNSPECIFIED_FAILURE;
}
}
/* Return link action confirmation to the MIH-F */
if (link_action_done) {
g_enb_ral_obj[instanceP].pending_req_transaction_id = msgP->header.transaction_id;
g_enb_ral_obj[instanceP].pending_req_status = MIH_C_STATUS_SUCCESS;
eRAL_send_link_action_confirm(instanceP, &g_enb_ral_obj[instanceP].pending_req_transaction_id,
&g_enb_ral_obj[instanceP].pending_req_status,
NULL,
&g_enb_ral_obj[instanceP].pending_req_ac_result);
} else if (status == MIH_C_STATUS_SUCCESS) {
eRAL_send_link_action_confirm(instanceP, &msgP->header.transaction_id,
&status,
NULL,
&link_action_result);
} else {
eRAL_send_link_action_confirm(instanceP, &msgP->header.transaction_id,
&status,
NULL,
NULL);
}
g_enb_ral_obj[instanceP].pending_req_action = 0;
}
/****************************************************************************
** **
** Name: eRAL_action_save_flow_id() **
** **
** Description: Save connection identifier and data of the specified data **
** flow into the list of active data flows. **
** **
** Inputs: flowId: The data flow identifier **
** cnxid: The connection identifier **
** Others: None **
** **
** Outputs: None **
** Return: The index of the specified data flow in **
** the list of active data flows. **
** -1 if the list is full. **
** Others: None **
** **
***************************************************************************/
int eRAL_action_save_flow_id(ral_enb_instance_t instanceP, MIH_C_FLOW_ID_T* flowId, int cnxid)
{
return eRAL_action_set_channel_id(instanceP, flowId, cnxid);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
/****************************************************************************
** Name: eRAL_action_set_channel_id() **
** **
** Description: Set the Connection identifier and store data of the **
** specified data flow in the list of active data flows. **
** Inputs: flowId: The data flow identifier **
** cnxid: The connection identifier **
** Outputs: None **
** Return: The index of the specified data flow in **
** the list of active data flows. **
** -1 if the list is full. **
***************************************************************************/
int eRAL_action_set_channel_id (ral_enb_instance_t instanceP, MIH_C_FLOW_ID_T* flowId, int cnxid)
{
// char addr[128];
//char port[8];
int f_ix;
assert(cnxid != 0);
for (f_ix = 0; f_ix < ACTION_MAX_FLOW; f_ix++) {
if (g_flows.flow[f_ix].cnxid > 0) continue;
g_flows.flow[f_ix].cnxid = cnxid;
g_flows.flow_id[f_ix] = (int)flowId;
g_flows.n_flows += 1;
// Modified Michelle
#warning "TO DO DestIpv6Addr ?"
//memcpy((char*)&(DestIpv6Addr[0][16]), addr, 16);
eRAL_process_mt_addr_to_l2id(&g_flows.flow[f_ix].addr[8],
&g_flows.flow[f_ix].l2id[0]);
/* MIH_C_TRANSPORT_ADDR_VALUE2String(&flowId->dest_addr.ip_addr.address, addr);
memcpy((char*)&(g_flows.flow[f_ix].addr), addr, 16);
eRAL_process_mt_addr_to_l2id(&g_flows.flow[f_ix].addr[8],
&g_flows.flow[f_ix].l2id[0]);
MIH_C_PORT2String(&flowId->dest_addr.port, port);
g_flows.flow[f_ix].port = strtol(port, (char**) NULL, 16);
g_flows.flow[f_ix].proto = flowId->transport_protocol;*/
return f_ix;
}
return (-1);
}
/****************************************************************************
** Name: eRAL_action_get_channel_id() **
** **
** Description: Returns the Connection identifier of the specified data **
** flow. **
** Inputs: flowId: The data flow identifier **
** Others: None **
** Outputs: cnxid: The connection identifier allocated to the **
** specified data flow. **
** Return: The index of the specified data flow in **
** the list of active data flows. **
** -1 if no any connection identifier exists **
** for the specified data flow. **
** Others: None **
***************************************************************************/
int eRAL_action_get_channel_id (ral_enb_instance_t instanceP, MIH_C_FLOW_ID_T* flowId, int* cnxid)
{
//char addr[128];
//char port[8];
//unsigned int dp;
int f_ix;
// MIH_C_TRANSPORT_ADDR_VALUE2String(&flowId->dest_addr.ip_addr.address, addr);
// MIH_C_PORT2String(&flowId->dest_addr.port, port);
// dp = strtol(port, (char**) NULL, 16);
for (f_ix = 0; f_ix < ACTION_MAX_FLOW; f_ix++) {
/* if (!eRAL_process_cmp_mt_addr((const char*)addr, (const char*)g_flows.flow[f_ix].l2id)) continue;
if (g_flows.flow[f_ix].port != dp) continue;
if (g_flows.flow[f_ix].proto != flowId->transport_protocol) continue;*/
if (g_flows.flow_id[f_ix] != *flowId) continue;
*cnxid = g_flows.flow[f_ix].cnxid;
return f_ix;
}
return (-1);
}
/****************************************************************************
** **
** Name: eRAL_action_del_channel_id() **
** **
** Description: Remove the data flow stored at the specified index in the **
** list of active data flows. **
** **
** Inputs: fix: Index of the data flow in the list **
** Others: None **
** **
** Outputs: None **
** Return: The number of the remaining data flows in **
** the list. **
** -1 if the specified index is out of the **
** boundary of the list. **
** Others: None **
** **
***************************************************************************/
int eRAL_action_del_channel_id (ral_enb_instance_t instanceP, int fix)
{
if (fix < ACTION_MAX_FLOW) {
g_flows.n_flows -= 1;
memset (&g_flows.flow[fix], 0, sizeof (struct Data_flow));
return g_flows.n_flows;
}
return (-1);
}
/****************************************************************************
** **
** Name: eRAL_action_is_in_progress() **
** **
** Description: Checks if an action request is supported and whether it **
** is currently in progress. **
** **
** Inputs: action: Type of link action **
** Others: g_link_action, ralpriv **
** **
** Outputs: status: MIH request status **
** ac_status: Action request status **
** Return: 1 if the request is not supported or is **
** currently in progress and the resource is **
** already in the required state. 0 otherwise.**
** Others: None **
** **
***************************************************************************/
int eRAL_action_is_in_progress(ral_enb_instance_t instanceP, MIH_C_STATUS_T* status,
MIH_C_LINK_AC_RESULT_T* ac_status,
MIH_C_LINK_AC_TYPE_T action)
{
/* Check whether the action link command is supported */
if (!(g_enb_ral_obj[instanceP].mih_supported_link_command_list & MIH_C_BIT_LINK_ACTION)) {
*status = MIH_C_STATUS_REJECTED;
LOG_D(RAL_ENB,"THE LINK ACTION is not in the list\n");
return 1;
}
*status = MIH_C_STATUS_SUCCESS;
/* Check whether the action request is supported */
if (g_enb_ral_obj[instanceP].mih_supported_link_action_list & (1 << action)) {
/* Check whether another action request is currently in progress */
if ((g_enb_ral_obj[instanceP].pending_req_action) && (g_enb_ral_obj[instanceP].pending_req_action != action)) {
/* Another action request is in progress:
* Do not process new request before completion of this one */
LOG_D(RAL_ENB,"THE LINK ACTION is pending\n");
*ac_status = MIH_C_LINK_AC_RESULT_REFUSED;
return 1;
}
/* The action request is supported and no other request is in progress:
* Go ahead and process the request */
LOG_D(RAL_ENB,"THE LINK ACTION is not pending\n");
return 0;
}
LOG_D(RAL_ENB,"THE LINK ACTION is not supported\n");
/* The link action request is not supported */
*ac_status = MIH_C_LINK_AC_RESULT_INCAPABLE;
return 1;
}
#ifdef MIH_C_MEDIEVAL_EXTENSIONS
/****************************************************************************
** **
** Name: eRAL_action_link_flow_attr() **
** **
** Description: Processes the link flow attribut action request. **
** **
** Inputs: None **
** Others: g_link_action **
** **
** Outputs: None **
** Return: MIH_C_LINK_AC_RESULT_SUCCESS if action has **
** been successfully processed. **
** Others: ralpriv **
** **
***************************************************************************/
MIH_C_LINK_AC_RESULT_T eRAL_action_link_flow_attr(ral_enb_instance_t instanceP)
//TODO
{
MIH_C_FLOW_ATTRIBUTE_T *flow = &g_link_action.link_ac_param._union.flow_attribute;
int mt_ix, ch_ix, f_ix;
int cnxid;
/* Get the connection identifier */
f_ix = eRAL_action_get_channel_id(instanceP, &flow->flow_id, &cnxid);
if (f_ix < 0) {
LOG_D(RAL_ENB, " No RB allocated for this data flow\n");
return MIH_C_LINK_AC_RESULT_REFUSED;
}
/* Get MT and RB channel identifiers */
if (eRAL_process_find_channel(instanceP, cnxid, &mt_ix, &ch_ix) != 0) {
/* Unicast data flow */
LOG_D(RAL_ENB, " %s: Unicast MT's address = %s\n", __FUNCTION__,
eRAL_process_mt_addr_to_string(g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_addr));
} else {
/* Multicast data flow */
LOG_D(RAL_ENB, " %s: Multicast MT's address = %s\n", __FUNCTION__,
eRAL_process_mt_addr_to_string(g_enb_ral_obj[instanceP].mcast.mc_group_addr));
}
if (flow->choice_mark_qos) {
LOG_D(RAL_ENB, " Mark QoS enabled\n");
//TODO ???
}
if (flow->choice_mark_drop_eligibility) {
LOG_D(RAL_ENB, " Mark drop eligibility enabled\n");
//TODO ???
}
/* Link action successfully processed */
g_enb_ral_obj[instanceP].pending_req_action = MIH_C_LINK_AC_TYPE_LINK_FLOW_ATTR;
return MIH_C_LINK_AC_RESULT_SUCCESS;
}
/****************************************************************************
** **
** Name: eRAL_action_link_activate_resources() **
** **
** Description: Processes the link activate resource action request. **
** **
** Inputs: None **
** Others: g_link_action **
** **
** Outputs: None **
** Return: MIH_C_LINK_AC_RESULT_SUCCESS if action has **
** been successfully processed. **
** Others: ralpriv **
** **
***************************************************************************/
MIH_C_LINK_AC_RESULT_T eRAL_action_link_activate_resources(ral_enb_instance_t instanceP)
{
//---------------------------------------------------------------------------
MIH_C_RESOURCE_DESC_T *res = &g_link_action.link_ac_param._union.resource_desc;
MIH_C_COS_T classIdDL = 0;
MIH_C_COS_T classIdUL = 0;
MIH_C_LINK_DATA_RATE_T resBitrateDL = 0;
MIH_C_LINK_DATA_RATE_T resBitrateUL = 0;
MIH_C_BOOLEAN_T multicast = MIH_C_BOOLEAN_FALSE;
/* TODO: To be initialized downlink/uplink */
if (res->choice_qos) {
MIH_C_QOS_T *qos = &(res->_union_qos.qos);
if (qos->choice) {
classIdDL = qos->_union.cos;
classIdUL = qos->_union.cos;
}
}
if (res->choice_link_data_rate) {
resBitrateDL = res->_union_link_data_rate.link_data_rate;
resBitrateUL = res->_union_link_data_rate.link_data_rate;
}
/* end TODO */
if (res->choice_multicast_enable) {
multicast = res->_union_multicast_enable.multicast_enable;
}
/*
* Get the Care-of Address (MT address):
* The destination address is contained into the MIH_C_FLOW_ID structure
* within the MIH_C_RESOURCE_DESC parameters of the request.
*/
char mt_addr[128];
//original code: int len = MIH_C_TRANSPORT_ADDR_VALUE2String(&res->flow_id.dest_addr.ip_addr.address, mt_addr);
MIH_C_TRANSPORT_ADDR_VALUE_T mihc_transport_addr_value;
MIH_C_TRANSPORT_ADDR_VALUE_set(&mihc_transport_addr_value, (unsigned char*)"2001:660:382:14:335:600:8014:9150", strlen("2001:660:382:14:335:600:8014:9150"));
int len = MIH_C_TRANSPORT_ADDR_VALUE2String(&mihc_transport_addr_value, mt_addr);
//int len = MIH_C_TRANSPORT_ADDR_VALUE2String(&DestIpv6Addr[0][16], mt_addr);
if ( (len > 0) && (len < 128)) {
LOG_D(RAL_ENB, " %s: MT's address = %s\n", __FUNCTION__, eRAL_process_mt_addr_to_string((unsigned char*)mt_addr));
} else {
LOG_E(RAL_ENB, "%s : IP Address is NOT valid (len=%d)\n", __FUNCTION__, len);
return MIH_C_LINK_AC_RESULT_FAILURE;
}
#if 0
char mt_addr[128];
if (res->link_id.link_addr.choice == MIH_C_CHOICE_3GPP_3G_CELL_ID) {
char link_addr[128];
int len = MIH_C_LINK_ADDR2String(&res->link_id.link_addr, link_addr);
if ( (len > 0) && (len <= 128) ) {
int i;
LOG_D(RAL_ENB, " %s : Link address = %s\n", __FUNCTION__, link_addr);
for (i=0; i < len; i++) {
if (link_addr[i] == '=') break;
}
strncpy(mt_addr, &link_addr[i+2], 16);
LOG_D(RAL_ENB, " %s : MT address = %s\n", __FUNCTION__, mt_addr);
} else {
LOG_E(RAL_ENB, "%s : Link address is NOT valid (len=%d)\n", __FUNCTION__, len);
return MIH_C_LINK_AC_RESULT_FAILURE;
}
} else {
LOG_E(RAL_ENB, "%s : Link address is NOT valid (type=%d, not 3GPP_3G_CELL_ID)\n",
__FUNCTION__, res->link_id.link_addr.choice);
return MIH_C_LINK_AC_RESULT_FAILURE;
}
#endif
/*
* If the resource has already been activated, check whether it is in the
* required state.
*/
struct ral_lte_channel *currChannel;
int mt_ix, ch_ix, f_ix;
int cnxid;
/* Get the connection identifier */
f_ix = eRAL_action_get_channel_id(instanceP, &res->flow_id, &cnxid);
if (f_ix != -1) {
/* Get MT and RB channel identifiers */
if (eRAL_process_find_channel(instanceP, cnxid, &mt_ix, &ch_ix) != 0) {
/* Unicast data flow */
currChannel = &(g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix]);
} else {
/* Multicast data flow */
assert(multicast == MIH_C_BOOLEAN_TRUE);
currChannel = &(g_enb_ral_obj[instanceP].mcast.radio_channel);
}
if (currChannel->status == RB_CONNECTED) {
//if (currChannel->status == NAS_CONNECTED) {
/* The resource is already in the required state */
LOG_D(RAL_ENB, " Link action ACTIVATE_RESOURCES requested while link resource is ALREADY activated\n");
return MIH_C_LINK_AC_RESULT_SUCCESS;
}
/* The resource is not in the required state:
* Remove the connection identifier from the list of active resources
* and process the action request again. */
LOG_D(RAL_ENB, " Resource has been activated but is not in the ACTIVE state\n");
(void) eRAL_action_del_channel_id(instanceP, f_ix);
}
MIH_C_LINK_TUPLE_ID_T *ltid;
int is_ready_for_rb_establish = 1;
if (multicast) {
/*
* Multicast data flow:
*/
mt_ix = RAL_MAX_MT;
ch_ix = 0;
currChannel = &(g_enb_ral_obj[instanceP].mcast.radio_channel);
currChannel->cnx_id = (RAL_MAX_RB_PER_UE*mt_ix)+1;
currChannel->rbId = RAL_DEFAULT_RAB_ID;
currChannel->multicast = 1;
memcpy((char*)&(g_enb_ral_obj[instanceP].mcast.mc_group_addr), mt_addr, 16);
ltid = &(g_enb_ral_obj[instanceP].mcast.ltid);
} else {
/*
* Unicast data flow
*/
/* Get the list of MTs waiting for RB establishment */
#ifdef RAL_REALTIME
// LG RAL_process_NAS_message(IO_OBJ_CNX, IO_CMD_LIST, 0, 0);
// LG RAL_process_NAS_message(IO_OBJ_RB, IO_CMD_LIST, 0, 0);
#endif
/* Check if the MT is in the list */
mt_ix = eRAL_process_find_mt_by_addr(instanceP, mt_addr);
if ( (mt_ix < RAL_MAX_MT) &&
(g_enb_ral_obj[instanceP].mt[mt_ix].mt_state == RB_CONNECTED)) {
/* The MT is ready for RB establishment */
ch_ix = eRAL_process_find_new_channel(instanceP, mt_ix);
if (ch_ix == RAL_MAX_RB) {
LOG_D(RAL_ENB, " No RB available in MT\n");
return MIH_C_LINK_AC_RESULT_REFUSED;
}
currChannel = &(g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix]);
currChannel->cnx_id = (RAL_MAX_RB_PER_UE*mt_ix)+ch_ix+1;
currChannel->rbId = RAL_DEFAULT_RAB_ID + ch_ix;
currChannel->multicast = 0;
LOG_D(RAL_ENB, " mt_ix %d, ch_ix %d, cnx_id %d, rbId %d\n",
mt_ix, ch_ix, currChannel->cnx_id, currChannel->rbId);
memcpy((char *)&(g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_addr), mt_addr, 16);
ltid = &(g_enb_ral_obj[instanceP].mt[mt_ix].ltid);
} else {
/* The MT is NOT ready for RB establishment */
is_ready_for_rb_establish = 0;
int qos_is_valid = 0;
LOG_D(RAL_ENB, " Mobile Terminal not ready - Storing request data\n");
/* Check validity of QoS parameters */
if ( (classIdDL < 64) && (classIdUL < 64) ) {
if ( (resBitrateDL <= RAL_BITRATE_320k)
&& (resBitrateUL <= RAL_BITRATE_320k) ) {
qos_is_valid = 1;
} else if ( (resBitrateDL >= RAL_BITRATE_384k)
&& (resBitrateDL <= RAL_BITRATE_440k)
&& (resBitrateUL <= RAL_BITRATE_64k) ) {
qos_is_valid = 1;
}
}
if (qos_is_valid) {
LOG_D(RAL_ENB, " Received QoS parameters are valid\n");
} else {
LOG_D(RAL_ENB, " Received QoS parameters are NOT valid - Request will be rejected\n");
return MIH_C_LINK_AC_RESULT_REFUSED;
}
currChannel = &(g_enb_ral_obj[instanceP].pending_mt.radio_channel[0]);
currChannel->cnx_id = 0;
currChannel->rbId = 0;
currChannel->multicast = 0;
memcpy((char *)&(g_enb_ral_obj[instanceP].pending_mt.ipv6_addr), mt_addr, 16);
ltid = &(g_enb_ral_obj[instanceP].pending_mt.ltid);
g_enb_ral_obj[instanceP].pending_req_flag = 1;
} /* end MT not ready */
} /* end unicast data flow */
/* Save the current data flow identifier into the list of active data flows */
if (currChannel->cnx_id != 0) {
f_ix = eRAL_action_set_channel_id(instanceP, &res->flow_id, currChannel->cnx_id);
if (f_ix < 0) {
LOG_D(RAL_ENB, " No RB available\n");
return MIH_C_LINK_AC_RESULT_REFUSED;
}
} else {
/* The current request is pending waiting for RB establishment */
f_ix = 0;
g_enb_ral_obj[instanceP].pending_req_fid = res->flow_id;
}
/*
* Store resource parameters
*/
int i;
for (i = 0; i < 2; i++) {
//TODO: int dir = p->qos.value[i].direction;
// TODO: To be initialized downlink/uplink
currChannel->flowId[i] = f_ix;
currChannel->classId[i] = classIdDL; // classIdUL
currChannel->resBitrate[i] = resBitrateDL; // resBitrateUL
//currChannel->meanBitrate[i] = p->qos.value[i].tspec.meanBitrate;
//currChannel->bktDepth[i] = p->qos.value[i].tspec.bucketDepth;
//currChannel->pkBitrate[i] = p->qos.value[i].tspec.peakBitrate;
//currChannel->MTU[i] = p->qos.value[i].tspec.maximumTransmissionUnit;
LOG_D(RAL_ENB, " qos value : DIR %d, flowId %d, classId %d, resBitrate %.1f\n", i , currChannel->flowId[i], currChannel->classId[i], currChannel->resBitrate[i]);
}
/* Store the link identifier */
ltid->link_id = res->link_id;
ltid->choice = MIH_C_LINK_TUPLE_ID_CHOICE_LINK_ADDR;
ltid->_union.link_addr.choice = MIH_C_CHOICE_3GPP_3G_CELL_ID; // DUMMY
ltid->_union.link_addr._union._3gpp_3g_cell_id.cell_id = RAL_DEFAULT_CELL_ID; // DUMMY
/*
* Setup Radio Bearer resources
*/
if (is_ready_for_rb_establish) {
/* Map QoS */
int mapping_result = eRAL_process_map_qos(instanceP, mt_ix, ch_ix);
if (mapping_result) {
int rc = -1;
#ifdef RAL_DUMMY
rc = eRAL_NAS_send_rb_establish_request(mt_ix, ch_ix);
#endif
#ifdef RAL_REALTIME
// LG rc = RAL_process_NAS_message(IO_OBJ_RB, IO_CMD_ADD, mt_ix, ch_ix); // FIXME why is this commented?
#endif
if (rc < 0) {
/* Failed to send RB establishment request */
return MIH_C_LINK_AC_RESULT_FAILURE;
}
} else {
/* QoS mapping is not supported */
return MIH_C_LINK_AC_RESULT_REFUSED;
}
} else {
/* Wait for MT coming ready;
* re-try to establish RB upon timer expiration */
#ifdef RAL_DUMMY
g_enb_ral_obj[instanceP].pending_mt_timer = 5;
#endif
#ifdef RAL_REALTIME
g_enb_ral_obj[instanceP].pending_mt_timer = 300;
#endif
}
/* Link action successfully processed */
g_enb_ral_obj[instanceP].pending_req_action = MIH_C_LINK_AC_TYPE_LINK_ACTIVATE_RESOURCES;
return MIH_C_LINK_AC_RESULT_SUCCESS;
}
/****************************************************************************
** **
** Name: eRAL_action_link_deactivate_resources() **
** **
** Description: Processes the link deactivate resource action request. **
** **
** Inputs: None **
** Others: g_link_action **
** **
** Outputs: None **
** Return: MIH_C_LINK_AC_RESULT_SUCCESS if action has **
** been successfully processed. **
** Others: ralpriv **
** **
***************************************************************************/
MIH_C_LINK_AC_RESULT_T eRAL_action_link_deactivate_resources(ral_enb_instance_t instanceP)
{
MIH_C_RESOURCE_DESC_T *res = &g_link_action.link_ac_param._union.resource_desc;
struct ral_lte_channel *currChannel;
int mt_ix, ch_ix, f_ix;
int cnxid;
/* Get the connection identifier */
f_ix = eRAL_action_get_channel_id(instanceP, &res->flow_id, &cnxid);
if (f_ix < 0) {
LOG_D(RAL_ENB, " Link action DEACTIVATE_RESOURCES requested while link resource is NOT activated\n");
return MIH_C_LINK_AC_RESULT_SUCCESS;
}
/* Get MT and RB channel identifiers */
if (eRAL_process_find_channel(instanceP, cnxid, &mt_ix, &ch_ix) != 0) {
/* Unicast data flow */
currChannel = &(g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix]);
LOG_D(RAL_ENB, " %s: Unicast MT's address = %s\n", __FUNCTION__,
eRAL_process_mt_addr_to_string(g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_addr));
} else {
/* Multicast data flow */
currChannel = &(g_enb_ral_obj[instanceP].mcast.radio_channel);
LOG_D(RAL_ENB, " %s: Multicast MT's address = %s\n", __FUNCTION__,
eRAL_process_mt_addr_to_string(g_enb_ral_obj[instanceP].mcast.mc_group_addr));
}
if (currChannel->status == NAS_DISCONNECTED) {
/* The resource is already in the required state */
LOG_D(RAL_ENB, " Link action request DEACTIVATE_RESOURCES is currently in progress\n");
return MIH_C_LINK_AC_RESULT_SUCCESS;
}
/* The resource is not in the required state:
* Remove the connection identifier from the list of active resources
* and go ahead in the request processing. */
(void) eRAL_action_del_channel_id(instanceP, f_ix);
int rc = -1;
#ifdef RAL_DUMMY
rc = eRAL_NAS_send_rb_release_request(mt_ix, ch_ix);
#endif
#ifdef RAL_REALTIME
// LG rc = RAL_process_NAS_message(IO_OBJ_RB, IO_CMD_DEL, mt_ix, ch_ix); // FIXME why is this commented?
#endif
if (rc < 0) {
/* Failed to send RB release request */
return MIH_C_LINK_AC_RESULT_FAILURE;
}
/* Link action successfully processed */
g_enb_ral_obj[instanceP].pending_req_action = MIH_C_LINK_AC_TYPE_LINK_DEACTIVATE_RESOURCES;
return MIH_C_LINK_AC_RESULT_SUCCESS;
}
#endif // MIH_C_MEDIEVAL_EXTENSIONS
@@ -1,725 +0,0 @@
/***************************************************************************
lteRALenb_ioctl.c - description
***************************************************************************
Eurecom OpenAirInterface 3
Copyright(c) 1999 - 2013 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, 450 route des Chappes, 06410 Biot Sophia Antipolis, France
*******************************************************************************/
/*! \file lteRALenb_ioctl.c
* \brief Handling of ioctl for LTE driver in LTE-RAL-ENB
* \author WETTERWALD Michelle, GAUTHIER Lionel, MAUREL Frederic
* \date 2013
* \company EURECOM
* \email: michelle.wetterwald@eurecom.fr, lionel.gauthier@eurecom.fr, frederic.maurel@eurecom.fr
*/
/*******************************************************************************
#include <sys/ioctl.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <net/if.h>
//#include <linux/ipv6.h>
//#include <linux/in.h>
//#include <linux/in6.h>
#include <netinet/in.h>
//
#include "rrc_d_types.h"
//-----------------------------------------------------------------------------
// LTE AS sub-system
//#include "rrc_nas_primitives.h"
//#include "nasrg_constant.h"
//#include "nasrg_iocontrol.h"
//-----------------------------------------------------------------------------
#include "lteRALenb_mih_msg.h"
#include "lteRALenb_constants.h"
#include "lteRALenb_variables.h"
#include "lteRALenb_proto.h"
#include "MIH_C.h"
//#include "MIH_C_Types.h"
extern struct nas_ioctl gifr;
extern int fd;
extern int s_mgr; //socket with QoS Mgr
extern int init_flag;
//---------------------------------------------------------------------------
void print_state(uint8_t state){
//---------------------------------------------------------------------------
switch(state){
case NAS_IDLE:printf("NAS_IDLE\n");return;
case NAS_CX_FACH:printf("NAS_CX_FACH\n");return;
case NAS_CX_DCH:printf("NAS_CX_DCH\n");return;
case NAS_CX_RECEIVED:printf("NAS_CX_RECEIVED\n");return;
case NAS_CX_CONNECTING:printf("NAS_CX_CONNECTING\n");return;
case NAS_CX_RELEASING:printf("NAS_CX_RELEASING\n");return;
case NAS_CX_CONNECTING_FAILURE:printf("NAS_CX_CONNECTING_FAILURE\n");return;
case NAS_CX_RELEASING_FAILURE:printf("NAS_CX_RELEASING_FAILURE\n");return;
case NAS_RB_ESTABLISHING:printf("NAS_RB_ESTABLISHING\n");return;
case NAS_RB_RELEASING:printf("NAS_RB_RELEASING\n");return;
case NAS_RB_ESTABLISHED:printf("NAS_RB_ESTABLISHED\n");return;
default: printf(" Unknown state\n");
}
}
//---------------------------------------------------------------------------
void RAL_NASinitMTlist(uint8_t *msgrep, int num_mts){
//---------------------------------------------------------------------------
int mt_ix, ch_ix;
struct nas_msg_cx_list_reply *list;
memcpy(g_enb_ral_obj[instanceP].plmn, DefaultPLMN, DEFAULT_PLMN_SIZE); // DUMMY
list=(struct nas_msg_cx_list_reply *)(msgrep+1);
num_mts = msgrep[0];
for(mt_ix=0; mt_ix<num_mts; ++mt_ix){
if (list[mt_ix].state != NAS_IDLE){
g_enb_ral_obj[instanceP].cell_id = list[mt_ix].cellid;
g_enb_ral_obj[instanceP].mt[mt_ix].ue_id = list[mt_ix].lcr;
g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_l2id[0]= list[mt_ix].iid6[0];
g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_l2id[1]= list[mt_ix].iid6[1];
g_enb_ral_obj[instanceP].mt[mt_ix].num_rbs = list[mt_ix].num_rb;
g_enb_ral_obj[instanceP].mt[mt_ix].num_class = list[mt_ix].nsclassifier;
g_enb_ral_obj[instanceP].mt[mt_ix].nas_state = list[mt_ix].state;
if (g_enb_ral_obj[instanceP].mt[mt_ix].num_class>=2)
g_enb_ral_obj[instanceP].mt[mt_ix].mt_state= NAS_CONNECTED;
// enter default rb
ch_ix = 0;
g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix].rbId = RAL_DEFAULT_MC_RAB_ID+1;
g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix].RadioQoSclass = 2;
g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix].cnx_id = (RAL_MAX_RB_PER_UE*mt_ix)+ch_ix+1;
g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix].dscpUL = 0;
g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix].dscpDL = 0;
g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix].nas_state = NAS_CX_DCH;
g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix].status = RB_CONNECTED;
g_enb_ral_obj[instanceP].num_connected_mts++;
//RAL_printMobileData(mt_ix);
DEBUG(" MT%d initialized : address %d %d\n", mt_ix, g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_l2id[0], g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_l2id[1]);
}
}
}
//---------------------------------------------------------------------------
void RAL_NASupdatetMTlist(uint8_t *msgrep, int num_mts){
//---------------------------------------------------------------------------
int mt_ix, ch_ix;
struct nas_msg_cx_list_reply *list;
//MIH_C_LINK_TUPLE_ID_T* ltid;
MIH_C_LINK_ADDR_T new_ar;
MIH_C_LINK_DN_REASON_T reason_code;
MIH_C_TRANSACTION_ID_T transaction_id;
int previous_num_class;
list=(struct nas_msg_cx_list_reply *)(msgrep+1);
num_mts = msgrep[0];
for(mt_ix=0; mt_ix<num_mts; ++mt_ix){
// check if MT already known
if ((g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_l2id[0]== list[mt_ix].iid6[0])&&
(g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_l2id[1]== list[mt_ix].iid6[1])){
// MT already known - update
g_enb_ral_obj[instanceP].mt[mt_ix].num_rbs = list[mt_ix].num_rb;
previous_num_class = g_enb_ral_obj[instanceP].mt[mt_ix].num_class;
g_enb_ral_obj[instanceP].mt[mt_ix].num_class = list[mt_ix].nsclassifier;
if (g_enb_ral_obj[instanceP].mt[mt_ix].num_class>=2)
g_enb_ral_obj[instanceP].mt[mt_ix].mt_state= RB_CONNECTED;
//check if state has changed - MT disconnected FFS
if ((g_enb_ral_obj[instanceP].mt[mt_ix].nas_state==NAS_CX_DCH)&&(list[mt_ix].state == NAS_IDLE)){
DEBUG ("\n\n");
DEBUG (" MOBILE TERMINAL %d IS NOW IDLE.\n\n",mt_ix);
// TODO Send linkdown
}
//check if state has changed - MT reconnected FFS
if ((g_enb_ral_obj[instanceP].mt[mt_ix].nas_state==NAS_IDLE)&&(list[mt_ix].state == NAS_CX_DCH)){
DEBUG ("\n\n");
DEBUG (" MOBILE TERMINAL %d WAS IDLE AND IS NOW CONNECTED.\n\n",mt_ix);
}
//check if MT is completely connected
if ((g_enb_ral_obj[instanceP].mt[mt_ix].num_class - previous_num_class)&&(list[mt_ix].state == NAS_CX_DCH)){
DEBUG ("\n\n");
DEBUG (" MOBILE TERMINAL %d IS NOW COMPLETELY CONNECTED.\n\n",mt_ix);
// send linkup: new_ar will contain the address from the MT
new_ar.choice = MIH_C_CHOICE_3GPP_ADDR;
MIH_C_3GPP_ADDR_set(&(new_ar._union._3gpp_addr), (u_int8_t*)&(g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_l2id[0]), strlen(DEFAULT_ADDRESS_3GPP));
eRALlte_send_link_up_indication(&g_enb_ral_obj[instanceP].pending_req_transaction_id, &g_enb_ral_obj[instanceP].mt[mt_ix].ltid, NULL, &new_ar, NULL, NULL);
//eRALlte_send_link_up_indication(&g_enb_ral_obj[instanceP].pending_req_transaction_id, &g_enb_ral_obj[instanceP].mt[mt_ix].ltid, NULL, NULL, NULL, NULL);
// if RAL realtime and MEASURES are enabled, start the measuring process in RRC+Driver
#ifdef RAL_REALTIME
#ifdef ENABLE_MEDIEVAL_DEMO3
RAL_process_NAS_message(IO_OBJ_MEAS, IO_CMD_ADD,0,0);
#endif
#endif
}
//check enter sleep mode
if ((g_enb_ral_obj[instanceP].mt[mt_ix].nas_state==NAS_CX_DCH)&&(list[mt_ix].state == NAS_CX_RELEASING)){
DEBUG ("\n\n");
DEBUG (" MOBILE TERMINAL %d is entering sleep mode. Send LinkDown.\n\n",mt_ix);
// send linkdown: old_ar (represented by new_ar variable) will contain the address from the MT
transaction_id = MIH_C_get_new_transaction_id();
reason_code = MIH_C_LINK_DOWN_REASON_EXPLICIT_DISCONNECT;
new_ar.choice = MIH_C_CHOICE_3GPP_ADDR;
MIH_C_3GPP_ADDR_set(&(new_ar._union._3gpp_addr), (u_int8_t*)&(g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_l2id[0]), strlen(DEFAULT_ADDRESS_3GPP));
eRALlte_send_link_down_indication(&transaction_id, &g_enb_ral_obj[instanceP].mt[mt_ix].ltid, &new_ar, &reason_code);
}
// check leave sleep mode
if ((g_enb_ral_obj[instanceP].mt[mt_ix].nas_state==NAS_CX_RELEASING)&&(list[mt_ix].state == NAS_CX_DCH)){
DEBUG ("\n\n");
DEBUG (" MOBILE TERMINAL %d WAS IN SLEEP MODE AND IS NOW ACTIVATED.\n\n",mt_ix);
// send linkup: new_ar will contain the address from the MT
new_ar.choice = MIH_C_CHOICE_3GPP_ADDR;
MIH_C_3GPP_ADDR_set(&(new_ar._union._3gpp_addr), (u_int8_t*)&(g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_l2id[0]), strlen(DEFAULT_ADDRESS_3GPP));
eRALlte_send_link_up_indication(&g_enb_ral_obj[instanceP].pending_req_transaction_id, &g_enb_ral_obj[instanceP].mt[mt_ix].ltid, NULL, &new_ar, NULL, NULL);
}
g_enb_ral_obj[instanceP].mt[mt_ix].nas_state = list[mt_ix].state;
}else{
// MT unknown or different
if (list[mt_ix].state != NAS_IDLE){
DEBUG ("\n\n");
DEBUG (" NEW TERMINAL %d DETECTED.\n\n",mt_ix);
g_enb_ral_obj[instanceP].mt[mt_ix].ue_id = list[mt_ix].lcr;
g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_l2id[0]= list[mt_ix].iid6[0];
g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_l2id[1]= list[mt_ix].iid6[1];
g_enb_ral_obj[instanceP].mt[mt_ix].num_rbs = list[mt_ix].num_rb;
g_enb_ral_obj[instanceP].mt[mt_ix].num_class = list[mt_ix].nsclassifier;
// initialize ltid (MIH_C_LINK_TUPLE_ID_T) for that mobile
// first version
//g_enb_ral_obj[instanceP].mt[mt_ix].ltid.link_id.link_type = MIH_C_WIRELESS_UMTS;
//g_enb_ral_obj[instanceP].mt[mt_ix].ltid.link_id.link_addr.choice = MIH_C_CHOICE_3GPP_ADDR;
//MIH_C_3GPP_ADDR_set(&g_enb_ral_obj[instanceP].mt[mt_ix].ltid.link_id.link_addr._union._3gpp_addr, (u_int8_t*)&(g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_l2id[0]), strlen(DEFAULT_ADDRESS_3GPP));
//g_enb_ral_obj[instanceP].mt[mt_ix].ltid.choice = MIH_C_LINK_TUPLE_ID_CHOICE_LINK_ADDR;
// SECOND Version
g_enb_ral_obj[instanceP].mt[mt_ix].ltid.link_id.link_type = MIH_C_WIRELESS_UMTS;
g_enb_ral_obj[instanceP].mt[mt_ix].ltid.choice = MIH_C_LINK_TUPLE_ID_CHOICE_NULL;
g_enb_ral_obj[instanceP].mt[mt_ix].ltid.link_id.link_addr.choice = MIH_C_CHOICE_3GPP_3G_CELL_ID;
Bit_Buffer_t *plmn = new_BitBuffer_0();
BitBuffer_wrap(plmn, (unsigned char*) g_enb_ral_obj[instanceP].plmn, DEFAULT_PLMN_SIZE);
MIH_C_PLMN_ID_decode(plmn, &g_enb_ral_obj[instanceP].mt[mt_ix].ltid.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id);
free_BitBuffer(plmn);
g_enb_ral_obj[instanceP].mt[mt_ix].ltid.link_id.link_addr._union._3gpp_3g_cell_id.cell_id = g_enb_ral_obj[instanceP].cell_id;
g_enb_ral_obj[instanceP].mt[mt_ix].ltid.choice = MIH_C_LINK_TUPLE_ID_CHOICE_NULL;
// check state of the UE connection
g_enb_ral_obj[instanceP].mt[mt_ix].nas_state = list[mt_ix].state;
if (g_enb_ral_obj[instanceP].mt[mt_ix].num_class>=2){
g_enb_ral_obj[instanceP].mt[mt_ix].mt_state= RB_CONNECTED;
// send linkup
//ltid = &g_enb_ral_obj[instanceP].mt[mt_ix].ltid;
DEBUG (" MOBILE TERMINAL %d IS COMPLETELY CONNECTED.\n\n",mt_ix);
// new_ar will contain the address from the MT
new_ar.choice = MIH_C_CHOICE_3GPP_ADDR;
MIH_C_3GPP_ADDR_set(&(new_ar._union._3gpp_addr), (u_int8_t*)&(g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_l2id[0]), strlen(DEFAULT_ADDRESS_3GPP));
eRALlte_send_link_up_indication(&g_enb_ral_obj[instanceP].pending_req_transaction_id, &g_enb_ral_obj[instanceP].mt[mt_ix].ltid, NULL, &new_ar, NULL, NULL);
// if RAL realtime and MEASURES are enabled, start the measuring process in RRC+Driver
#ifdef RAL_REALTIME
#ifdef ENABLE_MEDIEVAL_DEMO3
RAL_process_NAS_message(IO_OBJ_MEAS, IO_CMD_ADD,0,0);
#endif
#endif
}
// enter default rb
ch_ix = 0;
g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix].rbId = RAL_DEFAULT_MC_RAB_ID+1;
g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix].RadioQoSclass = 2;
g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix].cnx_id = (RAL_MAX_RB_PER_UE*mt_ix)+ch_ix+1;
g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix].dscpUL = 0;
g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix].dscpDL = 0;
g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix].nas_state = NAS_CX_DCH;
g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix].status = RB_CONNECTED;
g_enb_ral_obj[instanceP].num_connected_mts++;
//RAL_printMobileData(mt_ix);
}
} // end if MT unknonwn
} // end for loop
}
//---------------------------------------------------------------------------
void RAL_verifyPendingRbStatus(void){
//---------------------------------------------------------------------------
// g_enb_ral_obj[instanceP].mcast.radio_channel.status = RB_CONNECTED;
int mt_ix, ch_ix;
MIH_C_LINK_TUPLE_ID_T* ltid;
//int is_unicast;
mt_ix = g_enb_ral_obj[instanceP].pending_req_mt_ix;
ch_ix = g_enb_ral_obj[instanceP].pending_req_ch_ix;
if ((g_enb_ral_obj[instanceP].pending_req_flag)%5==0){
DEBUG("Pending Req Flag %d, Mobile %d, channel %d\n", g_enb_ral_obj[instanceP].pending_req_flag, mt_ix, ch_ix);
if (g_enb_ral_obj[instanceP].pending_req_multicast == RAL_TRUE){
mt_ix =0;
ch_ix =1;
}
RAL_process_NAS_message(IO_OBJ_RB, IO_CMD_LIST,mt_ix,0);
if ((g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix].status == RB_CONNECTED)||((g_enb_ral_obj[instanceP].pending_req_flag) > 100)){
DEBUG("RAL_verifyPendingRbStatus -in- mt_ix %d - ch_ix %d \n", mt_ix, ch_ix );
// send confirmation to upper layer
g_enb_ral_obj[instanceP].pending_req_status = MIH_C_STATUS_SUCCESS;
if ((g_enb_ral_obj[instanceP].pending_req_flag) > 100){
g_enb_ral_obj[instanceP].pending_req_status = MIH_C_STATUS_REJECTED;
if (mt_ix == RAL_MAX_MT)
eRALlte_process_clean_channel(&(g_enb_ral_obj[instanceP].mcast.radio_channel));
else
eRALlte_process_clean_channel(&(g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix]));
}
if (mt_ix == RAL_MAX_MT)
ltid = &g_enb_ral_obj[instanceP].mcast.ltid;
else
ltid = &g_enb_ral_obj[instanceP].mt[mt_ix].ltid;
if (!g_enb_ral_obj[instanceP].pending_mt_flag)
// To be updated and completed
//aRALu_send_link_res_activate_cnf();
eRALlte_send_link_up_indication(&g_enb_ral_obj[instanceP].pending_req_transaction_id, ltid, NULL, NULL, NULL, NULL);
else
g_enb_ral_obj[instanceP].pending_mt_flag = 0;
g_enb_ral_obj[instanceP].pending_req_flag = 0;
DEBUG("After response, Pending Req Flag = 0 , %d\n", g_enb_ral_obj[instanceP].pending_req_flag);
}
//DEBUG("RAL_verifyPendingRbStatus - 2- \n");
}
}
//---------------------------------------------------------------------------
int RAL_process_NAS_message(int ioctl_obj, int ioctl_cmd, int mt_ix, int ch_ix){
//---------------------------------------------------------------------------
int err, rc;
// int mt_ix, ch_ix;
unsigned int cnxid;
// DEBUG ("\n%d , %d,", mt_ix, ch_ix);
switch (ioctl_obj){
case IO_OBJ_STATS:
{
DEBUG("Statistics requested -- FFS \n");
}
break;
case IO_OBJ_CNX:
switch (ioctl_cmd){
case IO_CMD_LIST:
{
// printf("Usage: gioctl cx list\n");
uint8_t *msgrep;
uint8_t i;
struct nas_msg_cx_list_reply *list;
uint8_t lcr;
short int num_mts;
gifr.type=NAS_MSG_CX_LIST_REQUEST;
//gifr.msg=(char *)malloc(NAS_LIST_CX_MAX*sizeof(struct nas_msg_cx_list_reply)+1);
memset (g_enb_ral_obj[instanceP].buffer,0,800);
gifr.msg= &(g_enb_ral_obj[instanceP].buffer[0]);
msgrep=(uint8_t *)(gifr.msg);
//
DEBUG("--\n");
DEBUG("Connexion list requested\n");
err=ioctl(fd, NASRG_IOCTL_RAL, &gifr);
if (err<0){
ERR("IOCTL error, err=%d\n",err);
rc = -1;
}
// Print result
DEBUG("Lcr\t\tCellId\tIID4\tIID6\t\t\tnum_rb\tnsclass\tState\n");
list=(struct nas_msg_cx_list_reply *)(msgrep+1);
num_mts = msgrep[0];
for(lcr=0; lcr<num_mts; ++lcr){
DEBUG("%u\t\t%u\t%u\t", list[lcr].lcr, list[lcr].cellid, list[lcr].iid4);
for (i=0;i<8;++i)
DEBUG("%02x", *((uint8_t *)list[lcr].iid6+i));
DEBUG("\t%u\t%u\t", list[lcr].num_rb, list[lcr].nsclassifier);
print_state(list[lcr].state);
}
if (init_flag){
RAL_NASinitMTlist(msgrep, num_mts);
}else{
RAL_NASupdatetMTlist(msgrep, num_mts);
}
rc = 0;
}
break;
default:
ERR ("RAL_process_NAS_message : invalid ioctl command %d\n",ioctl_cmd);
rc= -1;
} //end switch ioctl_cmd
break;
case IO_OBJ_RB:
switch (ioctl_cmd){
case IO_CMD_ADD:
{
// printf("Usage: gioctl rb add <lcr> <rab_id> <qos>\n");
struct nas_msg_rb_establishment_request *msgreq;
struct nas_msg_rb_establishment_reply *msgrep;
struct ral_lte_channel *currChannel;
MIH_C_LINK_TUPLE_ID_T* ltid;
MIH_C_LINK_DN_REASON_T reason_code;
//
gifr.type=NAS_MSG_RB_ESTABLISHMENT_REQUEST;
memset (g_enb_ral_obj[instanceP].buffer,0,800);
gifr.msg= &(g_enb_ral_obj[instanceP].buffer[0]);
msgreq=(struct nas_msg_rb_establishment_request *)(gifr.msg);
msgrep=(struct nas_msg_rb_establishment_reply *)(gifr.msg);
//
if (mt_ix == RAL_MAX_MT){
// multicast
currChannel = &(g_enb_ral_obj[instanceP].mcast.radio_channel);
msgreq->lcr = mt_ix;
memcpy ((char *)&(msgreq->mcast_group), (char *)&(g_enb_ral_obj[instanceP].mcast.mc_group_addr), 16);
}else{
// unicast
currChannel = &(g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix]);
msgreq->lcr = g_enb_ral_obj[instanceP].mt[mt_ix].ue_id;
}
msgreq->cnxid = currChannel->cnx_id;
msgreq->rab_id = currChannel->rbId;
msgreq->qos = currChannel->RadioQoSclass;
msgreq->dscp_ul = currChannel->dscpUL;
msgreq->dscp_dl = currChannel->dscpDL;
msgreq->mcast_flag = currChannel->multicast;
cnxid = msgreq->cnxid;
currChannel->status = RB_DISCONNECTED;
//
DEBUG("Radio bearer establishment requested, cnxid %d\n", cnxid);
err=ioctl(fd, NASRG_IOCTL_RAL, &gifr);
if (err<0){
ERR("IOCTL error, err=%d\n",err);
rc = -1;
}
// check answer from NAS
msgrep->cnxid = cnxid; // Temp - hardcoded
if ((msgrep->status<0)||(msgrep->cnxid!=cnxid)||(err<0)){
ERR(" Radio bearer establishment failure: %d\n",msgrep->status);
currChannel->status = RB_DISCONNECTED;
rc = -1;
g_enb_ral_obj[instanceP].pending_req_status = MIH_C_STATUS_REJECTED;
if (g_enb_ral_obj[instanceP].pending_mt_flag){
reason_code = MIH_C_LINK_DOWN_REASON_NO_RESOURCE;
if (mt_ix == RAL_MAX_MT)
ltid = &g_enb_ral_obj[instanceP].mcast.ltid;
else
ltid = &g_enb_ral_obj[instanceP].mt[mt_ix].ltid;
eRALlte_send_link_down_indication(&g_enb_ral_obj[instanceP].pending_req_transaction_id, ltid, NULL, &reason_code);
// aRALu_send_link_res_activate_cnf();
}
if (mt_ix == RAL_MAX_MT)
eRALlte_process_clean_channel(&(g_enb_ral_obj[instanceP].mcast.radio_channel));
else
eRALlte_process_clean_channel(&(g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix]));
}else{
rc = 0;
g_enb_ral_obj[instanceP].pending_req_flag = 1;
g_enb_ral_obj[instanceP].pending_req_mt_ix = mt_ix;
g_enb_ral_obj[instanceP].pending_req_ch_ix = ch_ix;
g_enb_ral_obj[instanceP].pending_req_multicast = currChannel->multicast;
DEBUG("-1- pending_req_mt_ix %d, pending_req_ch_ix %d\n", g_enb_ral_obj[instanceP].pending_req_mt_ix, g_enb_ral_obj[instanceP].pending_req_ch_ix);
}
}
break;
case IO_CMD_DEL:
{
// printf("Usage: gioctl rb del <lcr> <rab_id>\n");
struct nas_msg_rb_release_request *msgreq;
struct nas_msg_rb_release_reply *msgrep;
struct ral_lte_channel *currChannel;
MIH_C_LINK_TUPLE_ID_T* ltid;
MIH_C_LINK_DN_REASON_T reason_code;
//
gifr.type=NAS_MSG_RB_RELEASE_REQUEST;
memset (g_enb_ral_obj[instanceP].buffer,0,800);
gifr.msg= &(g_enb_ral_obj[instanceP].buffer[0]);
msgreq=(struct nas_msg_rb_release_request *)(gifr.msg);
msgrep=(struct nas_msg_rb_release_reply *)(gifr.msg);
//
if (mt_ix == RAL_MAX_MT){
currChannel = &(g_enb_ral_obj[instanceP].mcast.radio_channel);
msgreq->lcr = mt_ix;
}else{
currChannel = &(g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix]);
msgreq->lcr = g_enb_ral_obj[instanceP].mt[mt_ix].ue_id;
}
msgreq->rab_id = currChannel->rbId;
msgreq->cnxid = currChannel->cnx_id;
msgreq->mcast_flag = currChannel->multicast;
cnxid = msgreq->cnxid;
//
DEBUG(" Radio Bearer release requested\n");
err=ioctl(fd, NASRG_IOCTL_RAL, &gifr);
if (err<0){
ERR("IOCTL error, err=%d\n",err);
rc = -1;
}
// check answer from NAS
msgrep->cnxid = cnxid; // Temp - hardcoded
if ((msgrep->status<0)||(msgrep->cnxid!=cnxid)||(err<0)){
ERR(" Radio bearer release failure: status %d\n", msgrep->status);
rc = -1;
g_enb_ral_obj[instanceP].pending_req_status = MIH_C_STATUS_REJECTED;
}else{
g_enb_ral_obj[instanceP].pending_req_status = MIH_C_STATUS_SUCCESS;
}
if (g_enb_ral_obj[instanceP].pending_mt_flag){
reason_code = MIH_C_LINK_DOWN_REASON_EXPLICIT_DISCONNECT;
if (mt_ix == RAL_MAX_MT)
ltid = &g_enb_ral_obj[instanceP].mcast.ltid;
else
ltid = &g_enb_ral_obj[instanceP].mt[mt_ix].ltid;
eRALlte_send_link_down_indication(&g_enb_ral_obj[instanceP].pending_req_transaction_id, ltid, NULL, &reason_code);
// aRALu_send_link_res_deactivate_cnf();
}
// mark resource as free again anyway
if (mt_ix == RAL_MAX_MT)
eRALlte_process_clean_channel(&(g_enb_ral_obj[instanceP].mcast.radio_channel));
else
eRALlte_process_clean_channel(&(g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix]));
DEBUG("Channel released : UE %d, channel %d, cnx_id %d \n\n",mt_ix, ch_ix, cnxid);
}
break;
case IO_CMD_LIST:
{
// printf("Usage: gioctl rb list <lcr>\n");
uint8_t *msgrep;
uint8_t rbi, i;
uint8_t num_rbs;
struct nas_msg_rb_list_reply *list;
struct nas_msg_rb_list_request *msgreq;
gifr.type=NAS_MSG_RB_LIST_REQUEST;
memset (g_enb_ral_obj[instanceP].buffer,0,800);
gifr.msg= &(g_enb_ral_obj[instanceP].buffer[0]);
msgreq=(struct nas_msg_rb_list_request *)(gifr.msg);
msgrep=(uint8_t *)(gifr.msg);
if (mt_ix < RAL_MAX_MT){
msgreq->lcr = g_enb_ral_obj[instanceP].mt[mt_ix].ue_id;
}else{
msgreq->lcr = 0;
mt_ix =0; //Temp
}
//
DEBUG(" Radio bearer list requested\n");
err=ioctl(fd, NASRG_IOCTL_RAL, &gifr);
if (err<0){
ERR("IOCTL error, err=%d\n",err);
rc = -1;
}
num_rbs = msgrep[0];
//RAL_print_buffer (msgrep, 50);
DEBUG("number of radio bearers %d \n", num_rbs);
DEBUG("rab_id\tcnxid\tSapi\t\tQoS\t\tState\n");
list=(struct nas_msg_rb_list_reply *)(msgrep+1);
for(rbi=0; rbi<num_rbs; ++rbi){
DEBUG("%u\t%u\t%u\t\t%u\t\t", list[rbi].rab_id,list[rbi].cnxid, list[rbi].sapi, list[rbi].qos);
print_state(list[rbi].state);
rc = 0;
// store channel status
for (i=0;i<num_rbs; i++){
if (g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[i].cnx_id == list[rbi].cnxid){
g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[i].nas_state = list[rbi].state;
if (list[rbi].state == NAS_CX_DCH)
g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[i].status = RB_CONNECTED;
}
}
if ((mt_ix==0)&&(i==num_rbs)){
if (g_enb_ral_obj[instanceP].mcast.radio_channel.cnx_id == list[rbi].cnxid){
g_enb_ral_obj[instanceP].mcast.radio_channel.nas_state = list[rbi].state;
if (list[rbi].state == NAS_CX_DCH){
g_enb_ral_obj[instanceP].mcast.radio_channel.status = RB_CONNECTED;
g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[1].status = RB_CONNECTED;
}
}
}
}
DEBUG("List complete \n");
}
break;
default:
ERR ("RAL_process_NAS_message : invalid ioctl command %d\n",ioctl_cmd);
rc= -1;
} //end switch ioctl_cmd
break;
case IO_OBJ_MEAS:
switch (ioctl_cmd){
case IO_CMD_ADD:
{
struct nas_msg_enb_measure_trigger *msgreq;
struct nas_msg_enb_measure_trigger_reply *msgrep;
//
gifr.type=NAS_MSG_ENB_MEAS_TRIGGER;
memset (g_enb_ral_obj[instanceP].buffer,0,800);
gifr.msg= &(g_enb_ral_obj[instanceP].buffer[0]);
msgreq=(struct nas_msg_enb_measure_trigger *)(gifr.msg);
msgrep=(struct nas_msg_enb_measure_trigger_reply *)(gifr.msg);
//
msgreq->cell_id = g_enb_ral_obj[instanceP].cell_id;
//
DEBUG("eNB measures triggered, cell_id %d\n", msgreq->cell_id);
err=ioctl(fd, NASRG_IOCTL_RAL, &gifr);
if (err<0){
ERR("IOCTL error, err=%d\n",err);
rc = -1;
}
// check answer from NAS
if (msgrep->status != 0){
ERR(" eNB measures trigger failure: %d\n",msgrep->status);
rc = -1;
}else{
DEBUG(" eNB measures triggered successfully \n");
rc = 0;
}
}
break;
case IO_CMD_LIST:
{
struct nas_msg_enb_measure_retrieve *msgrep;
int ix;
//
gifr.type=NAS_MSG_ENB_MEAS_RETRIEVE;
memset (g_enb_ral_obj[instanceP].buffer,0,800);
gifr.msg= &(g_enb_ral_obj[instanceP].buffer[0]);
msgrep=(struct nas_msg_enb_measure_retrieve *)(gifr.msg);
//
DEBUG("Retrieving measure from NAS\n");
err=ioctl(fd, NASRG_IOCTL_RAL, &gifr);
if (err<0){
ERR("IOCTL error, err=%d\n",err);
rc = -1;
}
// Store the values received
g_enb_ral_obj[instanceP].num_UEs = msgrep->num_UEs;
for (ix=0; ix<g_enb_ral_obj[instanceP].num_UEs; ix++){
g_enb_ral_obj[instanceP].rlcBufferOccupancy[ix] = msgrep->measures[ix].rlcBufferOccupancy;
g_enb_ral_obj[instanceP].scheduledPRB[ix] = msgrep->measures[ix].scheduledPRB;
g_enb_ral_obj[instanceP].totalDataVolume[ix] = msgrep->measures[ix].totalDataVolume;
}
g_enb_ral_obj[instanceP].totalNumPRBs = msgrep->totalNumPRBs;
#ifdef DEBUG_RAL_DETAILS
DEBUG("Measures received- cell %d, Number of UEs %d, Total number of PRBs %d\n", msgrep->cell_id, msgrep->num_UEs, msgrep->totalNumPRBs);
for (ix=0; ix<g_enb_ral_obj[instanceP].num_UEs; ix++)
DEBUG("UE%d : RLC Buffers %d, scheduledPRB %d, totalDataVolume %d\n", ix, msgrep->measures[ix].rlcBufferOccupancy,
msgrep->measures[ix].scheduledPRB, msgrep->measures[ix].totalDataVolume);
#endif
RAL_NAS_measures_analyze();
}
break;
default:
ERR ("RAL_process_NAS_message : invalid ioctl command %d\n",ioctl_cmd);
rc= -1;
} //end switch ioctl_cmd
break;
case IO_OBJ_MC:
switch (ioctl_cmd){
case IO_CMD_ADD:
{
struct nas_msg_mt_mcast_join *msgreq;
struct nas_msg_mt_mcast_reply *msgrep;
struct ral_lte_channel *currChannel;
//
gifr.type=NAS_RG_MSG_MT_MCAST_JOIN;
memset (g_enb_ral_obj[instanceP].buffer,0,800);
gifr.msg= &(g_enb_ral_obj[instanceP].buffer[0]);
msgreq=(struct nas_msg_mt_mcast_join *)(gifr.msg);
msgrep=(struct nas_msg_mt_mcast_reply *)(gifr.msg);
//
currChannel = &(g_enb_ral_obj[instanceP].mcast.radio_channel);
msgreq->ue_id = mt_ix;
msgreq->rab_id = currChannel->rbId;
msgreq->cnxid = currChannel->cnx_id;
//
DEBUG("UE multicast join notification requested, ue_id %d\n", mt_ix);
err=ioctl(fd, NASRG_IOCTL_RAL, &gifr);
if (err<0){
ERR("IOCTL error, err=%d\n",err);
rc = -1;
}
// check answer from NAS
if ((msgrep->result<0)||(msgrep->ue_id!=mt_ix)||(err<0)){
ERR(" UE multicast join notification failure: %d\n",msgrep->result);
g_enb_ral_obj[instanceP].pending_req_status = MIH_C_STATUS_REJECTED;
rc = -1;
}else{
DEBUG(" ++ UE multicast join notification transmitted to MT \n");
g_enb_ral_obj[instanceP].pending_req_status = MIH_C_STATUS_SUCCESS;
rc = 0;
}
// TODO aRALu_send_link_mc_join_cnf();
}
break;
case IO_CMD_DEL:
{
struct nas_msg_mt_mcast_leave *msgreq;
struct nas_msg_mt_mcast_reply *msgrep;
struct ral_lte_channel *currChannel;
//
gifr.type=NAS_RG_MSG_MT_MCAST_LEAVE;
memset (g_enb_ral_obj[instanceP].buffer,0,800);
gifr.msg= &(g_enb_ral_obj[instanceP].buffer[0]);
msgreq=(struct nas_msg_mt_mcast_leave *)(gifr.msg);
msgrep=(struct nas_msg_mt_mcast_reply *)(gifr.msg);
//
currChannel = &(g_enb_ral_obj[instanceP].mcast.radio_channel);
msgreq->ue_id = mt_ix;
msgreq->rab_id = currChannel->rbId;
msgreq->cnxid = currChannel->cnx_id;
//
DEBUG("UE multicast leave notification requested, ue_id %d\n", mt_ix);
err=ioctl(fd, NASRG_IOCTL_RAL, &gifr);
if (err<0){
ERR("IOCTL error, err=%d\n",err);
rc = -1;
}
// check answer from NAS
if ((msgrep->result<0)||(msgrep->ue_id!=mt_ix)||(err<0)){
ERR(" UE multicast leave notification failure: %d\n",msgrep->result);
g_enb_ral_obj[instanceP].pending_req_status = MIH_C_STATUS_REJECTED;
rc = -1;
}else{
DEBUG(" ++ UE multicast leave notification transmitted to MT \n" );
g_enb_ral_obj[instanceP].pending_req_status = MIH_C_STATUS_SUCCESS;
rc = 0;
}
// TODO aRALu_send_link_mc_leave_cnf();
}
break;
default:
ERR ("RAL_process_NAS_message : invalid ioctl command %d\n",ioctl_cmd);
rc= -1;
} //end switch ioctl_cmd
break;
default:
ERR ("RAL_process_NAS_message : invalid ioctl object %d\n",ioctl_obj);
rc= -1;
} //end switch ioctl_obj
//rc=0;
return rc;
}
*/
@@ -1,340 +0,0 @@
/*****************************************************************************
* Eurecom OpenAirInterface 3
* Copyright(c) 2012 Eurecom
*
* Source lteRALenb_main.c
* Version 0.1
* Date 01/17/2014
* Product MIH RAL LTE
* Subsystem RAL main process running at the network side
* Authors Michelle Wetterwald, Lionel Gauthier, Frederic Maurel
* Description Implements the Radio Access Link process that interface the
* Media Independent Handover (MIH) Function to the LTE specific
* L2 media-dependent access layer.
*
* The MIH Function provides network information to upper layers
* and requests actions from lower layers to optimize handovers
* between heterogeneous networks.
*****************************************************************************/
#define LTE_RAL_ENB
#define LTE_RAL_ENB_MAIN_C
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <sys/epoll.h>
#include <sys/select.h>
#include <net/if.h>
#include <getopt.h>
#include <stdlib.h>
#include <time.h>
//-----------------------------------------------------------------------------
#include "assertions.h"
#include "lteRALenb.h"
#include "intertask_interface.h"
#include "OCG.h"
//-----------------------------------------------------------------------------
/****************************************************************************/
/******************* G L O B A L D E F I N I T I O N S *****************/
/****************************************************************************/
extern OAI_Emulation oai_emulation;
/****************************************************************************/
/******************* L O C A L D E F I N I T I O N S *******************/
/****************************************************************************/
/****************************************************************************
** Name: get_IPv6_addr() **
** Description: Gets the IPv6 address of the specified network interface. **
** Inputs: if_name Interface name **
***************************************************************************/
void eRAL_get_IPv6_addr(const char* if_name)
{
//-----------------------------------------------------------------------------
#define IPV6_ADDR_LINKLOCAL 0x0020U
FILE *f;
char devname[20];
int plen, scope, dad_status, if_idx;
char addr6p[8][5];
int found = 0;
char my_addr[16];
char temp_addr[32];
int i, j;
LOG_D(RAL_ENB, " %s : network interface %s\n", __FUNCTION__, if_name);
if ((f = fopen("/proc/net/if_inet6", "r")) != NULL) {
while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n",
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
addr6p[4], addr6p[5], addr6p[6], addr6p[7],
&if_idx, &plen, &scope, &dad_status, devname) != EOF) {
if (!strcmp(devname, if_name)) {
found = 1;
// retrieve numerical value
if ((scope == 0) || (scope == IPV6_ADDR_LINKLOCAL)) {
LOG_D(RAL_ENB, " adresse %s:%s:%s:%s:%s:%s:%s:%s",
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
LOG_D(RAL_ENB, " Scope:");
switch (scope) {
case 0:
LOG_D(RAL_ENB, " Global\n");
break;
case IPV6_ADDR_LINKLOCAL:
LOG_D(RAL_ENB, " Link\n");
break;
default:
LOG_D(RAL_ENB, " Unknown\n");
break;
}
LOG_D(RAL_ENB, " Numerical value: ");
for (i = 0; i < 8; i++) {
for (j = 0; j < 4; j++) {
addr6p[i][j]= toupper(addr6p[i][j]);
if ((addr6p[i][j] >= 'A') && (addr6p[i][j] <= 'F')) {
temp_addr[(4*i)+j] =(unsigned short int)(addr6p[i][j]-'A')+10;
} else if ((addr6p[i][j] >= '0') && (addr6p[i][j] <= '9')) {
temp_addr[(4*i)+j] =(unsigned short int)(addr6p[i][j]-'0');
}
}
my_addr[2*i] = (16*temp_addr[(4*i)])+temp_addr[(4*i)+1];
my_addr[(2*i)+1] = (16*temp_addr[(4*i)+2])+temp_addr[(4*i)+3];
}
for (i = 0; i < 16; i++) {
LOG_D(RAL_ENB, "-%hhx-",my_addr[i]);
}
LOG_D(RAL_ENB, "\n");
}
}
}
fclose(f);
if (!found) {
LOG_E(RAL_ENB, " %s : interface %s not found\n\n", __FUNCTION__, if_name);
}
}
}
void eRAL_init_default_values(void)
{
g_conf_enb_ral_listening_port = ENB_DEFAULT_LOCAL_PORT_RAL;
g_conf_enb_ral_ip_address = ENB_DEFAULT_IP_ADDRESS_RAL;
g_conf_enb_ral_link_id = ENB_DEFAULT_LINK_ID_RAL;
g_conf_enb_ral_link_address = ENB_DEFAULT_LINK_ADDRESS_RAL;
g_conf_enb_mihf_remote_port = ENB_DEFAULT_REMOTE_PORT_MIHF;
g_conf_enb_mihf_ip_address = ENB_DEFAULT_IP_ADDRESS_MIHF;
g_conf_enb_mihf_id = ENB_DEFAULT_MIHF_ID;
}
/****************************************************************************
** Name: eRAL_initialize() **
** **
** Description: Performs overall RAL LTE initialisations: **
** **
** Inputs: None **
** **
***************************************************************************/
int eRAL_initialize(void)
{
//-----------------------------------------------------------------------------
ral_enb_instance_t instance = 0;
unsigned int mod_id = 0;
char *char_tmp = NULL;
MIH_C_init();
srand(time(NULL));
memset(g_enb_ral_obj, 0, sizeof(lte_ral_enb_object_t)*MAX_MODULES);
g_enb_ral_fd2instance = hashtable_create (32, NULL, hash_free_int_func);
for (mod_id = 0; mod_id < oai_emulation.info.nb_enb_local; mod_id++) {
char_tmp = calloc(1, strlen(g_conf_enb_ral_listening_port) + 3); // 2 digits + \0 ->99 instances
instance = mod_id;
sprintf(char_tmp,"%d", atoi(g_conf_enb_ral_listening_port) + mod_id);
g_enb_ral_obj[mod_id].ral_listening_port = char_tmp;
g_enb_ral_obj[mod_id].ral_ip_address = strdup(g_conf_enb_ral_ip_address);
g_enb_ral_obj[mod_id].ral_link_address = strdup(g_conf_enb_ral_link_address);
char_tmp = calloc(1, strlen(g_conf_enb_mihf_remote_port) + 3); // 2 digits + \0 ->99 instances
sprintf(char_tmp, "%d", atoi(g_conf_enb_mihf_remote_port) + instance);
g_enb_ral_obj[mod_id].mihf_remote_port = char_tmp;
g_enb_ral_obj[mod_id].mihf_ip_address = strdup(g_conf_enb_mihf_ip_address);
char_tmp = calloc(1, strlen(g_conf_enb_mihf_id) + 3); // 2 digits + \0 ->99 instances
sprintf(char_tmp, "%s%02d",g_conf_enb_mihf_id, instance);
g_enb_ral_obj[mod_id].mihf_id = char_tmp;
char_tmp = calloc(1, strlen(g_conf_enb_ral_link_id) + 3); // 2 digits + \0 ->99 instances
sprintf(char_tmp, "%s%02d",g_conf_enb_ral_link_id, mod_id);
g_enb_ral_obj[mod_id].link_id = char_tmp;
char_tmp = NULL;
// excluded MIH_C_LINK_AC_TYPE_NONE
// excluded MIH_C_LINK_AC_TYPE_LINK_DISCONNECT
// excluded MIH_C_LINK_AC_TYPE_LINK_LOW_POWER
// excluded MIH_C_LINK_AC_TYPE_LINK_POWER_DOWN
// excluded MIH_C_LINK_AC_TYPE_LINK_POWER_UP
g_enb_ral_obj[mod_id].mih_supported_link_action_list = (1 << MIH_C_LINK_AC_TYPE_LINK_FLOW_ATTR) |
(1 << MIH_C_LINK_AC_TYPE_LINK_ACTIVATE_RESOURCES) |
(1 << MIH_C_LINK_AC_TYPE_LINK_DEACTIVATE_RESOURCES)|
(1 << MIH_C_LINK_AC_TYPE_LINK_POWER_UP)|
(1 << MIH_C_LINK_AC_TYPE_LINK_DISCONNECT)|
(1 << MIH_C_LINK_AC_TYPE_LINK_POWER_DOWN);
// excluded MIH_C_BIT_LINK_DETECTED
// excluded MIH_C_BIT_LINK_GOING_DOWN
// excluded MIH_C_BIT_LINK_HANDOVER_IMMINENT
// excluded MIH_C_BIT_LINK_HANDOVER_COMPLETE
// excluded MIH_C_BIT_LINK_PDU_TRANSMIT_STATUS
g_enb_ral_obj[mod_id].mih_supported_link_event_list = MIH_C_BIT_LINK_UP | MIH_C_BIT_LINK_DOWN | MIH_C_BIT_LINK_PARAMETERS_REPORT;
// excluded MIH_C_BIT_LINK_GET_PARAMETERS
// excluded MIH_C_BIT_LINK_CONFIGURE_THRESHOLDS
g_enb_ral_obj[mod_id].mih_supported_link_command_list = MIH_C_BIT_LINK_EVENT_SUBSCRIBE | MIH_C_BIT_LINK_CONFIGURE_THRESHOLDS | MIH_C_BIT_LINK_ACTION |
MIH_C_BIT_LINK_EVENT_UNSUBSCRIBE |
MIH_C_BIT_LINK_ACTION;
g_enb_ral_obj[mod_id].link_mihcap_flag = MIH_C_BIT_EVENT_SERVICE_SUPPORTED | MIH_C_BIT_COMMAND_SERVICE_SUPPORTED | MIH_C_BIT_INFORMATION_SERVICE_SUPPORTED;
g_enb_ral_obj[mod_id].net_caps = MIH_C_BIT_NET_CAPS_QOS_CLASS5 | MIH_C_BIT_NET_CAPS_INTERNET_ACCESS | MIH_C_BIT_NET_CAPS_MIH_CAPABILITY;
g_enb_ral_obj[mod_id].transaction_id = (MIH_C_TRANSACTION_ID_T)rand();
g_enb_ral_obj[mod_id].ue_htbl = hashtable_create(32, NULL, NULL);
LOG_D(RAL_ENB, " Connect to the MIH-F for module id instance %d...\n", mod_id, instance);
g_enb_ral_obj[mod_id].mih_sock_desc = -1;
AssertFatal(eRAL_mihf_connect(instance) >= 0, " %s : Could not connect to MIH-F...\n", __FUNCTION__);
itti_subscribe_event_fd(TASK_RAL_ENB, g_enb_ral_obj[mod_id].mih_sock_desc);
hashtable_insert(g_enb_ral_fd2instance, g_enb_ral_obj[mod_id].mih_sock_desc, (void*)instance);
eRAL_send_link_register_indication(instance, &g_enb_ral_obj[mod_id].transaction_id);
g_enb_ral_obj[mod_id].transaction_id += 1;
}
return 0;
}
void eRAL_process_file_descriptors(struct epoll_event *events, int nb_events)
{
int i;
ral_enb_instance_t instance;
hashtable_rc_t rc;
if (events == NULL) {
return;
}
for (i = 0; i < nb_events; i++) {
rc = hashtable_get(g_enb_ral_fd2instance, events[i].data.fd, (void**)&instance);
if (rc == HASH_TABLE_OK) {
eRAL_mih_link_process_message(instance);
}
}
}
void* eRAL_task(void *args_p)
{
int nb_events;
struct epoll_event *events;
MessageDef *msg_p = NULL;
const char *msg_name = NULL;
instance_t instance = 0;
eRAL_initialize();
itti_mark_task_ready (TASK_RAL_ENB);
while(1) {
// Wait for a message
itti_receive_msg (TASK_RAL_ENB, &msg_p);
if (msg_p != NULL) {
msg_name = ITTI_MSG_NAME (msg_p);
instance = ITTI_MSG_INSTANCE (msg_p);
switch (ITTI_MSG_ID(msg_p)) {
case TERMINATE_MESSAGE:
// TO DO
itti_exit_task ();
break;
case TIMER_HAS_EXPIRED:
LOG_D(RAL_ENB, "Received %s\n", msg_name);
break;
case RRC_RAL_SYSTEM_CONFIGURATION_IND:
LOG_D(RAL_ENB, "Received %s\n", msg_name);
eRAL_rx_rrc_ral_system_configuration_indication(instance, msg_p);
break;
case RRC_RAL_CONNECTION_ESTABLISHMENT_IND:
LOG_D(RAL_ENB, "Received %s\n", msg_name);
eRAL_rx_rrc_ral_connection_establishment_indication(instance, msg_p);
break;
case RRC_RAL_CONNECTION_REESTABLISHMENT_IND:
LOG_D(RAL_ENB, "Received %s\n", msg_name);
eRAL_rx_rrc_ral_connection_reestablishment_indication(instance, msg_p);
break;
case RRC_RAL_CONNECTION_RECONFIGURATION_IND:
LOG_D(RAL_ENB, "Received %s\n", msg_name);
eRAL_rx_rrc_ral_connection_reconfiguration_indication(instance, msg_p);
break;
case RRC_RAL_MEASUREMENT_REPORT_IND:
LOG_D(RAL_ENB, "Received %s\n", msg_name);
eRAL_rx_rrc_ral_measurement_report_indication(instance, msg_p);
break;
case RRC_RAL_CONNECTION_RELEASE_IND:
LOG_D(RAL_ENB, "Received %s\n", msg_name);
eRAL_rx_rrc_ral_connection_release_indication(instance, msg_p);
break;
case RRC_RAL_CONFIGURE_THRESHOLD_CONF:
LOG_D(RAL_ENB, "Received %s\n", msg_name);
eRAL_rx_rrc_ral_configure_threshold_conf(instance, msg_p);
break;
default:
LOG_E(RAL_ENB, "Received unexpected message %s\n", msg_name);
break;
}
itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
msg_p = NULL;
}
nb_events = itti_get_events(TASK_RAL_ENB, &events);
/* Now handle notifications for other sockets */
if (nb_events > 0) {
eRAL_process_file_descriptors(events, nb_events);
}
}
}
File diff suppressed because it is too large Load Diff
@@ -1,182 +0,0 @@
/*****************************************************************************
* Eurecom OpenAirInterface 3
* Copyright(c) 2012 Eurecom
*
* Source eRAL_parameters.c
*
* Version 0.1
*
* Date 07/03/2012
*
* Product MIH RAL LTE
*
* Subsystem
*
* Authors Michelle Wetterwald, Lionel Gauthier, Frederic Maurel
*
* Description
*
*****************************************************************************/
#define LTE_RAL_ENB
#define LTE_RAL_ENB_PARAMETERS_C
#include "lteRALenb.h"
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: eRAL_get_parameters_request() **
** **
** Description: Processes the Link_Get_Parameters.request message and **
** sends a LinK_Get_Parameters.confirm message to the MIHF. **
** **
** Inputs: msgP: Pointer to the received message **
** Others: None **
** **
** Outputs: None **
** Return: None **
** Others: None **
** **
***************************************************************************/
void eRAL_get_parameters_request(ral_enb_instance_t instanceP, MIH_C_Message_Link_Get_Parameters_request_t* messageP)
{
MIH_C_STATUS_T status;
MIH_C_LINK_PARAM_LIST_T link_parameters_status_list;
MIH_C_LINK_STATES_RSP_LIST_T link_states_response_list;
MIH_C_LINK_DESC_RSP_LIST_T link_descriptors_response_list;
unsigned int link_index;
// SAVE REQUEST
// MAY BE MERGE REQUESTS ?
//memcpy(&g_link_cfg_param_thresholds_list, &messageP->primitive.LinkConfigureParameterList_list, sizeof(MIH_C_LINK_CFG_PARAM_LIST_T));
status = MIH_C_STATUS_SUCCESS;
for (link_index = 0;
link_index < messageP->primitive.LinkParametersRequest_list.length;
link_index++) {
//------------------------------------------------
// MIH_C_LINK_PARAM_LIST_T
//------------------------------------------------
memcpy(&link_parameters_status_list.val[link_index].link_param_type,
&messageP->primitive.LinkParametersRequest_list.val[link_index],
sizeof(MIH_C_LINK_PARAM_TYPE_T));
switch (messageP->primitive.LinkParametersRequest_list.val[link_index].choice) {
case MIH_C_LINK_PARAM_TYPE_CHOICE_GEN:
/*#define MIH_C_LINK_PARAM_GEN_DATA_RATE (MIH_C_LINK_PARAM_GEN_T)0
#define MIH_C_LINK_PARAM_GEN_SIGNAL_STRENGTH (MIH_C_LINK_PARAM_GEN_T)1
#define MIH_C_LINK_PARAM_GEN_SINR (MIH_C_LINK_PARAM_GEN_T)2
#define MIH_C_LINK_PARAM_GEN_THROUGHPUT (MIH_C_LINK_PARAM_GEN_T)3
#define MIH_C_LINK_PARAM_GEN_PACKET_ERROR_RATE (MIH_C_LINK_PARAM_GEN_T)4*/
link_parameters_status_list.val[link_index].choice = MIH_C_LINK_PARAM_CHOICE_LINK_PARAM_VAL;
link_parameters_status_list.val[link_index]._union.link_param_val = MIH_C_LINK_PARAM_GEN_SIGNAL_STRENGTH;
break;
case MIH_C_LINK_PARAM_TYPE_CHOICE_QOS:
/*
* \brief A type to represent QOS_LIST parameters.
* 0: Maximum number of differentiable classes of service supported.
* 1: Minimum packet transfer delay for all CoS, the minimum delay over a class
* population of interest.
* 2: Average packet transfer delay for all CoS, the arithmetic mean of the delay
* over a class population of interest. (See B.3.4)
* 3: Maximum packet transfer delay for all CoS, the maximum delay over a class
* population of interest.
* 4: Packet transfer delay jitter for all CoS, the standard deviation of the delay
* over a class population of interest. (See B.3.5.)
* 5: Packet loss rate for all CoS, the ratio between the number of frames that are
* transmitted but not received and the total number of frames transmitted over
* a class population of interest. (See B.3.2.)
* 6–255: (Reserved)
*/
link_parameters_status_list.val[link_index].choice = MIH_C_LINK_PARAM_CHOICE_QOS_PARAM_VAL;
link_parameters_status_list.val[link_index]._union.qos_param_val.choice = MIH_C_QOS_PARAM_VAL_CHOICE_AVG_PK_TX_DELAY;
link_parameters_status_list.val[link_index]._union.qos_param_val._union.avg_pk_tx_delay_list.length = 2; //??
link_parameters_status_list.val[link_index]._union.qos_param_val._union.avg_pk_tx_delay_list.val[0].cos_id = 2; //??
link_parameters_status_list.val[link_index]._union.qos_param_val._union.avg_pk_tx_delay_list.val[0].value = 20; //??
link_parameters_status_list.val[link_index]._union.qos_param_val._union.avg_pk_tx_delay_list.val[1].cos_id = 3; //??
link_parameters_status_list.val[link_index]._union.qos_param_val._union.avg_pk_tx_delay_list.val[2].value = 50; //??
break;
case MIH_C_LINK_PARAM_TYPE_CHOICE_LTE:
/*
#define MIH_C_LINK_PARAM_LTE_UE_RSRP 0
#define MIH_C_LINK_PARAM_LTE_UE_RSRQ 1
#define MIH_C_LINK_PARAM_LTE_UE_CQI 2
#define MIH_C_LINK_PARAM_LTE_AVAILABLE_BW 3
#define MIH_C_LINK_PARAM_LTE_PACKET_DELAY 4
#define MIH_C_LINK_PARAM_LTE_PACKET_LOSS_RATE 5
#define MIH_C_LINK_PARAM_LTE_L2_BUFFER_STATUS 6
#define MIH_C_LINK_PARAM_LTE_MOBILE_NODE_CAPABILITIES 7
#define MIH_C_LINK_PARAM_LTE_EMBMS_CAPABILITY 8
#define MIH_C_LINK_PARAM_LTE_JUMBO_FEASIBILITY 9
#define MIH_C_LINK_PARAM_LTE_JUMBO_SETUP_STATUS 10
#define MIH_C_LINK_PARAM_LTE_NUM_ACTIVE_EMBMS_RECEIVERS_PER_FLOW 11
*/
case MIH_C_LINK_PARAM_TYPE_CHOICE_GG:
case MIH_C_LINK_PARAM_TYPE_CHOICE_EDGE:
case MIH_C_LINK_PARAM_TYPE_CHOICE_ETH:
case MIH_C_LINK_PARAM_TYPE_CHOICE_802_11:
case MIH_C_LINK_PARAM_TYPE_CHOICE_C2K:
case MIH_C_LINK_PARAM_TYPE_CHOICE_FDD:
case MIH_C_LINK_PARAM_TYPE_CHOICE_HRPD:
case MIH_C_LINK_PARAM_TYPE_CHOICE_802_16:
case MIH_C_LINK_PARAM_TYPE_CHOICE_802_20:
case MIH_C_LINK_PARAM_TYPE_CHOICE_802_22:
default:
LOG_E(RAL_ENB, "%s TO DO CONTINUE PROCESSING LinkParametersRequest_list of \n", __FUNCTION__);
}
//------------------------------------------------
// MIH_C_LINK_STATES_RSP_LIST_T
//------------------------------------------------
if (messageP->primitive.LinkStatesRequest & MIH_C_BIT_LINK_STATES_REQ_OP_MODE) {
link_states_response_list.val[link_index].choice = 0;
link_states_response_list.val[link_index]._union.op_mode = MIH_C_OPMODE_NORMAL_MODE;
} else if (messageP->primitive.LinkStatesRequest & MIH_C_BIT_LINK_STATES_REQ_CHANNEL_ID) {
link_states_response_list.val[link_index].choice = 1;
link_states_response_list.val[link_index]._union.channel_id = PREDEFINED_CHANNEL_ID;
} else {
LOG_E(RAL_ENB, "%s Invalid LinkStatesRequest in MIH_C_Link_Get_Parameters_request\n", __FUNCTION__);
// DEFAULT VALUES
link_states_response_list.val[link_index].choice = 0;
link_states_response_list.val[link_index]._union.op_mode = MIH_C_OPMODE_NORMAL_MODE;
}
//------------------------------------------------
// MIH_C_LINK_DESC_RSP_LIST_T
//------------------------------------------------
if (messageP->primitive.LinkDescriptorsRequest & MIH_C_BIT_NUMBER_OF_CLASSES_OF_SERVICE_SUPPORTED) {
link_descriptors_response_list.val[link_index].choice = 0;
link_descriptors_response_list.val[link_index]._union.num_cos = PREDEFINED_CLASSES_SERVICE_SUPPORTED;
} else if (messageP->primitive.LinkDescriptorsRequest & MIH_C_BIT_NUMBER_OF_QUEUES_SUPPORTED) {
link_descriptors_response_list.val[link_index].choice = 1;
link_descriptors_response_list.val[link_index]._union.num_queue = PREDEFINED_QUEUES_SUPPORTED;
} else {
LOG_E(RAL_ENB, "%s Invalid LinkDescriptorsRequest in MIH_C_Link_Get_Parameters_request\n", __FUNCTION__);
// DEFAULT VALUES
link_descriptors_response_list.val[link_index].choice = 0;
link_descriptors_response_list.val[link_index]._union.num_cos = PREDEFINED_CLASSES_SERVICE_SUPPORTED;
}
}
link_parameters_status_list.length = messageP->primitive.LinkParametersRequest_list.length;
link_states_response_list.length = messageP->primitive.LinkParametersRequest_list.length;
link_descriptors_response_list.length = messageP->primitive.LinkParametersRequest_list.length;
/* Get parameters link command is not supported at the network side */
LOG_D(RAL_ENB, " Get Parameters request is not supported by the network\n");
eRAL_send_get_parameters_confirm(instanceP, &messageP->header.transaction_id,
&status, NULL, NULL, NULL);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
@@ -1,670 +0,0 @@
/*****************************************************************************
* Eurecom OpenAirInterface 3
* Copyright(c) 2012 Eurecom
*
* Source eRAL_process.c
*
* Version 0.1
*
* Date 07/10/2012
*
* Product MIH RAL LTE
*
* Subsystem
*
* Authors Michelle Wetterwald, Lionel Gauthier, Frederic Maurel
*
* Description
*
*****************************************************************************/
#define LTE_RAL_ENB
#define LTE_RAL_ENB_PROCESS_C
#include "lteRALenb.h"
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: eRAL_process_find_channel() **
** **
** Description: Returns the Mobile Terminal index and the Radio Bearer **
** channel index for the specified Connection identifier. **
** **
** Inputs: cnxid: Connection identifier **
** Others: ralpriv **
** **
** Outputs: mt_ix: Mobile Terminal index **
** ch_ix: Radio Bearer channel index **
** Return: 0 if no MT and RB channel indexes exist **
** for the specified Connection identifier. **
** 1 otherwise. **
** Others: None **
** **
***************************************************************************/
int eRAL_process_find_channel(ral_enb_instance_t instanceP, unsigned int cnxid, int* mt_ix, int* ch_ix)
{
int mt, ch;
int found = 0;
LOG_D(RAL_ENB, " %s : cnxid = %d\n", __FUNCTION__, cnxid);
for (mt = 0; !found && (mt < RAL_MAX_MT); mt++) {
for (ch = 0; ch < RAL_MAX_RB; ch++) {
if (g_enb_ral_obj[instanceP].mt[mt].radio_channel[ch].cnx_id == cnxid) {
found = 1;
*mt_ix = mt;
*ch_ix = ch;
break;
}
}
}
if (!found) {
*mt_ix = RAL_MAX_MT;
*ch_ix = 0;
}
LOG_D(RAL_ENB, " %s : return %d (mt=%d, ch=%d)\n" , __FUNCTION__, found, *mt_ix, *ch_ix);
return found;
}
/****************************************************************************
** **
** Name: eRAL_process_find_new_channel() **
** **
** Description: Returns the index of the first available Radio Bearer **
** channel for the specified Mobile Terminal identifier. **
** **
** Inputs: mt_ix: Mobile Terminal index **
** Others: ralpriv **
** **
** Outputs: None **
** Return: The index of the first available RB chan- **
** nel; RAL_MAX_RB if no any RB channel is **
** available. **
** Others: None **
** **
***************************************************************************/
int eRAL_process_find_new_channel(ral_enb_instance_t instanceP, int mt_ix)
{
int ch_ix;
LOG_D(RAL_ENB, " %s : mt_ix = %d\n", __FUNCTION__, mt_ix);
for (ch_ix = 0; ch_ix < RAL_MAX_RB; ch_ix++) {
if (g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix].cnx_id == 0) {
break;
}
}
LOG_D(RAL_ENB, " %s : return %d\n" , __FUNCTION__, ch_ix);
return ch_ix;
}
/****************************************************************************
** **
** Name: eRAL_process_clean_channel() **
** **
** Description: Cleans data of the specified Radio Bearer channel. **
** **
** Inputs: None **
** Others: None **
** **
** Outputs: channel: Channel data to clean **
** Return: None **
** Others: None **
** **
***************************************************************************/
void eRAL_process_clean_channel(struct ral_lte_channel* channel)
{
LOG_D(RAL_ENB, " %s : cnx_id = %d, rbId = %d\n", __FUNCTION__,
channel->cnx_id, channel->rbId);
memset(channel, 0, sizeof (struct ral_lte_channel));
}
/****************************************************************************
** **
** Name: eRAL_process_mt_addr_to_string() **
** **
** Description: Display the specified IPv6 address. **
** **
** Inputs: ip_addr: The IP address **
** Others: None **
** **
** Outputs: None **
** Return: Pointer to the string buffer. **
** Others: None **
** **
***************************************************************************/
char* eRAL_process_mt_addr_to_string(const unsigned char* ip_addr)
{
static char buffer[40];
int i, index = 0;
for (i = 0; i < 16; i++) {
index += sprintf(&buffer[index], "%.2hhX", ip_addr[i]);
if (i % 2) buffer[index++] = ':';
}
buffer[--index] = '\0';
return buffer;
}
/****************************************************************************
** **
** Name: eRAL_process_mt_addr_to_l2id() **
** **
** Description: Convert the specified IP address to Layer 2 identifier. **
** **
** Inputs: mt_addr: MT's IP address **
** Others: None **
** **
** Outputs: l2id Layer 2 identifier **
** Return: None **
** Others: None **
** **
***************************************************************************/
void eRAL_process_mt_addr_to_l2id(const unsigned char* mt_addr, unsigned int* l2id)
{
if ( !(mt_addr) || !(l2id) ) {
LOG_E(RAL_ENB, " %s : input parameter is NULL\n", __FUNCTION__);
return;
}
l2id[0] = mt_addr[0]+256 *(mt_addr[1]+256*(mt_addr[2]+256*(mt_addr[3])));
l2id[1] = mt_addr[4]+256 *(mt_addr[5]+256*(mt_addr[6]+256*(mt_addr[7])));
}
/****************************************************************************
** **
** Name: eRAL_process_cmp_mt_addr() **
** **
** Description: Compares MT's IP address to the specified L2 identifier. **
** **
** Inputs: mt_addr: MT's IP address **
** l2id Layer 2 identifier **
** Others: None **
** **
** Outputs: None **
** Return: 0 if the MT's IP address matches the L2 **
** identifier, 1 otherwise. **
** Others: None **
** **
***************************************************************************/
int eRAL_process_cmp_mt_addr(const char* mt_addr, const char* l2id)
{
int i;
for (i = 0; i < 8; i++) {
if ((uint8_t)l2id[i] != (uint8_t)mt_addr[i+8]) {
return 0;
}
}
return 1;
}
/****************************************************************************
** **
** Name: eRAL_process_find_mt_by_addr() **
** **
** Description: Returns the index of the Mobile Terminal with the **
** specified IP address. **
** **
** Inputs: mt_addr: MT's IP address **
** Others: ralpriv **
** **
** Outputs: None **
** Return: The MT's index in the list of MTs; **
** RAL_MAX_MT if not found. **
** Others: None **
** **
***************************************************************************/
int eRAL_process_find_mt_by_addr(ral_enb_instance_t instanceP, const char* mt_addr)
{
int mt_ix;
for (mt_ix = 0; mt_ix < RAL_MAX_MT; mt_ix++) {
const char* l2id = (const char*)(&g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_l2id[0]);
int i;
for (i = 0; i < 8; i++) {
if ((uint8_t)l2id[i] != (uint8_t)mt_addr[i+8]) {
break;
}
}
if (i == 8) {
break;
}
}
LOG_D(RAL_ENB, " %s : return %d\n" , __FUNCTION__, mt_ix);
return mt_ix;
}
/****************************************************************************
** **
** Name: eRAL_process_verify_pending_mt_status() **
** **
** Description: Checks the pending MT connection status and simulates RB **
** setup if it is ready for Radio Bearer establishment. **
** **
** Inputs: None **
** Others: ralpriv **
** **
** Outputs: None **
** Return: None **
** Others: None **
** **
***************************************************************************/
void eRAL_process_verify_pending_mt_status(ral_enb_instance_t instanceP)
{
int mt_ix;
if (!g_enb_ral_obj[instanceP].pending_mt_timer) {
LOG_D(RAL_ENB, " Pending MT timer expired\n");
#ifdef RAL_REALTIME
eRAL_process_clean_pending_mt(instanceP);
#endif
#ifdef RAL_DUMMY
LOG_D(RAL_ENB, " SIMULATE MT arrival\n");
mt_ix = eRAL_NAS_update_MTs_list();
LOG_D(RAL_ENB, " SIMULATE RB setup\n");
eRAL_process_waiting_RB(mt_ix);
#endif
} else {
#ifdef RAL_REALTIME
if (!( g_enb_ral_obj[instanceP].pending_mt_timer % 10)) {
/* Get the list of MTs in the driver waiting for pending
* RB establishment */
// LG RAL_process_NAS_message(IO_OBJ_CNX, IO_CMD_LIST, 0, 0);
// LG RAL_process_NAS_message(IO_OBJ_RB, IO_CMD_LIST, 0, 0);
/* Check if the pending MT is in the list */
mt_ix = eRAL_process_find_mt_by_addr(instanceP, (char*)g_enb_ral_obj[instanceP].pending_mt.ipv6_addr);
if ( (mt_ix < RAL_MAX_MT) &&
(g_enb_ral_obj[instanceP].mt[mt_ix].mt_state == RB_CONNECTED)) {
/* The pending MT is ready for RB establishment */
eRAL_process_waiting_RB(instanceP, mt_ix);
}
}
#endif
}
}
/****************************************************************************
** **
** Name: eRAL_process_map_qos() **
** **
** Description: Performs mapping of reserved bit rate to Radio QoS class, **
** and mapping of traffic class to DCSP. **
** **
** Inputs: mt_ix: Mobile Terminal index **
** ch_ix: Radio Bearer channel index **
** Others: None **
** **
** Outputs: None **
** Return: 1 if the requested reserved bit rate and **
** traffic class are supported and their **
** mapping to Radio Qos class and DSCP **
** succeed. 0 otherwise. **
** Others: ralpriv **
** **
***************************************************************************/
int eRAL_process_map_qos(ral_enb_instance_t instanceP, int mt_ix, int ch_ix)
{
int resBitrateDL = 0, resBitrateUL = 0;
struct ral_lte_channel *currChannel;
/*
* Map for multicast flow
*/
if (mt_ix == RAL_MAX_MT) {
currChannel = &(g_enb_ral_obj[instanceP].mcast.radio_channel);
/* multicast - reserved bit rate */
resBitrateDL = (int)currChannel->resBitrate[1];
if (resBitrateDL <= RAL_BITRATE_128k) {
currChannel->RadioQoSclass = 20;
} else if (resBitrateDL <= RAL_BITRATE_256k) {
currChannel->RadioQoSclass = 21;
} else if (resBitrateDL <= RAL_BITRATE_384k) {
currChannel->RadioQoSclass = 22;
} else {
LOG_E(RAL_ENB, " %s : Invalid requested resBitrate %d - Request will be rejected.\n", __FUNCTION__, resBitrateDL);
return 0;
}
/* multicast - DSCP */
if (currChannel->classId[1] < 64) {
currChannel->dscpDL = currChannel->classId[1];
} else {
LOG_E(RAL_ENB, " %s : DSCP %d > 63 - NOT SUPPORTED - Request will be rejected.\n", __FUNCTION__, currChannel->classId[1]);
return 0;
}
LOG_D(RAL_ENB, " QoS Mapping : Requested radio QoS class %d, DSCP DL %d\n",
currChannel->RadioQoSclass,
currChannel->dscpDL);
}
/*
* Map for unicast flow
*/
else {
currChannel = &(g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix]);
/* unicast - reserved bit rate - CONVERSATIONAL */
resBitrateDL = (int)currChannel->resBitrate[1];
resBitrateUL = (int)currChannel->resBitrate[0];
if ((resBitrateDL <= RAL_BITRATE_32k) &&
(resBitrateUL <= RAL_BITRATE_32k)) {
currChannel->RadioQoSclass = 1;
} else if ((resBitrateDL <= RAL_BITRATE_64k) &&
(resBitrateUL <= RAL_BITRATE_64k)) {
currChannel->RadioQoSclass = 2;
} else if ((resBitrateDL <= RAL_BITRATE_128k) &&
(resBitrateUL <= RAL_BITRATE_128k)) {
currChannel->RadioQoSclass = 3;
} else if ((resBitrateDL <= RAL_BITRATE_256k) &&
(resBitrateUL <= RAL_BITRATE_256k)) {
currChannel->RadioQoSclass = 4;
} else if ((resBitrateDL <= RAL_BITRATE_320k) &&
(resBitrateUL <= RAL_BITRATE_320k)) {
currChannel->RadioQoSclass = 5;
} else if ((resBitrateDL >= RAL_BITRATE_384k) &&
(resBitrateDL <= RAL_BITRATE_440k) &&
(resBitrateUL <= RAL_BITRATE_64k)) {
currChannel->RadioQoSclass = 14;
} else {
LOG_E(RAL_ENB, " %s : Invalid requested resBitrate %d , %d - Request will be rejected\n", __FUNCTION__, resBitrateDL, resBitrateUL);
return 0;
}
/* unicast - DSCP */
if ((currChannel->classId[0] < 64) &&
(currChannel->classId[1] < 64)) {
currChannel->dscpUL = currChannel->classId[0];
currChannel->dscpDL = currChannel->classId[1];
} else {
LOG_E(RAL_ENB, " %s : DSCP > 63 - NOT SUPPORTED - Request will be rejected.\n", __FUNCTION__);
return 0;
}
LOG_D(RAL_ENB, " QoS Mapping : Requested radio QoS class %d, DSCP UL %d, DSCP DL %d\n", currChannel->RadioQoSclass, currChannel->dscpUL, currChannel->dscpDL);
}
return 1;
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
/****************************************************************************
** **
** Name: eRAL_process_waiting_RB() **
** **
** Description: Allocates a new Radio Bearer parameters to the specified **
** Mobile Terminal which was pending for RB establishment, **
** and sends RB establishment request to the NAS sublayer. **
** **
** Inputs: mt_ix: Mobile Terminal index **
** Others: ralpriv **
** **
** Outputs: None **
** Return: None **
** Others: ralpriv **
** **
***************************************************************************/
void eRAL_process_waiting_RB(ral_enb_instance_t instanceP, int mt_ix)
{
struct ral_lte_channel *currChannel;
struct ral_lte_channel *pendingChannel;
int ch_ix, f_ix;
int dir, mapping_result, rc = -1;
LOG_D(RAL_ENB, " Establishment of pending RB now starting...\n");
ch_ix = eRAL_process_find_new_channel(instanceP, mt_ix);
if (ch_ix == RAL_MAX_RB) {
LOG_D(RAL_ENB, " No RB available in MT - Deleting request data\n");
eRAL_process_clean_pending_mt(instanceP);
return;
}
pendingChannel = &(g_enb_ral_obj[instanceP].pending_mt.radio_channel[0]);
currChannel = &(g_enb_ral_obj[instanceP].mt[mt_ix].radio_channel[ch_ix]);
currChannel->cnx_id = (RAL_MAX_RB_PER_UE*mt_ix)+ch_ix+1;
currChannel->rbId = RAL_DEFAULT_RAB_ID+ch_ix;
currChannel->multicast = 0;
LOG_D(RAL_ENB, " mt_ix %d, ch_ix %d, cnx_id %d, rbId %d\n",
mt_ix, ch_ix, currChannel->cnx_id, currChannel->rbId);
memcpy((char *)&(g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_addr),
(char *)&(g_enb_ral_obj[instanceP].pending_mt.ipv6_addr), 16);
LOG_D(RAL_ENB, " MT's address = %s\n",
eRAL_process_mt_addr_to_string(g_enb_ral_obj[instanceP].mt[mt_ix].ipv6_addr));
/* Save the pending data flow identifier into the list of active data flows */
f_ix = eRAL_action_save_flow_id(instanceP, &g_enb_ral_obj[instanceP].pending_req_fid, currChannel->cnx_id);
if (f_ix < 0) {
LOG_D(RAL_ENB, " No RB available - Deleting request data\n");
eRAL_process_clean_pending_mt(instanceP);
return;
}
/* Store resource parameters of the pending MT */
for (dir = 0; dir < 2; dir++) {
currChannel->flowId[dir] = f_ix;
currChannel->classId[dir]= pendingChannel->classId[dir] ;
currChannel->resBitrate[dir] = pendingChannel->resBitrate[dir];
currChannel->meanBitrate[dir] = pendingChannel->meanBitrate[dir];
currChannel->bktDepth[dir] = pendingChannel->bktDepth[dir];
currChannel->pkBitrate[dir] = pendingChannel->pkBitrate[dir];
currChannel->MTU[dir] = pendingChannel->MTU[dir];
LOG_D(RAL_ENB, " qos value : DIR %d, flowId %d, classId %d, resBitrate %.1f \n",
dir, currChannel->flowId[dir], currChannel->classId[dir], currChannel->resBitrate[dir]);
}
/* Map Qos */
mapping_result = eRAL_process_map_qos(instanceP, mt_ix, ch_ix);
if (mapping_result) {
#ifdef RAL_DUMMY
rc = eRAL_NAS_send_rb_establish_request(mt_ix, ch_ix);
#endif
#ifdef RAL_REALTIME
// LG rc = RAL_process_NAS_message(IO_OBJ_RB, IO_CMD_ADD, mt_ix, ch_ix);
#endif
}
if (rc < 0) {
/* Failed to send RB establishment request; release new RB data */
eRAL_process_clean_channel(currChannel);
} else {
/* RB establishment request has been sent; release pending MT data */
g_enb_ral_obj[instanceP].pending_req_flag = 0;
eRAL_process_clean_pending_mt(instanceP);
}
}
/****************************************************************************
** Name: eRAL_process_clean_pending_mt() **
** Description: Deletes previously stored pending MT data. **
***************************************************************************/
void eRAL_process_clean_pending_mt(ral_enb_instance_t instanceP)
{
memset(g_enb_ral_obj[instanceP].pending_mt.ipv6_addr, 0 , 16);
eRAL_process_clean_channel(&g_enb_ral_obj[instanceP].pending_mt.radio_channel[0]);
g_enb_ral_obj[instanceP].pending_mt_timer = -1;
LOG_D(RAL_ENB, " Pending MT data deleted\n");
}
/****************************************************************************
** MW Added **
***************************************************************************/
//---------------------------------------------------------------------------
void RAL_printInitStatus(ral_enb_instance_t instanceP)
{
//---------------------------------------------------------------------------
LOG_D(RAL_ENB, "Network status updated \n");
LOG_D(RAL_ENB, "Mobile : %d, %d, %d, %d, %d, %d \n",
g_enb_ral_obj[instanceP].cell_id,
g_enb_ral_obj[instanceP].mt[0].ue_id,
g_enb_ral_obj[instanceP].mt[0].ipv6_l2id[0],
g_enb_ral_obj[instanceP].mt[0].ipv6_l2id[1],
g_enb_ral_obj[instanceP].mt[0].num_rbs ,
g_enb_ral_obj[instanceP].mt[0].nas_state );
LOG_D(RAL_ENB, "Default rb : %d, %d, %d, %d, %d, %d, %d \n",
g_enb_ral_obj[instanceP].mt[0].radio_channel[0].rbId ,
g_enb_ral_obj[instanceP].mt[0].radio_channel[0].RadioQoSclass ,
g_enb_ral_obj[instanceP].mt[0].radio_channel[0].cnx_id ,
g_enb_ral_obj[instanceP].mt[0].radio_channel[0].dscpUL ,
g_enb_ral_obj[instanceP].mt[0].radio_channel[0].dscpDL ,
g_enb_ral_obj[instanceP].mt[0].radio_channel[0].nas_state ,
g_enb_ral_obj[instanceP].mt[0].radio_channel[0].status );
LOG_D(RAL_ENB, "Number of connected MTs : %d\n\n", g_enb_ral_obj[instanceP].num_connected_mts);
}
//---------------------------------------------------------------------------
// poll for measures in NAS
void RAL_NAS_measures_polling(ral_enb_instance_t instanceP)
{
//---------------------------------------------------------------------------
#ifdef RAL_REALTIME
// LG RAL_process_NAS_message(IO_OBJ_MEAS, IO_CMD_LIST,0,0);
#endif
#ifdef RAL_DUMMY
eRAL_NAS_send_measure_request();
#endif
}
//---------------------------------------------------------------------------
// Common function to report congestion
void RAL_NAS_report_congestion(ral_enb_instance_t instanceP, int ix)
{
//---------------------------------------------------------------------------
MIH_C_TRANSACTION_ID_T transaction_id;
MIH_C_LINK_TUPLE_ID_T link_identifier;
LIST(MIH_C_LINK_PARAM_RPT, LinkParametersReportList);
LOG_D(RAL_ENB, "Congestion detected for UE%d, sending congestion notification to MIH User \n", ix);
transaction_id = MIH_C_get_new_transaction_id();
link_identifier.link_id.link_type = MIH_C_WIRELESS_UMTS;
link_identifier.link_id.link_addr.choice = MIH_C_CHOICE_3GPP_3G_CELL_ID;
Bit_Buffer_t *plmn = new_BitBuffer_0();
BitBuffer_wrap(plmn, (unsigned char*) &g_enb_ral_obj[instanceP].plmn_id, sizeof(g_enb_ral_obj[instanceP].plmn_id));
MIH_C_PLMN_ID_decode(plmn, &link_identifier.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id);
free_BitBuffer(plmn);
link_identifier.link_id.link_addr._union._3gpp_3g_cell_id.cell_id = g_enb_ral_obj[instanceP].cell_id;
link_identifier.choice = MIH_C_LINK_TUPLE_ID_CHOICE_NULL;
//
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.link_param_type.choice = MIH_C_LINK_PARAM_TYPE_CHOICE_LTE;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.link_param_type._union.link_param_lte = MIH_C_LINK_PARAM_LTE_L2_BUFFER_STATUS;
// LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.link_param_type.choice = MIH_C_LINK_PARAM_TYPE_CHOICE_GEN;
// LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.link_param_type._union.link_param_gen = MIH_C_LINK_PARAM_LTE_L2_BUFFER_STATUS;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.choice = MIH_C_LINK_PARAM_CHOICE_LINK_PARAM_VAL;
// LG obsolete rlcBufferOccupancy LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param._union.link_param_val = g_enb_ral_obj[instanceP].rlcBufferOccupancy[ix];
LinkParametersReportList_list.val[LinkParametersReportList_list.length].choice = MIH_C_LINK_PARAM_RPT_CHOICE_THRESHOLD;
#warning "TO DO"
//LinkParametersReportList_list.val[LinkParametersReportList_list.length]._union.threshold.threshold_val = g_enb_ral_obj[instanceP].congestion_threshold;
LinkParametersReportList_list.val[LinkParametersReportList_list.length]._union.threshold.threshold_xdir = MIH_C_ABOVE_THRESHOLD;
LinkParametersReportList_list.length = LinkParametersReportList_list.length + 1;
//
eRAL_send_link_parameters_report_indication(instanceP, &transaction_id, &link_identifier, &LinkParametersReportList_list);
#warning "TO DO?"
//g_enb_ral_obj[instanceP].congestion_flag = RAL_TRUE;
}
//---------------------------------------------------------------------------
// Temp - Enter hard-coded measures in IAL
/*LGvoid RAL_NAS_measures_analyze(ral_enb_instance_t instanceP){
//---------------------------------------------------------------------------
MIH_C_TRANSACTION_ID_T transaction_id;
MIH_C_LINK_TUPLE_ID_T link_identifier;
LIST(MIH_C_LINK_PARAM_RPT, LinkParametersReportList);
int ix;
LinkParametersReportList_list.length = 0;
if (g_enb_ral_obj[instanceP].congestion_flag == RAL_FALSE){
// Check congestion
for (ix=0; ix<g_enb_ral_obj[instanceP].num_UEs; ix++){
if ((g_enb_ral_obj[instanceP].rlcBufferOccupancy[ix] > g_enb_ral_obj[instanceP].congestion_threshold)&&
((g_enb_ral_obj[instanceP].mih_subscribe_req_event_list && MIH_C_BIT_LINK_PARAMETERS_REPORT )>0)){
RAL_NAS_report_congestion(instanceP, ix);
break;
}
}
} else if (g_enb_ral_obj[instanceP].measures_triggered_flag == RAL_TRUE){
// Measures should be reported to MIH user
LOG_D(RAL_ENB, "Sending traffic measures to MIH User \n");
transaction_id = MIH_C_get_new_transaction_id();
link_identifier.link_id.link_type = MIH_C_WIRELESS_UMTS;
link_identifier.link_id.link_addr.choice = MIH_C_CHOICE_3GPP_3G_CELL_ID;
Bit_Buffer_t *plmn = new_BitBuffer_0();
BitBuffer_wrap(plmn, (unsigned char*) g_enb_ral_obj[instanceP].plmn, DEFAULT_PLMN_SIZE);
MIH_C_PLMN_ID_decode(plmn, &link_identifier.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id);
free_BitBuffer(plmn);
link_identifier.link_id.link_addr._union._3gpp_3g_cell_id.cell_id = g_enb_ral_obj[instanceP].cell_id;
link_identifier.choice = MIH_C_LINK_TUPLE_ID_CHOICE_NULL;
//
// send parameters !!! Value link_param_val must be in 0...65535 range
// UE0 scheduledPRB
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.link_param_type.choice = MIH_C_LINK_PARAM_TYPE_CHOICE_LTE;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.link_param_type._union.link_param_lte = MIH_C_LINK_PARAM_LTE_AVAILABLE_BW;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.choice = MIH_C_LINK_PARAM_CHOICE_LINK_PARAM_VAL;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param._union.link_param_val = g_enb_ral_obj[instanceP].scheduledPRB[0];
LinkParametersReportList_list.val[LinkParametersReportList_list.length].choice = MIH_C_LINK_PARAM_RPT_CHOICE_NULL;
LinkParametersReportList_list.length = LinkParametersReportList_list.length + 1;
// UE0 totalDataVolume
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.link_param_type.choice = MIH_C_LINK_PARAM_TYPE_CHOICE_LTE;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.link_param_type._union.link_param_lte = MIH_C_LINK_PARAM_LTE_AVAILABLE_BW;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.choice = MIH_C_LINK_PARAM_CHOICE_LINK_PARAM_VAL;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param._union.link_param_val = (g_enb_ral_obj[instanceP].totalDataVolume[0]/1000);
LinkParametersReportList_list.val[LinkParametersReportList_list.length].choice = MIH_C_LINK_PARAM_RPT_CHOICE_NULL;
LinkParametersReportList_list.length = LinkParametersReportList_list.length + 1;
// UE1 scheduledPRB
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.link_param_type.choice = MIH_C_LINK_PARAM_TYPE_CHOICE_LTE;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.link_param_type._union.link_param_lte = MIH_C_LINK_PARAM_LTE_AVAILABLE_BW;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.choice = MIH_C_LINK_PARAM_CHOICE_LINK_PARAM_VAL;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param._union.link_param_val = g_enb_ral_obj[instanceP].scheduledPRB[1];
LinkParametersReportList_list.val[LinkParametersReportList_list.length].choice = MIH_C_LINK_PARAM_RPT_CHOICE_NULL;
LinkParametersReportList_list.length = LinkParametersReportList_list.length + 1;
// UE1 totalDataVolume
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.link_param_type.choice = MIH_C_LINK_PARAM_TYPE_CHOICE_LTE;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.link_param_type._union.link_param_lte = MIH_C_LINK_PARAM_LTE_AVAILABLE_BW;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.choice = MIH_C_LINK_PARAM_CHOICE_LINK_PARAM_VAL;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param._union.link_param_val = (g_enb_ral_obj[instanceP].totalDataVolume[1]/1000);
LinkParametersReportList_list.val[LinkParametersReportList_list.length].choice = MIH_C_LINK_PARAM_RPT_CHOICE_NULL;
LinkParametersReportList_list.length = LinkParametersReportList_list.length + 1;
// totalNumPRBs
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.link_param_type.choice = MIH_C_LINK_PARAM_TYPE_CHOICE_LTE;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.link_param_type._union.link_param_lte = MIH_C_LINK_PARAM_LTE_AVAILABLE_BW;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.choice = MIH_C_LINK_PARAM_CHOICE_LINK_PARAM_VAL;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param._union.link_param_val = g_enb_ral_obj[instanceP].totalNumPRBs;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].choice = MIH_C_LINK_PARAM_RPT_CHOICE_NULL;
LinkParametersReportList_list.length = LinkParametersReportList_list.length + 1;
//
eRAL_send_link_parameters_report_indication(instanceP, &transaction_id, &link_identifier, &LinkParametersReportList_list);
}
}
*/
@@ -1,168 +0,0 @@
/*****************************************************************************
* Eurecom OpenAirInterface 3
* Copyright(c) 2012 Eurecom
*
* Source eRAL_subscribe.c
*
* Version 0.1
*
* Date 11/27/2013
*
* Product MIH RAL LTE
*
* Subsystem
*
* Authors Lionel Gauthier
*
* Description
*
*****************************************************************************/
#define LTE_RAL_ENB
#define LTE_RAL_ENB_RRC_MSG_C
#include "lteRALenb.h"
static int ueid2eui48(uint8_t *euiP, uint8_t* ue_idP)
{
// inspired by linux-source-3.2.0/net/ipv6/addrconf.c
memcpy(euiP, ue_idP, 3);
memcpy(euiP + 5, ue_idP + 3, 3);
euiP[3] = 0xFF;
euiP[4] = 0xFE;
euiP[0] ^= 2;
return 0;
}
//---------------------------------------------------------------------------------------------------------------------
void eRAL_rx_rrc_ral_system_configuration_indication(instance_t instanceP, MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
module_id_t mod_id = instanceP;
g_enb_ral_obj[mod_id].plmn_id = RRC_RAL_SYSTEM_CONFIGURATION_IND(msg_pP).plmn_id;
g_enb_ral_obj[mod_id].cell_id = RRC_RAL_SYSTEM_CONFIGURATION_IND(msg_pP).cell_id;
}
//---------------------------------------------------------------------------------------------------------------------
void eRAL_rx_rrc_ral_connection_establishment_indication(instance_t instanceP, MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
MIH_C_LINK_TUPLE_ID_T link_tuple_id;
#ifdef USE_3GPP_ADDR_AS_LINK_ADDR
uint8_t ue_id_array[MIH_C_3GPP_ADDR_LENGTH];
uint8_t mn_link_addr[MIH_C_3GPP_ADDR_LENGTH];
uint64_t ue_id; //EUI-64
int i;
#endif
module_id_t mod_id = instanceP;
// The LINK_ID contains the MN LINK_ADDR
link_tuple_id.choice = MIH_C_LINK_TUPLE_ID_CHOICE_LINK_ADDR;
link_tuple_id.link_id.link_type = MIH_C_WIRELESS_LTE;
#ifdef USE_3GPP_ADDR_AS_LINK_ADDR
link_tuple_id.link_id.link_addr.choice = (MIH_C_CHOICE_T)MIH_C_CHOICE_3GPP_ADDR;
memset(ue_id_array, 0, MIH_C_3GPP_ADDR_LENGTH);
ue_id = (uint64_t)RRC_RAL_CONNECTION_ESTABLISHMENT_IND(msg_pP).ue_id;
for (i = 0; i < MIH_C_3GPP_ADDR_LENGTH; i++) {
ue_id_array[MIH_C_3GPP_ADDR_LENGTH-1-i] = (ue_id & 0x00000000000000FF);
ue_id = ue_id >> 8;
}
ueid2eui48(mn_link_addr, ue_id_array);
MIH_C_3GPP_ADDR_set(&(link_tuple_id.link_id.link_addr._union._3gpp_addr), NULL, 8);
// The optional LINK_ADDR contains a link address of PoA.
eRAL_MIH_C_3GPP_ADDR_load_3gpp_str_address(mod_id, &link_tuple_id._union.link_addr._union._3gpp_addr, (uint8_t*)ENB_DEFAULT_3GPP_ADDRESS);
#else
#warning TO DO UE ID
// preserve byte order of plmn id
memcpy(link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val, &g_enb_ral_obj[mod_id].plmn_id, 3);
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.cell_id = g_enb_ral_obj[mod_id].cell_id;
LOG_D(RAL_ENB, "PLMN ID %d.%d.%d\n",
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[0],
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[1],
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[2]);
LOG_D(RAL_ENB, "CELL ID %d\n",
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.cell_id);
#endif
eRAL_send_link_up_indication(instanceP, &g_enb_ral_obj[instanceP].transaction_id,
&link_tuple_id,
NULL, //MIH_C_LINK_ADDR_T *old_arP,(Optional) Old Access Router link address.
NULL, //MIH_C_LINK_ADDR_T *new_arP,(Optional) New Access Router link address.
NULL, //MIH_C_IP_RENEWAL_FLAG_T *flagP, (Optional) Indicates whether the MN needs to change IP Address in the new PoA.
NULL); //MIH_C_IP_MOB_MGMT_T *mobil_mngtP, (Optional) Indicates the type of Mobility Management Protocol supported by the new PoA.
g_enb_ral_obj[instanceP].transaction_id ++;
}
//---------------------------------------------------------------------------------------------------------------------
void eRAL_rx_rrc_ral_connection_reestablishment_indication(instance_t instanceP, MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
// module_id_t mod_id = instanceP;
#warning "TO DO ral_rx_rrc_ral_connection_reestablishment_indication"
}
//---------------------------------------------------------------------------------------------------------------------
void eRAL_rx_rrc_ral_connection_reconfiguration_indication(instance_t instanceP, MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
MIH_C_LINK_TUPLE_ID_T link_tuple_id;
uint8_t ue_id_array[MIH_C_3GPP_ADDR_LENGTH];
uint8_t mn_link_addr[MIH_C_3GPP_ADDR_LENGTH];
uint64_t ue_id; //EUI-64
int i;
module_id_t mod_id = instanceP;
// The LINK_ID contains the MN LINK_ADDR
link_tuple_id.link_id.link_type = MIH_C_WIRELESS_LTE;
link_tuple_id.link_id.link_addr.choice = MIH_C_CHOICE_3GPP_ADDR;
memset(ue_id_array, 0, MIH_C_3GPP_ADDR_LENGTH);
#warning "TO DO FIX UE_ID TYPE in rrc_ral_connection_establishment_ind_t"
ue_id = (uint64_t)RRC_RAL_CONNECTION_ESTABLISHMENT_IND(msg_pP).ue_id;
for (i = 0; i < MIH_C_3GPP_ADDR_LENGTH; i++) {
ue_id_array[MIH_C_3GPP_ADDR_LENGTH-1-i] = (ue_id & 0x00000000000000FF);
ue_id = ue_id >> 8;
}
ueid2eui48(mn_link_addr, ue_id_array);
MIH_C_3GPP_ADDR_set(&(link_tuple_id.link_id.link_addr._union._3gpp_addr), NULL, 8);
//The optional LINK_ADDR may contains a link address of PoA.
link_tuple_id.choice = MIH_C_LINK_TUPLE_ID_CHOICE_NULL;
eRAL_send_link_up_indication(instanceP, &g_enb_ral_obj[instanceP].transaction_id,
&link_tuple_id,
NULL, //MIH_C_LINK_ADDR_T *old_arP,(Optional) Old Access Router link address.
NULL, //MIH_C_LINK_ADDR_T *new_arP,(Optional) New Access Router link address.
NULL, //MIH_C_IP_RENEWAL_FLAG_T *flagP, (Optional) Indicates whether the MN needs to change IP Address in the new PoA.
NULL); //MIH_C_IP_MOB_MGMT_T *mobil_mngtP, (Optional) Indicates the type of Mobility Management Protocol supported by the new PoA.
g_enb_ral_obj[mod_id].transaction_id ++;
}
//---------------------------------------------------------------------------------------------------------------------
void eRAL_rx_rrc_ral_measurement_report_indication(instance_t instanceP, MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
// module_id_t mod_id = instanceP;
}
//---------------------------------------------------------------------------------------------------------------------
void eRAL_rx_rrc_ral_connection_release_indication(instance_t instanceP, MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
// module_id_t mod_id = instanceP;
}
@@ -1,113 +0,0 @@
/*****************************************************************************
* Eurecom OpenAirInterface 3
* Copyright(c) 2012 Eurecom
*
* Source lteRALenb_subscribe.c
*
* Version 0.1
*
* Date 07/02/2012
*
* Product MIH RAL LTE
*
* Subsystem
*
* Authors Michelle Wetterwald, Lionel Gauthier, Frederic Maurel
*
* Description
*
*****************************************************************************/
#define LTE_RAL_ENB
#define LTE_RAL_ENB_SUBSCRIBE_C
#include "lteRALenb.h"
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: eRAL_subscribe_request() **
** **
** Description: Subscribes the MIH-F to receive specified link event **
** indications and sends Link Event Subscribe confirmation **
** to the MIH-F. **
** **
** Inputs: msgP: Pointer to the received MIH message **
** Others: None **
** **
** Outputs: None **
** Return: None **
** Others: ralpriv **
** **
***************************************************************************/
void eRAL_subscribe_request(ral_enb_instance_t instanceP, MIH_C_Message_Link_Event_Subscribe_request_t* msgP)
{
MIH_C_STATUS_T status = MIH_C_STATUS_REJECTED;
/* Check whether the action request is supported */
if (g_enb_ral_obj[instanceP].mih_supported_link_command_list & MIH_C_BIT_LINK_EVENT_SUBSCRIBE) {
MIH_C_LINK_EVENT_LIST_T mih_subscribed_req_event_list;
g_enb_ral_obj[instanceP].mih_subscribe_req_event_list |= (msgP->primitive.RequestedLinkEventList & g_enb_ral_obj[instanceP].mih_supported_link_event_list);
mih_subscribed_req_event_list = g_enb_ral_obj[instanceP].mih_subscribe_req_event_list & msgP->primitive.RequestedLinkEventList;
status = MIH_C_STATUS_SUCCESS;
eRAL_send_event_subscribe_confirm(instanceP, &msgP->header.transaction_id,
&status,
&mih_subscribed_req_event_list);
} else {
eRAL_send_event_subscribe_confirm(instanceP, &msgP->header.transaction_id,
&status,
NULL);
}
}
/****************************************************************************
** **
** Name: eRAL_unsubscribe_request() **
** **
** Description: Unsubscribes the MIH-F to receive specified link event **
** indications and sends Link Event Unsubscribe confirmation **
** to the MIH-F. **
** **
** Inputs: msgP: Pointer to the received MIH message **
** Others: None **
** **
** Outputs: None **
** Return: None **
** Others: ralpriv **
** **
***************************************************************************/
void eRAL_unsubscribe_request(ral_enb_instance_t instanceP, MIH_C_Message_Link_Event_Unsubscribe_request_t* msgP)
{
MIH_C_STATUS_T status = MIH_C_STATUS_REJECTED;
/* Check whether the action request is supported */
if (g_enb_ral_obj[instanceP].mih_supported_link_command_list & MIH_C_BIT_LINK_EVENT_UNSUBSCRIBE) {
MIH_C_LINK_EVENT_LIST_T mih_unsubscribed_req_event_list;
MIH_C_LINK_EVENT_LIST_T saved_req_event_list;
saved_req_event_list = g_enb_ral_obj[instanceP].mih_subscribe_req_event_list;
g_enb_ral_obj[instanceP].mih_subscribe_req_event_list &= ~(msgP->primitive.RequestedLinkEventList & g_enb_ral_obj[instanceP].mih_supported_link_event_list);
mih_unsubscribed_req_event_list = g_enb_ral_obj[instanceP].mih_subscribe_req_event_list ^ saved_req_event_list;
status = MIH_C_STATUS_SUCCESS;
eRAL_send_event_unsubscribe_confirm(instanceP, &msgP->header.transaction_id,
&status,
&mih_unsubscribed_req_event_list);
} else {
eRAL_send_event_unsubscribe_confirm(instanceP, &msgP->header.transaction_id,
&status,
NULL);
}
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
@@ -1,171 +0,0 @@
/*****************************************************************************
* Eurecom OpenAirInterface 3
* Copyright(c) 2012 Eurecom
*
* Source eRAL_thresholds.c
*
* Version 0.1
*
* Date 07/03/2012
*
* Product MIH RAL LTE
*
* Subsystem
*
* Authors Michelle Wetterwald, Lionel Gauthier, Frederic Maurel
*
* Description
*
*****************************************************************************/
#define LTE_RAL_ENB
#define LTE_RAL_ENB_THRESHOLDS_C
#include <assert.h>
#include "lteRALenb.h"
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: eRAL_configure_thresholds_request() **
** **
** Description: Forwards the Link_Configure_Thresholds.request message **
** to the RRC layer. **
** **
** Inputs: msgP: Pointer to the received message **
** Others: ralpriv **
** **
** Outputs: None **
** Return: None **
** Others: None **
** **
***************************************************************************/
void eRAL_configure_thresholds_request(ral_enb_instance_t instanceP, MIH_C_Message_Link_Configure_Thresholds_request_t* msgP)
{
unsigned int index;
unsigned int th_index;
rrc_ral_configure_threshold_req_t configure_threshold_req;
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RAL_ENB, RRC_RAL_CONFIGURE_THRESHOLD_REQ);
memset(&configure_threshold_req, 0, sizeof(rrc_ral_configure_threshold_req_t));
// copy transaction id
configure_threshold_req.transaction_id = msgP->header.transaction_id;
// configure_threshold_req.num_link_cfg_params = 0; // done
for (index = 0; index < msgP->primitive.LinkConfigureParameterList_list.length; index++) {
// copy link_param_type
configure_threshold_req.link_cfg_params[index].link_param_type.choice = msgP->primitive.LinkConfigureParameterList_list.val[index].link_param_type.choice;
switch (configure_threshold_req.link_cfg_params[index].link_param_type.choice) {
case RAL_LINK_PARAM_TYPE_CHOICE_GEN:
memcpy(&configure_threshold_req.link_cfg_params[index].link_param_type._union.link_param_gen,
&msgP->primitive.LinkConfigureParameterList_list.val[index].link_param_type._union.link_param_gen,
sizeof(ral_link_param_gen_t));
break;
case RAL_LINK_PARAM_TYPE_CHOICE_QOS:
memcpy(&configure_threshold_req.link_cfg_params[index].link_param_type._union.link_param_qos,
&msgP->primitive.LinkConfigureParameterList_list.val[index].link_param_type._union.link_param_qos,
sizeof(ral_link_param_qos_t));
break;
case RAL_LINK_PARAM_TYPE_CHOICE_LTE:
memcpy(&configure_threshold_req.link_cfg_params[index].link_param_type._union.link_param_lte,
&msgP->primitive.LinkConfigureParameterList_list.val[index].link_param_type._union.link_param_lte,
sizeof(ral_link_param_lte_t));
break;
default:
assert(1==0);
}
configure_threshold_req.num_link_cfg_params += 1;
// copy choice
configure_threshold_req.link_cfg_params[index].union_choice = msgP->primitive.LinkConfigureParameterList_list.val[index].choice;
// copy _union
switch (configure_threshold_req.link_cfg_params[index].union_choice) {
case RAL_LINK_CFG_PARAM_CHOICE_TIMER_NULL:
configure_threshold_req.link_cfg_params[index]._union.null_attr = 0;
break;
case RAL_LINK_CFG_PARAM_CHOICE_TIMER:
configure_threshold_req.link_cfg_params[index]._union.timer_interval = msgP->primitive.LinkConfigureParameterList_list.val[index]._union.timer_interval;
default:
assert(1==0);
}
// copy th_action
configure_threshold_req.link_cfg_params[index].th_action = msgP->primitive.LinkConfigureParameterList_list.val[index].th_action;
// configure_threshold_req.link_cfg_params[index].num_thresholds = 0; // done
for (th_index = 0; th_index < msgP->primitive.LinkConfigureParameterList_list.val[index].threshold_list.length; th_index++) {
configure_threshold_req.link_cfg_params[index].thresholds[th_index].threshold_val = msgP->primitive.LinkConfigureParameterList_list.val[index].threshold_list.val[th_index].threshold_val;
configure_threshold_req.link_cfg_params[index].thresholds[th_index].threshold_xdir = msgP->primitive.LinkConfigureParameterList_list.val[index].threshold_list.val[th_index].threshold_xdir;
configure_threshold_req.link_cfg_params[index].num_thresholds += 1;
}
}
memcpy (&message_p->ittiMsg, (void *) &configure_threshold_req, sizeof(rrc_ral_configure_threshold_req_t));
itti_send_msg_to_task (TASK_RRC_ENB, instanceP, message_p);
}
//---------------------------------------------------------------------------------------------------------------------
void eRAL_rx_rrc_ral_configure_threshold_conf(instance_t instance, MessageDef *msg_p)
//---------------------------------------------------------------------------------------------------------------------
{
MIH_C_STATUS_T status;
// This parameter is not included if Status does not indicate “Success.”
MIH_C_LINK_CFG_STATUS_LIST_T link_cfg_status_list;
unsigned int i;
status = RRC_RAL_CONFIGURE_THRESHOLD_CONF(msg_p).status;
if (status == RAL_STATUS_SUCCESS) {
link_cfg_status_list.length = 0;
for (i = 0; i < RRC_RAL_CONFIGURE_THRESHOLD_CONF(msg_p).num_link_cfg_params; i++) {
link_cfg_status_list.val[i].link_param_type.choice = RRC_RAL_CONFIGURE_THRESHOLD_CONF(msg_p).cfg_status[i].link_param_type.choice;
switch (link_cfg_status_list.val[i].link_param_type.choice) {
case RAL_LINK_PARAM_TYPE_CHOICE_GEN:
memcpy(&link_cfg_status_list.val[i].link_param_type._union.link_param_gen,
&RRC_RAL_CONFIGURE_THRESHOLD_CONF(msg_p).cfg_status[i].link_param_type._union.link_param_gen,
sizeof(ral_link_param_gen_t));
break;
case RAL_LINK_PARAM_TYPE_CHOICE_QOS:
memcpy(&link_cfg_status_list.val[i].link_param_type._union.link_param_qos,
&RRC_RAL_CONFIGURE_THRESHOLD_CONF(msg_p).cfg_status[i].link_param_type._union.link_param_qos,
sizeof(ral_link_param_qos_t));
break;
case RAL_LINK_PARAM_TYPE_CHOICE_LTE:
memcpy(&link_cfg_status_list.val[i].link_param_type._union.link_param_lte,
&RRC_RAL_CONFIGURE_THRESHOLD_CONF(msg_p).cfg_status[i].link_param_type._union.link_param_lte,
sizeof(ral_link_param_lte_t));
break;
default:
assert(1==0);
}
link_cfg_status_list.val[i].threshold.threshold_val = RRC_RAL_CONFIGURE_THRESHOLD_CONF(msg_p).cfg_status[i].threshold.threshold_val;
link_cfg_status_list.val[i].threshold.threshold_xdir = RRC_RAL_CONFIGURE_THRESHOLD_CONF(msg_p).cfg_status[i].threshold.threshold_xdir;
link_cfg_status_list.val[i].config_status = RRC_RAL_CONFIGURE_THRESHOLD_CONF(msg_p).cfg_status[i].config_status;
link_cfg_status_list.length += 1;
}
eRAL_send_configure_thresholds_confirm(instance, &RRC_RAL_CONFIGURE_THRESHOLD_CONF(msg_p).transaction_id, &status, &link_cfg_status_list);
} else {
eRAL_send_configure_thresholds_confirm(instance, &RRC_RAL_CONFIGURE_THRESHOLD_CONF(msg_p).transaction_id, &status, NULL);
}
}
@@ -1,48 +0,0 @@
/*******************************************************************************
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
*******************************************************************************/
#ifndef __LTE_RAL_UE_H__
#define __LTE_RAL_UE_H__
#include "MIH_C.h"
#include "openair_types.h"
#include "platform_constants.h"
#include "platform_types.h"
#include "lteRALue_constants.h"
#include "lteRALue_variables.h"
#include "lteRALue_main.h"
#include "lteRALue_action.h"
#include "lteRALue_mih_msg.h"
#include "lteRALue_rrc_msg.h"
#include "lteRALue_parameters.h"
//#include "lteRALue_process.h"
#include "lteRALue_subscribe.h"
#include "lteRALue_thresholds.h"
#endif
@@ -1,81 +0,0 @@
/*******************************************************************************
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 lteralue_action.h
* \brief
* \author GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
#ifndef __LTE_RAL_UE_ACTION_H__
#define __LTE_RAL_UE_ACTION_H__
//-----------------------------------------------------------------------------
# ifdef LTE_RAL_UE_ACTION_C
# define private_lteralue_action(x) x
# define protected_lteralue_action(x) x
# define public_lteralue_action(x) x
# else
# ifdef LTE_RAL_UE
# define private_lteralue_action(x)
# define protected_lteralue_action(x) extern x
# define public_lteralue_action(x) extern x
# else
# define private_lteralue_action(x)
# define protected_lteralue_action(x)
# define public_lteralue_action(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include "lteRALue.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
/****************************************************************************/
#ifdef MIH_C_MEDIEVAL_EXTENSIONS
#endif // MIH_C_MEDIEVAL_EXTENSIONS
/****************************************************************************/
/******************** G L O B A L V A R I A B L E S ********************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
protected_lteralue_action(void mRAL_action_request(ral_ue_instance_t instanceP, MIH_C_Message_Link_Action_request_t* messageP);)
#endif
@@ -1,60 +0,0 @@
/*******************************************************************************
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 lteRALue_constants.h
* \brief Constants for LTE-RAL-UE
* \author WETTERWALD Michelle, GAUTHIER Lionel, MAUREL Frederic
* \date 2013
* \company EURECOM
* \email: michelle.wetterwald@eurecom.fr, lionel.gauthier@eurecom.fr, frederic.maurel@eurecom.fr
*/
/*******************************************************************************/
#ifndef __LTERALUE_CONSTANTS_H__
#define __LTERALUE_CONSTANTS_H__
//-----------------------------------------------------------------------------
#define UE_DEFAULT_LOCAL_PORT_RAL "1234"
#define UE_DEFAULT_REMOTE_PORT_MIHF "1025"
#define UE_DEFAULT_IP_ADDRESS_MIHF "127.0.0.1"
#define UE_DEFAULT_IP_ADDRESS_RAL "127.0.0.1"
#define UE_DEFAULT_LINK_ID_RAL "ue_lte_link"
#define UE_DEFAULT_LINK_ADDRESS_RAL "060080149150"
#define UE_DEFAULT_MIHF_ID "mihf2_ue"
//#define UE_DEFAULT_3GPP_ADDRESS "0335060080149150"
#define UE_DEFAULT_3GPP_ADDRESS "0000000000000000"
//-----------------------------------------------------------------------------
// Constants for scenario
#define PREDEFINED_MIH_PLMN_ID 503
#define PREDEFINED_MIH_NETWORK_ID "eurecom"
#define PREDEFINED_MIH_NETAUX_ID "netaux"
#define PREDEFINED_CHANNEL_ID 2
#define PREDEFINED_CLASSES_SERVICE_SUPPORTED 2
#define PREDEFINED_QUEUES_SUPPORTED 2
#endif
@@ -1,187 +0,0 @@
/*******************************************************************************
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 lteRALue_main.h
* \brief This file defines the prototypes of the functions for lteRALue_main.c
* \author WETTERWALD Michelle, GAUTHIER Lionel, MAUREL Frederic
* \date 2013
* \company EURECOM
* \email: michelle.wetterwald@eurecom.fr, lionel.gauthier@eurecom.fr, frederic.maurel@eurecom.fr
*/
/*******************************************************************************/
#ifndef __LTERALUE_MAIN_H__
# define __LTERALUE_MAIN_H__
//-----------------------------------------------------------------------------
# ifdef LTERALUE_MAIN_C
# define private_mrallte_main(x) x
# define protected_mrallte_main(x) x
# define public_mrallte_main(x) x
# else
# ifdef LTE_RAL_UE
# define private_mrallte_main(x)
# define protected_mrallte_main(x) extern x
# define public_mrallte_main(x) extern x
# else
# define private_mrallte_main(x)
# define protected_mrallte_main(x)
# define public_mrallte_main(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <netdb.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/time.h>
#include <ctype.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <getopt.h>
#include <libgen.h>
//-----------------------------------------------------------------------------
#include "lteRALue.h"
#include "commonDef.h"
#include "hashtable.h"
//#include "collection/hashtable/hashtable.h"
public_mrallte_main(char* g_conf_ue_ral_listening_port;)
public_mrallte_main(char* g_conf_ue_ral_ip_address;)
public_mrallte_main(char* g_conf_ue_ral_link_id;)
public_mrallte_main(char* g_conf_ue_ral_link_address;)
public_mrallte_main(char* g_conf_ue_mihf_remote_port;)
public_mrallte_main(char* g_conf_ue_mihf_ip_address;)
public_mrallte_main(char* g_conf_ue_mihf_id;)
typedef int ral_ue_instance_t;
typedef struct lte_ral_ue_object_s {
//------------------------
// CONFIG PARAMETERS
//------------------------
char* ral_listening_port;
char* ral_ip_address;
char* ral_link_address;
char* mihf_remote_port;
char* mihf_ip_address;
char* link_id;
char* mihf_id;
MIH_C_LINK_MIHCAP_FLAG_T link_mihcap_flag; // hardcoded parameters
MIH_C_NET_CAPS_T net_caps;// hardcoded parameters
// only to call ralu_verifyPendingConnection
uint8_t pending_req_flag;
// network parameters
uint16_t cell_id;
plmn_t plmn_id;
//uint16_t nas_state;
int state;
//uint32_t curr_signal_level;
uint32_t ipv6_l2id[2];
//measures
uint8_t req_num_bs;
uint16_t req_cell_id[MAX_NUMBER_BS];
uint32_t req_prov_id[MAX_NUMBER_BS];
uint16_t req_order_index[MAX_NUMBER_BS];
int num_measures;
uint16_t meas_cell_id[MAX_NUMBER_BS];
uint32_t last_meas_level[MAX_NUMBER_BS];
uint32_t integrated_meas_level[MAX_NUMBER_BS];
uint32_t prev_integrated_meas_level[MAX_NUMBER_BS];
uint32_t provider_id[MAX_NUMBER_BS];
//Radio Bearers
uint16_t num_rb;
int num_class;
uint16_t rbId[RAL_MAX_RB];
uint16_t QoSclass[RAL_MAX_RB];
uint16_t dscp[RAL_MAX_RB];
// statistics
//uint32_t rx_packets;
//uint32_t tx_packets;
//uint32_t rx_bytes;
//uint32_t tx_bytes;
//uint32_t rx_errors;
//uint32_t tx_errors;
//uint32_t rx_dropped;
//uint32_t tx_dropped;
//char buffer[800]; // For ioctl with NAS driver
// MIH-INTERFACE data
// MIH-INTERFACE data
int mih_sock_desc;
// Initialised, then read-only, supported actions
MIH_C_LINK_AC_TYPE_T mih_supported_action_list;
// action currently processed
MIH_C_LINK_AC_TYPE_T pending_req_action;
// actions requested by MIH-H
MIH_C_LINK_AC_TYPE_T req_action_list;
//MIH_C_STATUS_T pending_req_status;
MIH_C_LINK_AC_RESULT_T pending_req_ac_result;
//MIH_C_TRANSACTION_ID_T pending_req_transaction_id;
// set unset bits by MIH_C_Message_Link_Event_Subscribe_request MIH_C_Message_Link_Event_Unsubscribe_request
MIH_C_LINK_EVENT_LIST_T mih_subscribe_req_event_list;
// Initialised, then read-only
MIH_C_LINK_EVENT_LIST_T mih_supported_link_event_list;
// Initialised, then read-only
MIH_C_LINK_CMD_LIST_T mih_supported_link_command_list;
LIST(MIH_C_LINK_CFG_PARAM, mih_link_cfg_param_thresholds);
// to tell what are the configured thresholds in mih_link_cfg_param_thresholds_list
MIH_C_BOOLEAN_T active_mih_link_cfg_param_threshold[MIH_C_LINK_CFG_PARAM_LIST_LENGTH];
MIH_C_BOOLEAN_T link_to_be_detected;
MIH_C_TRANSACTION_ID_T transaction_id;
} lte_ral_ue_object_t;
/* RAL LTE internal data */
protected_mrallte_main(lte_ral_ue_object_t g_ue_ral_obj[MAX_MODULES];)
private_mrallte_main(hash_table_t *g_ue_ral_fd2instance;);
public_mrallte_main( void mRAL_init_default_values(void);)
public_mrallte_main( int mRAL_initialize(void);)
private_mrallte_main(void mRAL_process_file_descriptors(struct epoll_event *events, int nb_events);)
public_mrallte_main( void* mRAL_task(void *args_p);)
#endif
@@ -1,80 +0,0 @@
/*******************************************************************************
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 lteRALue_mih_execute.h
* \brief This file defines the prototypes of the functions for lteRALue_mih_execute.c
* \author WETTERWALD Michelle, GAUTHIER Lionel, MAUREL Frederic
* \date 2013
* \company EURECOM
* \email: michelle.wetterwald@eurecom.fr, lionel.gauthier@eurecom.fr, frederic.maurel@eurecom.fr
*/
/*******************************************************************************/
#ifndef __MRALLTE_MIH_EXECUTE_H__
# define __MRALLTE_MIH_EXECUTE_H__
//-----------------------------------------------------------------------------
# ifdef MRALLTE_MIH_EXECUTE_C
# define private_mRAL_mih_execute(x) x
# define protected_mRAL_mih_execute(x) x
# define public_mRAL_mih_execute(x) x
# else
# ifdef LTE_RAL_UE
# define private_mRAL_mih_execute(x)
# define protected_mRAL_mih_execute(x) extern x
# define public_mRAL_mih_execute(x) extern x
# else
# define private_mRAL_mih_execute(x)
# define protected_mRAL_mih_execute(x)
# define public_mRAL_mih_execute(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <ctype.h>
//-----------------------------------------------------------------------------
#include "lteRALue.h"
//-----------------------------------------------------------------------------
protected_mRAL_mih_execute(MIH_C_LINK_ACTION_T g_link_action;)
//-----------------------------------------------------------------------------
protected_mRAL_mih_execute(void mRAL_action_request(MIH_C_Message_Link_Action_request_t* messageP);)
//-----------------------------------------------------------------------------
protected_mRAL_mih_execute(void mRAL_get_parameters_request(MIH_C_Message_Link_Get_Parameters_request_t* messageP);)
//-----------------------------------------------------------------------------
protected_mRAL_mih_execute(void mRAL_subscribe_request (MIH_C_Message_Link_Event_Subscribe_request_t* messageP);)
protected_mRAL_mih_execute(void mRAL_unsubscribe_request(MIH_C_Message_Link_Event_Unsubscribe_request_t* messageP);)
//-----------------------------------------------------------------------------
protected_mRAL_mih_execute(LIST(MIH_C_LINK_CFG_PARAM, g_link_cfg_param_thresholds);)
//-----------------------------------------------------------------------------
protected_mRAL_mih_execute(void mRAL_configure_thresholds_request(MIH_C_Message_Link_Configure_Thresholds_request_t* messageP);)
public_mRAL_mih_execute(void mRAL_check_thresholds_signal_strength(MIH_C_THRESHOLD_VAL_T new_valP, MIH_C_THRESHOLD_VAL_T old_valP);)
#endif
@@ -1,153 +0,0 @@
/*******************************************************************************
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 lteRALue_mih_msg.h
* \brief This file defines the prototypes of the functions for lteRALue_mih_msg.c
* \author WETTERWALD Michelle, GAUTHIER Lionel, MAUREL Frederic
* \date 2013
* \company EURECOM
* \email: michelle.wetterwald@eurecom.fr, lionel.gauthier@eurecom.fr, frederic.maurel@eurecom.fr
*/
/*******************************************************************************/
#ifndef __LTERALUE_MIH_MSG_H__
# define __LTERALUE_MIH_MSG_H__
//-----------------------------------------------------------------------------
# ifdef LTERALUE_MIH_MSG_C
# define private_mRAL_mih_msg(x) x
# define protected_mRAL_mih_msg(x) x
# define public_mRAL_mih_msg(x) x
# else
# ifdef LTE_RAL_UE
# define private_mRAL_mih_msg(x)
# define protected_mRAL_mih_msg(x) extern x
# define public_mRAL_mih_msg(x) extern x
# else
# define private_mRAL_mih_msg(x)
# define protected_mRAL_mih_msg(x)
# define public_mRAL_mih_msg(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include "lteRALue.h"
#define MSG_CODEC_RECV_BUFFER_SIZE 16400
#define MSG_CODEC_SEND_BUFFER_SIZE 16400
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
public_mRAL_mih_msg( int mRAL_send_to_mih(ral_ue_instance_t instanceP, u_int8_t *bufferP, size_t lenP);)
protected_mRAL_mih_msg( int mRAL_mihf_connect (ral_ue_instance_t instanceP);)
protected_mRAL_mih_msg( void MIH_C_3GPP_ADDR_load_3gpp_str_address(ral_ue_instance_t instanceP, \
MIH_C_3GPP_ADDR_T* _3gpp_addrP, \
u_int8_t* strP);)
protected_mRAL_mih_msg( void mRAL_send_link_register_indication (\
ral_ue_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP);)
protected_mRAL_mih_msg( void mRAL_send_link_detected_indication (\
ral_ue_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_LINK_DET_INFO_T *link_detected_infoP);)
protected_mRAL_mih_msg( void mRAL_send_link_up_indication(\
ral_ue_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_LINK_TUPLE_ID_T *link_identifierP,\
MIH_C_LINK_ADDR_T *old_access_routerP,\
MIH_C_LINK_ADDR_T *new_access_routerP,\
MIH_C_IP_RENEWAL_FLAG_T *ip_renewal_flagP,\
MIH_C_IP_MOB_MGMT_T *mobility_management_supportP);)
protected_mRAL_mih_msg( void mRAL_send_link_parameters_report_indication(\
ral_ue_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_LINK_TUPLE_ID_T *link_identifierP,\
MIH_C_LINK_PARAM_RPT_LIST_T *link_parameters_report_listP);)
protected_mRAL_mih_msg( void mRAL_send_link_going_down_indication(\
ral_ue_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_LINK_TUPLE_ID_T *link_identifierP,\
MIH_C_UNSIGNED_INT2_T *time_intervalP,\
MIH_C_LINK_GD_REASON_T *link_going_down_reasonP);)
protected_mRAL_mih_msg( void mRAL_send_link_down_indication(\
ral_ue_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_LINK_TUPLE_ID_T *link_identifierP,\
MIH_C_LINK_ADDR_T *old_access_routerP,\
MIH_C_LINK_DN_REASON_T *reason_codeP);)
protected_mRAL_mih_msg( void mRAL_send_link_action_confirm(\
ral_ue_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_STATUS_T *statusP,\
MIH_C_LINK_SCAN_RSP_LIST_T *scan_response_setP,\
MIH_C_LINK_AC_RESULT_T *link_action_resultP);)
protected_mRAL_mih_msg( void mRAL_send_capability_discover_confirm(\
ral_ue_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_STATUS_T *statusP,\
MIH_C_LINK_EVENT_LIST_T *supported_link_event_listP,\
MIH_C_LINK_CMD_LIST_T *supported_link_command_listP);)
protected_mRAL_mih_msg( void mRAL_send_event_subscribe_confirm (\
ral_ue_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_STATUS_T *statusP,\
MIH_C_LINK_EVENT_LIST_T *response_link_event_listP);)
protected_mRAL_mih_msg( void mRAL_send_event_unsubscribe_confirm (\
ral_ue_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_STATUS_T *statusP,\
MIH_C_LINK_EVENT_LIST_T *response_link_event_listP);)
protected_mRAL_mih_msg( void mRAL_send_configure_thresholds_confirm(\
ral_ue_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_STATUS_T *statusP,\
MIH_C_LINK_CFG_STATUS_LIST_T *link_configure_status_listP);)
protected_mRAL_mih_msg( void mRAL_send_get_parameters_confirm (\
ral_ue_instance_t instanceP,\
MIH_C_TRANSACTION_ID_T *transaction_idP,\
MIH_C_STATUS_T *statusP,\
MIH_C_LINK_PARAM_LIST_T *link_parameters_status_listP,\
MIH_C_LINK_STATES_RSP_LIST_T *link_states_response_listP,\
MIH_C_LINK_DESC_RSP_LIST_T *link_descriptors_response_listP);)
private_mRAL_mih_msg( int mRAL_mih_link_msg_decode (\
ral_ue_instance_t instanceP,\
Bit_Buffer_t* bbP, MIH_C_Message_Wrapper_t *message_wrapperP);)
protected_mRAL_mih_msg( int mRAL_mih_link_process_message (ral_ue_instance_t instanceP);)
#endif
@@ -1,78 +0,0 @@
/*******************************************************************************
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 lteRALenb_parameters.h
* \brief
* \author GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
#ifndef __LTE_RAL_UE_PARAMETERS_H__
#define __LTE_RAL_UE_PARAMETERS_H__
//-----------------------------------------------------------------------------
# ifdef LTE_RAL_UE_PARAMETERS_C
# define private_lteralue_parameters(x) x
# define protected_lteralue_parameters(x) x
# define public_lteralue_parameters(x) x
# else
# ifdef LTE_RAL_UE
# define private_lteralue_parameters(x)
# define protected_lteralue_parameters(x) extern x
# define public_lteralue_parameters(x) extern x
# else
# define private_lteralue_parameters(x)
# define protected_lteralue_parameters(x)
# define public_lteralue_parameters(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include "lteRALue.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
/****************************************************************************/
/****************************************************************************/
/******************** G L O B A L V A R I A B L E S ********************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
protected_lteralue_parameters(void mRAL_get_parameters_request(ral_ue_instance_t instanceP, MIH_C_Message_Link_Get_Parameters_request_t* messageP);)
#endif
@@ -1,54 +0,0 @@
/*******************************************************************************
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 lteRALue_proto.h
* \brief This file defines the prototypes of the common functions
* \author WETTERWALD Michelle, GAUTHIER Lionel, MAUREL Frederic
* \date 2013
* \company EURECOM
* \email: michelle.wetterwald@eurecom.fr, lionel.gauthier@eurecom.fr, frederic.maurel@eurecom.fr
*/
/*******************************************************************************/
#ifndef __RAL_UE_LTE_PROTO_H__
#define __RAL_UE_LTE_PROTO_H__
//lteRALue_ioctl.c
int RAL_ue_process_NAS_message(int ioctl_obj, int ioctl_cmd, int ioctl_cellid);
//mRALuD_process.c
void IAL_ue_NAS_measures_init(void);
void IAL_ue_NAS_measures_update(int i);
void IAL_ue_integrate_measure(int measure, int i);
void rallte_ue_NAS_measures_polling(void);
int rallte_ue_NAS_corresponding_cell(int req_index);
void rallte_ue_verifyPendingConnection(void);
void* ral_ue_task(void *args_p);
#endif
@@ -1,69 +0,0 @@
/*******************************************************************************
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 lteRALenb_rrc_msg.h
* \brief
* \author GAUTHIER Lionel
* \date 2013
* \version
* \note
* \bug
* \warning
*/
#ifndef __LTE_RAL_UE_RRC_MSG_H__
#define __LTE_RAL_UE_RRC_MSG_H__
//-----------------------------------------------------------------------------
# ifdef LTE_RAL_UE_RRC_MSG_C
# define private_lteralue_rrc_msg(x) x
# define protected_lteralue_rrc_msg(x) x
# define public_lteralue_rrc_msg(x) x
# else
# ifdef LTE_RAL_UE
# define private_lteralue_rrc_msg(x)
# define protected_lteralue_rrc_msg(x) extern x
# define public_lteralue_rrc_msg(x) extern x
# else
# define private_lteralue_rrc_msg(x)
# define protected_lteralue_rrc_msg(x)
# define public_lteralue_rrc_msg(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include "lteRALue.h"
#include "intertask_interface.h"
protected_lteralue_rrc_msg(void mRAL_rx_rrc_ral_scan_confirm (instance_t instance, MessageDef *msg_p);)
protected_lteralue_rrc_msg(void mRAL_rx_rrc_ral_system_information_indication (instance_t instance, MessageDef *msg_p);)
protected_lteralue_rrc_msg(void mRAL_rx_rrc_ral_connection_establishment_indication (instance_t instance, MessageDef *msg_p);)
protected_lteralue_rrc_msg(void mRAL_rx_rrc_ral_connection_reestablishment_indication (instance_t instance, MessageDef *msg_p);)
protected_lteralue_rrc_msg(void mRAL_rx_rrc_ral_connection_reconfiguration_indication (instance_t instance, MessageDef *msg_p);)
protected_lteralue_rrc_msg(void mRAL_rx_rrc_ral_connection_release_indication (instance_t instance, MessageDef *msg_p);)
#endif
@@ -1,79 +0,0 @@
/*******************************************************************************
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 lteRALenb_subscribe.h
* \brief
* \author GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
#ifndef __LTE_RAL_UE_SUBSCRIBE_H__
#define __LTE_RAL_UE_SUBSCRIBE_H__
//-----------------------------------------------------------------------------
# ifdef LTE_RAL_UE_PROCESS_C
# define private_lteralue_subscribe(x) x
# define protected_lteralue_subscribe(x) x
# define public_lteralue_subscribe(x) x
# else
# ifdef LTE_RAL_UE
# define private_lteralue_subscribe(x)
# define protected_lteralue_subscribe(x) extern x
# define public_lteralue_subscribe(x) extern x
# else
# define private_lteralue_subscribe(x)
# define protected_lteralue_subscribe(x)
# define public_lteralue_subscribe(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include "lteRALue.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
/****************************************************************************/
/****************************************************************************/
/******************** G L O B A L V A R I A B L E S ********************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
protected_lteralue_subscribe(void mRAL_subscribe_request (ral_ue_instance_t instanceP, MIH_C_Message_Link_Event_Subscribe_request_t* msgP);)
protected_lteralue_subscribe(void mRAL_unsubscribe_request(ral_ue_instance_t instanceP, MIH_C_Message_Link_Event_Unsubscribe_request_t* msgP);)
#endif
@@ -1,83 +0,0 @@
/*******************************************************************************
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 lteRALenb_thresholds.h
* \brief
* \author GAUTHIER Lionel, MAUREL Frederic, WETTERWALD Michelle
* \date 2012
* \version
* \note
* \bug
* \warning
*/
#ifndef __LTE_RAL_UE_THRESHOLDS_H__
#define __LTE_RAL_UE_THRESHOLDS_H__
//-----------------------------------------------------------------------------
# ifdef LTE_RAL_UE_PROCESS_C
# define private_lteralue_thresholds(x) x
# define protected_lteralue_thresholds(x) x
# define public_lteralue_thresholds(x) x
# else
# ifdef LTE_RAL_UE
# define private_lteralue_thresholds(x)
# define protected_lteralue_thresholds(x) extern x
# define public_lteralue_thresholds(x) extern x
# else
# define private_lteralue_thresholds(x)
# define protected_lteralue_thresholds(x)
# define public_lteralue_thresholds(x) extern x
# endif
# endif
//-----------------------------------------------------------------------------
#include "lteRALue.h"
#include "intertask_interface.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
/****************************************************************************/
/****************************************************************************/
/******************** G L O B A L V A R I A B L E S ********************/
/****************************************************************************/
//LIST(MIH_C_LINK_CFG_PARAM, g_link_cfg_param_thresholds);
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
protected_lteralue_thresholds(void mRAL_configure_thresholds_request (ral_ue_instance_t instanceP, MIH_C_Message_Link_Configure_Thresholds_request_t* messageP);)
protected_lteralue_thresholds(void mRAL_rx_rrc_ral_configure_threshold_conf (ral_ue_instance_t instance, MessageDef *msg_p);)
protected_lteralue_thresholds(void mRAL_rx_rrc_ral_measurement_report_indication (ral_ue_instance_t instance, MessageDef *msg_p);)
#endif
@@ -1,83 +0,0 @@
/*******************************************************************************
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 lteRALue_mih_msg.h
* \brief This file defines the data structures and LTE-RAL-UE protocol parameters
* \author WETTERWALD Michelle, GAUTHIER Lionel, MAUREL Frederic
* \date 2013
* \company EURECOM
* \email: michelle.wetterwald@eurecom.fr, lionel.gauthier@eurecom.fr, frederic.maurel@eurecom.fr
*/
/*******************************************************************************/
#ifndef __LTERALUE_VARIABLES_H__
#define __LTERALUE_VARIABLES_H__
//-------------------------------------------------------------------
#include "lteRALue.h"
/***************************************************************************
CONSTANTS
***************************************************************************/
//#define RAL_DUMMY
#define RAL_REALTIME
//#define MRALU_SIMU_LINKDOWN
//#define DEBUG_MRALU_MEASURES
//#define UPDATE
#define RALU_MT_EVENT_MAP MIH_EVENT_Link_AdvertisementIndication + MIH_EVENT_Link_Parameters_ReportIndication + MIH_EVENT_Link_UpIndication + MIH_EVENT_Link_DownIndication
#define MIHLink_MAX_LENGTH 500
#define MAX_NUMBER_BS 3 /* Max number of base stations */
#define CONF_UNKNOWN_CELL_ID 0
#define UMTS_INTF_NAME "graal0"
//Attachment status
#define UNKNOWN 9
#define CONNECTED 1
#define DISCONNECTED 0
//max number RB supported (27 in Spec)
#define RAL_MAX_RB 5
// constant for integrating measures according to the formula
// y[n] = (1-LAMBDA)*u[n-1] + LAMBDA*u[n]
#define LAMBDA 8
#define MEAS_MAX_RSSI 110
/***************************************************************************
VARIABLES
***************************************************************************/
//struct ral_lte_priv {
//};
//-----------------------------------------------------------------------------
//extern struct ral_lte_priv *ralpriv;
#endif
@@ -1,65 +0,0 @@
/*******************************************************************************
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 nas_ue_ioctl.h
* \brief This file defines the constants for triggering the ioctl interface
* \author WETTERWALD Michelle, GAUTHIER Lionel, MAUREL Frederic
* \date 2013
* \company EURECOM
* \email: michelle.wetterwald@eurecom.fr, lionel.gauthier@eurecom.fr, frederic.maurel@eurecom.fr
*/
/*******************************************************************************/
#ifndef _IAL_IOCTL_H
#define _IAL_IOCTL_H
#include <sys/ioctl.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <net/if.h>
#include <netinet/in.h>
// Temp constants = arguments gioctl
//arg[0]
#define IO_OBJ_STATS 0
#define IO_OBJ_CNX 1
#define IO_OBJ_RB 2
#define IO_OBJ_MEAS 3
#define IO_OBJ_IMEI 4
//arg[1]
#define IO_CMD_ADD 0
#define IO_CMD_DEL 1
#define IO_CMD_LIST 2
//LGextern int inet_pton(int af, const char *src, void *dst);
//LGextern char *inet_ntop(int af, const void *src, char *dst, size_t sise);
#endif
@@ -1,45 +0,0 @@
/*******************************************************************************
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 rrc_d_types.h
* \brief This file defines shortcuts to main unsigned types (part of LTE_RAL_UE
* \author WETTERWALD Michelle, GAUTHIER Lionel, MAUREL Frederic
* \date 2013
* \company EURECOM
* \email: michelle.wetterwald@eurecom.fr, lionel.gauthier@eurecom.fr, frederic.maurel@eurecom.fr
*/
/*******************************************************************************/
#ifndef __RRC_DTYPES_H__
#define __RRC_DTYPES_H__
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
#endif
-47
View File
@@ -1,47 +0,0 @@
#===============================================================================
# Brief : Link SAP configuration file
# Authors : Carlos Guimaraes <cguimaraes@av.it.pt>
# Bruno Santos <bsantos@av.it.pt>
#-------------------------------------------------------------------------------
# ODTONE - Open Dot Twenty One
#
# Copyright (C) 2009-2012 Universidade Aveiro
# Copyright (C) 2009-2012 Instituto de Telecomunicações - Pólo Aveiro
#
# This software is distributed under a license. The full license
# agreement can be found in the file LICENSE in this distribution.
# This software may not be copied, modified, sold or distributed
# other than expressed in the named license agreement.
#
# This software is distributed without any warranty.
#===============================================================================
[link]
##
## Link SAP identifier
##
id=link1
##
## Link SAP listening
##
port = 1235
##
## Link SAP interface technology
##
tec = LTE
##
## Link SAP interface address
##
link_addr = 00:11:22:33:44:55
##
## Comma separated list of the Link SAP supported events
##
event_list = link_detected, link_up, link_down, link_parameters_report, link_going_down, link_handover_imminent, link_handover_complete
[mihf]
ip=127.0.0.1
local_port=1025
-40
View File
@@ -1,40 +0,0 @@
#===============================================================================
# Brief : MIH-User configuration file
# Authors : Carlos Guimaraes <cguimaraes@av.it.pt>
# Bruno Santos <bsantos@av.it.pt>
#-------------------------------------------------------------------------------
# ODTONE - Open Dot Twenty One
#
# Copyright (C) 2009-2012 Universidade Aveiro
# Copyright (C) 2009-2012 Instituto de Telecomunicações - Pólo Aveiro
#
# This software is distributed under a license. The full license
# agreement can be found in the file LICENSE in this distribution.
# This software may not be copied, modified, sold or distributed
# other than expressed in the named license agreement.
#
# This software is distributed without any warranty.
#===============================================================================
##
## User id
##
[user]
id = user
##
## Commands supported by the MIH-User
##
commands = mih_link_get_parameters, mih_link_configure_thresholds, mih_link_actions, mih_net_ho_candidate_query, mih_net_ho_commit, mih_n2n_ho_query_resources, mih_n2n_ho_commit, mih_n2n_ho_complete, mih_mn_ho_candidate_query, mih_mn_ho_commit, mih_mn_ho_complete
##
## Port used for communication with MIHF
##
[conf]
port = 1234
##
## MIHF configuration. For the default demonstration leave as is.
##
[mihf]
local_port = 1025
-71
View File
@@ -1,71 +0,0 @@
#===============================================================================
# Brief : MIHF configuration file
# Authors : Carlos Guimaraes <cguimaraes@av.it.pt>
#-------------------------------------------------------------------------------
# ODTONE - Open Dot Twenty One
#
# Copyright (C) 2009-2012 Universidade Aveiro
# Copyright (C) 2009-2012 Instituto de Telecomunicações - Pólo Aveiro
#
# This software is distributed under a license. The full license
# agreement can be found in the file LICENSE in this distribution.
# This software may not be copied, modified, sold or distributed
# other than expressed in the named license agreement.
#
# This software is distributed without any warranty.
#===============================================================================
[mihf]
##
## This mihf's id
##
## Usage: id = <MIHF ID>
##
id = mihf1
##
## Port on localhost that MIH Users and MIH Link SAPs connect to.
##
## Usage: local_port = <port>
##
local_port = 1025
##
## Port to which remote peer MIHF connect to
##
## Usage: remote_port = <port>
##
#remote_port = 4551
##
## Comma seperated list of remote MIHF's
##
## If you want to test remote MIHF communication add an entry here
## with the IP address of the remote MIHF.
##
## Usage: peers = <mihf id> <ip> <port>, ...
##
#peers = mihf2 0.0.0.0 4552
##
## Comma separated list of local MIH User SAPs id's and ports
##
## Usage: users = <user sap id> <port> [<supported commands> <supported queries>], ...
## Note: If no command is specified, the MIHF will assume that the MIH-User
## supports all MIH_***_HO_*** commands and the MIH_Get_Information
## Note: If no query is specified, the MIHF will assume that the MIH-User does
## not support the MIH_Get_Information command.
##
users = user 1234
##
## Comma separated list of local MIH Link SAPs id's and ports.
##
## Usage: links = <link sap id> <port> <techonoly type> <interface> [<supported events list> <supported commands list>], ...
##
#links = wifi 1235 802_11 00:11:22:33:44:55, lte 1234 LTE 00:11:22 5
##
## Comma separated list of the MIHF's transport protocol
##
transport = udp
@@ -1,34 +0,0 @@
#===============================================================================
# Brief : MIH-User SAP Application Sample Project Build
# Authors : Carlos Guimaraes <cguimaraes@av.it.pt>
# Bruno Santos <bsantos@av.it.pt>
#-------------------------------------------------------------------------------
# ODTONE - Open Dot Twenty One
#
# Copyright (C) 2009-2012 Universidade Aveiro
# Copyright (C) 2009-2012 Instituto de Telecomunicações - Pólo Aveiro
#
# This software is distributed under a license. The full license
# agreement can be found in the file LICENSE in this distribution.
# This software may not be copied, modified, sold or distributed
# other than expressed in the named license agreement.
#
# This software is distributed without any warranty.
#===============================================================================
install install
: ue_lte_user
ue_lte_user.conf
: <location>../../dist
;
project ue_lte_user
;
exe ue_lte_user
: ue_lte_user.cpp
../../lib/odtone//odtone
/boost//program_options
;
@@ -1,11 +0,0 @@
FILES TO BE USED:
Jamfile
ue_lte_user.conf
ue_lte_user.cpp
README.txt
FILES OBSOLETES:
lte_user.conf
mih_usr.cpp
@@ -1,42 +0,0 @@
#===============================================================================
# Brief : MIH-User configuration file
# Authors : Carlos Guimaraes <cguimaraes@av.it.pt>
# Bruno Santos <bsantos@av.it.pt>
#-------------------------------------------------------------------------------
# ODTONE - Open Dot Twenty One
#
# Copyright (C) 2009-2012 Universidade Aveiro
# Copyright (C) 2009-2012 Instituto de Telecomunicações - Pólo Aveiro
#
# This software is distributed under a license. The full license
# agreement can be found in the file LICENSE in this distribution.
# This software may not be copied, modified, sold or distributed
# other than expressed in the named license agreement.
#
# This software is distributed without any warranty.
#===============================================================================
##
## User id
##
[user]
id = user_ue
##
## Commands supported by the MIH-User
##
commands = mih_link_get_parameters, mih_link_configure_thresholds, mih_link_actions, mih_net_ho_candidate_query, mih_net_ho_commit, mih_n2n_ho_query_resources, mih_n2n_ho_commit, mih_n2n_ho_complete, mih_mn_ho_candidate_query, mih_mn_ho_commit, mih_mn_ho_complete
##
## Port used for communication with MIHF
##
[conf]
port = 1235
##
## MIHF configuration. For the default demonstration leave as is.
##
[mihf]
local_port = 1025
File diff suppressed because it is too large Load Diff
@@ -1,42 +0,0 @@
#===============================================================================
# Brief : MIH-User configuration file
# Authors : Carlos Guimaraes <cguimaraes@av.it.pt>
# Bruno Santos <bsantos@av.it.pt>
#-------------------------------------------------------------------------------
# ODTONE - Open Dot Twenty One
#
# Copyright (C) 2009-2012 Universidade Aveiro
# Copyright (C) 2009-2012 Instituto de Telecomunicações - Pólo Aveiro
#
# This software is distributed under a license. The full license
# agreement can be found in the file LICENSE in this distribution.
# This software may not be copied, modified, sold or distributed
# other than expressed in the named license agreement.
#
# This software is distributed without any warranty.
#===============================================================================
##
## User id
##
[user]
id = user_ue
##
## Commands supported by the MIH-User
##
commands = mih_link_get_parameters, mih_link_configure_thresholds, mih_link_actions, mih_net_ho_candidate_query, mih_net_ho_commit, mih_n2n_ho_query_resources, mih_n2n_ho_commit, mih_n2n_ho_complete, mih_mn_ho_candidate_query, mih_mn_ho_commit, mih_mn_ho_complete
##
## Port used for communication with MIHF
##
[conf]
port = 1235
##
## MIHF configuration. For the default demonstration leave as is.
##
[mihf]
local_port = 1025
File diff suppressed because it is too large Load Diff
-75
View File
@@ -1,75 +0,0 @@
# lines starting with the pound sign are comments.
#
# These things are options that you might need
# to tweak.
INTERFACE_DIR=../INTERFACE-802.21
INCLUDE_DIR=INCLUDE
SRC_DIR=SRC
# external directories for ioctl
RRC_DIR := $(OPENAIR2_DIR)/RRC/CELLULAR
NAS_DIR := $(OPENAIR2_DIR)/NAS/DRIVER/CELLULAR/NASMT
# SVN version
#SVNREV = -D'SVN_REV="$(shell svnversion -n .)"'
SVNREV = -D'SVN_REV="1"'
CC = gcc
#CFLAGS = -Wall -g -I$(SRC_DIR) -I$(INTERFACE_DIR)/INCLUDE -I$(INCLUDE_DIR) \
# -DMIH_C_MEDIEVAL_EXTENSIONS -DMSCGEN_PYTOOL -DMIH_USER_CONTROL $(SVNREV)
CFLAGS = -Wall -g -I$(SRC_DIR) -I$(INTERFACE_DIR)/INCLUDE -I$(INCLUDE_DIR) -DMIH_C_MEDIEVAL_EXTENSIONS -DMIH_USER_CONTROL $(SVNREV)
CFLAGS += -I$(NAS_DIR) -I$(RRC_DIR)
LDFLAGS = -L$(INTERFACE_DIR)/LIB -lmih_c-802.21 -lrt
MRAL_OBJS = $(SRC_DIR)/lteRALue_mih_msg.o
#MRAL_OBJS += $(SRC_DIR)/lteRALue_thresholds.o
#MRAL_OBJS += $(SRC_DIR)/lteRALue_parameters.o
#MRAL_OBJS += $(SRC_DIR)/lteRALue_action.o
#MRAL_OBJS += $(SRC_DIR)/lteRALue_get.o
#MRAL_OBJS += $(SRC_DIR)/lteRALue_subscribe.o
MRAL_OBJS += $(SRC_DIR)/lteRALue_mih_execute.o
MRAL_OBJS += $(SRC_DIR)/lteRALue_main.o
MRAL_OBJS += $(SRC_DIR)/lteRALue_ioctl.o
MRAL_OBJS += $(SRC_DIR)/lteRALue_process.o
OBJS = $(MRAL_OBJS)
M_RAL_EXE = LTE_RAL_UE
EXECUTABLE = interface $(M_RAL_EXE)
# "all" is the default target. Simply make it point to myprogram.
all: $(EXECUTABLE)
runral: $(M_RAL_EXE)
-rm -f /tmp/*.txt
-./$(M_RAL_EXE) > /tmp/mral.txt
interface :
-(cd $(INTERFACE_DIR) && make)
# -(cd $(INTERFACE_DIR) && make clean && make)
cleaninterface :
-(cd $(INTERFACE_DIR) && make clean)
$(M_RAL_EXE) : $(MRAL_OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
%.o: %.c Makefile
@echo Compiling $<
@$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $<
clean:
-find . -name "*.o" -delete
-find . -name "*.*~" -delete
-find . -name "*~" -delete
# -rm -f $(M_RAL_EXE) $(M_NAS_EXE)
# -rm -f $(E_RAL_EXE) $(E_NAS_EXE)
@@ -1,240 +0,0 @@
/***************************************************************************
lteRALue_action.c - description
***************************************************************************
Eurecom OpenAirInterface 3
Copyright(c) 1999 - 2013 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, 450 route des Chappes, 06410 Biot Sophia Antipolis, France
*******************************************************************************/
/*! \file lteRALue_mih_execute.c
* \brief Execution of MIH primitives in LTE-RAL-UE
* \author WETTERWALD Michelle, GAUTHIER Lionel, MAUREL Frederic
* \date 2013
* \company EURECOM
* \email: michelle.wetterwald@eurecom.fr, lionel.gauthier@eurecom.fr, frederic.maurel@eurecom.fr
*/
/*******************************************************************************/
#define LTE_RAL_UE
#define LTERALUE_ACTION_C
//-----------------------------------------------------------------------------
#include "lteRALue.h"
#include "LAYER2/MAC/extern.h"
//-----------------------------------------------------------------------------
void mRAL_action_request(ral_ue_instance_t instanceP, MIH_C_Message_Link_Action_request_t* messageP)
{
//-----------------------------------------------------------------------------
MIH_C_STATUS_T status;
LIST(MIH_C_LINK_SCAN_RSP, scan_response_set);
MIH_C_LINK_AC_RESULT_T link_action_result;
//unsigned int scan_index, meas_to_send;
MessageDef *message_p = NULL;
rrc_ral_connection_release_req_t release_req;
rrc_ral_connection_establishment_req_t connection_establishment_req;
module_id_t mod_id = instanceP - NB_eNB_INST;
status = MIH_C_STATUS_SUCCESS;
link_action_result = MIH_C_LINK_AC_RESULT_SUCCESS;
scan_response_set_list.length = 0;
if ( messageP->primitive.LinkAction.link_ac_attr & MIH_C_BIT_LINK_AC_ATTR_LINK_SCAN) {
//----------------------------------------------------
// send a response to MIH-F or it will report an error.
//----------------------------------------------------
//link_action_result = MIH_C_LINK_AC_RESULT_SUCCESS;
//mRAL_send_link_action_confirm(instanceP, &messageP->header.transaction_id, &status, &scan_response_set_list, &link_action_result);
//----------------------------------------------------
// Transmit request to RRC.
//----------------------------------------------------
message_p = itti_alloc_new_message (TASK_RAL_UE, RRC_RAL_SCAN_REQ);
RRC_RAL_SCAN_REQ(message_p).transaction_id = messageP->header.transaction_id;
itti_send_msg_to_task (TASK_RRC_UE, instanceP, message_p);
}
if ( messageP->primitive.LinkAction.link_ac_attr & MIH_C_BIT_LINK_AC_ATTR_LINK_RES_RETAIN) {
// TO DO
// The link will be disconnected but the resource for the link connection still remains so
// reestablishing the link connection later can be more efficient.
}
if ( messageP->primitive.LinkAction.link_ac_attr & MIH_C_BIT_LINK_AC_ATTR_DATA_FWD_REQ) {
// TO DO
// This indication requires the buffered data at the old serving PoA entity to be forwarded
// to the new target PoA entity in order to avoid data loss. This action can be taken imme-
// diately after the old serving PoS receives MIH_N2N_HO_Commit response message
// from the new target PoS, or the old serving PoS receives MIH_Net_HO_Commit
// response message from the MN. This is not valid on UMTS link type.
}
// do not make actions if SCAN required
if (( messageP->primitive.LinkAction.link_ac_attr & MIH_C_BIT_LINK_AC_ATTR_LINK_SCAN) == 0) {
switch (messageP->primitive.LinkAction.link_ac_type) {
case MIH_C_LINK_AC_TYPE_NONE:
LOG_D(RAL_UE, "%s ACTION REQUESTED: MIH_C_LINK_AC_TYPE_NONE: NO ACTION\n", __FUNCTION__);
break;
case MIH_C_LINK_AC_TYPE_LINK_DISCONNECT:
LOG_D(RAL_UE, "%s ACTION REQUESTED: MIH_C_LINK_AC_TYPE_LINK_DISCONNECT: NO ACTION\n", __FUNCTION__);
if (g_ue_ral_obj[mod_id].mih_supported_action_list & MIH_C_LINK_AC_TYPE_LINK_DISCONNECT) {
message_p = itti_alloc_new_message (TASK_RAL_UE, RRC_RAL_CONNECTION_RELEASE_REQ);
memset(&release_req, 0, sizeof(rrc_ral_connection_release_req_t));
// copy transaction id
release_req.transaction_id = messageP->header.transaction_id;
memcpy (&message_p->ittiMsg, (void *) &release_req, sizeof(rrc_ral_connection_release_req_t));
itti_send_msg_to_task (TASK_RRC_UE, instanceP, message_p);
} else {
link_action_result = MIH_C_LINK_AC_RESULT_INCAPABLE;
mRAL_send_link_action_confirm(instanceP, &messageP->header.transaction_id, &status, &scan_response_set_list, &link_action_result);
}
break;
case MIH_C_LINK_AC_TYPE_LINK_LOW_POWER:
LOG_D(RAL_UE, "%s ACTION REQUESTED: MIH_C_LINK_AC_TYPE_LINK_LOW_POWER\n", __FUNCTION__);
if (g_ue_ral_obj[mod_id].mih_supported_action_list & MIH_C_LINK_AC_TYPE_LINK_LOW_POWER) {
// TO DO
} else {
link_action_result = MIH_C_LINK_AC_RESULT_INCAPABLE;
mRAL_send_link_action_confirm(instanceP, &messageP->header.transaction_id, &status, &scan_response_set_list, &link_action_result);
}
break;
case MIH_C_LINK_AC_TYPE_LINK_POWER_DOWN:
LOG_D(RAL_UE, "%s ACTION REQUESTED: MIH_C_LINK_AC_TYPE_LINK_POWER_DOWN\n", __FUNCTION__);
if (g_ue_ral_obj[mod_id].mih_supported_action_list & MIH_C_LINK_AC_TYPE_LINK_POWER_DOWN) {
if ( g_ue_ral_obj[mod_id].pending_req_action & MIH_C_LINK_AC_TYPE_LINK_POWER_DOWN ) {
if (g_ue_ral_obj[mod_id].state == DISCONNECTED) {
LOG_D(RAL_UE, "Deactivation requested, but interface already inactive ==> NO OP\n");
mRAL_send_link_action_confirm(instanceP, &messageP->header.transaction_id, &status, &scan_response_set_list, &link_action_result);
} else {
g_ue_ral_obj[mod_id].pending_req_action = g_ue_ral_obj[mod_id].pending_req_action | MIH_C_LINK_AC_TYPE_LINK_POWER_DOWN;
//Send immediatly a confirm, otherwise it will arrive to late and MIH-F will report a failure to the MIH-USER
mRAL_send_link_action_confirm(instanceP, &messageP->header.transaction_id, &status, NULL, &link_action_result);
message_p = itti_alloc_new_message (TASK_RAL_UE, RRC_RAL_CONNECTION_RELEASE_REQ);
memset(&release_req, 0, sizeof(rrc_ral_connection_release_req_t));
// copy transaction id
release_req.transaction_id = messageP->header.transaction_id;
memcpy (&message_p->ittiMsg, (void *) &release_req, sizeof(rrc_ral_connection_release_req_t));
itti_send_msg_to_task (TASK_RRC_UE, instanceP, message_p);
LOG_D(RAL_UE, "Deactivation requested to NAS interface\n");
//RAL_process_NAS_message(IO_OBJ_CNX, IO_CMD_DEL, g_ue_ral_obj[mod_id].cell_id);
}
} else {
g_ue_ral_obj[mod_id].pending_req_action |= MIH_C_LINK_AC_TYPE_LINK_POWER_DOWN;
//Send immediatly a confirm, otherwise it will arrive to late and MIH-F will report a failure to the MIH-USER
mRAL_send_link_action_confirm(instanceP, &messageP->header.transaction_id, &status, NULL, &link_action_result);
message_p = itti_alloc_new_message (TASK_RAL_UE, RRC_RAL_CONNECTION_RELEASE_REQ);
memset(&release_req, 0, sizeof(rrc_ral_connection_release_req_t));
// copy transaction id
release_req.transaction_id = messageP->header.transaction_id;
memcpy (&message_p->ittiMsg, (void *) &release_req, sizeof(rrc_ral_connection_release_req_t));
itti_send_msg_to_task (TASK_RRC_UE, instanceP, message_p);
LOG_D(RAL_UE, "Deactivation requested to NAS interface\n");
//RAL_process_NAS_message(IO_OBJ_CNX, IO_CMD_DEL, g_ue_ral_obj[mod_id].cell_id);
}
} else {
LOG_D(RAL_UE, " command POWER DOWN not available \n\n");
link_action_result = MIH_C_LINK_AC_RESULT_INCAPABLE;
mRAL_send_link_action_confirm(instanceP, &messageP->header.transaction_id, &status, NULL, &link_action_result);
}
break;
case MIH_C_LINK_AC_TYPE_LINK_POWER_UP:
LOG_D(RAL_UE, "%s ACTION REQUESTED: MIH_C_LINK_AC_TYPE_LINK_POWER_UP\n", __FUNCTION__);
if (g_ue_ral_obj[mod_id].mih_supported_action_list & MIH_C_LINK_AC_TYPE_LINK_POWER_UP) {
// Activation requested - check it is not already active
if(g_ue_ral_obj[mod_id].pending_req_action & MIH_C_LINK_AC_TYPE_LINK_POWER_UP) {
if (g_ue_ral_obj[mod_id].state == CONNECTED) {
LOG_D(RAL_UE, "Activation requested, but interface already active ==> NO OP\n");
mRAL_send_link_action_confirm(instanceP, &messageP->header.transaction_id, &status, &scan_response_set_list, &link_action_result);
} else {
g_ue_ral_obj[mod_id].pending_req_action = g_ue_ral_obj[mod_id].pending_req_action | MIH_C_LINK_AC_TYPE_LINK_POWER_UP;
g_ue_ral_obj[mod_id].cell_id = g_ue_ral_obj[mod_id].meas_cell_id[0]; // Default cell #0 - Next, choose cell with best conditions
LOG_D(RAL_UE, "Activation requested to NAS interface on cell %d\n", g_ue_ral_obj[mod_id].cell_id);
//RAL_process_NAS_message(IO_OBJ_CNX, IO_CMD_ADD, g_ue_ral_obj[mod_id].cell_id);
}
} else {
g_ue_ral_obj[mod_id].pending_req_action |= MIH_C_LINK_AC_TYPE_LINK_POWER_UP;
g_ue_ral_obj[mod_id].cell_id = g_ue_ral_obj[mod_id].meas_cell_id[0]; // Default cell #0 - Next, choose cell with best conditions
message_p = itti_alloc_new_message (TASK_RAL_UE, RRC_RAL_CONNECTION_ESTABLISHMENT_REQ);
memset(&connection_establishment_req, 0, sizeof(rrc_ral_connection_establishment_req_t));
// copy transaction id
connection_establishment_req.transaction_id = messageP->header.transaction_id;
memcpy (&message_p->ittiMsg, (void *) &connection_establishment_req, sizeof(rrc_ral_connection_establishment_req_t));
itti_send_msg_to_task (TASK_RRC_UE, instanceP, message_p);
}
} else {
LOG_D(RAL_UE, "[mRAL]: command POWER UP not available \n\n");
link_action_result = MIH_C_LINK_AC_RESULT_INCAPABLE;
mRAL_send_link_action_confirm(instanceP, &messageP->header.transaction_id, &status, &scan_response_set_list, &link_action_result);
}
break;
/* LG KEEP case MIH_C_LINK_AC_TYPE_LINK_FLOW_ATTR:
LOG_D(RAL_UE, "%s ACTION REQUESTED: MIH_C_LINK_AC_TYPE_LINK_FLOW_ATTR: NO ACTION\n", __FUNCTION__);
if (g_ue_ral_obj[mod_id].mih_supported_action_list & MIH_C_LINK_AC_TYPE_LINK_FLOW_ATTR) {
} else {
link_action_result = MIH_C_LINK_AC_RESULT_INCAPABLE;
mRAL_send_link_action_confirm(instanceP, &messageP->header.transaction_id, &status, &scan_response_set_list, &link_action_result);
}
break;
case MIH_C_LINK_AC_TYPE_LINK_ACTIVATE_RESOURCES:
LOG_D(RAL_UE, "%s ACTION REQUESTED: MIH_C_LINK_AC_TYPE_LINK_ACTIVATE_RESOURCES: NO ACTION\n", __FUNCTION__);
if (g_ue_ral_obj[mod_id].mih_supported_action_list & MIH_C_LINK_AC_TYPE_LINK_ACTIVATE_RESOURCES) {
} else {
link_action_result = MIH_C_LINK_AC_RESULT_INCAPABLE;
mRAL_send_link_action_confirm(instanceP, &messageP->header.transaction_id, &status, &scan_response_set_list, &link_action_result);
}
break;
case MIH_C_LINK_AC_TYPE_LINK_DEACTIVATE_RESOURCES:
LOG_D(RAL_UE, "%s ACTION REQUESTED: MIH_C_LINK_AC_TYPE_LINK_DEACTIVATE_RESOURCES: NO ACTION\n", __FUNCTION__);
if (g_ue_ral_obj[mod_id].mih_supported_action_list & MIH_C_LINK_AC_TYPE_LINK_DEACTIVATE_RESOURCES) {
} else {
link_action_result = MIH_C_LINK_AC_RESULT_INCAPABLE;
mRAL_send_link_action_confirm(instanceP, &messageP->header.transaction_id, &status, &scan_response_set_list, &link_action_result);
}
break;*/
default:
LOG_E(RAL_UE, "%s Invalid LinkAction.link_ac_type in MIH_C_Message_Link_Action_request\n", __FUNCTION__);
status = MIH_C_STATUS_UNSPECIFIED_FAILURE;
mRAL_send_link_action_confirm(instanceP, &messageP->header.transaction_id, &status, &scan_response_set_list, &link_action_result);
}
}
}
@@ -1,455 +0,0 @@
/***************************************************************************
lteRALue_ioctl.c - description
***************************************************************************
Eurecom OpenAirInterface 3
Copyright(c) 1999 - 2013 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, 450 route des Chappes, 06410 Biot Sophia Antipolis, France
*******************************************************************************/
/*! \file lteRALue_ioctl.c
* \brief Handling of ioctl for LTE driver in LTE-RAL-UE
* \author WETTERWALD Michelle, GAUTHIER Lionel, MAUREL Frederic
* \date 2013
* \company EURECOM
* \email: michelle.wetterwald@eurecom.fr, lionel.gauthier@eurecom.fr, frederic.maurel@eurecom.fr
*/
/*******************************************************************************/
#define MRAL_MODULE
#include "rrc_d_types.h"
#include "nas_ue_ioctl.h"
#include "rrc_nas_primitives.h"
#include "nasmt_constant.h"
#include "nasmt_iocontrol.h"
#include "lteRALue_mih_msg.h"
#include "lteRALue_variables.h"
#include "lteRALue_proto.h"
#include "MIH_C.h"
#include "lteRALue_mih_msg.h"
extern struct nas_ioctl gifr;
extern int fd;
// 0335060080149150
uint8_t NAS_DEFAULT_IMEI[16]= {0x00, 0x03, 0x03, 0x05, 0x00 ,0x06, 0x00, 0x00, 0x08, 0x00, 0x01 ,0x04, 0x09, 0x01, 0x05, 0x00};
//---------------------------------------------------------------------------
void print_state(uint8_t state)
{
//---------------------------------------------------------------------------
switch(state) {
case NAS_IDLE:
DEBUG("NAS_IDLE\n");
return;
// case NAS_STATE_CONNECTED:DEBUG("NAS_STATE_CONNECTED\n");return;
// case NAS_STATE_ESTABLISHMENT_REQUEST:DEBUG("NAS_STATE_ESTABLISHMENT_REQUEST\n");return;
// case NAS_STATE_ESTABLISHMENT_FAILURE:DEBUG("NAS_STATE_ESTABLISHMENT_FAILURE\n");return;
// case NAS_STATE_RELEASE_FAILURE:DEBUG("NAS_STATE_RELEASE_FAILURE\n");return;
case NAS_CX_FACH:
DEBUG("NAS_CX_FACH\n");
return;
case NAS_CX_DCH:
DEBUG("NAS_CX_DCH\n");
return;
case NAS_CX_RECEIVED:
DEBUG("NAS_CX_RECEIVED\n");
return;
case NAS_CX_CONNECTING:
DEBUG("NAS_CX_CONNECTING\n");
return;
case NAS_CX_RELEASING:
DEBUG("NAS_CX_RELEASING\n");
return;
case NAS_CX_CONNECTING_FAILURE:
DEBUG("NAS_CX_CONNECTING_FAILURE\n");
return;
case NAS_CX_RELEASING_FAILURE:
DEBUG("NAS_CX_RELEASING_FAILURE\n");
return;
case NAS_RB_ESTABLISHING:
DEBUG("NAS_RB_ESTABLISHING\n");
return;
case NAS_RB_RELEASING:
DEBUG("NAS_RB_RELEASING\n");
return;
case NAS_RB_DCH:
DEBUG("NAS_RB_DCH\n");
return;
default:
ERR(" Unknown state\n");
}
}
//---------------------------------------------------------------------------
// Convert the IMEI to iid
void RAL_imei2iid(uint8_t *imei, uint8_t *iid)
{
//---------------------------------------------------------------------------
// Start debug information
if (!imei ||! iid ) {
ERR("RAL_imei2iid - input parameter is NULL \n");
return;
}
// End debug information
memset(iid, 0, 8);
iid[0] = 16*imei[0]+imei[1];
iid[1] = 16*imei[2]+imei[3];
iid[2] = 16*imei[4]+imei[5];
iid[3] = 16*imei[6]+imei[7];
iid[4] = 16*imei[8]+imei[9];
iid[5] = 16*imei[10]+imei[11];
iid[6] = 16*imei[12]+imei[13];
iid[7] = 16*imei[14]+imei[15]+1;
}
//---------------------------------------------------------------------------
int RAL_process_NAS_message(int ioctl_obj, int ioctl_cmd, int ioctl_cellid)
{
//---------------------------------------------------------------------------
int err, rc;
NOTICE(" \n");
switch (ioctl_obj) {
/***************************/
case IO_OBJ_STATS: {
struct nas_msg_statistic_reply *msgrep;
//printf("Statistics requested -0\n");
gifr.type=NAS_MSG_STATISTIC_REQUEST;
// gifr.msg=(char *)malloc(sizeof(struct nas_msg_statistic_reply));
memset (ralpriv->buffer,0,800);
gifr.msg= &(ralpriv->buffer[0]);
msgrep=(struct nas_msg_statistic_reply *)(gifr.msg);
NOTICE("[MSC_MSG][%s][%s][--- ioctl : NAS_MSG_STATISTIC_REQUEST --->][nas]\n", getTimeStamp4Log(), g_link_id);
err=ioctl(fd, NASMT_IOCTL_RAL, &gifr);
if (err<0) {
ERR("IOCTL error, err=%d\n",err);
rc = -1;
} else {
DEBUG("tx_packets = %u, rx_packets = %u\n", msgrep->tx_packets, msgrep->rx_packets);
DEBUG("tx_bytes = %u, rx_bytes = %u\n", msgrep->tx_bytes, msgrep->rx_bytes);
DEBUG("tx_errors = %u, rx_errors = %u\n", msgrep->tx_errors, msgrep->rx_errors);
DEBUG("tx_dropped = %u, rx_dropped = %u\n", msgrep->tx_dropped, msgrep->rx_dropped);
memcpy(&(ralpriv->rx_packets), &(msgrep->rx_packets), sizeof(struct nas_msg_statistic_reply));
//IAL_return_NAS_Statistics();
rc = 0;
}
}
break;
/***************************/
case IO_OBJ_CNX:
switch (ioctl_cmd) {
/***/
case IO_CMD_ADD: {
//printf("Usage: gioctl cx add <lcr> <cellid>\n");
struct nas_msg_cx_establishment_request *msgreq;
struct nas_msg_cx_establishment_reply *msgrep;
gifr.type=NAS_MSG_CX_ESTABLISHMENT_REQUEST;
//gifr.msg=(char *)malloc(sizeof(msgrep)<sizeof(msgreq)?sizeof(msgreq):sizeof(msgrep));
memset (ralpriv->buffer,0,800);
gifr.msg= &(ralpriv->buffer[0]);
msgreq=(struct nas_msg_cx_establishment_request *)(gifr.msg);
msgrep=(struct nas_msg_cx_establishment_reply *)(gifr.msg);
msgreq->lcr=0; //Temp <lcr>
msgreq->cellid=ioctl_cellid;
// send IOCTL
NOTICE("[MSC_MSG][%s][%s][--- ioctl : NAS_MSG_CX_ESTABLISHMENT_REQUEST --->][nas]\n", getTimeStamp4Log(), g_link_id);
err=ioctl(fd, NASMT_IOCTL_RAL, &gifr);
if (err<0) {
ERR("IOCTL error, err=%d\n",err);
}
NOTICE("[MSC_MSG][%s][nas][--- NAS_MSG_CX_ESTABLISHMENT_REPLY --->][%s]\n", getTimeStamp4Log(), g_link_id);
ralpriv->pending_req_action = MIH_C_LINK_AC_TYPE_NONE;
ralpriv->state = DISCONNECTED;
if ((err<0)||(msgrep->status<0)) {
ERR(" Connexion establishment failure: %d\n",msgrep->status);
//ralpriv->state = DISCONNECTED;
rc = -1;
ralpriv->pending_req_status = MIH_C_STATUS_SUCCESS;
ralpriv->pending_req_ac_result = MIH_C_LINK_AC_RESULT_FAILURE;
} else {
//ralpriv->state = CONNECTED;
ralpriv->cell_id = ioctl_cellid;
ralpriv->pending_req_status = MIH_C_STATUS_SUCCESS;
ralpriv->pending_req_ac_result = MIH_C_LINK_AC_RESULT_SUCCESS;
ralpriv->pending_req_flag = 1;
DEBUG(" Connexion establishment pending: pending_req_flag %d\n",ralpriv->pending_req_flag);
}
//mRAL_send_link_action_confirm(&ralpriv->pending_req_transaction_id, &ralpriv->pending_req_status, NULL, &ralpriv->pending_req_ac_result);
rc = 0;
}
break;
/***/
case IO_CMD_DEL: {
//printf("Usage: gioctl cx del <lcr>\n");
struct nas_msg_cx_release_request *msgreq;
struct nas_msg_cx_release_reply *msgrep;
gifr.type=NAS_MSG_CX_RELEASE_REQUEST;
//gifr.msg=(char *)malloc(sizeof(msgrep)<sizeof(msgreq)?sizeof(msgreq):sizeof(msgrep));
memset (ralpriv->buffer,0,800);
gifr.msg= &(ralpriv->buffer[0]);
msgreq=(struct nas_msg_cx_release_request *)(gifr.msg);
msgrep=(struct nas_msg_cx_release_reply *)(gifr.msg);
msgreq->lcr=0; //Temp <lcr>
//
NOTICE("[MSC_MSG][%s][%s][--- ioctl : NAS_MSG_CX_RELEASE_REQUEST --->][nas]\n", getTimeStamp4Log(), g_link_id);
err=ioctl(fd, NASMT_IOCTL_RAL, &gifr);
if (err<0) {
ERR("IOCTL error, err=%d\n",err);
rc = -1;
}
//
NOTICE("[MSC_MSG][%s][nas][--- NAS_MSG_CX_RELEASE_REPLY --->][%s]\n", getTimeStamp4Log(), g_link_id);
ralpriv->pending_req_action = MIH_C_LINK_AC_TYPE_NONE;
if (msgrep->status<0) {
ERR(" Connexion release failure: %d", msgrep->status);
rc = -1;
}
if (rc == -1) { // something failed
ralpriv->pending_req_ac_result = MIH_C_LINK_AC_RESULT_FAILURE;
} else {
ralpriv->pending_req_ac_result = MIH_C_LINK_AC_RESULT_SUCCESS;
}
ralpriv->pending_req_status = MIH_C_STATUS_SUCCESS;
ralpriv->state = DISCONNECTED;
//mRALu_send_link_switch_cnf();
ralpriv->pending_req_flag = 0;
ralpriv->cell_id = CONF_UNKNOWN_CELL_ID;
rc = 0;
}
break;
/***/
case IO_CMD_LIST: {
//printf("Usage: gioctl cx list\n");
uint8_t *msgrep;
uint8_t i;
struct nas_msg_cx_list_reply *list;
uint8_t lcr;
gifr.type=NAS_MSG_CX_LIST_REQUEST;
//gifr.msg=(char *)malloc(NAS_LIST_CX_MAX*sizeof(struct nas_msg_cx_list_reply)+1);
memset (ralpriv->buffer,0,800);
gifr.msg= &(ralpriv->buffer[0]);
msgrep=(uint8_t *)(gifr.msg);
//
NOTICE("[MSC_MSG][%s][%s][--- ioctl : NAS_MSG_CX_LIST_REQUEST --->][nas]\n", getTimeStamp4Log(), g_link_id);
err=ioctl(fd, NASMT_IOCTL_RAL, &gifr);
if (err<0) {
ERR("IOCTL error, err=%d\n",err);
rc = -1;
} else {
NOTICE("[MSC_MSG][%s][nas][--- NAS_UE_MSG_CNX_LIST_REPLY --->][%s]\n", getTimeStamp4Log(), g_link_id);
DEBUG("Lcr\t\tCellId\tIID4\tIID6\t\t\tnum_rb\tnsclass\tState\n");
list=(struct nas_msg_cx_list_reply *)(msgrep+1);
lcr=0;
DEBUG("%u\t\t%u\t%u\t", list[lcr].lcr, list[lcr].cellid, list[lcr].iid4);
for (i=0; i<8; ++i)
DEBUG("%02x", *((uint8_t *)list[lcr].iid6+i));
DEBUG("\t%u\t%u\t", list[lcr].num_rb, list[lcr].nsclassifier);
print_state(list[lcr].state);
ralpriv->nas_state = list[lcr].state ;
ralpriv->num_rb = list[lcr].num_rb;
ralpriv->num_class = list[lcr].nsclassifier;
ralpriv->cell_id = list[lcr].cellid ;
//IAL_return_NAS_StatAttach();
rc = 0;
}
}
break;
/***/
default:
ERR ("IAL_process_NAS_message : IO_OBJ_CNX : invalid ioctl command %d\n",ioctl_cmd);
rc= -1;
} //end switch ioctl_cmd
break;
/***************************/
case IO_OBJ_RB:
switch (ioctl_cmd) {
/***/
case IO_CMD_LIST: {
//printf("Usage: gioctl rb list <lcr>\n");
uint8_t *msgrep;
uint8_t rbi;
struct nas_msg_rb_list_reply *list;
struct nas_msg_rb_list_request *msgreq;
gifr.type=NAS_MSG_RB_LIST_REQUEST;
// gifr.msg=(char *)malloc(NAS_LIST_RB_MAX*sizeof(struct nas_msg_rb_list_reply)+1);
memset (ralpriv->buffer,0,800);
gifr.msg= &(ralpriv->buffer[0]);
msgreq=(struct nas_msg_rb_list_request *)(gifr.msg);
msgrep=(uint8_t *)(gifr.msg);
msgreq->lcr=0; //Temp <lcr> - MT
//
NOTICE("[MSC_MSG][%s][%s][--- ioctl : NAS_MSG_RB_LIST_REQUEST --->][nas]\n", getTimeStamp4Log(), g_link_id);
err=ioctl(fd, NASMT_IOCTL_RAL, &gifr);
if (err<0) {
ERR("IOCTL error, err=%d\n",err);
rc = -1;
} else {
DEBUG("rab_id\t\tSapi\t\tQoS\t\tState\n");
list=(struct nas_msg_rb_list_reply *)(msgrep+1);
for (rbi=0; rbi<msgrep[0]; ++rbi) {
DEBUG("%u\t\t%u\t\t%u\t\t", list[rbi].rab_id, list[rbi].sapi, list[rbi].qos);
print_state(list[rbi].state);
rc = 0;
}
//
ralpriv->num_rb = msgrep[0];
for (rbi=0; rbi<ralpriv->num_rb; rbi++) {
ralpriv->rbId[rbi]= list[rbi].rab_id;
ralpriv->QoSclass[rbi] = list[rbi].qos;
ralpriv->dscp[rbi] = rbi+4;
}
//IAL_return_NAS_StatRB();
}
}
break;
/***/
default:
ERR ("IAL_process_NAS_message : IO_OBJ_RB : invalid ioctl command %d\n",ioctl_cmd);
rc= -1;
} //end switch ioctl_cmd
break;
/***************************/
case IO_OBJ_MEAS:
//
{
uint8_t i;
struct nas_msg_measure_request *msgreq;
struct nas_msg_measure_reply *msgrep;
gifr.type=NAS_MSG_MEAS_REQUEST;
// gifr.msg=(char *)malloc(sizeof(msgrep)<sizeof(msgreq)?sizeof(msgreq):sizeof(msgrep));
memset (ralpriv->buffer,0,800);
gifr.msg= &(ralpriv->buffer[0]);
msgreq=(struct nas_msg_measure_request *)(gifr.msg);
msgrep=(struct nas_msg_measure_reply *)(gifr.msg);
//
NOTICE("[MSC_MSG][%s][%s][--- ioctl : NAS_MSG_MEAS_REQUEST --->][nas]\n", getTimeStamp4Log(), g_link_id);
err=ioctl(fd, NASMT_IOCTL_RAL, &gifr);
if (err<0) {
ERR("IOCTL error, err=%d\n",err);
rc = -1;
} else {
//
NOTICE("[MSC_MSG][%s][nas][--- NAS_MSG_MEAS_REPLY --->][%s]\n", getTimeStamp4Log(), g_link_id);
// ralpriv->num_measures = msgrep->num_cells; TEMP- To be activated later
for (i=0; i<msgrep->num_cells; i++) {
ralpriv->meas_cell_id[i] = msgrep-> measures[i].cell_id;
IAL_integrate_measure(msgrep-> measures[i].level, i);
ralpriv->provider_id[i] = msgrep-> measures[i].provider_id;
}
DEBUG("Measurement Report - Number of cells %d - Current cell %d\n", msgrep->num_cells, ralpriv->cell_id);
#ifdef DEBUG_MRALU_MEASURES
DEBUG("Cell_id\tMeasure\tProvider_id\n");
for (i=0; i<msgrep->num_cells; i++) {
DEBUG(" %d\t%d\t%d\n",msgrep-> measures[i].cell_id,msgrep-> measures[i].level,msgrep-> measures[i].provider_id);
}
#endif
//Temp
//ralpriv->meas_cell_id[0] = ralpriv->cell_id;
rc = 0;
}
}
break;
/***************************/
case IO_OBJ_IMEI: {
struct nas_msg_l2id_reply *msgrep;
gifr.type=NAS_MSG_IMEI_REQUEST;
// gifr.msg=(char *)malloc(sizeof(struct nas_msg_statistic_reply));
memset (ralpriv->buffer,0,800);
gifr.msg= &(ralpriv->buffer[0]);
msgrep=(struct nas_msg_l2id_reply *)(gifr.msg);
NOTICE("[MSC_MSG][%s][%s][--- ioctl : NAS_MSG_IMEI_REQUEST (L2Id) --->][nas]\n", getTimeStamp4Log(), g_link_id);
err=ioctl(fd, NASMT_IOCTL_RAL, &gifr);
if (err<0) {
ERR("IOCTL error, err=%d\n",err);
rc = -1;
// default IMEI address : NAS_DEFAULT_IMEI
RAL_imei2iid(NAS_DEFAULT_IMEI, (uint8_t *)&(ralpriv->ipv6_l2id[0]));
} else {
NOTICE("[MSC_MSG][%s][nas][--- NAS_MSG_IMEI_REPLY --->][%s]\n", getTimeStamp4Log(), g_link_id);
DEBUG("IMEI value received= %d %d\n", msgrep->l2id[0], msgrep->l2id[1]);
//store the received value, to be used later
ralpriv->ipv6_l2id[0] = msgrep->l2id[0];
ralpriv->ipv6_l2id[1] = msgrep->l2id[1];
rc = 0;
}
}
break;
/***************************/
default:
ERR ("IAL_process_NAS_message : invalid ioctl object %d\n",ioctl_obj);
rc= -1;
} //end switch ioctl_obj
return rc;
}
@@ -1,375 +0,0 @@
/***************************************************************************
lteRALue_main.c - description
***************************************************************************
Eurecom OpenAirInterface 3
Copyright(c) 1999 - 2013 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, 450 route des Chappes, 06410 Biot Sophia Antipolis, France
*******************************************************************************/
/*! \file lteRALue_main.c
* \brief This file contains the main() function for the LTE-RAL-UE
* \author WETTERWALD Michelle, GAUTHIER Lionel, MAUREL Frederic
* \date 2013
* \company EURECOM
* \email: michelle.wetterwald@eurecom.fr, lionel.gauthier@eurecom.fr, frederic.maurel@eurecom.fr
*/
/*******************************************************************************/
#define LTE_RAL_UE
#define LTERALUE_MAIN_C
//-----------------------------------------------------------------------------
#include <stdio.h>
# include <sys/epoll.h>
#include <sys/select.h>
#include <net/if.h>
#include <getopt.h>
#include <stdlib.h>
#include <time.h>
//-----------------------------------------------------------------------------
#include "assertions.h"
#include "lteRALue.h"
#include "LAYER2/MAC/extern.h"
#include "intertask_interface.h"
#include "OCG.h"
//-----------------------------------------------------------------------------
extern unsigned char NB_eNB_INST;
extern unsigned char NB_UE_INST;
extern OAI_Emulation oai_emulation;
//---------------------------------------------------------------------------
void mRAL_get_IPv6_addr(void)
{
//---------------------------------------------------------------------------
#define IPV6_ADDR_LINKLOCAL 0x0020U
#ifdef RAL_DUMMY
char * eth0_name="eth0";/* interface name */
#endif
#ifdef RAL_REALTIME
char * graal0_name="oai0";/* interface name */
#endif
FILE *f;
char devname[20];
int plen, scope, dad_status, if_idx;
char addr6p[8][5];
int intf_found = 0;
char my_addr[16];
char temp_addr[32];
int i, j;
if ((f = fopen("/proc/net/if_inet6", "r")) != NULL) {
while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n",
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
addr6p[4], addr6p[5], addr6p[6], addr6p[7],
&if_idx, &plen, &scope, &dad_status, devname) != EOF) {
#ifdef RAL_DUMMY
if (!strcmp(devname, eth0_name)) {
#endif
#ifdef RAL_REALTIME
if (!strcmp(devname, graal0_name)) {
#endif
intf_found = 1;
// retrieve numerical value
if ((scope ==0)||(scope== IPV6_ADDR_LINKLOCAL)) {
LOG_D(RAL_UE, " adresse %s:%s:%s:%s:%s:%s:%s:%s",
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
LOG_D(RAL_UE, " Scope:");
switch (scope) {
case 0:
LOG_D(RAL_UE, "Global");
break;
case IPV6_ADDR_LINKLOCAL:
LOG_D(RAL_UE, "Link");
break;
default:
LOG_D(RAL_UE, "Unknown");
}
LOG_D(RAL_UE, "\n Numerical value: ");
for (i = 0; i < 8; i++) {
for (j=0; j<4; j++) {
addr6p[i][j]= toupper(addr6p[i][j]);
if ((addr6p[i][j] >= 'A') && (addr6p[i][j] <= 'F')) {
temp_addr[(4*i)+j] =(unsigned short int)(addr6p[i][j]-'A')+10;
} else if ((addr6p[i][j] >= '0') && (addr6p[i][j] <= '9')) {
temp_addr[(4*i)+j] =(unsigned short int)(addr6p[i][j]-'0');
}
}
my_addr[2*i]= (16*temp_addr[(4*i)])+temp_addr[(4*i)+1];
my_addr[(2*i)+1]= (16*temp_addr[(4*i)+2])+temp_addr[(4*i)+3];
}
for (i=0; i<16; i++) {
LOG_D(RAL_UE, "-%hhx-",my_addr[i]);
}
LOG_D(RAL_UE, "\n\n");
}
}
}
fclose(f);
if (!intf_found) {
LOG_E(RAL_UE, "interface not found\n\n");
}
}
}
//---------------------------------------------------------------------------
void mRAL_init_default_values(void)
//---------------------------------------------------------------------------
{
g_conf_ue_ral_listening_port = UE_DEFAULT_LOCAL_PORT_RAL;
g_conf_ue_ral_ip_address = UE_DEFAULT_IP_ADDRESS_RAL;
g_conf_ue_ral_link_id = UE_DEFAULT_LINK_ID_RAL;
g_conf_ue_ral_link_address = UE_DEFAULT_LINK_ADDRESS_RAL;
g_conf_ue_mihf_remote_port = UE_DEFAULT_REMOTE_PORT_MIHF;
g_conf_ue_mihf_ip_address = UE_DEFAULT_IP_ADDRESS_MIHF;
g_conf_ue_mihf_id = UE_DEFAULT_MIHF_ID;
}
//---------------------------------------------------------------------------
int mRAL_initialize(void) {
//---------------------------------------------------------------------------
ral_ue_instance_t instance = 0;
module_id_t mod_id = 0;
char *char_tmp = NULL;
MIH_C_init();
srand(time(NULL));
memset(g_ue_ral_obj, 0, sizeof(lte_ral_ue_object_t)*MAX_MODULES);
g_ue_ral_fd2instance = hashtable_create (32, NULL, hash_free_int_func);
for (mod_id = oai_emulation.info.first_ue_local; mod_id < oai_emulation.info.first_ue_local+ oai_emulation.info.nb_ue_local; mod_id++) {
instance = mod_id + NB_eNB_INST;
char_tmp = calloc(1, strlen(g_conf_ue_ral_listening_port) + 3); // 2 digits + \0 ->99 mod_ids
sprintf(char_tmp,"%d", atoi(g_conf_ue_ral_listening_port) + mod_id);
g_ue_ral_obj[mod_id].ral_listening_port = char_tmp;
g_ue_ral_obj[mod_id].ral_ip_address = strdup(g_conf_ue_ral_ip_address);
g_ue_ral_obj[mod_id].ral_link_address = strdup(g_conf_ue_ral_link_address);
char_tmp = calloc(1, strlen(g_conf_ue_mihf_remote_port) + 3); // 2 digits + \0 ->99 mod_ids
sprintf(char_tmp, "%d", atoi(g_conf_ue_mihf_remote_port) + mod_id);
g_ue_ral_obj[mod_id].mihf_remote_port = char_tmp;
g_ue_ral_obj[mod_id].mihf_ip_address = strdup(g_conf_ue_mihf_ip_address);
char_tmp = calloc(1, strlen(g_conf_ue_mihf_id) + 3); // 2 digits + \0 ->99 mod_ids
sprintf(char_tmp, "%s%02d",g_conf_ue_mihf_id, mod_id);
g_ue_ral_obj[mod_id].mihf_id = char_tmp;
char_tmp = calloc(1, strlen(g_conf_ue_ral_link_id) + 3); // 2 digits + \0 ->99 mod_ids
sprintf(char_tmp, "%s%02d",g_conf_ue_ral_link_id, mod_id);
g_ue_ral_obj[mod_id].link_id = char_tmp;
char_tmp = NULL;
printf("g_ue_ral_obj[%d].link_id=%s\n", mod_id, g_ue_ral_obj[mod_id].link_id);
// excluded MIH_C_LINK_AC_TYPE_NONE
// excluded MIH_C_LINK_AC_TYPE_LINK_LOW_POWER
g_ue_ral_obj[mod_id].mih_supported_action_list = MIH_C_LINK_AC_TYPE_LINK_DISCONNECT |
MIH_C_LINK_AC_TYPE_LINK_POWER_DOWN |
MIH_C_LINK_AC_TYPE_LINK_POWER_UP |
MIH_C_LINK_AC_TYPE_LINK_FLOW_ATTR |
MIH_C_LINK_AC_TYPE_LINK_ACTIVATE_RESOURCES |
MIH_C_LINK_AC_TYPE_LINK_DEACTIVATE_RESOURCES;
g_ue_ral_obj[mod_id].mih_supported_link_event_list = MIH_C_BIT_LINK_DETECTED |
MIH_C_BIT_LINK_UP |
MIH_C_BIT_LINK_DOWN |
MIH_C_BIT_LINK_PARAMETERS_REPORT |
MIH_C_BIT_LINK_GOING_DOWN |
MIH_C_BIT_LINK_HANDOVER_IMMINENT |
MIH_C_BIT_LINK_HANDOVER_COMPLETE |
MIH_C_BIT_LINK_PDU_TRANSMIT_STATUS;
g_ue_ral_obj[mod_id].mih_supported_link_command_list = MIH_C_BIT_LINK_EVENT_SUBSCRIBE | MIH_C_BIT_LINK_EVENT_UNSUBSCRIBE |
MIH_C_BIT_LINK_GET_PARAMETERS | MIH_C_BIT_LINK_CONFIGURE_THRESHOLDS |
MIH_C_BIT_LINK_ACTION;
g_ue_ral_obj[mod_id].link_to_be_detected = MIH_C_BOOLEAN_TRUE;
g_ue_ral_obj[mod_id].link_mihcap_flag = MIH_C_BIT_EVENT_SERVICE_SUPPORTED | MIH_C_BIT_COMMAND_SERVICE_SUPPORTED | MIH_C_BIT_INFORMATION_SERVICE_SUPPORTED;
g_ue_ral_obj[mod_id].net_caps = MIH_C_BIT_NET_CAPS_QOS_CLASS5 | MIH_C_BIT_NET_CAPS_INTERNET_ACCESS | MIH_C_BIT_NET_CAPS_MIH_CAPABILITY;
g_ue_ral_obj[mod_id].transaction_id = (MIH_C_TRANSACTION_ID_T)rand();
LOG_D(RAL_UE, " Connect to the MIH-F for module id instance %d...\n", mod_id, instance);
g_ue_ral_obj[mod_id].mih_sock_desc = -1;
AssertFatal (mRAL_mihf_connect(instance) >= 0, "%s : Could not connect to MIH-F...\n", __FUNCTION__);
itti_subscribe_event_fd(TASK_RAL_UE, g_ue_ral_obj[mod_id].mih_sock_desc);
hashtable_insert(g_ue_ral_fd2instance, g_ue_ral_obj[mod_id].mih_sock_desc, (void*)instance);
mRAL_send_link_register_indication(instance, &g_ue_ral_obj[mod_id].transaction_id);
g_ue_ral_obj[mod_id].transaction_id += 1;
}
return 0;
}
void mRAL_process_file_descriptors(struct epoll_event *events, int nb_events) {
int i;
ral_ue_instance_t instance;
hashtable_rc_t rc;
if (events == NULL) {
return;
}
for (i = 0; i < nb_events; i++) {
rc = hashtable_get(g_ue_ral_fd2instance, events[i].data.fd, (void**)&instance);
if (rc == HASH_TABLE_OK) {
mRAL_mih_link_process_message(instance);
}
}
}
void* mRAL_task(void *args_p) {
int nb_events;
struct epoll_event *events;
MessageDef *msg_p = NULL;
const char *msg_name = NULL;
instance_t instance = 0;
mRAL_initialize();
itti_mark_task_ready (TASK_RAL_UE);
// Set UE activation state
for (instance = NB_eNB_INST; instance < (NB_eNB_INST + NB_UE_INST); instance++) {
MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_RAL_UE, DEACTIVATE_MESSAGE);
itti_send_msg_to_task(TASK_L2L1, instance, message_p);
}
while(1) {
// Wait for a message
itti_receive_msg (TASK_RAL_UE, &msg_p);
if (msg_p != NULL) {
msg_name = ITTI_MSG_NAME (msg_p);
instance = ITTI_MSG_INSTANCE (msg_p);
switch (ITTI_MSG_ID(msg_p)) {
case TERMINATE_MESSAGE:
// TO DO
itti_exit_task ();
break;
case TIMER_HAS_EXPIRED:
LOG_D(RAL_UE, "Received %s\n", msg_name);
break;
case RRC_RAL_SCAN_CONF:
LOG_D(RAL_UE, "Received %s\n", msg_name);
mRAL_rx_rrc_ral_scan_confirm(instance, msg_p);
break;
case RRC_RAL_SYSTEM_INFORMATION_IND:
LOG_D(RAL_UE, "Received %s\n", msg_name);
mRAL_rx_rrc_ral_system_information_indication(instance, msg_p);
break;
case RRC_RAL_CONNECTION_ESTABLISHMENT_IND:
LOG_D(RAL_UE, "Received %s\n", msg_name);
mRAL_rx_rrc_ral_connection_establishment_indication(instance, msg_p);
break;
case RRC_RAL_CONNECTION_REESTABLISHMENT_IND:
LOG_D(RAL_UE, "Received %s\n", msg_name);
mRAL_rx_rrc_ral_connection_reestablishment_indication(instance, msg_p);
break;
case RRC_RAL_CONNECTION_RECONFIGURATION_IND:
LOG_D(RAL_UE, "Received %s\n", msg_name);
mRAL_rx_rrc_ral_connection_reconfiguration_indication(instance, msg_p);
break;
case RRC_RAL_CONNECTION_RECONFIGURATION_HO_IND:
LOG_D(RAL_UE, "Received %s\n", msg_name);
//mRAL_rx_rrc_ral_connection_reconfiguration_ho_indication(instance, msg_p);
break;
case RRC_RAL_MEASUREMENT_REPORT_IND:
LOG_D(RAL_UE, "Received %s\n", msg_name);
mRAL_rx_rrc_ral_measurement_report_indication(instance, msg_p);
break;
case RRC_RAL_CONNECTION_RELEASE_IND:
LOG_D(RAL_UE, "Received %s\n", msg_name);
mRAL_rx_rrc_ral_connection_release_indication(instance, msg_p);
break;
case RRC_RAL_CONFIGURE_THRESHOLD_CONF:
LOG_D(RAL_UE, "Received %s\n", msg_name);
mRAL_rx_rrc_ral_configure_threshold_conf(instance, msg_p);
break;
default:
LOG_E(RAL_UE, "Received unexpected message %s\n", msg_name);
break;
}
itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
msg_p = NULL;
}
nb_events = itti_get_events(TASK_RAL_UE, &events);
/* Now handle notifications for other sockets */
if (nb_events > 0) {
mRAL_process_file_descriptors(events, nb_events);
}
}
}
@@ -1,224 +0,0 @@
/***************************************************************************
lteRALue_mih_execute.c - description
***************************************************************************
Eurecom OpenAirInterface 3
Copyright(c) 1999 - 2013 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, 450 route des Chappes, 06410 Biot Sophia Antipolis, France
*******************************************************************************/
/*! \file lteRALue_mih_execute.c
* \brief Execution of MIH primitives in LTE-RAL-UE
* \author WETTERWALD Michelle, GAUTHIER Lionel, MAUREL Frederic
* \date 2013
* \company EURECOM
* \email: michelle.wetterwald@eurecom.fr, lionel.gauthier@eurecom.fr, frederic.maurel@eurecom.fr
*/
/*******************************************************************************/
#define LTE_RAL_UE
#define LTERALUE_MIH_MSG_C
#include <assert.h>
//-----------------------------------------------------------------------------
#include "lteRALue.h"
//-----------------------------------------------------------------------------
void mRAL_configure_thresholds_request(MIH_C_Message_Link_Configure_Thresholds_request_t* messageP)
{
//-----------------------------------------------------------------------------
MIH_C_STATUS_T status;
MIH_C_LINK_CFG_STATUS_LIST_T link_cfg_status_list;
unsigned int threshold_index;
unsigned int link_index;
unsigned int result_index;
// SAVE REQUEST
// IT IS ASSUMED SINCE IT IS NOT CLEAR IN SPECs THAT THERE IS NO NEED TO MERGE CONFIGURE_THRESHOLDS_requests
//memset(&ralpriv->mih_link_cfg_param_thresholds_list, 0, sizeof(MIH_C_LINK_CFG_PARAM_LIST_T));
memcpy(&ralpriv->mih_link_cfg_param_thresholds_list, &messageP->primitive.LinkConfigureParameterList_list, sizeof(MIH_C_LINK_CFG_PARAM_LIST_T));
status = MIH_C_STATUS_SUCCESS;
result_index = 0;
for (link_index = 0;
link_index < messageP->primitive.LinkConfigureParameterList_list.length;
link_index++) {
ralpriv->active_mih_link_cfg_param_threshold[link_index] = MIH_C_BOOLEAN_TRUE;
for (threshold_index = 0;
threshold_index < messageP->primitive.LinkConfigureParameterList_list.val[link_index].threshold_list.length;
threshold_index ++) {
memcpy(&link_cfg_status_list.val[result_index].link_param_type,
&messageP->primitive.LinkConfigureParameterList_list.val[link_index].link_param_type,
sizeof(MIH_C_LINK_PARAM_TYPE_T));
memcpy(&link_cfg_status_list.val[result_index].threshold,
&messageP->primitive.LinkConfigureParameterList_list.val[link_index].threshold_list.val[threshold_index],
sizeof(MIH_C_THRESHOLD_T));
// NOW, ALWAYS SAY OK FOR PARAMETERS, BUT MAY BE WE WILL PUT MIH_C_BOOLEAN_FALSE in active_mih_link_cfg_param_threshold[link_index]
link_cfg_status_list.val[result_index].config_status = MIH_C_CONFIG_STATUS_SUCCESS;
result_index += 1;
}
}
// Say following thresholds entries are not configured
for (link_index = messageP->primitive.LinkConfigureParameterList_list.length;
link_index < MIH_C_LINK_CFG_PARAM_LIST_LENGTH;
link_index++) {
ralpriv->active_mih_link_cfg_param_threshold[link_index] = MIH_C_BOOLEAN_FALSE;
}
link_cfg_status_list.length = result_index;
mRALte_send_configure_thresholds_confirm(&messageP->header.transaction_id,&status, &link_cfg_status_list);
}
/*
//-----------------------------------------------------------------------------
void mRAL_check_thresholds_signal_strength(MIH_C_THRESHOLD_VAL_T new_valP, MIH_C_THRESHOLD_VAL_T old_valP) {
//-----------------------------------------------------------------------------
unsigned int threshold_index, threshold_index_mov;
unsigned int link_index;
unsigned int buffer_index;
MIH_C_THRESHOLD_VAL_T threshold_val;
MIH_C_THRESHOLD_XDIR_T threshold_xdir;
MIH_C_TH_ACTION_T th_action;
LIST(MIH_C_LINK_PARAM_RPT, LinkParametersReportList);
MIH_C_TRANSACTION_ID_T transaction_id;
MIH_C_LINK_TUPLE_ID_T link_identifier;
char buf[256];
DEBUG("%s new_val %d old_val %d\n", __FUNCTION__, new_valP, old_valP);
LinkParametersReportList_list.length = 0;
for (link_index = 0;
link_index < MIH_C_LINK_CFG_PARAM_LIST_LENGTH;
link_index++) {
if (ralpriv->active_mih_link_cfg_param_threshold[link_index] == MIH_C_BOOLEAN_TRUE) {
if ( ralpriv->mih_link_cfg_param_thresholds_list.val[link_index].link_param_type.choice == MIH_C_LINK_PARAM_TYPE_CHOICE_GEN) {
th_action = ralpriv->mih_link_cfg_param_thresholds_list.val[link_index].th_action;
for (threshold_index = 0;
threshold_index < ralpriv->mih_link_cfg_param_thresholds_list.val[link_index].threshold_list.length;
threshold_index ++) {
threshold_val = ralpriv->mih_link_cfg_param_thresholds_list.val[link_index].threshold_list.val[threshold_index].threshold_val;
threshold_xdir = ralpriv->mih_link_cfg_param_thresholds_list.val[link_index].threshold_list.val[threshold_index].threshold_xdir;
switch (th_action) {
case MIH_C_SET_NORMAL_THRESHOLD:
if (((threshold_xdir == MIH_C_ABOVE_THRESHOLD) && (old_valP <= threshold_val) && (new_valP > threshold_val)) ||
((threshold_xdir == MIH_C_BELOW_THRESHOLD) && (old_valP >= threshold_val) && (new_valP < threshold_val))) {
memset(buf, 0, 256);
buffer_index = sprintf(buf, "CROSSED NORMAL THRESHOLD VAL %d DIR ", threshold_val);
buffer_index = MIH_C_THRESHOLD_XDIR2String2(&threshold_xdir, &buf[buffer_index]);
buffer_index = sprintf(buf, " with VAL %d\n", new_valP);
NOTICE("%s", buf);
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.link_param_type.choice = MIH_C_LINK_PARAM_TYPE_CHOICE_GEN;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.link_param_type._union.link_param_gen = MIH_C_LINK_PARAM_GEN_SIGNAL_STRENGTH;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.choice = MIH_C_LINK_PARAM_CHOICE_LINK_PARAM_VAL;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param._union.link_param_val = new_valP;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].choice = MIH_C_LINK_PARAM_RPT_CHOICE_THRESHOLD;
LinkParametersReportList_list.val[LinkParametersReportList_list.length]._union.threshold.threshold_val = threshold_val;
LinkParametersReportList_list.val[LinkParametersReportList_list.length]._union.threshold.threshold_xdir = threshold_xdir;
LinkParametersReportList_list.length = LinkParametersReportList_list.length + 1;
}
break;
case MIH_C_SET_ONE_SHOT_THRESHOLD:
if (((threshold_xdir == MIH_C_ABOVE_THRESHOLD) && (old_valP <= threshold_val) && (new_valP > threshold_val)) ||
((threshold_xdir == MIH_C_BELOW_THRESHOLD) && (old_valP >= threshold_val) && (new_valP < threshold_val))) {
memset(buf, 0, 256);
buffer_index = sprintf(buf, "CROSSED ONE SHOT THRESHOLD VAL %d DIR ", threshold_val);
buffer_index = MIH_C_THRESHOLD_XDIR2String2(&threshold_xdir, &buf[buffer_index]);
buffer_index = sprintf(buf, " with VAL %d\n", new_valP);
NOTICE("%s", buf);
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.link_param_type.choice = MIH_C_LINK_PARAM_TYPE_CHOICE_GEN;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.link_param_type._union.link_param_gen = MIH_C_LINK_PARAM_GEN_SIGNAL_STRENGTH;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param.choice = MIH_C_LINK_PARAM_CHOICE_LINK_PARAM_VAL;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].link_param._union.link_param_val = new_valP;
LinkParametersReportList_list.val[LinkParametersReportList_list.length].choice = MIH_C_LINK_PARAM_RPT_CHOICE_THRESHOLD;
LinkParametersReportList_list.val[LinkParametersReportList_list.length]._union.threshold.threshold_val = threshold_val;
LinkParametersReportList_list.val[LinkParametersReportList_list.length]._union.threshold.threshold_xdir = threshold_xdir;
LinkParametersReportList_list.length = LinkParametersReportList_list.length + 1;
// Remove this threshold: shift Thresholds
for (threshold_index_mov = threshold_index;
threshold_index_mov < ralpriv->mih_link_cfg_param_thresholds_list.val[link_index].threshold_list.length - 1;
threshold_index_mov ++) {
memcpy(&ralpriv->mih_link_cfg_param_thresholds_list.val[link_index].threshold_list.val[threshold_index_mov],
&ralpriv->mih_link_cfg_param_thresholds_list.val[link_index].threshold_list.val[threshold_index_mov+1],
sizeof(MIH_C_THRESHOLD_T));
}
}
break;
// may be not necessary here
case MIH_C_CANCEL_THRESHOLD:
// shift Thresholds
for (threshold_index_mov = threshold_index;
threshold_index_mov < ralpriv->mih_link_cfg_param_thresholds_list.val[link_index].threshold_list.length - 1;
threshold_index_mov ++) {
memcpy(&ralpriv->mih_link_cfg_param_thresholds_list.val[link_index].threshold_list.val[threshold_index_mov],
&ralpriv->mih_link_cfg_param_thresholds_list.val[link_index].threshold_list.val[threshold_index_mov+1],
sizeof(MIH_C_THRESHOLD_T));
}
ralpriv->mih_link_cfg_param_thresholds_list.val[link_index].threshold_list.length -= 1;
break;
default:
ERR("%s UNKNOWN TH ACTION FOUND, RETURN", __FUNCTION__);
return;
}
}
}
}
}
if (LinkParametersReportList_list.length > 0) {
transaction_id = MIH_C_get_new_transaction_id();
link_identifier.link_id.link_type = MIH_C_WIRELESS_UMTS;
link_identifier.link_id.link_addr.choice = (MIH_C_CHOICE_T)MIH_C_CHOICE_3GPP_ADDR;
MIH_C_3GPP_ADDR_set(&link_identifier.link_id.link_addr._union._3gpp_addr, (u_int8_t*)&(ralpriv->ipv6_l2id[0]), strlen(DEFAULT_ADDRESS_3GPP));
link_identifier.choice = MIH_C_LINK_TUPLE_ID_CHOICE_NULL;
mRAL_send_link_parameters_report_indication(&transaction_id, &link_identifier, &LinkParametersReportList_list);
}
}
*/
@@ -1,966 +0,0 @@
/***************************************************************************
lteRALue_mih_msg.c - description
***************************************************************************
Eurecom OpenAirInterface 3
Copyright(c) 1999 - 2013 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, 450 route des Chappes, 06410 Biot Sophia Antipolis, France
*******************************************************************************/
/*! \file lteRALue_mih_msg.c
* \brief Interface for MIH primitives in LTE-RAL-UE
* \author WETTERWALD Michelle, GAUTHIER Lionel, MAUREL Frederic
* \date 2013
* \company EURECOM
* \email: michelle.wetterwald@eurecom.fr, lionel.gauthier@eurecom.fr, frederic.maurel@eurecom.fr
*/
/*******************************************************************************/
#define LTE_RAL_UE
#define LTERALUE_MIH_MSG_C
//-----------------------------------------------------------------------------
#include "lteRALue.h"
#include "LAYER2/MAC/extern.h"
//-----------------------------------------------------------------------------
#define MSG_CODEC_RECV_BUFFER_SIZE 16400
#define MSG_CODEC_SEND_BUFFER_SIZE 16400
/****************************************************************************/
/******************* L O C A L D E F I N I T I O N S *******************/
/****************************************************************************/
static u_int8_t g_msg_codec_recv_buffer[MSG_CODEC_RECV_BUFFER_SIZE] = {};
static u_int8_t g_msg_codec_send_buffer[MSG_CODEC_SEND_BUFFER_SIZE] = {};
static char g_msg_print_buffer[8192] = {};
static char g_msg_codec_print_buffer[8192] = {};
//-----------------------------------------------------------------------------
int mRAL_send_to_mih(ral_ue_instance_t instanceP, u_int8_t *buffer_pP, size_t lenP)
{
//-----------------------------------------------------------------------------
int result;
module_id_t mod_id = instanceP - NB_eNB_INST;
result = send(g_ue_ral_obj[mod_id].mih_sock_desc, (const void *)buffer_pP, lenP, 0);
if (result != lenP) {
LOG_E(RAL_UE, "send_to_mih %d bytes failed, returned %d: %s\n", lenP, result, strerror(errno));
}
return result;
}
//---------------------------------------------------------------------------
int mRAL_mihf_connect(ral_ue_instance_t instanceP)
{
//---------------------------------------------------------------------------
struct addrinfo info; /* endpoint information */
struct addrinfo *addr, *rp; /* endpoint address */
int rc; /* returned error code */
int optval; /* socket option value */
module_id_t mod_id = instanceP - NB_eNB_INST;
unsigned char buf[sizeof(struct sockaddr_in6)];
/*
* Initialize the remote MIH-F endpoint address information
*/
memset(&info, 0, sizeof(struct addrinfo));
info.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */
info.ai_socktype = SOCK_DGRAM; /* Datagram socket */
info.ai_flags = 0;
info.ai_protocol = 0; /* Any protocol */
rc = getaddrinfo(g_ue_ral_obj[mod_id].mihf_ip_address, g_ue_ral_obj[mod_id].mihf_remote_port, &info, &addr);
if (rc != 0) {
LOG_E(RAL_UE, " getaddrinfo: %s\n", gai_strerror(rc));
return -1;
}
/*
* getaddrinfo() returns a linked list of address structures.
* Try each address until we successfully connect(2). If socket(2)
* (or connect(2)) fails, we (close the socket and) try the next address.
*/
for (rp = addr; rp != NULL; rp = rp->ai_next) {
g_ue_ral_obj[mod_id].mih_sock_desc = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
if (g_ue_ral_obj[mod_id].mih_sock_desc < 0) {
continue;
}
optval = 1;
setsockopt(g_ue_ral_obj[mod_id].mih_sock_desc, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval));
/*
* Convert the RAL local network address
*/
if (rp->ai_family == AF_INET) {
/* IPv4 network address family */
struct sockaddr_in *addr4 = NULL;
LOG_D(RAL_UE, " %s is an ipv4 address\n", g_ue_ral_obj[mod_id].mihf_ip_address);
addr4 = (struct sockaddr_in *)(&buf[0]);
addr4->sin_port = htons(atoi(g_ue_ral_obj[mod_id].ral_listening_port));
addr4->sin_family = AF_INET;
rc = inet_pton(AF_INET, g_ue_ral_obj[mod_id].ral_ip_address, &addr4->sin_addr);
} else if (rp->ai_family == AF_INET6) {
/* IPv6 network address family */
struct sockaddr_in6 *addr6 = NULL;
LOG_D(RAL_UE, " %s is an ipv6 address\n", g_ue_ral_obj[mod_id].mihf_ip_address);
addr6 = (struct sockaddr_in6 *)(&buf[0]);
addr6->sin6_port = htons(atoi(g_ue_ral_obj[mod_id].ral_listening_port));
addr6->sin6_family = AF_INET6;
rc = inet_pton(AF_INET, g_ue_ral_obj[mod_id].ral_ip_address, &addr6->sin6_addr);
} else {
LOG_E(RAL_UE, " %s is an unknown address format %d\n",
g_ue_ral_obj[mod_id].mihf_ip_address, rp->ai_family);
return -1;
}
if (rc < 0) {
/* The network address convertion failed */
LOG_E(RAL_UE, " inet_pton(RAL IP address %s): %s\n",
g_ue_ral_obj[mod_id].ral_ip_address, strerror(rc));
return -1;
} else if (rc == 0) {
/* The network address is not valid */
LOG_E(RAL_UE, " RAL IP address %s is not valid\n", g_ue_ral_obj[mod_id].ral_ip_address);
return -1;
}
/* Bind the socket to the local RAL network address */
rc = bind(g_ue_ral_obj[mod_id].mih_sock_desc, (const struct sockaddr *)buf,
sizeof(struct sockaddr_in));
if (rc < 0) {
LOG_E(RAL_UE, " bind(RAL IP address %s): %s\n",
g_ue_ral_obj[mod_id].ral_ip_address, strerror(errno));
return -1;
}
/* Connect the socket to the remote MIH-F network address */
if (connect(g_ue_ral_obj[mod_id].mih_sock_desc, rp->ai_addr, rp->ai_addrlen) == 0) {
LOG_N(RAL_UE, " RAL [%s:%s] is now UDP-CONNECTED to MIH-F [%s:%s]\n",
g_ue_ral_obj[mod_id].ral_ip_address, g_ue_ral_obj[mod_id].ral_listening_port,
g_ue_ral_obj[mod_id].mihf_ip_address, g_ue_ral_obj[mod_id].mihf_remote_port);
break;
}
/*
* We failed to connect:
* Close the socket file descriptor and try to connect to an other
* address.
*/
close(g_ue_ral_obj[mod_id].mih_sock_desc);
}
/*
* Unable to connect to a network address
*/
if (rp == NULL) {
LOG_E(RAL_UE, " Could not connect to MIH-F\n");
return -1;
}
freeaddrinfo(addr);
return 0;
}
//-----------------------------------------------------------------------------
void MIH_C_3GPP_ADDR_load_3gpp_str_address(ral_ue_instance_t instanceP, MIH_C_3GPP_ADDR_T* _3gpp_addr_pP, u_int8_t* str_pP)
//-----------------------------------------------------------------------------
{
int i, l;
u_int8_t val_temp;
unsigned char address_3gpp[32];
unsigned char buf[3];
u_int8_t _3gpp_byte_address[8];
module_id_t mod_id = instanceP - NB_eNB_INST;
strcpy((char *)address_3gpp, (char *)str_pP);
for(l=0; l<8; l++) {
i=l*2;
buf[0]= address_3gpp[i];
buf[1]= address_3gpp[i+1];
buf[2]= '\0';
//sscanf((const char *)buf,"%02x", &val_temp);
sscanf((const char *)buf,"%hhx", &val_temp);
_3gpp_byte_address[l] = val_temp;
}
_3gpp_byte_address[7] += mod_id;
MIH_C_3GPP_ADDR_set(_3gpp_addr_pP, _3gpp_byte_address, 8);
}
/***************************************************************************
Transmission side
***************************************************************************/
//-----------------------------------------------------------------------------
void mRAL_send_link_register_indication(ral_ue_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_id_pP)
{
//-----------------------------------------------------------------------------
MIH_C_Message_Link_Register_indication_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
memset(&message, 0, sizeof (MIH_C_Message_Link_Register_indication_t));
message.header.version = (MIH_C_VERSION_T)MIH_C_PROTOCOL_VERSION;
message.header.service_identifier = (MIH_C_SID_T)1;
message.header.operation_code = (MIH_C_OPCODE_T)3;
message.header.action_identifier = (MIH_C_AID_T)6;
message.header.transaction_id = *transaction_id_pP;
MIH_C_MIHF_ID_set(&message.source, (u_int8_t*)g_ue_ral_obj[mod_id].link_id, strlen(g_ue_ral_obj[mod_id].link_id));
MIH_C_MIHF_ID_set(&message.destination, (u_int8_t*)g_ue_ral_obj[mod_id].mihf_id, strlen(g_ue_ral_obj[mod_id].mihf_id));
message.primitive.Link_Id.link_type = MIH_C_WIRELESS_LTE; //MIH_C_WIRELESS_UMTS;
#ifdef USE_3GPP_ADDR_AS_LINK_ADDR
message.primitive.Link_Id.link_addr.choice = (MIH_C_CHOICE_T)MIH_C_CHOICE_3GPP_ADDR;
MIH_C_3GPP_ADDR_load_3gpp_str_address(mod_id, &message.primitive.Link_Id.link_addr._union._3gpp_addr, (u_int8_t*)UE_DEFAULT_3GPP_ADDRESS);
#else
message.primitive.Link_Id.link_addr.choice = (MIH_C_CHOICE_T)MIH_C_CHOICE_3GPP_3G_CELL_ID;
memcpy(message.primitive.Link_Id.link_addr._union._3gpp_3g_cell_id.plmn_id.val, &g_ue_ral_obj[mod_id].plmn_id, 3);
message.primitive.Link_Id.link_addr._union._3gpp_3g_cell_id.cell_id = g_ue_ral_obj[mod_id].cell_id;
#endif
//MIH_C_3GPP_ADDR_set(&message.primitive.Link_Id.link_addr._union._3gpp_addr, (u_int8_t*)&(g_ue_ral_obj[instanceP].ipv6_l2id[0]), strlen(UE_DEFAULT_3GPP_ADDRESS));
////MIH_C_3GPP_ADDR_set(&message.primitive.Link_Id.link_addr._union._3gpp_addr, (u_int8_t*)UE_DEFAULT_3GPP_ADDRESS, strlen(UE_DEFAULT_3GPP_ADDRESS));
////MIH_C_3GPP_ADDR_load_3gpp_str_address(&message.primitive.Link_Id.link_addr._union._3gpp_addr, (u_int8_t*)UE_DEFAULT_3GPP_ADDRESS);
message_total_length = MIH_C_Link_Message_Encode_Link_Register_indication(bb_p, &message);
#ifdef MSCGEN_PYTOOL
memset(g_msc_gen_buf, 0, MSC_GEN_BUF_SIZE);
g_msc_gen_buffer_index = 0;
MIH_C_LINK_ID2String(&message.primitive.Link_Id, g_msc_gen_buf);
#endif
if (mRAL_send_to_mih(instanceP, bb_p->m_buffer,message_total_length)<0) {
printf("ERROR RAL_UE, : Send Link_Register.indication\n");
LOG_E(RAL_UE, ": Send Link_Register.indication\n");
} else {
printf("OK RAL_UE, : Send Link_Register.indication\n");
LOG_D(RAL_UE, ": Sent Link_Register.indication\n");
}
free_BitBuffer(bb_p);
}
//-----------------------------------------------------------------------------
void mRAL_send_link_detected_indication(ral_ue_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_id_pP,
MIH_C_LINK_DET_INFO_T *link_detected_info_pP)
{
//-----------------------------------------------------------------------------
MIH_C_Message_Link_Detected_indication_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
memset(&message, 0, sizeof (MIH_C_Message_Link_Detected_indication_t));
message.header.version = (MIH_C_VERSION_T)MIH_C_PROTOCOL_VERSION;
message.header.service_identifier = (MIH_C_SID_T)2;
message.header.operation_code = (MIH_C_OPCODE_T)3;
message.header.action_identifier = (MIH_C_AID_T)1;
message.header.transaction_id = *transaction_id_pP;
MIH_C_MIHF_ID_set(&message.source, (u_int8_t*)g_ue_ral_obj[mod_id].link_id, strlen(g_ue_ral_obj[mod_id].link_id));
MIH_C_MIHF_ID_set(&message.destination, (u_int8_t*)g_ue_ral_obj[mod_id].mihf_id, strlen(g_ue_ral_obj[mod_id].mihf_id));
memcpy(&message.primitive.LinkDetectedInfo, link_detected_info_pP, sizeof(MIH_C_LINK_DET_INFO_T));
message_total_length = MIH_C_Link_Message_Encode_Link_Detected_indication(bb_p, &message);
if (mRAL_send_to_mih(instanceP, bb_p->m_buffer,message_total_length)<0) {
LOG_E(RAL_UE, ": Send Link_Detected.indication\n");
} else {
LOG_D(RAL_UE, ": Sent Link_Detected.indication\n");
}
free_BitBuffer(bb_p);
}
//-----------------------------------------------------------------------------
void mRAL_send_link_up_indication(ral_ue_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_id_pP,
MIH_C_LINK_TUPLE_ID_T *link_identifier_pP,
MIH_C_LINK_ADDR_T *old_access_router_pP,
MIH_C_LINK_ADDR_T *new_access_router_pP,
MIH_C_IP_RENEWAL_FLAG_T *ip_renewal_flag_pP,
MIH_C_IP_MOB_MGMT_T *mobility_management_support_pP)
{
//-----------------------------------------------------------------------------
MIH_C_Message_Link_Up_indication_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
memset(&message, 0, sizeof (MIH_C_Message_Link_Up_indication_t));
message.header.version = (MIH_C_VERSION_T)MIH_C_PROTOCOL_VERSION;
message.header.service_identifier = (MIH_C_SID_T)2;
message.header.operation_code = (MIH_C_OPCODE_T)3;
message.header.action_identifier = (MIH_C_AID_T)2;
message.header.transaction_id = *transaction_id_pP;
MIH_C_MIHF_ID_set(&message.source, (u_int8_t*)g_ue_ral_obj[mod_id].link_id, strlen(g_ue_ral_obj[mod_id].link_id));
MIH_C_MIHF_ID_set(&message.destination, (u_int8_t*)g_ue_ral_obj[mod_id].mihf_id, strlen(g_ue_ral_obj[mod_id].mihf_id));
memcpy(&message.primitive.LinkIdentifier, link_identifier_pP, sizeof(MIH_C_LINK_TUPLE_ID_T));
message.primitive.OldAccessRouter = old_access_router_pP;
message.primitive.NewAccessRouter = new_access_router_pP;
message.primitive.IPRenewalFlag = ip_renewal_flag_pP;
message.primitive.MobilityManagementSupport = mobility_management_support_pP;
message_total_length = MIH_C_Link_Message_Encode_Link_Up_indication(bb_p, &message);
if (mRAL_send_to_mih(instanceP, bb_p->m_buffer,message_total_length)<0) {
LOG_E(RAL_UE, ": Send Link_Up.indication\n");
} else {
LOG_D(RAL_UE, ": Sent Link_Up.indication\n");
}
free_BitBuffer(bb_p);
}
//-----------------------------------------------------------------------------
void mRAL_send_link_parameters_report_indication(ral_ue_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_id_pP,
MIH_C_LINK_TUPLE_ID_T *link_identifier_pP,
MIH_C_LINK_PARAM_RPT_LIST_T *link_parameters_report_list_pP)
{
//-----------------------------------------------------------------------------
MIH_C_Message_Link_Parameters_Report_indication_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
memset(&message, 0, sizeof (MIH_C_Message_Link_Parameters_Report_indication_t));
message.header.version = (MIH_C_VERSION_T)MIH_C_PROTOCOL_VERSION;
message.header.service_identifier = (MIH_C_SID_T)2;
message.header.operation_code = (MIH_C_OPCODE_T)3;
message.header.action_identifier = (MIH_C_AID_T)5;
message.header.transaction_id = *transaction_id_pP;
MIH_C_MIHF_ID_set(&message.source, (u_int8_t*)g_ue_ral_obj[mod_id].link_id, strlen(g_ue_ral_obj[mod_id].link_id));
MIH_C_MIHF_ID_set(&message.destination, (u_int8_t*)g_ue_ral_obj[mod_id].mihf_id, strlen(g_ue_ral_obj[mod_id].mihf_id));
memcpy(&message.primitive.LinkIdentifier, link_identifier_pP, sizeof(MIH_C_LINK_TUPLE_ID_T));
memcpy(&message.primitive.LinkParametersReportList_list, link_parameters_report_list_pP, sizeof(MIH_C_LINK_PARAM_RPT_LIST_T));
message_total_length = MIH_C_Link_Message_Encode_Link_Parameters_Report_indication(bb_p, &message);
if (mRAL_send_to_mih(instanceP, bb_p->m_buffer,message_total_length)<0) {
LOG_E(RAL_UE, ": Send Link_Parameters_Report.indication\n");
} else {
LOG_D(RAL_UE, ": Sent Link_Parameters_Report.indication\n");
}
free_BitBuffer(bb_p);
}
//-----------------------------------------------------------------------------
void mRAL_send_link_going_down_indication(ral_ue_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_id_pP,
MIH_C_LINK_TUPLE_ID_T *link_identifier_pP,
MIH_C_UNSIGNED_INT2_T *time_interval_pP,
MIH_C_LINK_GD_REASON_T *link_going_down_reason_pP)
{
//-----------------------------------------------------------------------------
MIH_C_Message_Link_Going_Down_indication_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
memset(&message, 0, sizeof (MIH_C_Message_Link_Going_Down_indication_t));
message.header.version = (MIH_C_VERSION_T)MIH_C_PROTOCOL_VERSION;
message.header.service_identifier = (MIH_C_SID_T)2;
message.header.operation_code = (MIH_C_OPCODE_T)3;
message.header.action_identifier = (MIH_C_AID_T)6;
message.header.transaction_id = *transaction_id_pP;
MIH_C_MIHF_ID_set(&message.source, (u_int8_t*)g_ue_ral_obj[mod_id].link_id, strlen(g_ue_ral_obj[mod_id].link_id));
MIH_C_MIHF_ID_set(&message.destination, (u_int8_t*)g_ue_ral_obj[mod_id].mihf_id, strlen(g_ue_ral_obj[mod_id].mihf_id));
memcpy(&message.primitive.LinkIdentifier, link_identifier_pP, sizeof(MIH_C_LINK_TUPLE_ID_T));
message.primitive.TimeInterval = *time_interval_pP;
memcpy(&message.primitive.LinkGoingDownReason, link_going_down_reason_pP, sizeof(MIH_C_LINK_GD_REASON_T));
message_total_length = MIH_C_Link_Message_Encode_Link_Going_Down_indication(bb_p, &message);
if (mRAL_send_to_mih(instanceP, bb_p->m_buffer,message_total_length)<0) {
LOG_E(RAL_UE, ": Send Link_Going_Down.indication\n");
} else {
LOG_D(RAL_UE, ": Sent Link_Going_Down.indication\n");
}
free_BitBuffer(bb_p);
}
//-----------------------------------------------------------------------------
void mRAL_send_link_down_indication(ral_ue_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_id_pP,
MIH_C_LINK_TUPLE_ID_T *link_identifier_pP,
MIH_C_LINK_ADDR_T *old_access_router_pP,
MIH_C_LINK_DN_REASON_T *reason_code_pP)
{
//-----------------------------------------------------------------------------
MIH_C_Message_Link_Down_indication_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
memset(&message, 0, sizeof (MIH_C_Message_Link_Going_Down_indication_t));
message.header.version = (MIH_C_VERSION_T)MIH_C_PROTOCOL_VERSION;
message.header.service_identifier = (MIH_C_SID_T)2;
message.header.operation_code = (MIH_C_OPCODE_T)3;
message.header.action_identifier = (MIH_C_AID_T)3;
message.header.transaction_id = *transaction_id_pP;
MIH_C_MIHF_ID_set(&message.source, (u_int8_t*)g_ue_ral_obj[mod_id].link_id, strlen(g_ue_ral_obj[mod_id].link_id));
MIH_C_MIHF_ID_set(&message.destination, (u_int8_t*)g_ue_ral_obj[mod_id].mihf_id, strlen(g_ue_ral_obj[mod_id].mihf_id));
memcpy(&message.primitive.LinkIdentifier, link_identifier_pP, sizeof(MIH_C_LINK_TUPLE_ID_T));
message.primitive.OldAccessRouter = old_access_router_pP;
memcpy(&message.primitive.ReasonCode, reason_code_pP, sizeof(MIH_C_LINK_DN_REASON_T));
message_total_length = MIH_C_Link_Message_Encode_Link_Down_indication(bb_p, &message);
if (mRAL_send_to_mih(instanceP, bb_p->m_buffer,message_total_length)<0) {
LOG_E(RAL_UE, ": Send Link_Down.indication\n");
} else {
LOG_D(RAL_UE, ": Sent Link_Down.indication\n");
}
free_BitBuffer(bb_p);
}
//-----------------------------------------------------------------------------
void mRAL_send_link_action_confirm(ral_ue_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_id_pP,
MIH_C_STATUS_T *status_pP,
MIH_C_LINK_SCAN_RSP_LIST_T *scan_response_set_pP,
MIH_C_LINK_AC_RESULT_T *link_action_result_pP)
{
//-----------------------------------------------------------------------------
MIH_C_Message_Link_Action_confirm_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
memset(&message, 0, sizeof (MIH_C_Message_Link_Action_confirm_t));
message.header.version = (MIH_C_VERSION_T)MIH_C_PROTOCOL_VERSION;
message.header.service_identifier = (MIH_C_SID_T)3;
message.header.operation_code = (MIH_C_OPCODE_T)0;
message.header.action_identifier = (MIH_C_AID_T)3;
message.header.transaction_id = *transaction_id_pP;
MIH_C_MIHF_ID_set(&message.source, (u_int8_t*)g_ue_ral_obj[mod_id].link_id, strlen(g_ue_ral_obj[mod_id].link_id));
MIH_C_MIHF_ID_set(&message.destination, (u_int8_t*)g_ue_ral_obj[mod_id].mihf_id, strlen(g_ue_ral_obj[mod_id].mihf_id));
message.primitive.Status = *status_pP;
message.primitive.ScanResponseSet_list = scan_response_set_pP;
message.primitive.LinkActionResult = link_action_result_pP;
message_total_length = MIH_C_Link_Message_Encode_Link_Action_confirm(bb_p, &message);
if (mRAL_send_to_mih(instanceP, bb_p->m_buffer,message_total_length)<0) {
LOG_E(RAL_UE, ": Send Link_Action.confirm\n");
} else {
LOG_D(RAL_UE, ": Sent Link_Action.confirm\n");
}
free_BitBuffer(bb_p);
}
//-----------------------------------------------------------------------------
void mRAL_send_capability_discover_confirm(ral_ue_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_id_pP,
MIH_C_STATUS_T *status_pP,
MIH_C_LINK_EVENT_LIST_T *supported_link_event_list_pP,
MIH_C_LINK_CMD_LIST_T *supported_link_command_list_pP)
{
//-----------------------------------------------------------------------------
MIH_C_Message_Link_Capability_Discover_confirm_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
memset(&message, 0, sizeof (MIH_C_Message_Link_Capability_Discover_confirm_t));
message.header.version = (MIH_C_VERSION_T)MIH_C_PROTOCOL_VERSION;
message.header.service_identifier = (MIH_C_SID_T)1;
message.header.operation_code = (MIH_C_OPCODE_T)0;
message.header.action_identifier = (MIH_C_AID_T)1;
message.header.transaction_id = *transaction_id_pP;
MIH_C_MIHF_ID_set(&message.source, (u_int8_t*)g_ue_ral_obj[mod_id].link_id, strlen(g_ue_ral_obj[mod_id].link_id));
MIH_C_MIHF_ID_set(&message.destination, (u_int8_t*)g_ue_ral_obj[mod_id].mihf_id, strlen(g_ue_ral_obj[mod_id].mihf_id));
message.primitive.Status = *status_pP;
message.primitive.SupportedLinkEventList = supported_link_event_list_pP;
message.primitive.SupportedLinkCommandList = supported_link_command_list_pP;
message_total_length = MIH_C_Link_Message_Encode_Capability_Discover_confirm(bb_p, &message);
if (mRAL_send_to_mih(instanceP, bb_p->m_buffer,message_total_length)<0) {
LOG_E(RAL_UE, ": Send Link_Capability_Discover.confirm\n");
} else {
LOG_D(RAL_UE, ": Sent Link_Capability_Discover.confirm\n");
}
free_BitBuffer(bb_p);
}
//-----------------------------------------------------------------------------
void mRAL_send_event_subscribe_confirm(ral_ue_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_id_pP,
MIH_C_STATUS_T *status_pP,
MIH_C_LINK_EVENT_LIST_T *response_link_event_list_pP)
{
//-----------------------------------------------------------------------------
MIH_C_Message_Link_Event_Subscribe_confirm_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
memset(&message, 0, sizeof (MIH_C_Message_Link_Event_Subscribe_confirm_t));
message.header.version = (MIH_C_VERSION_T)MIH_C_PROTOCOL_VERSION;
message.header.service_identifier = (MIH_C_SID_T)1;
message.header.operation_code = (MIH_C_OPCODE_T)0;
message.header.action_identifier = (MIH_C_AID_T)4;
message.header.transaction_id = *transaction_id_pP;
MIH_C_MIHF_ID_set(&message.source, (u_int8_t*)g_ue_ral_obj[mod_id].link_id, strlen(g_ue_ral_obj[mod_id].link_id));
MIH_C_MIHF_ID_set(&message.destination, (u_int8_t*)g_ue_ral_obj[mod_id].mihf_id, strlen(g_ue_ral_obj[mod_id].mihf_id));
message.primitive.Status = *status_pP;
message.primitive.ResponseLinkEventList = response_link_event_list_pP;
message_total_length = MIH_C_Link_Message_Encode_Event_Subscribe_confirm(bb_p, &message);
if (mRAL_send_to_mih(instanceP, bb_p->m_buffer,message_total_length)<0) {
LOG_E(RAL_UE, ": Send Link_Event_Subscribe.confirm\n");
} else {
LOG_D(RAL_UE, ": Sent Link_Event_Subscribe.confirm\n");
}
free_BitBuffer(bb_p);
}
//-----------------------------------------------------------------------------
void mRAL_send_event_unsubscribe_confirm(ral_ue_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_id_pP,
MIH_C_STATUS_T *status_pP,
MIH_C_LINK_EVENT_LIST_T *response_link_event_list_pP)
{
//-----------------------------------------------------------------------------
MIH_C_Message_Link_Event_Unsubscribe_confirm_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
memset(&message, 0, sizeof (MIH_C_Message_Link_Event_Unsubscribe_confirm_t));
message.header.version = (MIH_C_VERSION_T)MIH_C_PROTOCOL_VERSION;
message.header.service_identifier = (MIH_C_SID_T)1;
message.header.operation_code = (MIH_C_OPCODE_T)0;
message.header.action_identifier = (MIH_C_AID_T)5;
message.header.transaction_id = *transaction_id_pP;
MIH_C_MIHF_ID_set(&message.source, (u_int8_t*)g_ue_ral_obj[mod_id].link_id, strlen(g_ue_ral_obj[mod_id].link_id));
MIH_C_MIHF_ID_set(&message.destination, (u_int8_t*)g_ue_ral_obj[mod_id].mihf_id, strlen(g_ue_ral_obj[mod_id].mihf_id));
message.primitive.Status = *status_pP;
message.primitive.ResponseLinkEventList = response_link_event_list_pP;
message_total_length = MIH_C_Link_Message_Encode_Event_Unsubscribe_confirm(bb_p, &message);
if (mRAL_send_to_mih(instanceP, bb_p->m_buffer,message_total_length)<0) {
LOG_E(RAL_UE, ": Send Link_Event_Unsubscribe.confirm\n");
} else {
LOG_D(RAL_UE, ": Sent Link_Event_Unsubscribe.confirm\n");
}
free_BitBuffer(bb_p);
}
//-----------------------------------------------------------------------------
void mRAL_send_configure_thresholds_confirm(ral_ue_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_id_pP,
MIH_C_STATUS_T *status_pP,
MIH_C_LINK_CFG_STATUS_LIST_T *link_configure_status_list_pP)
{
//-----------------------------------------------------------------------------
MIH_C_Message_Link_Configure_Thresholds_confirm_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
memset(&message, 0, sizeof (MIH_C_Message_Link_Configure_Thresholds_confirm_t));
message.header.version = (MIH_C_VERSION_T)MIH_C_PROTOCOL_VERSION;
message.header.service_identifier = (MIH_C_SID_T)3;
message.header.operation_code = (MIH_C_OPCODE_T)0;
message.header.action_identifier = (MIH_C_AID_T)2;
message.header.transaction_id = *transaction_id_pP;
MIH_C_MIHF_ID_set(&message.source, (u_int8_t*)g_ue_ral_obj[mod_id].link_id, strlen(g_ue_ral_obj[mod_id].link_id));
MIH_C_MIHF_ID_set(&message.destination, (u_int8_t*)g_ue_ral_obj[mod_id].mihf_id, strlen(g_ue_ral_obj[mod_id].mihf_id));
message.primitive.Status = *status_pP;
message.primitive.LinkConfigureStatusList_list = link_configure_status_list_pP;
message_total_length = MIH_C_Link_Message_Encode_Configure_Thresholds_confirm(bb_p, &message);
if (mRAL_send_to_mih(instanceP, bb_p->m_buffer,message_total_length)<0) {
LOG_E(RAL_UE, ": Send Link_Configure_Threshold.confirm\n");
} else {
LOG_D(RAL_UE, ": Sent Link_Configure_Threshold.confirm\n");
}
free_BitBuffer(bb_p);
}
//-----------------------------------------------------------------------------
void mRAL_send_get_parameters_confirm (ral_ue_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_id_pP,
MIH_C_STATUS_T *status_pP,
MIH_C_LINK_PARAM_LIST_T *link_parameters_status_list_pP,
MIH_C_LINK_STATES_RSP_LIST_T *link_states_response_list_pP,
MIH_C_LINK_DESC_RSP_LIST_T *link_descriptors_response_list_pP)
{
//-----------------------------------------------------------------------------
MIH_C_Message_Link_Get_Parameters_confirm_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
memset(&message, 0, sizeof (MIH_C_Message_Link_Get_Parameters_confirm_t));
message.header.version = (MIH_C_VERSION_T)MIH_C_PROTOCOL_VERSION;
message.header.service_identifier = (MIH_C_SID_T)3;
message.header.operation_code = (MIH_C_OPCODE_T)0;
message.header.action_identifier = (MIH_C_AID_T)1;
message.header.transaction_id = *transaction_id_pP;
MIH_C_MIHF_ID_set(&message.source, (u_int8_t*)g_ue_ral_obj[mod_id].link_id, strlen(g_ue_ral_obj[mod_id].link_id));
MIH_C_MIHF_ID_set(&message.destination, (u_int8_t*)g_ue_ral_obj[mod_id].mihf_id, strlen(g_ue_ral_obj[mod_id].mihf_id));
message.primitive.Status = *status_pP;
message.primitive.LinkParametersStatusList_list = link_parameters_status_list_pP;
message.primitive.LinkStatesResponse_list = link_states_response_list_pP;
message.primitive.LinkDescriptorsResponse_list = link_descriptors_response_list_pP;
message_total_length = MIH_C_Link_Message_Encode_Get_Parameters_confirm(bb_p, &message);
if (mRAL_send_to_mih(instanceP, bb_p->m_buffer,message_total_length)<0) {
LOG_E(RAL_UE, ": Send Link_Get_Parameters.confirm\n");
} else {
LOG_D(RAL_UE, ": Sent Link_Get_Parameters.confirm\n");
}
free_BitBuffer(bb_p);
}
/***************************************************************************
Reception side
***************************************************************************/
//-----------------------------------------------------------------------------
int mRAL_mih_link_msg_decode(ral_ue_instance_t instanceP,
Bit_Buffer_t *bbP,
MIH_C_Message_Wrapper_t *message_wrapperP)
{
//-----------------------------------------------------------------------------
int status = MIH_MESSAGE_DECODE_FAILURE;
MIH_C_HEADER_T header;
MIH_C_STATUS_T mih_status;
module_id_t mod_id = instanceP - NB_eNB_INST;
if ((bbP != NULL) && (message_wrapperP != NULL)) {
status = MIH_C_Link_Header_Decode(bbP, &header);
if (status == MIH_HEADER_DECODE_TOO_SHORT) {
return MIH_MESSAGE_DECODE_TOO_SHORT;
} else if (status == MIH_HEADER_DECODE_FAILURE) {
return MIH_MESSAGE_DECODE_FAILURE;
} else if (status == MIH_HEADER_DECODE_BAD_PARAMETER) {
return MIH_MESSAGE_DECODE_BAD_PARAMETER;
}
message_wrapperP->message_id = MIH_C_MESSAGE_ID(header.service_identifier, header.operation_code, header.action_identifier);
switch (message_wrapperP->message_id) {
case MIH_C_MESSAGE_LINK_CAPABILITY_DISCOVER_REQUEST_ID:
LOG_D(RAL_UE, " %s Received MIH_C_MESSAGE_LINK_CAPABILITY_DISCOVER_REQUEST TID %u\n", __FUNCTION__, header.transaction_id);
memcpy(&message_wrapperP->_union_message.link_capability_discover_request.header, (const void *)&header, sizeof(MIH_C_HEADER_T));
status = MIH_C_Link_Message_Decode_Link_Capability_Discover_request(bbP, &message_wrapperP->_union_message.link_capability_discover_request);
if (status == MIH_MESSAGE_DECODE_OK) {
MIH_C_Link_Message_Link_Capability_Discover_request2String(&message_wrapperP->_union_message.link_capability_discover_request, g_msg_print_buffer);
LOG_D(RAL_UE, "%s", g_msg_print_buffer);
mih_status = MIH_C_STATUS_SUCCESS;
LOG_D(RAL_UE, "**\n");
LOG_D(RAL_UE, " %s Sending MIH_C_MESSAGE_LINK_CAPABILITY_DISCOVER_CONFIRM\n\n", __FUNCTION__);
mRAL_send_capability_discover_confirm(instanceP,
&message_wrapperP->_union_message.link_capability_discover_request.header.transaction_id,
&mih_status,
&g_ue_ral_obj[mod_id].mih_supported_link_event_list,
&g_ue_ral_obj[mod_id].mih_supported_link_command_list);
} else {
}
break;
case MIH_C_MESSAGE_LINK_EVENT_SUBSCRIBE_REQUEST_ID:
LOG_D(RAL_UE, " %s Received MIH_C_MESSAGE_LINK_EVENT_SUBSCRIBE_REQUEST TID %u\n", __FUNCTION__, header.transaction_id);
memcpy(&message_wrapperP->_union_message.link_event_subscribe_request.header, (const void *)&header, sizeof(MIH_C_HEADER_T));
status = MIH_C_Link_Message_Decode_Link_Event_Subscribe_request(bbP, &message_wrapperP->_union_message.link_event_subscribe_request);
if (status == MIH_MESSAGE_DECODE_OK) {
LOG_D(RAL_UE, "**\n");
mRAL_subscribe_request(instanceP, &message_wrapperP->_union_message.link_event_subscribe_request);
} else {
}
break;
case MIH_C_MESSAGE_LINK_EVENT_UNSUBSCRIBE_REQUEST_ID:
LOG_D(RAL_UE, " %s Received MIH_C_MESSAGE_LINK_EVENT_UNSUBSCRIBE_REQUEST TID %u\n", __FUNCTION__, header.transaction_id);
memcpy(&message_wrapperP->_union_message.link_event_unsubscribe_request.header, (const void *)&header, sizeof(MIH_C_HEADER_T));
status = MIH_C_Link_Message_Decode_Link_Event_Unsubscribe_request(bbP, &message_wrapperP->_union_message.link_event_unsubscribe_request);
if (status == MIH_MESSAGE_DECODE_OK) {
LOG_D(RAL_UE, "**\n");
mRAL_unsubscribe_request(instanceP, &message_wrapperP->_union_message.link_event_unsubscribe_request);
} else {
}
break;
case MIH_C_MESSAGE_LINK_GET_PARAMETERS_REQUEST_ID:
LOG_D(RAL_UE, " %s Received MIH_C_MESSAGE_LINK_GET_PARAMETERS_REQUEST TID %u\n", __FUNCTION__, header.transaction_id);
memcpy(&message_wrapperP->_union_message.link_get_parameters_request.header, (const void *)&header, sizeof(MIH_C_HEADER_T));
status = MIH_C_Link_Message_Decode_Link_Get_Parameters_request(bbP, &message_wrapperP->_union_message.link_get_parameters_request);
if (status == MIH_MESSAGE_DECODE_OK) {
LOG_D(RAL_UE, "**\n");
mRAL_get_parameters_request(instanceP, &message_wrapperP->_union_message.link_get_parameters_request);
} else {
}
break;
case MIH_C_MESSAGE_LINK_CONFIGURE_THRESHOLDS_REQUEST_ID:
LOG_D(RAL_UE, " %s Received MIH_C_MESSAGE_LINK_CONFIGURE_THRESHOLDS_REQUEST TID %u\n", __FUNCTION__, header.transaction_id);
memcpy(&message_wrapperP->_union_message.link_configure_thresholds_request.header, (const void *)&header, sizeof(MIH_C_HEADER_T));
status = MIH_C_Link_Message_Decode_Link_Configure_Thresholds_request(bbP, &message_wrapperP->_union_message.link_configure_thresholds_request);
if (status == MIH_MESSAGE_DECODE_OK) {
LOG_D(RAL_UE, "**\n");
mRAL_configure_thresholds_request(instanceP, &message_wrapperP->_union_message.link_configure_thresholds_request);
} else {
}
break;
case MIH_C_MESSAGE_LINK_ACTION_REQUEST_ID:
LOG_D(RAL_UE, " %s Received MIH_C_MESSAGE_LINK_ACTION_REQUEST TID %u\n", __FUNCTION__, header.transaction_id);
memcpy(&message_wrapperP->_union_message.link_action_request.header, (const void *)&header, sizeof(MIH_C_HEADER_T));
status = MIH_C_Link_Message_Decode_Link_Action_request(bbP, &message_wrapperP->_union_message.link_action_request);
if (status == MIH_MESSAGE_DECODE_OK) {
LOG_D(RAL_UE, "**\n");
mRAL_action_request(instanceP, &message_wrapperP->_union_message.link_action_request);
} else {
}
break;
default:
LOG_W(RAL_UE, "UNKNOWN MESSAGE ID SID %d, OP_CODE %d, AID %d\n", header.service_identifier, header.operation_code, header.action_identifier);
status = MIH_MESSAGE_DECODE_FAILURE;
return status;
}
} else {
return MIH_MESSAGE_DECODE_BAD_PARAMETER;
}
return status;
}
//-----------------------------------------------------------------------------
int mRAL_mih_link_process_message(ral_ue_instance_t instanceP)
{
//-----------------------------------------------------------------------------
MIH_C_Message_Wrapper_t message_wrapper;
int nb_bytes_received ;
int nb_bytes_decoded ;
int total_bytes_to_decode ;
int status ;
Bit_Buffer_t *bb_p;
struct sockaddr_in udp_socket;
socklen_t sockaddr_len;
module_id_t mod_id = instanceP - NB_eNB_INST;
total_bytes_to_decode = 0;
nb_bytes_received = 0;
bb_p = new_BitBuffer_0();
nb_bytes_received = recvfrom(g_ue_ral_obj[mod_id].mih_sock_desc,
(void *)g_msg_codec_recv_buffer,
MSG_CODEC_RECV_BUFFER_SIZE,
0,
(struct sockaddr *) &udp_socket,
&sockaddr_len);
if (nb_bytes_received > 0) {
LOG_D(RAL_UE, " \n");
LOG_D(RAL_UE, " %s: Received %d bytes from MIHF\n", __FUNCTION__, nb_bytes_received);
total_bytes_to_decode += nb_bytes_received;
BitBuffer_wrap(bb_p, g_msg_codec_recv_buffer, total_bytes_to_decode);
status = mRAL_mih_link_msg_decode(instanceP, bb_p, &message_wrapper);
nb_bytes_decoded = BitBuffer_getPosition(bb_p);
if (status == MIH_MESSAGE_DECODE_OK) {
if (nb_bytes_decoded > 0) {
total_bytes_to_decode = total_bytes_to_decode - nb_bytes_decoded;
// if remaining bytes to decode
if (total_bytes_to_decode > 0) {
//shift left bytes in buffer
memcpy(g_msg_codec_recv_buffer, &g_msg_codec_recv_buffer[nb_bytes_decoded], nb_bytes_decoded);
//shift left again bytes in buffer
if (total_bytes_to_decode > nb_bytes_decoded) {
memcpy(&g_msg_codec_recv_buffer[nb_bytes_decoded], &g_msg_codec_recv_buffer[nb_bytes_decoded], total_bytes_to_decode - nb_bytes_decoded);
}
// not necessary
memset(&g_msg_codec_recv_buffer[total_bytes_to_decode], 0 , MSG_CODEC_RECV_BUFFER_SIZE - total_bytes_to_decode);
}
}
// data could not be decoded
} else if (status == MIH_MESSAGE_DECODE_FAILURE) {
memset(g_msg_codec_recv_buffer, 0, MSG_CODEC_RECV_BUFFER_SIZE);
total_bytes_to_decode = 0;
} else if (status == MIH_MESSAGE_DECODE_TOO_SHORT) {
}
LOG_D(RAL_UE, " \n");
}
free_BitBuffer(bb_p);
return 0;
}
@@ -1,145 +0,0 @@
/***************************************************************************
lteRALue_parameters.c - description
***************************************************************************
Eurecom OpenAirInterface 3
Copyright(c) 1999 - 2013 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, 450 route des Chappes, 06410 Biot Sophia Antipolis, France
*******************************************************************************/
/*! \file lteRALue_mih_execute.c
* \brief Execution of MIH primitives in LTE-RAL-UE
* \author WETTERWALD Michelle, GAUTHIER Lionel, MAUREL Frederic
* \date 2013
* \company EURECOM
* \email: michelle.wetterwald@eurecom.fr, lionel.gauthier@eurecom.fr, frederic.maurel@eurecom.fr
*/
/*******************************************************************************/
#define LTE_RAL_UE
#define LTERALUE_PARAMETERS_C
//-----------------------------------------------------------------------------
#include "lteRALue.h"
//-----------------------------------------------------------------------------
void mRAL_get_parameters_request(ral_ue_instance_t instanceP,
MIH_C_Message_Link_Get_Parameters_request_t *messageP)
{
//-----------------------------------------------------------------------------
MIH_C_STATUS_T status;
MIH_C_LINK_PARAM_LIST_T link_parameters_status_list;
MIH_C_LINK_STATES_RSP_LIST_T link_states_response_list;
MIH_C_LINK_DESC_RSP_LIST_T link_descriptors_response_list;
unsigned int link_index;
// SAVE REQUEST
// MAY BE MERGE REQUESTS ?
//memcpy(&g_link_cfg_param_thresholds_list, &messageP->primitive.LinkConfigureParameterList_list, sizeof(MIH_C_LINK_CFG_PARAM_LIST_T));
status = MIH_C_STATUS_SUCCESS;
for (link_index = 0;
link_index < messageP->primitive.LinkParametersRequest_list.length;
link_index++) {
//------------------------------------------------
// MIH_C_LINK_PARAM_LIST_T
//------------------------------------------------
memcpy(&link_parameters_status_list.val[link_index].link_param_type,
&messageP->primitive.LinkParametersRequest_list.val[link_index],
sizeof(MIH_C_LINK_PARAM_TYPE_T));
switch (messageP->primitive.LinkParametersRequest_list.val[link_index].choice) {
case MIH_C_LINK_PARAM_TYPE_CHOICE_GEN:
link_parameters_status_list.val[link_index].choice = MIH_C_LINK_PARAM_CHOICE_LINK_PARAM_VAL;
link_parameters_status_list.val[link_index]._union.link_param_val = MIH_C_LINK_PARAM_GEN_SIGNAL_STRENGTH;
break;
case MIH_C_LINK_PARAM_TYPE_CHOICE_QOS:
link_parameters_status_list.val[link_index].choice = MIH_C_LINK_PARAM_CHOICE_QOS_PARAM_VAL;
link_parameters_status_list.val[link_index]._union.qos_param_val.choice = MIH_C_QOS_PARAM_VAL_CHOICE_AVG_PK_TX_DELAY;
link_parameters_status_list.val[link_index]._union.qos_param_val._union.avg_pk_tx_delay_list.length = 2; //??
link_parameters_status_list.val[link_index]._union.qos_param_val._union.avg_pk_tx_delay_list.val[0].cos_id = 2; //??
link_parameters_status_list.val[link_index]._union.qos_param_val._union.avg_pk_tx_delay_list.val[0].value = 20; //??
link_parameters_status_list.val[link_index]._union.qos_param_val._union.avg_pk_tx_delay_list.val[1].cos_id = 3; //??
link_parameters_status_list.val[link_index]._union.qos_param_val._union.avg_pk_tx_delay_list.val[2].value = 50; //??
break;
case MIH_C_LINK_PARAM_TYPE_CHOICE_LTE:
case MIH_C_LINK_PARAM_TYPE_CHOICE_GG:
case MIH_C_LINK_PARAM_TYPE_CHOICE_EDGE:
case MIH_C_LINK_PARAM_TYPE_CHOICE_ETH:
case MIH_C_LINK_PARAM_TYPE_CHOICE_802_11:
case MIH_C_LINK_PARAM_TYPE_CHOICE_C2K:
case MIH_C_LINK_PARAM_TYPE_CHOICE_FDD:
case MIH_C_LINK_PARAM_TYPE_CHOICE_HRPD:
case MIH_C_LINK_PARAM_TYPE_CHOICE_802_16:
case MIH_C_LINK_PARAM_TYPE_CHOICE_802_20:
case MIH_C_LINK_PARAM_TYPE_CHOICE_802_22:
default:
LOG_E(RAL_UE, "%s TO DO CONTINUE PROCESSING LinkParametersRequest_list of \n", __FUNCTION__);
}
//------------------------------------------------
// MIH_C_LINK_STATES_RSP_LIST_T
//------------------------------------------------
if (messageP->primitive.LinkStatesRequest & MIH_C_BIT_LINK_STATES_REQ_OP_MODE) {
link_states_response_list.val[link_index].choice = 0;
link_states_response_list.val[link_index]._union.op_mode = MIH_C_OPMODE_NORMAL_MODE;
} else if (messageP->primitive.LinkStatesRequest & MIH_C_BIT_LINK_STATES_REQ_CHANNEL_ID) {
link_states_response_list.val[link_index].choice = 1;
link_states_response_list.val[link_index]._union.channel_id = PREDEFINED_CHANNEL_ID;
} else {
LOG_E(RAL_UE, "%s Invalid LinkStatesRequest in MIH_C_Link_Get_Parameters_request\n", __FUNCTION__);
// DEFAULT VALUES
link_states_response_list.val[link_index].choice = 0;
link_states_response_list.val[link_index]._union.op_mode = MIH_C_OPMODE_NORMAL_MODE;
}
//------------------------------------------------
// MIH_C_LINK_DESC_RSP_LIST_T
//------------------------------------------------
if (messageP->primitive.LinkDescriptorsRequest & MIH_C_BIT_NUMBER_OF_CLASSES_OF_SERVICE_SUPPORTED) {
link_descriptors_response_list.val[link_index].choice = 0;
link_descriptors_response_list.val[link_index]._union.num_cos = PREDEFINED_CLASSES_SERVICE_SUPPORTED;
} else if (messageP->primitive.LinkDescriptorsRequest & MIH_C_BIT_NUMBER_OF_QUEUES_SUPPORTED) {
link_descriptors_response_list.val[link_index].choice = 1;
link_descriptors_response_list.val[link_index]._union.num_queue = PREDEFINED_QUEUES_SUPPORTED;
} else {
LOG_E(RAL_UE, "%s Invalid LinkDescriptorsRequest in MIH_C_Link_Get_Parameters_request\n", __FUNCTION__);
// DEFAULT VALUES
link_descriptors_response_list.val[link_index].choice = 0;
link_descriptors_response_list.val[link_index]._union.num_cos = PREDEFINED_CLASSES_SERVICE_SUPPORTED;
}
}
link_parameters_status_list.length = messageP->primitive.LinkParametersRequest_list.length;
link_states_response_list.length = messageP->primitive.LinkParametersRequest_list.length;
link_descriptors_response_list.length = messageP->primitive.LinkParametersRequest_list.length;
mRAL_send_get_parameters_confirm(instanceP,
&messageP->header.transaction_id,
&status,
&link_parameters_status_list,
&link_states_response_list,
&link_descriptors_response_list);
}
@@ -1,301 +0,0 @@
/***************************************************************************
lteRALue_process.c - description
***************************************************************************
Eurecom OpenAirInterface 3
Copyright(c) 1999 - 2013 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, 450 route des Chappes, 06410 Biot Sophia Antipolis, France
*******************************************************************************/
/*! \file lteRALue_process.c
* \brief Handling of measurements and connection in LTE-RAL-UE
* \author WETTERWALD Michelle, GAUTHIER Lionel, MAUREL Frederic
* \date 2013
* \company EURECOM
* \email: michelle.wetterwald@eurecom.fr, lionel.gauthier@eurecom.fr, frederic.maurel@eurecom.fr
*/
/*******************************************************************************/
#define LTE_RAL_UE
#define LTERALUE_PROCESS_C
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/socket.h>
//-----------------------------------------------------------------------------
#include "lteRALue.h"
#include "PHY/extern.h"
/*
//---------------------------------------------------------------------------
// Temp - Enter hard-coded measures in IAL
void IAL_NAS_measures_init(void){
//---------------------------------------------------------------------------
#ifdef DEBUG_MRALU_MEASURES
DEBUG("Entering IAL_NAS_measures_init \n\n");
#endif
#ifdef RAL_DUMMY
ralpriv->num_measures = 3;
#endif
#ifdef RAL_REALTIME
ralpriv->num_measures = 1;
#endif
ralpriv->meas_cell_id[0] = 0;
#ifdef MIH_USER_CONTROL
ralpriv->last_meas_level[0] = 0;
#else
ralpriv->last_meas_level[0] = 30;
#endif
ralpriv->integrated_meas_level[0] = ralpriv->last_meas_level[0];
ralpriv->provider_id[0] = 25;
ralpriv->meas_cell_id[1] = 1;
ralpriv->last_meas_level[1] = 50;
ralpriv->integrated_meas_level[1] = ralpriv->last_meas_level[1];
ralpriv->provider_id[1] = 1;
ralpriv->meas_cell_id[2] = 20;
ralpriv->last_meas_level[2] = 20;
ralpriv->integrated_meas_level[2] = ralpriv->last_meas_level[2];
ralpriv->provider_id[2] = 25;
}
//---------------------------------------------------------------------------
// Temp - Enter hard-coded measures in IAL
void IAL_NAS_measures_update(int i){
//---------------------------------------------------------------------------
DEBUG("\n");
#ifdef DEBUG_MRALU_MEASURES
DEBUG("Entering IAL_NAS_measures_update\n");
#endif
int j;
//ralpriv->meas_cell_id[0] = ralpriv->cell_id;
j = i%2;
if (j==0){
ralpriv->integrated_meas_level[2] = (ralpriv->integrated_meas_level[2] + (ralpriv->last_meas_level[2]/5));
}else{
ralpriv->integrated_meas_level[2] = (ralpriv->integrated_meas_level[2] - (ralpriv->last_meas_level[2]/5));
}
ralpriv->curr_signal_level = ralpriv->integrated_meas_level[0];
// DEBUG ("Measure update - cell 1 %d, %d \n", ralpriv->last_meas_level[1], ralpriv->integrated_meas_level[1]);
}
//---------------------------------------------------------------------------
void IAL_integrate_measure(int measure, int i){
//---------------------------------------------------------------------------
#ifdef DEBUG_MRALU_MEASURES
DEBUG("Entering IAL_integrate_measure #%d\n", i);
#endif
int new_integrated = 0;
new_integrated = (((10-LAMBDA)*ralpriv->last_meas_level[i])+(LAMBDA*measure))/10;
//apply correction to get a value between 0-100 - now is linear
new_integrated = (new_integrated*100)/MEAS_MAX_RSSI;
// print result
#ifdef DEBUG_MRALU_MEASURES
DEBUG (" Integrate measure: old %d, new %d, integrated %d\n", ralpriv->last_meas_level[i], measure,new_integrated );
#endif
// store the result
ralpriv->last_meas_level[i] = measure;
ralpriv->prev_integrated_meas_level[i] = ralpriv->integrated_meas_level[i];
ralpriv->integrated_meas_level[i] = new_integrated;
// if cell_id = 0, it means that there is no base station. Level should be 0
// apply correction
if (!ralpriv->meas_cell_id[i])
ralpriv->integrated_meas_level[i]=0;
}
//---------------------------------------------------------------------------
// poll for measures in NAS
void rallte_NAS_measures_polling(void){
//---------------------------------------------------------------------------
MIH_C_LINK_GD_REASON_T going_down_reason_code;
MIH_C_LINK_DN_REASON_T down_reason_code;
MIH_C_TRANSACTION_ID_T transaction_id;
MIH_C_LINK_TUPLE_ID_T link_identifier;
MIH_C_LINK_DET_INFO_T link_detected_info;
MIH_C_UNSIGNED_INT2_T time_interval;
//MIH_C_LINK_PARAM_RPT_LIST_T link_parameters_report_list;
RAL_process_NAS_message(IO_OBJ_MEAS, IO_CMD_LIST, 0);
// hard-coded trigger for test
#ifdef MRALU_SIMU_LINKDOWN
meas_counter ++;
if (meas_counter == 4){
ralpriv->curr_signal_level = ralpriv->curr_signal_level/10;
IAL_integrate_measure(ralpriv->curr_signal_level, 0);
DEBUG ("\n signal level %d , integrated new value : %d\n",ralpriv->curr_signal_level, ralpriv->integrated_meas_level[0]);
}
if (meas_counter == 5){
ralpriv->curr_signal_level = 40;
IAL_integrate_measure(ralpriv->curr_signal_level, 0);
DEBUG ("\n signal level %d , integrated new value : %d\n",ralpriv->curr_signal_level, ralpriv->integrated_meas_level[0]);
}
if (meas_counter == 6){
ralpriv->curr_signal_level = 0;
IAL_integrate_measure(ralpriv->curr_signal_level, 0);
DEBUG ("\n signal level %d , integrated new value : %d\n",ralpriv->curr_signal_level, ralpriv->integrated_meas_level[0]);
}
#endif
DEBUG ("signal level %d , integrated new value : %d , integrated old value : (%d)\n",
ralpriv->curr_signal_level,
ralpriv->integrated_meas_level[0],
ralpriv->prev_integrated_meas_level[0]);
// condition still TBD - message dropped or level = 0
if ((!ralpriv->curr_signal_level) &&
(ralpriv->link_to_be_detected == MIH_C_BOOLEAN_FALSE) &&
(ralpriv->state != DISCONNECTED)) {
transaction_id = MIH_C_get_new_transaction_id();
down_reason_code = MIH_C_LINK_DOWN_REASON_NO_RESOURCE;
link_identifier.link_id.link_type = MIH_C_WIRELESS_UMTS;
link_identifier.link_id.link_addr.choice = (MIH_C_CHOICE_T)MIH_C_CHOICE_3GPP_ADDR;
//MIH_C_3GPP_ADDR_load_3gpp_str_address(&link_identifier.link_id.link_addr._union._3gpp_addr, (u_int8_t*)DEFAULT_ADDRESS_3GPP);
//MIH_C_3GPP_ADDR_set(&link_identifier.link_id.link_addr._union._3gpp_addr, (u_int8_t*)DEFAULT_ADDRESS_3GPP, strlen(DEFAULT_ADDRESS_3GPP));
MIH_C_3GPP_ADDR_set(&link_identifier.link_id.link_addr._union._3gpp_addr, (u_int8_t*)&(ralpriv->ipv6_l2id[0]), strlen(DEFAULT_ADDRESS_3GPP));
link_identifier.choice = MIH_C_LINK_TUPLE_ID_CHOICE_NULL;
mRAL_send_link_down_indication(&transaction_id, &link_identifier, NULL, &down_reason_code);
ralpriv->link_to_be_detected = MIH_C_BOOLEAN_TRUE;
// warning may be repeated several times
} else
if ((ralpriv->link_to_be_detected == MIH_C_BOOLEAN_FALSE) &&
(ralpriv->curr_signal_level <= ralpriv->integrated_meas_level[0]) &&
(ralpriv->integrated_meas_level[0] < ralpriv->prev_integrated_meas_level[0]) &&
(ralpriv->integrated_meas_level[0] < PREDEFINED_LINK_GOING_DOWN_INDICATION_SIG_STRENGTH) &&
(ralpriv->state != DISCONNECTED)) {
transaction_id = MIH_C_get_new_transaction_id();
link_identifier.link_id.link_type = MIH_C_WIRELESS_UMTS;
link_identifier.link_id.link_addr.choice = (MIH_C_CHOICE_T)MIH_C_CHOICE_3GPP_ADDR;
//MIH_C_3GPP_ADDR_load_3gpp_str_address(&link_identifier.link_id.link_addr._union._3gpp_addr, (u_int8_t*)DEFAULT_ADDRESS_3GPP);
//MIH_C_3GPP_ADDR_set(&link_identifier.link_id.link_addr._union._3gpp_addr, (u_int8_t*)DEFAULT_ADDRESS_3GPP, strlen(DEFAULT_ADDRESS_3GPP));
MIH_C_3GPP_ADDR_set(&link_identifier.link_id.link_addr._union._3gpp_addr, (u_int8_t*)&(ralpriv->ipv6_l2id[0]), strlen(DEFAULT_ADDRESS_3GPP));
link_identifier.choice = MIH_C_LINK_TUPLE_ID_CHOICE_NULL;
time_interval = (MIH_C_UNSIGNED_INT2_T)0; // unknown
going_down_reason_code = MIH_C_LINK_GOING_DOWN_REASON_LINK_PARAMETER_DEGRADING;
//
mRAL_send_link_going_down_indication(&transaction_id, &link_identifier, &time_interval, &going_down_reason_code);
} else
if ((ralpriv->link_to_be_detected == MIH_C_BOOLEAN_TRUE) &&
((ralpriv->mih_subscribe_req_event_list && (MIH_C_BIT_LINK_DETECTED + MIH_C_BIT_LINK_UP))>0)&&
(ralpriv->curr_signal_level > PREDEFINED_LINK_DETECTED_INDICATION_SIG_STRENGTH)) {
transaction_id = MIH_C_get_new_transaction_id();
// MIH_C_LINK_TUPLE_ID_T
link_detected_info.link_tuple_id.link_id.link_type = MIH_C_WIRELESS_UMTS;
link_detected_info.link_tuple_id.link_id.link_addr.choice = (MIH_C_CHOICE_T)MIH_C_CHOICE_3GPP_ADDR;
MIH_C_3GPP_ADDR_set(&link_detected_info.link_tuple_id.link_id.link_addr._union._3gpp_addr, (u_int8_t*)&(ralpriv->ipv6_l2id[0]), strlen(DEFAULT_ADDRESS_3GPP));
link_detected_info.link_tuple_id.choice = MIH_C_LINK_TUPLE_ID_CHOICE_NULL;
// MIH_C_NETWORK_ID_T
MIH_C_NETWORK_ID_set(&link_detected_info.network_id, (u_int8_t *)PREDEFINED_MIH_NETWORK_ID, strlen(PREDEFINED_MIH_NETWORK_ID));
// MIH_C_NET_AUX_ID_T
MIH_C_NET_AUX_ID_set(&link_detected_info.net_aux_id, (u_int8_t *)PREDEFINED_MIH_NETAUX_ID, strlen(PREDEFINED_MIH_NETAUX_ID));
// MIH_C_SIG_STRENGTH_T
link_detected_info.sig_strength.choice = MIH_C_SIG_STRENGTH_CHOICE_PERCENTAGE;
link_detected_info.sig_strength._union.percentage = ralpriv->curr_signal_level;
// sinr
link_detected_info.sinr = PREDEFINED_LINK_DETECTED_INDICATION_SINR;
// MIH_C_LINK_DATA_RATE_T
link_detected_info.link_data_rate = PREDEFINED_LINK_DETECTED_INDICATION_LINK_DATA_RATE;
// MIH_C_LINK_MIHCAP_FLAG
link_detected_info.link_mihcap_flag = MIH_C_BIT_EVENT_SERVICE_SUPPORTED |
MIH_C_BIT_COMMAND_SERVICE_SUPPORTED |
MIH_C_BIT_INFORMATION_SERVICE_SUPPORTED;
// MIH_C_NET_CAPS_T
link_detected_info.net_caps = MIH_C_BIT_NET_CAPS_QOS_CLASS0 |
MIH_C_BIT_NET_CAPS_QOS_CLASS1 |
MIH_C_BIT_NET_CAPS_INTERNET_ACCESS;
//
mRAL_send_link_detected_indication(&transaction_id, &link_detected_info);
ralpriv->link_to_be_detected = MIH_C_BOOLEAN_FALSE;
}
// LG: TO DO CHECK IF INDEX IS 0
mRAL_check_thresholds_signal_strength(ralpriv->integrated_meas_level[0], ralpriv->prev_integrated_meas_level[0]);
}
//---------------------------------------------------------------------------
// find correponding cell in NAS measures
int rallte_NAS_corresponding_cell(int req_index)
//---------------------------------------------------------------------------
{
int index, i=0;
while ((i<=ralpriv->num_measures)&&(ralpriv->req_cell_id[req_index]!=ralpriv->meas_cell_id[i]))
i++;
index = i;
return index;
}
//---------------------------------------------------------------------------
void rallte_verifyPendingConnection(void){
//---------------------------------------------------------------------------
int if_ready = 0;
MIH_C_LINK_TUPLE_ID_T link_identifier;
if ((ralpriv->pending_req_flag)%5==0){
DEBUG("**\n");
DEBUG("Pending Req Flag %d\n", ralpriv->pending_req_flag);
DEBUG(" >>>> verifyPendingConnection ");
//poll status from driver
#ifdef RAL_DUMMY
IAL_process_DNAS_message(IO_OBJ_CNX, IO_CMD_LIST, ralpriv->cell_id);
if ((ralpriv->nas_state == NAS_CONNECTED)&&(ralpriv->num_rb>=1)){
if_ready = 1;
ralpriv->state = CONNECTED;
}
#endif
#ifdef RAL_REALTIME
RAL_process_NAS_message(IO_OBJ_CNX, IO_CMD_LIST, ralpriv->cell_id);
if ((ralpriv->nas_state == NAS_CX_DCH)&&(ralpriv->num_rb>=1)){
if_ready = 1;
ralpriv->state = CONNECTED;
}
#endif
if ((if_ready==1)||(ralpriv->pending_req_flag > 100)){
if (ralpriv->pending_req_flag > 100){
ralpriv->pending_req_ac_result = MIH_C_LINK_AC_RESULT_FAILURE;
}
mRAL_send_link_action_confirm(&ralpriv->pending_req_transaction_id, &ralpriv->pending_req_status, NULL, &ralpriv->pending_req_ac_result);
////alternative : send linkup
//link_identifier.link_id.link_type = MIH_C_WIRELESS_UMTS;
//link_identifier.link_id.link_addr.choice = (MIH_C_CHOICE_T)MIH_C_CHOICE_3GPP_ADDR;
//MIH_C_3GPP_ADDR_set(&link_identifier.link_id.link_addr._union._3gpp_addr, (u_int8_t*)&(ralpriv->ipv6_l2id[0]), strlen(DEFAULT_ADDRESS_3GPP));
//link_identifier.choice = MIH_C_LINK_TUPLE_ID_CHOICE_NULL;
//mRAL_send_link_up_indication(&ralpriv->pending_req_transaction_id, &link_identifier, NULL, NULL, NULL, NULL);
DEBUG("After response, Pending Req Flag = %d, cell_id = %d\n", ralpriv->pending_req_flag, ralpriv->cell_id);
ralpriv->pending_req_flag = 0;
// Link_up Ind not needed anymore
//sleep(2);
//mRALte_send_link_up_indication();
}
}
}*/
@@ -1,283 +0,0 @@
/*****************************************************************************
* Eurecom OpenAirInterface 3
* Copyright(c) 2012 Eurecom
*
* Source mRAL_subscribe.c
*
* Version 0.1
*
* Date 11/27/2013
*
* Product MIH RAL LTE
*
* Subsystem
*
* Authors Lionel Gauthier
*
* Description
*
*****************************************************************************/
#define LTE_RAL_UE
#define LTE_RAL_UE_RRC_MSG_C
#include "lteRALue.h"
#include "LAYER2/MAC/extern.h"
//---------------------------------------------------------------------------------------------------------------------
static int ueid2eui48(uint8_t *euiP, uint8_t* ue_idP)
//---------------------------------------------------------------------------------------------------------------------
{
// inspired by linux-source-3.2.0/net/ipv6/addrconf.c
memcpy(euiP, ue_idP, 3);
memcpy(euiP + 5, ue_idP + 3, 3);
euiP[3] = 0xFF;
euiP[4] = 0xFE;
euiP[0] ^= 2;
return 0;
}
//---------------------------------------------------------------------------------------------------------------------
void mRAL_rx_rrc_ral_scan_confirm(instance_t instanceP,
MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
MIH_C_STATUS_T status;
MIH_C_LINK_SCAN_RSP_LIST_T scan_rsp_list;
MIH_C_LINK_AC_RESULT_T ac_result;
int i;
status = MIH_C_STATUS_SUCCESS;
ac_result = MIH_C_LINK_AC_RESULT_SUCCESS;
memset(&scan_rsp_list, 0, sizeof(MIH_C_LINK_SCAN_RSP_LIST_T));
for (i = 0 ; i < RRC_RAL_SCAN_CONF (msg_pP).num_scan_resp; i++) {
// TO DO
memcpy(&scan_rsp_list.val[i].link_addr, &RRC_RAL_SCAN_CONF (msg_pP).link_scan_resp[i].link_addr, sizeof(MIH_C_LINK_ADDR_T));
// TO DO
memcpy(&scan_rsp_list.val[i].network_id, &RRC_RAL_SCAN_CONF (msg_pP).link_scan_resp[i].network_id, sizeof(MIH_C_NETWORK_ID_T));
scan_rsp_list.val[i].sig_strength.choice = RRC_RAL_SCAN_CONF (msg_pP).link_scan_resp[i].sig_strength.choice;
switch (scan_rsp_list.val[i].sig_strength.choice) {
case RAL_SIG_STRENGTH_CHOICE_DBM:
scan_rsp_list.val[i].sig_strength._union.dbm = RRC_RAL_SCAN_CONF (msg_pP).link_scan_resp[i].sig_strength._union.dbm;
break;
case RAL_SIG_STRENGTH_CHOICE_PERCENTAGE:
scan_rsp_list.val[i].sig_strength._union.percentage = RRC_RAL_SCAN_CONF (msg_pP).link_scan_resp[i].sig_strength._union.percentage;
break;
default:
LOG_E(RAL_UE, "INVALID RRC_RAL_SCAN_CONF field sig_strength.choice %d\n", scan_rsp_list.val[i].sig_strength.choice);
status = MIH_C_STATUS_UNSPECIFIED_FAILURE;
}
scan_rsp_list.length += 1;
}
mRAL_send_link_action_confirm(instanceP,
&RRC_RAL_SCAN_CONF (msg_pP).transaction_id,
&status,
&scan_rsp_list,
&ac_result);
}
//---------------------------------------------------------------------------------------------------------------------
void mRAL_rx_rrc_ral_system_information_indication(instance_t instanceP,
MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
MIH_C_LINK_DET_INFO_T link_det_info;
int i;
module_id_t mod_id = instanceP - NB_eNB_INST;
memset(&link_det_info, 0, sizeof(MIH_C_LINK_DET_INFO_T));
// save cell parameters
g_ue_ral_obj[mod_id].cell_id = RRC_RAL_SYSTEM_INFORMATION_IND(msg_pP).cell_id;
memcpy(&g_ue_ral_obj[mod_id].plmn_id, &RRC_RAL_SYSTEM_INFORMATION_IND(msg_pP).plmn_id, sizeof(g_ue_ral_obj[mod_id].plmn_id));
// link id
link_det_info.link_tuple_id.link_id.link_type = MIH_C_WIRELESS_LTE;
#ifdef USE_3GPP_ADDR_AS_LINK_ADDR
link_det_info.link_tuple_id.link_id.link_addr.choice = (MIH_C_CHOICE_T)MIH_C_CHOICE_3GPP_ADDR;
MIH_C_3GPP_ADDR_load_3gpp_str_address(mod_id, &link_det_info.link_tuple_id.link_id.link_addr._union._3gpp_addr, (u_int8_t*)UE_DEFAULT_3GPP_ADDRESS);
#else
link_det_info.link_tuple_id.link_id.link_addr.choice = MIH_C_CHOICE_3GPP_3G_CELL_ID;
// preserve byte order of plmn id
memcpy(link_det_info.link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val, &RRC_RAL_SYSTEM_INFORMATION_IND(msg_pP).plmn_id, 3);
link_det_info.link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.cell_id = RRC_RAL_SYSTEM_INFORMATION_IND(msg_pP).cell_id;
LOG_D(RAL_UE, "PLMN ID %d.%d.%d\n", link_det_info.link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[0],
link_det_info.link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[1],
link_det_info.link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[2]);
LOG_D(RAL_UE, "CELL ID %d\n", link_det_info.link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.cell_id);
#endif
//The optional LINK_ADDR may contains a link address of PoA.
link_det_info.link_tuple_id.choice = MIH_C_LINK_TUPLE_ID_CHOICE_NULL;
MIH_C_NETWORK_ID_set(&link_det_info.network_id, (u_int8_t *)PREDEFINED_MIH_NETWORK_ID, strlen(PREDEFINED_MIH_NETWORK_ID));
MIH_C_NET_AUX_ID_set(&link_det_info.net_aux_id, (u_int8_t *)PREDEFINED_MIH_NETAUX_ID, strlen(PREDEFINED_MIH_NETAUX_ID));
link_det_info.sig_strength.choice = MIH_C_SIG_STRENGTH_CHOICE_DBM;
link_det_info.sig_strength._union.dbm = RRC_RAL_SYSTEM_INFORMATION_IND(msg_pP).dbm;
link_det_info.sinr = RRC_RAL_SYSTEM_INFORMATION_IND(msg_pP).sinr;
link_det_info.link_data_rate = RRC_RAL_SYSTEM_INFORMATION_IND(msg_pP).link_data_rate;
link_det_info.link_mihcap_flag = g_ue_ral_obj[mod_id].link_mihcap_flag;
link_det_info.net_caps = g_ue_ral_obj[mod_id].net_caps;
mRAL_send_link_detected_indication(instanceP, &g_ue_ral_obj[mod_id].transaction_id, &link_det_info);
g_ue_ral_obj[mod_id].transaction_id ++;
}
//---------------------------------------------------------------------------------------------------------------------
void mRAL_rx_rrc_ral_connection_establishment_indication(instance_t instanceP,
MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
MIH_C_LINK_TUPLE_ID_T link_tuple_id;
module_id_t mod_id = instanceP - NB_eNB_INST;
memset(&link_tuple_id, 0, sizeof(MIH_C_LINK_TUPLE_ID_T));
// The LINK_ID contains the MN LINK_ADDR
link_tuple_id.link_id.link_type = MIH_C_WIRELESS_LTE;
#ifdef USE_3GPP_ADDR_AS_LINK_ADDR
link_tuple_id.link_id.link_addr.choice = (MIH_C_CHOICE_T)MIH_C_CHOICE_3GPP_ADDR;
MIH_C_3GPP_ADDR_load_3gpp_str_address(mod_id, &link_tuple_id.link_id.link_addr._union._3gpp_addr, (u_int8_t*)UE_DEFAULT_3GPP_ADDRESS);
#else
link_tuple_id.link_id.link_addr.choice = MIH_C_CHOICE_3GPP_3G_CELL_ID;
memcpy(link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val, &g_ue_ral_obj[mod_id].plmn_id, 3);
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.cell_id = g_ue_ral_obj[mod_id].cell_id;
LOG_D(RAL_UE, "PLMN ID %d.%d.%d\n", link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[0],
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[1],
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[2]);
LOG_D(RAL_UE, "CELL ID %d\n", link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.cell_id);
#endif
//The optional LINK_ADDR may contains a link address of PoA.
link_tuple_id.choice = MIH_C_LINK_TUPLE_ID_CHOICE_NULL;
mRAL_send_link_up_indication(instanceP, &g_ue_ral_obj[mod_id].transaction_id,
&link_tuple_id,
NULL, //MIH_C_LINK_ADDR_T *old_arP,(Optional) Old Access Router link address.
NULL, //MIH_C_LINK_ADDR_T *new_arP,(Optional) New Access Router link address.
NULL, //MIH_C_IP_RENEWAL_FLAG_T *flagP, (Optional) Indicates whether the MN needs to change IP Address in the new PoA.
NULL); //MIH_C_IP_MOB_MGMT_T *mobil_mngtP, (Optional) Indicates the type of Mobility Management Protocol supported by the new PoA.
g_ue_ral_obj[mod_id].transaction_id ++;
}
//---------------------------------------------------------------------------------------------------------------------
void mRAL_rx_rrc_ral_connection_reestablishment_indication(instance_t instanceP,
MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
MIH_C_LINK_TUPLE_ID_T link_tuple_id;
module_id_t mod_id = instanceP - NB_eNB_INST;
memset(&link_tuple_id, 0, sizeof(MIH_C_LINK_TUPLE_ID_T));
//The optional LINK_ADDR may contains a link address of PoA.
link_tuple_id.choice = MIH_C_LINK_TUPLE_ID_CHOICE_NULL;
link_tuple_id.link_id.link_type = MIH_C_WIRELESS_LTE;
#ifdef USE_3GPP_ADDR_AS_LINK_ADDR
link_tuple_id.link_id.link_addr.choice = (MIH_C_CHOICE_T)MIH_C_CHOICE_3GPP_ADDR;
MIH_C_3GPP_ADDR_load_3gpp_str_address(mod_id, &link_tuple_id.link_id.link_addr._union._3gpp_addr, (u_int8_t*)UE_DEFAULT_3GPP_ADDRESS);
#else
link_tuple_id.link_id.link_addr.choice = MIH_C_CHOICE_3GPP_3G_CELL_ID;
// preserve byte order of plmn id
memcpy(link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val, &g_ue_ral_obj[mod_id].plmn_id, 3);
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.cell_id = g_ue_ral_obj[mod_id].cell_id;
LOG_D(RAL_UE, "PLMN ID %d.%d.%d\n", link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[0],
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[1],
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[2]);
LOG_D(RAL_UE, "CELL ID %d\n", link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.cell_id);
#endif
LOG_D(RAL_UE, "RRC_RAL_CONNECTION_ESTABLISHMENT_IND num srb %d num drb %d\n", RRC_RAL_CONNECTION_REESTABLISHMENT_IND(msg_pP).num_srb,RRC_RAL_CONNECTION_REESTABLISHMENT_IND(msg_pP).num_drb);
if ((RRC_RAL_CONNECTION_REESTABLISHMENT_IND(msg_pP).num_drb > 0) && (RRC_RAL_CONNECTION_REESTABLISHMENT_IND(msg_pP).num_srb > 0)) {
mRAL_send_link_up_indication(instanceP, &g_ue_ral_obj[mod_id].transaction_id,
&link_tuple_id,
NULL, //MIH_C_LINK_ADDR_T *old_arP,(Optional) Old Access Router link address.
NULL, //MIH_C_LINK_ADDR_T *new_arP,(Optional) New Access Router link address.
NULL, //MIH_C_IP_RENEWAL_FLAG_T *flagP, (Optional) Indicates whether the MN needs to change IP Address in the new PoA.
NULL); //MIH_C_IP_MOB_MGMT_T *mobil_mngtP, (Optional) Indicates the type of Mobility Management Protocol supported by the new PoA.
} else {
MIH_C_LINK_DN_REASON_T reason_code = MIH_C_LINK_DOWN_REASON_EXPLICIT_DISCONNECT;
mRAL_send_link_down_indication(instanceP, &g_ue_ral_obj[mod_id].transaction_id,
&link_tuple_id,
NULL,
&reason_code);
}
g_ue_ral_obj[mod_id].transaction_id ++;
}
//---------------------------------------------------------------------------------------------------------------------
void mRAL_rx_rrc_ral_connection_reconfiguration_indication(instance_t instanceP,
MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
MIH_C_LINK_TUPLE_ID_T link_tuple_id;
module_id_t mod_id = instanceP - NB_eNB_INST;
memset(&link_tuple_id, 0, sizeof(MIH_C_LINK_TUPLE_ID_T));
//The optional LINK_ADDR may contains a link address of PoA.
link_tuple_id.choice = MIH_C_LINK_TUPLE_ID_CHOICE_NULL;
link_tuple_id.link_id.link_type = MIH_C_WIRELESS_LTE;
#ifdef USE_3GPP_ADDR_AS_LINK_ADDR
link_tuple_id.link_id.link_addr.choice = (MIH_C_CHOICE_T)MIH_C_CHOICE_3GPP_ADDR;
MIH_C_3GPP_ADDR_load_3gpp_str_address(mod_id, &link_tuple_id.link_id.link_addr._union._3gpp_addr, (u_int8_t*)UE_DEFAULT_3GPP_ADDRESS);
#else
// preserve byte order of plmn id
memcpy(link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val, &g_ue_ral_obj[mod_id].plmn_id, 3);
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.cell_id = g_ue_ral_obj[mod_id].cell_id;
LOG_D(RAL_UE, "PLMN ID %d.%d.%d\n", link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[0],
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[1],
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[2]);
LOG_D(RAL_UE, "CELL ID %d\n", link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.cell_id);
#endif
LOG_D(RAL_UE, "RRC_RAL_CONNECTION_RECONFIGURATION_IND num srb %d num drb %d\n",
RRC_RAL_CONNECTION_RECONFIGURATION_IND(msg_pP).num_srb,
RRC_RAL_CONNECTION_RECONFIGURATION_IND(msg_pP).num_drb);
if ((RRC_RAL_CONNECTION_RECONFIGURATION_IND(msg_pP).num_drb > 0) &&
(RRC_RAL_CONNECTION_RECONFIGURATION_IND(msg_pP).num_srb > 0)) {
mRAL_send_link_up_indication(instanceP, &g_ue_ral_obj[mod_id].transaction_id,
&link_tuple_id,
NULL, //MIH_C_LINK_ADDR_T *old_arP,(Optional) Old Access Router link address.
NULL, //MIH_C_LINK_ADDR_T *new_arP,(Optional) New Access Router link address.
NULL, //MIH_C_IP_RENEWAL_FLAG_T *flagP, (Optional) Indicates whether the MN needs to change IP Address in the new PoA.
NULL); //MIH_C_IP_MOB_MGMT_T *mobil_mngtP, (Optional) Indicates the type of Mobility Management Protocol supported by the new PoA.
} else {
MIH_C_LINK_DN_REASON_T reason_code = MIH_C_LINK_DOWN_REASON_EXPLICIT_DISCONNECT;
mRAL_send_link_down_indication(instanceP, &g_ue_ral_obj[mod_id].transaction_id,
&link_tuple_id,
NULL,
&reason_code);
}
g_ue_ral_obj[mod_id].transaction_id ++;
}
//---------------------------------------------------------------------------------------------------------------------
void mRAL_rx_rrc_ral_connection_release_indication(instance_t instanceP, MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
}
@@ -1,136 +0,0 @@
/***************************************************************************
ltmRALue_subscribe.c - description
***************************************************************************
Eurecom OpenAirInterface 3
Copyright(c) 1999 - 2013 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, 450 route des Chappes, 06410 Biot Sophia Antipolis, France
*******************************************************************************/
/*! \file ltmRALue_subscribe.c
* \brief
* \author WETTERWALD Michelle, GAUTHIER Lionel, MAUREL Frederic
* \date 2013
* \company EURECOM
* \email: michelle.wetterwald@eurecom.fr, lionel.gauthier@eurecom.fr, frederic.maurel@eurecom.fr
*/
/*******************************************************************************/
#define LTE_RAL_UE
#define LTERALUE_SUBSCRIBE_C
//-----------------------------------------------------------------------------
#include "lteRALue.h"
#include "LAYER2/MAC/extern.h"
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: mRAL_subscribe_request() **
** **
** Description: Subscribes the MIH-F to receive specified link event **
** indications and sends Link Event Subscribe confirmation **
** to the MIH-F. **
** **
** Inputs: msg_pP: Pointer to the received MIH message **
** Others: None **
** **
** Outputs: None **
** Return: None **
** Others: ralpriv **
** **
***************************************************************************/
void mRAL_subscribe_request(ral_ue_instance_t instanceP,
MIH_C_Message_Link_Event_Subscribe_request_t *msg_pP)
{
module_id_t mod_id = instanceP - NB_eNB_INST;
MIH_C_STATUS_T status = MIH_C_STATUS_REJECTED;
/* Check whether the action request is supported */
if (g_ue_ral_obj[mod_id].mih_supported_link_command_list & MIH_C_BIT_LINK_EVENT_SUBSCRIBE) {
MIH_C_LINK_EVENT_LIST_T mih_subscribed_req_event_list;
g_ue_ral_obj[mod_id].mih_subscribe_req_event_list |= (msg_pP->primitive.RequestedLinkEventList & g_ue_ral_obj[mod_id].mih_supported_link_event_list);
mih_subscribed_req_event_list = g_ue_ral_obj[mod_id].mih_subscribe_req_event_list & msg_pP->primitive.RequestedLinkEventList;
status = MIH_C_STATUS_SUCCESS;
mRAL_send_event_subscribe_confirm(instanceP, &msg_pP->header.transaction_id,
&status,
&mih_subscribed_req_event_list);
} else {
mRAL_send_event_subscribe_confirm(instanceP, &msg_pP->header.transaction_id,
&status,
NULL);
}
}
/****************************************************************************
** **
** Name: mRAL_unsubscribe_request() **
** **
** Description: Unsubscribes the MIH-F to receive specified link event **
** indications and sends Link Event Unsubscribe confirmation **
** to the MIH-F. **
** **
** Inputs: msg_pP: Pointer to the received MIH message **
** Others: None **
** **
** Outputs: None **
** Return: None **
** Others: ralpriv **
** **
***************************************************************************/
void mRAL_unsubscribe_request(ral_ue_instance_t instanceP,
MIH_C_Message_Link_Event_Unsubscribe_request_t *msg_pP)
{
MIH_C_STATUS_T status = MIH_C_STATUS_REJECTED;
module_id_t mod_id = instanceP - NB_eNB_INST;
/* Check whether the action request is supported */
if (g_ue_ral_obj[mod_id].mih_supported_link_command_list & MIH_C_BIT_LINK_EVENT_UNSUBSCRIBE) {
MIH_C_LINK_EVENT_LIST_T mih_unsubscribed_req_event_list;
MIH_C_LINK_EVENT_LIST_T saved_req_event_list;
saved_req_event_list = g_ue_ral_obj[mod_id].mih_subscribe_req_event_list;
g_ue_ral_obj[mod_id].mih_subscribe_req_event_list &= ~(msg_pP->primitive.RequestedLinkEventList & g_ue_ral_obj[mod_id].mih_supported_link_event_list);
mih_unsubscribed_req_event_list = g_ue_ral_obj[mod_id].mih_subscribe_req_event_list ^ saved_req_event_list;
status = MIH_C_STATUS_SUCCESS;
mRAL_send_event_unsubscribe_confirm(instanceP, &msg_pP->header.transaction_id,
&status,
&mih_unsubscribed_req_event_list);
} else {
mRAL_send_event_unsubscribe_confirm(instanceP, &msg_pP->header.transaction_id,
&status,
NULL);
}
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/

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