renamed openair-cn to openair3

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7886 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
gauthier
2015-10-06 16:53:42 +00:00
parent c7518ecf42
commit 7b5431a62c
705 changed files with 206 additions and 208 deletions
+674
View File
@@ -0,0 +1,674 @@
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>.
+197
View File
@@ -0,0 +1,197 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmDeregistered.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-DEREGISTERED state.
In EMM-DEREGISTERED state, no EMM context has been established
or the EMM context is marked as detached.
The UE shall start the attach or combined attach procedure to
establish an EMM context.
The MME may answer to an attach or a combined attach procedure
initiated by the UE. It may also answer to a tracking area
updating procedure or combined tracking area updating procedure
initiated by a UE if the EMM context is marked as detached.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "networkDef.h"
#include "nas_log.h"
#include "emm_proc.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmDeregistered() **
** **
** Description: Handles the behaviour of the UE and the MME while the **
** EMM-SAP is in EMM-DEREGISTERED state. **
** **
** 3GPP TS 24.301, section 5.2.2.2 **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmDeregistered(const emm_reg_t *evt)
{
LOG_FUNC_IN;
int rc = RETURNerror;
assert(emm_fsm_get_status() == EMM_DEREGISTERED);
/* Delete the authentication data RAND and RES */
rc = emm_proc_authentication_delete();
if (rc != RETURNok) {
LOG_FUNC_RETURN (rc);
}
/* TODO: 3GPP TS 24.301, section 4.4.2.1
* The UE shall store the current native EPS security context as specified
* in annex C and mark it as valid only when the UE enters state EMM-
* DEREGISTERED from any other state except EMM-NULL or when the UE aborts
* the attach procedure without having left EMM-DEREGISTERED.
*/
switch (evt->primitive) {
case _EMMREG_NO_IMSI:
/*
* The UE was powered on without a valid USIM application present
*/
rc = emm_fsm_set_status(EMM_DEREGISTERED_NO_IMSI);
break;
case _EMMREG_REGISTER_REQ:
/*
* The default EMM primary substate when the UE is switched on
* with valid USIM application shall be PLMN-SEARCH
*/
rc = emm_fsm_set_status(EMM_DEREGISTERED_PLMN_SEARCH);
if (rc != RETURNerror) {
/* Process the network registration request */
rc = emm_fsm_process(evt);
}
break;
case _EMMREG_ATTACH_INIT:
/*
* Attach procedure has to be restarted (timers T3402 or T3411
* expired) while the UE locally detached from the network
*/
/* Move to the corresponding initial EMM state */
if (evt->u.attach.is_emergency) {
rc = emm_fsm_set_status(EMM_DEREGISTERED_LIMITED_SERVICE);
} else {
rc = emm_fsm_set_status(EMM_DEREGISTERED_NORMAL_SERVICE);
}
if (rc != RETURNerror) {
/* Restart the attach procedure */
rc = emm_proc_attach_restart();
}
break;
case _EMMREG_LOWERLAYER_SUCCESS:
/*
* Data successfully delivered to the network
*/
rc = RETURNok;
break;
case _EMMREG_LOWERLAYER_FAILURE:
/*
* Data failed to be delivered to the network
*/
rc = RETURNok;
break;
default:
LOG_TRACE(ERROR, "EMM-FSM - Primitive is not valid (%d)",
evt->primitive);
break;
}
/* TODO: 3GPP TS 24.301, section 4.4.2.1
* The UE shall mark the EPS security context on the USIM or in the non-
* volatile memory as invalid when the UE initiates an attach procedure
* or when the UE leaves state EMM-DEREGISTERED for any other state except
* EMM-NULL.
*/
LOG_FUNC_RETURN (rc);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+101
View File
@@ -0,0 +1,101 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmDeregisteredAttachNeeded.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-DEREGISTERED.ATTACH-NEEDED state.
In EMM-DEREGISTERED.ATTACH-NEEDED state, Valid subscriber
data are available for the UE and for some reason an attach
must be performed as soon as possible. The access class may
be blocked due to access class control, or the network rejec-
ted the NAS signalling connection establishment.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "nas_log.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmDeregisteredAttachNeeded() **
** **
** Description: Handles the behaviour of the UE while the EMM-SAP is in **
** EMM-DEREGISTERED.ATTACH-NEEDED state. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmDeregisteredAttachNeeded(const emm_reg_t *evt)
{
LOG_FUNC_IN;
assert(emm_fsm_get_status() == EMM_DEREGISTERED_ATTACH_NEEDED);
/* TODO */
LOG_FUNC_RETURN (RETURNok);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+145
View File
@@ -0,0 +1,145 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmDeregisteredAttemptingToAttach.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-DEREGISTERED.ATTEMPTING-TO-ATTACH
state.
In EMM-DEREGISTERED.ATTEMPTING-TO-ATTACH state, the EPS update
status is EU2, and a previous attach was not successful.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "nas_log.h"
#include "emm_proc.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmDeregisteredAttemptingToAttach() **
** **
** Description: Handles the behaviour of the UE while the EMM-SAP is in **
** EMM-DEREGISTERED.ATTEMPTING-TO-ATTACH state. **
** **
** 3GPP TS 24.301, section 5.2.2.3.3 **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmDeregisteredAttemptingToAttach(const emm_reg_t *evt)
{
LOG_FUNC_IN;
int rc = RETURNerror;
assert(emm_fsm_get_status() == EMM_DEREGISTERED_ATTEMPTING_TO_ATTACH);
switch (evt->primitive) {
case _EMMREG_ATTACH_INIT:
/*
* Attach procedure has to be restarted (timers T3402 or T3411
* expired)
*/
/* Move to the corresponding initial EMM state */
if (evt->u.attach.is_emergency) {
rc = emm_fsm_set_status(EMM_DEREGISTERED_LIMITED_SERVICE);
} else {
rc = emm_fsm_set_status(EMM_DEREGISTERED_NORMAL_SERVICE);
}
if (rc != RETURNerror) {
/* Restart the attach procedure */
rc = emm_proc_attach_restart();
}
break;
case _EMMREG_LOWERLAYER_SUCCESS:
/*
* Data successfully delivered to the network
*/
rc = emm_proc_lowerlayer_success();
break;
case _EMMREG_LOWERLAYER_FAILURE:
/*
* Data failed to be delivered to the network
*/
rc = emm_proc_lowerlayer_failure(FALSE);
break;
default:
LOG_TRACE(ERROR, "EMM-FSM - Primitive is not valid (%d)",
evt->primitive);
break;
}
LOG_FUNC_RETURN (rc);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+148
View File
@@ -0,0 +1,148 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmDeregisteredInitiated.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-DEREGISTERED-INITIATED state.
In EMM-DEREGISTERED-INITIATED state, the UE has requested
release of the EMM context by starting the detach or combined
detach procedure and is waiting for a response from the MME.
The MME has started a detach procedure and is waiting for a
response from the UE.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "nas_log.h"
#include "emm_proc.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmDeregisteredInitiated() **
** **
** Description: Handles the behaviour of the UE and the MME while the **
** EMM-SAP is in EMM-DEREGISTERED-INITIATED state. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmDeregisteredInitiated(const emm_reg_t *evt)
{
LOG_FUNC_IN;
int rc = RETURNerror;
assert(emm_fsm_get_status() == EMM_DEREGISTERED_INITIATED);
switch (evt->primitive) {
case _EMMREG_DETACH_CNF:
/*
* The UE explicitly detached from the network (all EPS
* bearer contexts have been deactivated as UE initiated
* detach procedure successfully completed)
*/
rc = emm_fsm_set_status(EMM_DEREGISTERED);
break;
case _EMMREG_DETACH_FAILED:
/*
* The detach procedure failed
*/
if (evt->u.detach.type == EMM_DETACH_TYPE_IMSI) {
rc = emm_fsm_set_status(EMM_REGISTERED_NORMAL_SERVICE);
} else {
rc = emm_fsm_set_status(EMM_DEREGISTERED);
}
break;
case _EMMREG_LOWERLAYER_SUCCESS:
/*
* Ignore Detach Request message successful retransmission
*/
rc = RETURNok;
break;
case _EMMREG_LOWERLAYER_FAILURE:
case _EMMREG_LOWERLAYER_RELEASE:
/*
* Lower layer failure or release of the NAS signalling connection
* before the Detach Accept is received
*/
rc = emm_proc_lowerlayer_release();
break;
default:
LOG_TRACE(ERROR, "EMM-FSM - Primitive is not valid (%d)",
evt->primitive);
break;
}
LOG_FUNC_RETURN (rc);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+165
View File
@@ -0,0 +1,165 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmDeregisteredLimitedService.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-DEREGISTERED.LIMITED-SERVICE state.
In EMM-DEREGISTERED.LIMITED-SERVICE state, the EPS update
status is EU3, and it is known that a selected cell is unable
to provide normal service.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "networkDef.h"
#include "nas_log.h"
#include "emm_proc.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmDeregisteredLimitedService() **
** **
** Description: Handles the behaviour of the UE while the EMM-SAP is in **
** EMM-DEREGISTERED.LIMITED-SERVICE state. **
** **
** 3GPP TS 24.301, section 5.2.2.3.2 **
** The UE shall initiate an attach or combined attach proce- **
** dure when entering a cell which provides normal service. **
** It may initiate attach for emergency bearer services. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmDeregisteredLimitedService(const emm_reg_t *evt)
{
LOG_FUNC_IN;
int rc = RETURNerror;
assert(emm_fsm_get_status() == EMM_DEREGISTERED_LIMITED_SERVICE);
switch (evt->primitive) {
case _EMMREG_REGISTER_REQ:
/*
* The user manually re-selected a PLMN to register to
*/
rc = emm_fsm_set_status(EMM_DEREGISTERED_PLMN_SEARCH);
if (rc != RETURNerror) {
/* Process the network registration request */
rc = emm_fsm_process(evt);
}
break;
case _EMMREG_ATTACH_INIT:
/*
* Initiate attach procedure for emergency bearer services
*/
rc = emm_proc_attach(EMM_ATTACH_TYPE_EMERGENCY);
break;
case _EMMREG_ATTACH_REQ:
/*
* An attach for bearer emergency services has been requested
* (Attach Request message successfully delivered to the network);
* enter state EMM-REGISTERED-INITIATED
*/
rc = emm_fsm_set_status(EMM_REGISTERED_INITIATED);
break;
case _EMMREG_LOWERLAYER_SUCCESS:
/*
* Initial NAS message has been successfully delivered
* to the network
*/
rc = emm_proc_lowerlayer_success();
break;
case _EMMREG_LOWERLAYER_FAILURE:
/*
* Initial NAS message failed to be delivered to the network
*/
rc = emm_proc_lowerlayer_failure(TRUE);
break;
case _EMMREG_LOWERLAYER_RELEASE:
/*
* NAS signalling connection has been released
*/
rc = emm_proc_lowerlayer_release();
break;
default:
LOG_TRACE(ERROR, "EMM-FSM - Primitive is not valid (%d)",
evt->primitive);
break;
}
LOG_FUNC_RETURN (rc);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+145
View File
@@ -0,0 +1,145 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmDeregisteredNoCellAvailable.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-DEREGISTERED.NO-CELL-AVAILABLE
state.
In EMM-DEREGISTERED.NO-CELL-AVAILABLE state, no E-UTRAN cell
can be selected. A first intensive search failed when in
substate EMM_DEREGISTERED.PLMN-SEARCH. Cells are searched for
at a low rhythm. No EPS services are offered.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "networkDef.h"
#include "nas_log.h"
#include "emm_proc.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmDeregisteredNoCellAvailable() **
** **
** Description: Handles the behaviour of the UE while the EMM-SAP is in **
** EMM-DEREGISTERED.NO-CELL-AVAILABLE state. **
** **
** 3GPP TS 24.301, section 5.2.2.3.7 **
** The UE shall perform cell selection and choose an appro- **
** priate substate when a cell is found. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmDeregisteredNoCellAvailable(const emm_reg_t *evt)
{
LOG_FUNC_IN;
int rc = RETURNerror;
assert(emm_fsm_get_status() == EMM_DEREGISTERED_NO_CELL_AVAILABLE);
switch (evt->primitive) {
/* TODO: network re-selection is not allowed when in No Cell
* Available substate. The AS should search for a suitable cell
* and notify the NAS when such a cell is found (TS 24.008 section
* 4.2.4.1.2) */
case _EMMREG_REGISTER_REQ:
/*
* The user manually re-selected a PLMN to register to
*/
rc = emm_fsm_set_status(EMM_DEREGISTERED_PLMN_SEARCH);
if (rc != RETURNerror) {
/*
* Notify EMM that the MT is currently searching an operator
* to register to
*/
rc = emm_proc_registration_notify(NET_REG_STATE_ON);
if (rc != RETURNok) {
LOG_TRACE(WARNING, "EMM-FSM - "
"Failed to notify registration update");
}
/*
* Perform network re-selection procedure
*/
rc = emm_proc_plmn_selection(evt->u.regist.index);
}
break;
default:
LOG_TRACE(ERROR, "EMM-FSM - Primitive is not valid (%d)",
evt->primitive);
break;
}
LOG_FUNC_RETURN (rc);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+102
View File
@@ -0,0 +1,102 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmDeregisteredNoImsi.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-DEREGISTERED.NO-IMSI state.
In EMM-DEREGISTERED.NO-IMSI state, the UE is switched on
without a valid USIM inserted.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "nas_log.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmDeregisteredNoImsi() **
** **
** Description: Handles the behaviour of the UE while the EMM-SAP is in **
** EMM-DEREGISTERED.NO-IMSI state. **
** **
** 3GPP TS 24.301, section 5.2.2.3.5 **
** The UE shall perform cell selection and may initiate **
** attach for emergency bearer services. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmDeregisteredNoImsi(const emm_reg_t *evt)
{
LOG_FUNC_IN;
assert(emm_fsm_get_status() == EMM_DEREGISTERED_NO_IMSI);
LOG_TRACE(ERROR, "EMM-FSM - USIM is not present or not valid");
LOG_FUNC_RETURN (RETURNerror);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+174
View File
@@ -0,0 +1,174 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmDeregisteredNormalService.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-DEREGISTERED.NORMAL-SERVICE state.
In EMM-DEREGISTERED.NORMAL-SERVICE state, the EPS update
status is EU1 or EU2, in the meantime a suitable cell has
been found and the PLMN or tracking area is not in the
forbidden list.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "networkDef.h"
#include "nas_log.h"
#include "emm_proc.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmDeregisteredNormalService() **
** **
** Description: Handles the behaviour of the UE while the EMM-SAP is in **
** EMM-DEREGISTERED.NORMAL-SERVICE state. **
** **
** 3GPP TS 24.301, section 5.2.2.3.1 **
** The UE shall initiate an attach or combined attach proce- **
** dure. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmDeregisteredNormalService(const emm_reg_t *evt)
{
LOG_FUNC_IN;
int rc = RETURNerror;
assert(emm_fsm_get_status() == EMM_DEREGISTERED_NORMAL_SERVICE);
switch (evt->primitive) {
case _EMMREG_REGISTER_REQ:
/*
* The user manually re-selected a PLMN to register to
*/
rc = emm_fsm_set_status(EMM_DEREGISTERED_PLMN_SEARCH);
if (rc != RETURNerror) {
/* Process the network registration request */
rc = emm_fsm_process(evt);
}
break;
case _EMMREG_ATTACH_INIT:
/*
* Initiate the attach procedure for EPS services
*/
rc = emm_proc_attach(EMM_ATTACH_TYPE_EPS);
break;
case _EMMREG_ATTACH_REQ:
/*
* An EPS network attach has been requested (Attach Request
* message successfully delivered to the network);
* enter state EMM-REGISTERED-INITIATED
*/
rc = emm_fsm_set_status(EMM_REGISTERED_INITIATED);
break;
case _EMMREG_LOWERLAYER_SUCCESS:
/*
* Initial NAS message has been successfully delivered
* to the network
*/
rc = emm_proc_lowerlayer_success();
break;
case _EMMREG_LOWERLAYER_FAILURE:
/*
* Initial NAS message failed to be delivered to the network
*/
rc = emm_proc_lowerlayer_failure(TRUE);
break;
case _EMMREG_LOWERLAYER_RELEASE:
/*
* NAS signalling connection has been released
*/
rc = emm_proc_lowerlayer_release();
break;
case _EMMREG_ATTACH_CNF:
/*
* Attach procedure successful and default EPS bearer
* context activated;
* enter state EMM-REGISTERED.
*/
rc = emm_fsm_set_status(EMM_REGISTERED);
break;
default:
LOG_TRACE(ERROR, "EMM-FSM - Primitive is not valid (%d)",
evt->primitive);
break;
}
LOG_FUNC_RETURN (rc);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+162
View File
@@ -0,0 +1,162 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmDeregisteredPlmnSearch.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-DEREGISTERED.PLMN-SEARCH state.
In EMM-DEREGISTERED.PLMN-SEARCH state, the UE with a valid
USIM is switched on.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "networkDef.h"
#include "nas_log.h"
#include "emm_proc.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmDeregisteredPlmnSearch() **
** **
** Description: Handles the behaviour of the UE while the EMM-SAP is in **
** EMM-DEREGISTERED.PLMN-SEARCH state. **
** **
** 3GPP TS 24.301, section 5.2.2.3.4 **
** The UE shall perform PLMN selection. If a new PLMN is **
** selected, the UE shall reset the attach attempt counter **
** and initiate the attach or combined attach procedure. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmDeregisteredPlmnSearch(const emm_reg_t *evt)
{
LOG_FUNC_IN;
int rc = RETURNerror;
assert(emm_fsm_get_status() == EMM_DEREGISTERED_PLMN_SEARCH);
switch (evt->primitive) {
case _EMMREG_NO_CELL:
/*
* No suitable cell of the selected PLMN has been found to camp on
*/
rc = emm_proc_registration_notify(NET_REG_STATE_DENIED);
if (rc != RETURNok) {
LOG_TRACE(WARNING, "EMM-FSM - "
"Failed to notify registration update");
}
rc = emm_fsm_set_status(EMM_DEREGISTERED_NO_CELL_AVAILABLE);
break;
case _EMMREG_REGISTER_REQ:
/*
* The UE has been switched on and is currently searching an
* operator to register to. The particular PLMN to be contacted
* may be selected either automatically or manually.
* Or the user manually re-selected a PLMN to register to.
*/
rc = emm_proc_registration_notify(NET_REG_STATE_ON);
if (rc != RETURNok) {
LOG_TRACE(WARNING, "EMM-FSM - "
"Failed to notify registration update");
}
/*
* Perform network selection procedure
*/
rc = emm_proc_plmn_selection(evt->u.regist.index);
break;
case _EMMREG_REGISTER_REJ:
/*
* The selected cell is known not to be able to provide normal
* service
*/
rc = emm_fsm_set_status(EMM_DEREGISTERED_LIMITED_SERVICE);
break;
case _EMMREG_REGISTER_CNF:
/*
* A suitable cell of the selected PLMN has been found to camp on
*/
rc = emm_fsm_set_status(EMM_DEREGISTERED_NORMAL_SERVICE);
break;
default:
LOG_TRACE(ERROR, "EMM-FSM - Primitive is not valid (%d)",
evt->primitive);
break;
}
LOG_FUNC_RETURN (rc);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+134
View File
@@ -0,0 +1,134 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmNull.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-NULL state.
In EMM-NULL state, the EPS capability is disabled in the UE.
No EPS mobility management function shall be performed.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "nas_log.h"
#include "emm_proc.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmNull() **
** **
** Description: Handles the behaviour of the UE while the EMM-SAP is in **
** EMM-NULL state. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmNull(const emm_reg_t *evt)
{
LOG_FUNC_IN;
int rc;
assert(emm_fsm_get_status() == EMM_NULL);
/* Delete the authentication data RAND and RES */
rc = emm_proc_authentication_delete();
if (rc != RETURNok) {
LOG_FUNC_RETURN (rc);
}
switch (evt->primitive) {
case _EMMREG_S1_ENABLED:
/*
* The EPS capability has been enabled in the UE:
* Move to the DEREGISTERED state;
*/
rc = emm_fsm_set_status(EMM_DEREGISTERED);
/*
* And initialize the EMM procedure call manager in order to
* establish an EMM context and make the UE reachable by an MME.
*/
if (rc != RETURNerror) {
rc = emm_proc_initialize();
}
break;
default:
rc = RETURNerror;
LOG_TRACE(ERROR, "EMM-FSM - Primitive is not valid (%d)",
evt->primitive);
LOG_TRACE(WARNING, "EMM-FSM - Set phone functionnality to "
"enable EPS capability (+cfun=1)");
break;
}
LOG_FUNC_RETURN (rc);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+175
View File
@@ -0,0 +1,175 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmRegistered.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-REGISTERED state.
In EMM-REGISTERED state, an EMM context has been established
and a default EPS bearer context has been activated in the UE
and the MME.
The UE may initiate sending and receiving user data and signal-
ling information and reply to paging. Additionally, tracking
area updating or combined tracking area updating procedure is
performed.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "networkDef.h"
#include "nas_log.h"
#include "emm_proc.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmRegistered() **
** **
** Description: Handles the behaviour of the UE and the MME while the **
** EMM-SAP is in EMM-REGISTERED state. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmRegistered(const emm_reg_t *evt)
{
LOG_FUNC_IN;
int rc = RETURNerror;
assert(emm_fsm_get_status() == EMM_REGISTERED);
switch (evt->primitive) {
case _EMMREG_DETACH_INIT:
/*
* Initiate detach procedure for EPS services
*/
rc = emm_proc_detach(EMM_DETACH_TYPE_EPS, evt->u.detach.switch_off);
break;
case _EMMREG_DETACH_REQ:
/*
* Network detach has been requested (Detach Request
* message successfully delivered to the network);
* enter state EMM-DEREGISTERED-INITIATED
*/
rc = emm_fsm_set_status(EMM_DEREGISTERED_INITIATED);
break;
case _EMMREG_DETACH_CNF:
/*
* The UE implicitly detached from the network (all EPS
* bearer contexts may have been deactivated)
*/
rc = emm_fsm_set_status(EMM_DEREGISTERED);
break;
case _EMMREG_TAU_REQ:
/*
* TODO: Tracking Area Update has been requested
*/
LOG_TRACE(ERROR, "EMM-FSM - Tracking Area Update procedure "
"is not implemented");
break;
case _EMMREG_SERVICE_REQ:
/*
* TODO: Service Request has been requested
*/
LOG_TRACE(ERROR, "EMM-FSM - Service Request procedure "
"is not implemented");
break;
case _EMMREG_LOWERLAYER_SUCCESS:
/*
* Data transfer message has been successfully delivered
*/
rc = emm_proc_lowerlayer_success();
break;
case _EMMREG_LOWERLAYER_FAILURE:
/*
* Data transfer message failed to be delivered
*/
rc = emm_proc_lowerlayer_failure(FALSE);
break;
case _EMMREG_LOWERLAYER_RELEASE:
/*
* NAS signalling connection has been released
*/
rc = emm_proc_lowerlayer_release();
break;
default:
LOG_TRACE(ERROR, "EMM-FSM - Primitive is not valid (%d)",
evt->primitive);
break;
}
LOG_FUNC_RETURN (rc);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+102
View File
@@ -0,0 +1,102 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmRegisteredAttemptingToUpdate.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-REGISTERED.ATTEMPTING-TO-UPDATE
state.
In EMM-REGISTERED.ATTEMPTING-TO-UPDATE state, the tracking
area updating or combined tracking area updating procedure
failed due to a missing response from the network.
No EMM procedure except the tracking area updating or com-
bined tracking area updating procedure shall be initiated
by the UE in this substate. No data shall be sent or received.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "nas_log.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmRegisteredAttemptingToUpdate() **
** **
** Description: Handles the behaviour of the UE while the EMM-SAP is in **
** EMM-REGISTERED.ATTEMPTING-TO-UPDATE state. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmRegisteredAttemptingToUpdate(const emm_reg_t *evt)
{
LOG_FUNC_IN;
assert(emm_fsm_get_status() == EMM_REGISTERED_ATTEMPTING_TO_UPDATE);
/* TODO */
LOG_FUNC_RETURN (RETURNok);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+102
View File
@@ -0,0 +1,102 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmRegisteredImsiDetachInitiated.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-REGISTERED.IMSI-DETACH-INITIATED
state.
In EMM-REGISTERED.IMSI-DETACH-INITIATED state, the UE performs
a combined detach procedure for non-EPS services only.
The UE was attached for EPS and non-EPS services and wants to
detach for non-EPS services only. User data and signalling
information may be sent and received.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "nas_log.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmRegisteredImsiDetachInitiated() **
** **
** Description: Handles the behaviour of the UE while the EMM-SAP is in **
** EMM-REGISTERED.IMSI-DETACH-INITIATED state. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmRegisteredImsiDetachInitiated(const emm_reg_t *evt)
{
LOG_FUNC_IN;
assert(emm_fsm_get_status() == EMM_REGISTERED_IMSI_DETACH_INITIATED);
/* TODO */
LOG_FUNC_RETURN (RETURNok);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+271
View File
@@ -0,0 +1,271 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmRegisteredInitiated.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-REGISTERED-INITIATED state.
In EMM-REGISTERED-INITIATED state, the attach or the combined
attach procedure has been started and the UE is waiting for a
response from the MME.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "networkDef.h"
#include "nas_log.h"
#include "emm_proc.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmRegisteredInitiated() **
** **
** Description: Handles the behaviour of the UE while the EMM-SAP is in **
** EMM-REGISTERED-INITIATED state. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmRegisteredInitiated(const emm_reg_t *evt)
{
LOG_FUNC_IN;
int rc = RETURNerror;
assert(emm_fsm_get_status() == EMM_REGISTERED_INITIATED);
switch (evt->primitive) {
case _EMMREG_ATTACH_INIT:
/*
* Attach procedure has to be restarted (timers T3402 or T3411
* expired)
*/
/* Move to the corresponding initial EMM state */
if (evt->u.attach.is_emergency) {
rc = emm_fsm_set_status(EMM_DEREGISTERED_LIMITED_SERVICE);
} else {
rc = emm_fsm_set_status(EMM_DEREGISTERED_NORMAL_SERVICE);
}
if (rc != RETURNerror) {
/* Restart the attach procedure */
rc = emm_proc_attach_restart();
}
break;
case _EMMREG_ATTACH_FAILED:
/*
* Attempt to attach to the network failed (abnormal case or
* timer T3410 expired). The network attach procedure shall be
* restarted when timer T3411 expires.
*/
rc = emm_fsm_set_status(EMM_DEREGISTERED_ATTEMPTING_TO_ATTACH);
break;
case _EMMREG_ATTACH_EXCEEDED:
/*
* Attempt to attach to the network failed (abnormal case or
* timer T3410 expired) and the attach attempt counter reached
* its maximum value. The state is changed to EMM-DEREGISTERED.
* ATTEMPTING-TO-ATTACH or optionally to EMM-DEREGISTERED.PLMN-
* SEARCH in order to perform a PLMN selection.
*/
/* TODO: ATTEMPTING-TO-ATTACH or PLMN-SEARCH ??? */
rc = emm_fsm_set_status(EMM_DEREGISTERED_ATTEMPTING_TO_ATTACH);
break;
case _EMMREG_ATTACH_CNF:
/*
* EPS network attach accepted by the network;
* enter state EMM-REGISTERED.
*/
rc = emm_fsm_set_status(EMM_REGISTERED);
if (rc != RETURNerror) {
/*
* Notify EMM that the MT is registered
*/
rc = emm_proc_registration_notify(NET_REG_STATE_HN);
if (rc != RETURNok) {
LOG_TRACE(WARNING, "EMM-FSM - "
"Failed to notify registration update");
}
}
break;
case _EMMREG_AUTH_REJ:
/*
* UE authentication rejected by the network;
* abort any EMM signalling procedure
*/
case _EMMREG_ATTACH_REJ:
/*
* EPS network attach rejected by the network;
* enter state EMM-DEREGISTERED.
*/
rc = emm_fsm_set_status(EMM_DEREGISTERED);
if (rc != RETURNerror) {
/*
* Notify EMM that the MT's registration is denied
*/
rc = emm_proc_registration_notify(NET_REG_STATE_DENIED);
if (rc != RETURNok) {
LOG_TRACE(WARNING, "EMM-FSM - "
"Failed to notify registration update");
}
}
break;
case _EMMREG_REGISTER_REQ:
/*
* The UE has to select a new PLMN to register to
*/
rc = emm_fsm_set_status(EMM_DEREGISTERED_PLMN_SEARCH);
if (rc != RETURNerror) {
/* Process the network registration request */
rc = emm_fsm_process(evt);
}
break;
case _EMMREG_REGISTER_REJ:
/*
* The UE failed to register to the network for normal EPS service
*/
rc = emm_fsm_set_status(EMM_DEREGISTERED_LIMITED_SERVICE);
break;
case _EMMREG_NO_IMSI:
/*
* The UE failed to register to the network for emergency
* bearer services
*/
rc = emm_fsm_set_status(EMM_DEREGISTERED_NO_IMSI);
break;
case _EMMREG_DETACH_INIT:
/*
* Initiate detach procedure for EPS services
*/
rc = emm_proc_detach(EMM_DETACH_TYPE_EPS, evt->u.detach.switch_off);
break;
case _EMMREG_DETACH_REQ:
/*
* An EPS network detach has been requested (Detach Request
* message successfully delivered to the network);
* enter state EMM-DEREGISTERED-INITIATED
*/
rc = emm_fsm_set_status(EMM_DEREGISTERED_INITIATED);
break;
case _EMMREG_LOWERLAYER_SUCCESS:
/*
* Data transfer message has been successfully delivered;
* The NAS message may be Attach Complete, Detach Request or
* any message transfered by EMM common procedures requested
* by the network.
*/
rc = emm_proc_lowerlayer_success();
break;
case _EMMREG_LOWERLAYER_FAILURE:
/*
* Data transfer message failed to be delivered;
* The NAS message may be Attach Complete, Detach Request or
* any message transfered by EMM common procedures requested
* by the network.
*/
rc = emm_proc_lowerlayer_failure(FALSE);
break;
case _EMMREG_LOWERLAYER_RELEASE:
/*
* NAS signalling connection has been released before the Attach
* Accept, Attach Reject, or any message transfered by EMM common
* procedures requested by the network, is received.
*/
rc = emm_proc_lowerlayer_release();
break;
default:
LOG_TRACE(ERROR, "EMM-FSM - Primitive is not valid (%d)",
evt->primitive);
break;
}
LOG_FUNC_RETURN (rc);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+98
View File
@@ -0,0 +1,98 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmRegisteredLimitedService.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-REGISTERED.LIMITED-SERVICE state.
In EMM-REGISTERED.LIMITED-SERVICE state, the cell the UE
selected is known not to be able to provide normal service.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "nas_log.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmRegisteredLimitedService() **
** **
** Description: Handles the behaviour of the UE while the EMM-SAP is in **
** EMM-REGISTERED.LIMITED-SERVICE state. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmRegisteredLimitedService(const emm_reg_t *evt)
{
LOG_FUNC_IN;
assert(emm_fsm_get_status() == EMM_REGISTERED_LIMITED_SERVICE);
/* TODO */
LOG_FUNC_RETURN (RETURNok);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+99
View File
@@ -0,0 +1,99 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmRegisteredNoCellAvailable.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-REGISTERED.NO-CELL-AVAILABLE state.
In EMM-REGISTERED.NO-CELL-AVAILABLE state, E-UTRAN coverage
has been lost. The UE shall not initiate any EMM procedures
except for cell and PLMN reselection.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "nas_log.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmRegisteredNoCellAvailable() **
** **
** Description: Handles the behaviour of the UE while the EMM-SAP is in **
** EMM-REGISTERED.NO-CELL-AVAILABLE state. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmRegisteredNoCellAvailable(const emm_reg_t *evt)
{
LOG_FUNC_IN;
assert(emm_fsm_get_status() == EMM_REGISTERED_NO_CELL_AVAILABLE);
/* TODO */
LOG_FUNC_RETURN (RETURNok);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+98
View File
@@ -0,0 +1,98 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmRegisteredNormalService.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-REGISTERED.NORMAL-SERVICE state.
The EMM-REGISTERED.NORMAL-SERVICE state is the primary
substate choosen when the UE enters the state EMM-REGISTERED.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "nas_log.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmRegisteredNormalService() **
** **
** Description: Handles the behaviour of the UE while the EMM-SAP is in **
** EMM-REGISTERED.NORMAL-SERVICE state. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmRegisteredNormalService(const emm_reg_t *evt)
{
LOG_FUNC_IN;
assert(emm_fsm_get_status() == EMM_REGISTERED_NORMAL_SERVICE);
/* TODO */
LOG_FUNC_RETURN (RETURNok);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+126
View File
@@ -0,0 +1,126 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmRegisteredPlmnSearch.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-REGISTERED.PLMN-SEARCH state.
In EMM-REGISTERED.PLMN-SEARCH state, the UE is searching
for PLMNs.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "nas_log.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmRegisteredPlmnSearch() **
** **
** Description: Handles the behaviour of the UE while the EMM-SAP is in **
** EMM-REGISTERED.PLMN-SEARCH state. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmRegisteredPlmnSearch(const emm_reg_t *evt)
{
LOG_FUNC_IN;
assert(emm_fsm_get_status() == EMM_REGISTERED_PLMN_SEARCH);
/* TODO */
LOG_FUNC_RETURN (RETURNok);
}
#if 0
/****************************************************************************
** **
** Name: EmmRegisteredPlmnSearch_xxx() **
** **
** Description: Procedure executed when xxx **
** while the EMM-SAP is in EMM-REGISTERED.PLMN-SEARCH state. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmRegisteredPlmnSearch_xxx(const emm_reg_t *evt)
{
LOG_FUNC_IN;
assert(emm_fsm_get_status() == EMM_REGISTERED_PLMN_SEARCH);
/* TODO */
LOG_FUNC_RETURN (RETURNok);
}
#endif
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+104
View File
@@ -0,0 +1,104 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
ource EmmRegisteredUpdateNeeded.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-REGISTERED.UPDATE-NEEDED state.
In EMM-REGISTERED.UPDATE-NEEDED state, the UE has to perform
a tracking area updating or combined tracking area updating
procedure, but access to the current cell is barred. The access
class may be blocked due to access class control, or the
network rejected the NAS signalling connection establishment.
No EMM procedure except tracking area updating or combined
tracking area updating or service request as a response to
paging shall be initiated by the UE in this substate.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "nas_log.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmRegisteredUpdateNeeded() **
** **
** Description: Handles the behaviour of the UE while the EMM-SAP is in **
** EMM-REGISTERED.UPDATE-NEEDED state. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmRegisteredUpdateNeeded(const emm_reg_t *evt)
{
LOG_FUNC_IN;
assert(emm_fsm_get_status() == EMM_REGISTERED_UPDATE_NEEDED);
/* TODO */
LOG_FUNC_RETURN (RETURNok);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+100
View File
@@ -0,0 +1,100 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmServiceRequestInitiated.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-SERVICE-REQUEST-INITIATED
state.
In EMM-SERVICE-REQUEST-INITIATED state, the UE has started
the service request procedure and is waiting for a response
from the MME.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "nas_log.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmServiceRequestInitiated() **
** **
** Description: Handles the behaviour of the UE while the EMM-SAP is in **
** EMM-SERVICE-REQUEST-INITIATED state. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmServiceRequestInitiated(const emm_reg_t *evt)
{
LOG_FUNC_IN;
assert(emm_fsm_get_status() == EMM_SERVICE_REQUEST_INITIATED);
/* TODO */
LOG_FUNC_RETURN (RETURNok);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+100
View File
@@ -0,0 +1,100 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source EmmTrackingAreaUpdatingInitiated.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Implements the EPS Mobility Management procedures executed
when the EMM-SAP is in EMM-TRACKING-AREA-UPDATING-INITIATED
state.
In EMM-TRACKING-AREA-UPDATING-INITIATED state, the UE has
started the tracking area updating or combined tracking area
updating procedure and is waiting for a response from the MME.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "nas_log.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: EmmTrackingAreaUpdatingInitiated() **
** **
** Description: Handles the behaviour of the UE while the EMM-SAP is in **
** EMM-TRACKING-AREA-UPDATING-INITIATED state. **
** **
** Inputs: evt: The received EMM-SAP event **
** Others: emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmTrackingAreaUpdatingInitiated(const emm_reg_t *evt)
{
LOG_FUNC_IN;
assert(emm_fsm_get_status() == EMM_TRACKING_AREA_UPDATING_INITIATED);
/* TODO */
LOG_FUNC_RETURN (RETURNok);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+1486
View File
File diff suppressed because it is too large Load Diff
+72
View File
@@ -0,0 +1,72 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source emm_as.h
Version 0.1
Date 2012/10/16
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Defines the EMMAS Service Access Point that provides
services to the EPS Mobility Management for NAS message
transfer to/from the Access Stratum sublayer.
*****************************************************************************/
#ifndef __EMM_AS_H__
#define __EMM_AS_H__
#include "emm_asDef.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 emm_as_initialize(void);
int emm_as_send(const emm_as_t *msg);
#endif /* __EMM_AS_H__*/
+276
View File
@@ -0,0 +1,276 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source emm_asDef.h
Version 0.1
Date 2012/10/16
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Defines the EMM primitives available at the EMMAS Service
Access Point to transfer NAS messages to/from the Access
Stratum sublayer.
*****************************************************************************/
#ifndef __EMM_ASDEF_H__
#define __EMM_ASDEF_H__
#include "commonDef.h"
#include "OctetString.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
/*
* EMMAS-SAP primitives
*/
typedef enum emm_as_primitive_u {
_EMMAS_START = 200,
_EMMAS_SECURITY_REQ, /* EMM->AS: Security request */
_EMMAS_SECURITY_IND, /* AS->EMM: Security indication */
_EMMAS_SECURITY_RES, /* EMM->AS: Security response */
_EMMAS_SECURITY_REJ, /* EMM->AS: Security reject */
_EMMAS_ESTABLISH_REQ, /* EMM->AS: Connection establish request */
_EMMAS_ESTABLISH_CNF, /* AS->EMM: Connection establish confirm */
_EMMAS_ESTABLISH_REJ, /* AS->EMM: Connection establish reject */
_EMMAS_RELEASE_REQ, /* EMM->AS: Connection release request */
_EMMAS_RELEASE_IND, /* AS->EMM: Connection release indication */
_EMMAS_DATA_REQ, /* EMM->AS: Data transfer request */
_EMMAS_DATA_IND, /* AS->EMM: Data transfer indication */
_EMMAS_PAGE_IND, /* AS->EMM: Paging data indication */
_EMMAS_STATUS_IND, /* AS->EMM: Status indication */
_EMMAS_CELL_INFO_REQ, /* EMM->AS: Cell information request */
_EMMAS_CELL_INFO_RES, /* AS->EMM: Cell information response */
_EMMAS_CELL_INFO_IND, /* AS->EMM: Cell information indication */
_EMMAS_END
} emm_as_primitive_t;
/* Data used to setup EPS NAS security */
typedef struct emm_as_security_data_s {
uint8_t is_new; /* New security data indicator */
#define EMM_AS_NO_KEY_AVAILABLE 0xff
uint8_t ksi; /* NAS key set identifier */
uint8_t sqn; /* Sequence number */
uint32_t count; /* NAS counter */
const OctetString *k_enc; /* NAS cyphering key */
const OctetString *k_int; /* NAS integrity key */
} emm_as_security_data_t;
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
/****************************************************************************/
/*
* EMMAS primitive for security
* ----------------------------
*/
typedef struct emm_as_security_s {
uint32_t ueid; /* UE lower layer identifier */
const GUTI_t *guti; /* GUTI temporary mobile identity */
emm_as_security_data_t sctx;/* EPS NAS security context */
int emm_cause; /* EMM failure cause code */
/*
* Identity request/response
*/
uint8_t identType; /* Type of requested UE's identity */
const imsi_t *imsi; /* The requested IMSI of the UE */
const imei_t *imei; /* The requested IMEI of the UE */
uint32_t tmsi; /* The requested TMSI of the UE */
/*
* Authentication request/response
*/
uint8_t ksi; /* NAS key set identifier */
const OctetString *rand; /* Random challenge number */
const OctetString *autn; /* Authentication token */
const OctetString *res; /* Authentication response */
const OctetString *auts; /* Synchronisation failure */
/*
* Security Mode Command
*/
uint8_t eea; /* Replayed EPS encryption algorithms */
uint8_t eia; /* Replayed EPS integrity algorithms */
uint8_t uea; /* Replayed UMTS encryption algorithms */
uint8_t ucs2;
uint8_t uia; /* Replayed UMTS integrity algorithms */
uint8_t gea; /* Replayed GPRS encryption algorithms */
uint8_t umts_present;
uint8_t gprs_present;
// Added by LG
uint8_t selected_eea; /* Selected EPS encryption algorithms */
uint8_t selected_eia; /* Selected EPS integrity algorithms */
#define EMM_AS_MSG_TYPE_IDENT 0x01 /* Identification message */
#define EMM_AS_MSG_TYPE_AUTH 0x02 /* Authentication message */
#define EMM_AS_MSG_TYPE_SMC 0x03 /* Security Mode Command */
uint8_t msgType; /* Type of NAS security message to transfer */
} emm_as_security_t;
/*
* EMMAS primitive for connection establishment
* --------------------------------------------
*/
typedef struct emm_as_EPS_identity_s {
const GUTI_t *guti; /* The GUTI, if valid */
const tai_t *tai; /* The last visited registered Tracking
* Area Identity, if available */
const imsi_t *imsi; /* IMSI in case of "AttachWithImsi" */
const imei_t *imei; /* UE's IMEI for emergency bearer services */
} emm_as_EPS_identity_t;
typedef struct emm_as_establish_s {
uint32_t ueid; /* UE lower layer identifier */
emm_as_EPS_identity_t UEid; /* UE's EPS mobile identity */
emm_as_security_data_t sctx;/* EPS NAS security context */
int switch_off; /* TRUE if the UE is switched off */
uint8_t type; /* Network attach/detach type */
uint8_t RRCcause; /* Connection establishment cause */
uint8_t RRCtype; /* Associated call type */
const plmn_t *plmnID; /* Identifier of the selected PLMN */
uint8_t ksi; /* NAS key set identifier */
uint8_t encryption:4; /* Ciphering algorithm */
uint8_t integrity:4; /* Integrity protection algorithm */
int emm_cause; /* EMM failure cause code */
const GUTI_t *new_guti; /* New GUTI, if re-allocated */
int n_tacs; /* Number of concecutive tracking areas
* the UE is registered to */
tac_t tac; /* Code of the first tracking area the UE
* is registered to */
#define EMM_AS_NAS_INFO_ATTACH 0x01 /* Attach request */
#define EMM_AS_NAS_INFO_DETACH 0x02 /* Detach request */
#define EMM_AS_NAS_INFO_TAU 0x03 /* Tracking Area Update request */
#define EMM_AS_NAS_INFO_SR 0x04 /* Service Request */
#define EMM_AS_NAS_INFO_EXTSR 0x05 /* Extended Service Request */
uint8_t NASinfo; /* Type of initial NAS information to transfer */
OctetString NASmsg; /* NAS message to be transfered within
* initial NAS information message */
} emm_as_establish_t;
/*
* EMMAS primitive for connection release
* --------------------------------------
*/
typedef struct emm_as_release_s {
uint32_t ueid; /* UE lower layer identifier */
const GUTI_t *guti; /* GUTI temporary mobile identity */
#define EMM_AS_CAUSE_AUTHENTICATION 0x01 /* Authentication failure */
#define EMM_AS_CAUSE_DETACH 0x02 /* Detach requested */
uint8_t cause; /* Release cause */
} emm_as_release_t;
/*
* EMMAS primitive for data transfer
* ---------------------------------
*/
typedef struct emm_as_data_s {
uint32_t ueid; /* UE lower layer identifier */
const GUTI_t *guti; /* GUTI temporary mobile identity */
emm_as_security_data_t sctx;/* EPS NAS security context */
int switch_off; /* TRUE if the UE is switched off */
uint8_t type; /* Network detach type */
uint8_t delivered; /* Data message delivery indicator */
#define EMM_AS_NAS_DATA_ATTACH 0x01 /* Attach complete */
#define EMM_AS_NAS_DATA_DETACH 0x02 /* Detach request */
uint8_t NASinfo; /* Type of NAS information to transfer */
OctetString NASmsg; /* NAS message to be transfered */
} emm_as_data_t;
/*
* EMMAS primitive for paging
* --------------------------
*/
typedef struct emm_as_page_s {} emm_as_page_t;
/*
* EMMAS primitive for status indication
* -------------------------------------
*/
typedef struct emm_as_status_s {
uint32_t ueid; /* UE lower layer identifier */
const GUTI_t *guti; /* GUTI temporary mobile identity */
emm_as_security_data_t sctx;/* EPS NAS security context */
int emm_cause; /* EMM failure cause code */
} emm_as_status_t;
/*
* EMMAS primitive for cell information
* ------------------------------------
*/
typedef struct emm_as_cell_info_s {
uint8_t found; /* Indicates whether a suitable cell is found */
#define EMM_AS_PLMN_LIST_SIZE 6
PLMN_LIST_T(EMM_AS_PLMN_LIST_SIZE) plmnIDs;
/* List of identifiers of available PLMNs */
Byte_t rat; /* Bitmap of Radio Access Technologies */
tac_t tac; /* Tracking Area Code */
ci_t cellID; /* cell identity */
} emm_as_cell_info_t;
/*
* --------------------------------
* Structure of EMMAS-SAP primitive
* --------------------------------
*/
typedef struct emm_as_s {
emm_as_primitive_t primitive;
union {
emm_as_security_t security;
emm_as_establish_t establish;
emm_as_release_t release;
emm_as_data_t data;
emm_as_page_t page;
emm_as_status_t status;
emm_as_cell_info_t cell_info;
} u;
} emm_as_t;
/****************************************************************************/
/******************** 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 ******************/
/****************************************************************************/
/*
* Defined in LowerLayer.c
* Setup security data according to the given EPS security context
*/
void emm_as_set_security_data(emm_as_security_data_t *data, const void *context,
int is_new, int is_ciphered);
#endif /* __EMM_ASDEF_H__*/
+178
View File
@@ -0,0 +1,178 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source emm_esm.c
Version 0.1
Date 2012/10/16
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Defines the EMMESM Service Access Point that provides
interlayer services to the EPS Session Management sublayer
for service registration and activate/deactivate PDN
connections.
*****************************************************************************/
#include "emm_esm.h"
#include "commonDef.h"
#include "nas_log.h"
#include "LowerLayer.h"
#include "emm_proc.h"
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/*
* String representation of EMMESM-SAP primitives
*/
static const char *_emm_esm_primitive_str[] = {
"EMMESM_ESTABLISH_REQ",
"EMMESM_ESTABLISH_CNF",
"EMMESM_ESTABLISH_REJ",
"EMMESM_RELEASE_IND",
"EMMESM_UNITDATA_REQ",
"EMMESM_UNITDATA_IND",
};
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: emm_esm_initialize() **
** **
** Description: Initializes the EMMESM Service Access Point **
** **
** Inputs: None **
** Others: None **
** **
** Outputs: None **
** Return: None **
** Others: NONE **
** **
***************************************************************************/
void emm_esm_initialize(void)
{
LOG_FUNC_IN;
/* TODO: Initialize the EMMESM-SAP */
LOG_FUNC_OUT;
}
/****************************************************************************
** **
** Name: emm_esm_send() **
** **
** Description: Processes the EMMESM Service Access Point primitive **
** **
** Inputs: msg: The EMMESM-SAP primitive to process **
** Others: None **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: None **
** **
***************************************************************************/
int emm_esm_send(const emm_esm_t *msg)
{
LOG_FUNC_IN;
int rc = RETURNerror;
emm_esm_primitive_t primitive = msg->primitive;
LOG_TRACE(INFO, "EMMESM-SAP - Received primitive %s (%d)",
_emm_esm_primitive_str[primitive - _EMMESM_START - 1], primitive);
switch (primitive) {
case _EMMESM_ESTABLISH_REQ:
/* ESM requests EMM to initiate an attach procedure before
* requesting subsequent connectivity to additional PDNs */
rc = emm_proc_attach_restart();
break;
case _EMMESM_ESTABLISH_CNF:
/* ESM notifies EMM that PDN connectivity procedure successfully
* processed */
if (msg->u.establish.is_attached) {
if (msg->u.establish.is_emergency) {
/* Consider the UE attached for emergency bearer services
* only */
rc = emm_proc_attach_set_emergency();
}
} else {
/* Consider the UE locally detached from the network */
rc = emm_proc_attach_set_detach();
}
break;
case _EMMESM_ESTABLISH_REJ:
/* ESM notifies EMM that PDN connectivity procedure failed */
break;
case _EMMESM_UNITDATA_REQ:
/* ESM requests EMM to transfer ESM data unit to lower layer */
rc = lowerlayer_data_req(msg->ueid, &msg->u.data.msg);
break;
default:
break;
}
if (rc != RETURNok) {
LOG_TRACE(WARNING, "EMMESM-SAP - Failed to process primitive %s (%d)",
_emm_esm_primitive_str[primitive - _EMMESM_START - 1],
primitive);
}
LOG_FUNC_RETURN (rc);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+73
View File
@@ -0,0 +1,73 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source emm_esm.h
Version 0.1
Date 2012/10/16
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Defines the EMMESM Service Access Point that provides
interlayer services to the EPS Session Management sublayer
for service registration and activate/deactivate PDP context.
*****************************************************************************/
#ifndef __EMM_ESM_H__
#define __EMM_ESM_H__
#include "emm_esmDef.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 emm_esm_initialize(void);
int emm_esm_send(const emm_esm_t *msg);
#endif /* __EMM_ESM_H__*/
+118
View File
@@ -0,0 +1,118 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source emm_esmDef.h
Version 0.1
Date 2012/10/16
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Defines the EMMESM Service Access Point that provides
interlayer services to the EPS Session Management sublayer
for service registration and activate/deactivate PDN
connections.
*****************************************************************************/
#ifndef __EMM_ESMDEF_H__
#define __EMM_ESMDEF_H__
#include "OctetString.h"
#include "emmData.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
/*
* EMMESM-SAP primitives
*/
typedef enum {
_EMMESM_START = 100,
_EMMESM_ESTABLISH_REQ,
_EMMESM_ESTABLISH_CNF,
_EMMESM_ESTABLISH_REJ,
_EMMESM_RELEASE_IND,
_EMMESM_UNITDATA_REQ,
_EMMESM_UNITDATA_IND,
_EMMESM_END
} emm_esm_primitive_t;
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
/****************************************************************************/
/*
* EMMESM primitive for connection establishment
* ---------------------------------------------
*/
typedef struct {
int is_emergency; /* Indicates whether the PDN connection is established
* for emergency bearer services only */
int is_attached; /* Indicates whether the UE remains attached to the
* network */
} emm_esm_establish_t;
/*
* EMMESM primitive for data transfer
* ----------------------------------
*/
typedef struct {
OctetString msg; /* ESM message to be transfered */
} emm_esm_data_t;
/*
* ---------------------------------
* Structure of EMMESM-SAP primitive
* ---------------------------------
*/
typedef struct {
emm_esm_primitive_t primitive;
unsigned int ueid;
union {
emm_esm_establish_t establish;
emm_esm_data_t data;
} u;
/* TODO: complete emm_esm_t structure definition */
} emm_esm_t;
/****************************************************************************/
/******************** 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 ******************/
/****************************************************************************/
#endif /* __EMM_ESMDEF_H__*/
+325
View File
@@ -0,0 +1,325 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source emm_fsm.c
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Defines the EPS Mobility Management procedures executed at
the EMMREG Service Access Point.
*****************************************************************************/
#include "emm_fsm.h"
#include "commonDef.h"
#include "nas_log.h"
#include "emmData.h"
/****************************************************************************/
/**************** E X T E R N A L D E F I N I T I O N S ****************/
/****************************************************************************/
#define EMM_FSM_NB_UE_MAX 1
/****************************************************************************/
/******************* L O C A L D E F I N I T I O N S *******************/
/****************************************************************************/
/*
* -----------------------------------------------------------------------------
* Data used for trace logging
* -----------------------------------------------------------------------------
*/
/* String representation of EMM events */
static const char *_emm_fsm_event_str[] = {
"S1_ENABLED",
"S1_DISABLED",
"NO_IMSI",
"NO_CELL",
"REGISTER_REQ",
"REGISTER_CNF",
"REGISTER_REJ",
"ATTACH_INIT",
"ATTACH_REQ",
"ATTACH_FAILED",
"ATTACH_EXCEEDED",
"AUTHENTICATION_REJ",
"ATTACH_CNF",
"ATTACH_REJ",
"DETACH_INIT",
"DETACH_REQ",
"DETACH_FAILED",
"DETACH_CNF",
"TAU_REQ",
"TAU_CNF",
"TAU_REJ",
"SERVICE_REQ",
"SERVICE_CNF",
"SERVICE_REJ",
"LOWERLAYER_SUCCESS",
"LOWERLAYER_FAILURE",
"LOWERLAYER_RELEASE",
};
/* String representation of EMM status */
static const char *_emm_fsm_status_str[EMM_STATE_MAX] = {
"INVALID",
"NULL",
"DEREGISTERED",
"REGISTERED",
"DEREGISTERED-INITIATED",
"DEREGISTERED.NORMAL-SERVICE",
"DEREGISTERED.LIMITED-SERVICE",
"DEREGISTERED.ATTEMPTING-TO-ATTACH",
"DEREGISTERED.PLMN-SEARCH",
"DEREGISTERED.NO-IMSI",
"DEREGISTERED.ATTACH-NEEDED",
"DEREGISTERED.NO-CELL-AVAILABLE",
"REGISTERED-INITIATED",
"REGISTERED.NORMAL-SERVICE",
"REGISTERED.ATTEMPTING-TO-PDATE",
"REGISTERED.LIMITED-SERVICE",
"REGISTERED.PLMN-SEARCH",
"REGISTERED.UPDATE-NEEDED",
"REGISTERED.NO-CELL-AVAILABLE",
"REGISTERED.ATTEMPTING-TO-UPDATE-MM",
"REGISTERED.IMSI-DETACH-INITIATED",
"TRACKING-AREA-UPDATING-INITIATED",
"SERVICE-REQUEST-INITIATED",
};
/*
* -----------------------------------------------------------------------------
* EPS Mobility Management state machine handlers
* -----------------------------------------------------------------------------
*/
/* Type of the EPS Mobility Management state machine handler */
typedef int(*emm_fsm_handler_t)(const emm_reg_t *);
int EmmNull(const emm_reg_t *);
int EmmDeregistered(const emm_reg_t *);
int EmmRegistered(const emm_reg_t *);
int EmmDeregisteredInitiated(const emm_reg_t *);
int EmmDeregisteredNormalService(const emm_reg_t *);
int EmmDeregisteredLimitedService(const emm_reg_t *);
int EmmDeregisteredAttemptingToAttach(const emm_reg_t *);
int EmmDeregisteredPlmnSearch(const emm_reg_t *);
int EmmDeregisteredNoImsi(const emm_reg_t *);
int EmmDeregisteredAttachNeeded(const emm_reg_t *);
int EmmDeregisteredNoCellAvailable(const emm_reg_t *);
int EmmRegisteredInitiated(const emm_reg_t *);
int EmmRegisteredNormalService(const emm_reg_t *);
int EmmRegisteredAttemptingToUpdate(const emm_reg_t *);
int EmmRegisteredLimitedService(const emm_reg_t *);
int EmmRegisteredPlmnSearch(const emm_reg_t *);
int EmmRegisteredUpdateNeeded(const emm_reg_t *);
int EmmRegisteredNoCellAvailable(const emm_reg_t *);
int EmmRegisteredAttemptingToUpdate(const emm_reg_t *);
int EmmRegisteredImsiDetachInitiated(const emm_reg_t *);
int EmmTrackingAreaUpdatingInitiated(const emm_reg_t *);
int EmmServiceRequestInitiated(const emm_reg_t *);
/* EMM state machine handlers */
static const emm_fsm_handler_t _emm_fsm_handlers[EMM_STATE_MAX] = {
NULL,
EmmNull,
EmmDeregistered,
EmmRegistered,
EmmDeregisteredInitiated,
EmmDeregisteredNormalService,
EmmDeregisteredLimitedService,
EmmDeregisteredAttemptingToAttach,
EmmDeregisteredPlmnSearch,
EmmDeregisteredNoImsi,
EmmDeregisteredAttachNeeded,
EmmDeregisteredNoCellAvailable,
EmmRegisteredInitiated,
EmmRegisteredNormalService,
EmmRegisteredAttemptingToUpdate,
EmmRegisteredLimitedService,
EmmRegisteredPlmnSearch,
EmmRegisteredUpdateNeeded,
EmmRegisteredNoCellAvailable,
EmmRegisteredAttemptingToUpdate,
EmmRegisteredImsiDetachInitiated,
EmmTrackingAreaUpdatingInitiated,
EmmServiceRequestInitiated,
};
/*
* -----------------------------------------------------------------------------
* Current EPS Mobility Management status
* -----------------------------------------------------------------------------
*/
emm_fsm_state_t _emm_fsm_status[EMM_FSM_NB_UE_MAX];
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: emm_fsm_initialize() **
** **
** Description: Initializes the EMM state machine **
** **
** Inputs: None **
** Others: None **
** **
** Outputs: None **
** Return: None **
** Others: _emm_fsm_status **
** **
***************************************************************************/
void emm_fsm_initialize(void)
{
int ueid;
LOG_FUNC_IN;
_emm_fsm_status[0] = EMM_NULL;
LOG_FUNC_OUT;
}
/****************************************************************************
** **
** Name: emm_fsm_set_status() **
** **
** Description: Set the EPS Mobility Management status to the given state **
** **
** Inputs: ueid: Lower layers UE identifier **
** status: The new EMM status **
** Others: None **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: _emm_fsm_status **
** **
***************************************************************************/
int emm_fsm_set_status(
emm_fsm_state_t status)
{
LOG_FUNC_IN;
unsigned int ueid = 0;
if ( (status < EMM_STATE_MAX) && (ueid < EMM_FSM_NB_UE_MAX) ) {
LOG_TRACE(INFO, "EMM-FSM - Status changed: %s ===> %s",
_emm_fsm_status_str[_emm_fsm_status[ueid]],
_emm_fsm_status_str[status]);
if (status != _emm_fsm_status[ueid]) {
_emm_fsm_status[ueid] = status;
}
LOG_FUNC_RETURN (RETURNok);
}
LOG_FUNC_RETURN (RETURNerror);
}
/****************************************************************************
** **
** Name: emm_fsm_get_status() **
** **
** Description: Get the current value of the EPS Mobility Management **
** status **
** **
** Inputs: ueid: Lower layers UE identifier **
** Others: _emm_fsm_status **
** **
** Outputs: None **
** Return: The current value of the EMM status **
** Others: None **
** **
***************************************************************************/
emm_fsm_state_t emm_fsm_get_status(void)
{
return (_emm_fsm_status[0]);
}
/****************************************************************************
** **
** Name: emm_fsm_process() **
** **
** Description: Executes the EMM state machine **
** **
** Inputs: evt: The EMMREG-SAP event to process **
** Others: _emm_fsm_status **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: None **
** **
***************************************************************************/
int emm_fsm_process(const emm_reg_t *evt)
{
int rc;
emm_fsm_state_t status;
emm_reg_primitive_t primitive;
LOG_FUNC_IN;
primitive = evt->primitive;
status = _emm_fsm_status[0];
LOG_TRACE(INFO, "EMM-FSM - Received event %s (%d) in state %s",
_emm_fsm_event_str[primitive - _EMMREG_START - 1], primitive,
_emm_fsm_status_str[status]);
/* Execute the EMM state machine */
rc = (_emm_fsm_handlers[status])(evt);
LOG_FUNC_RETURN (rc);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+109
View File
@@ -0,0 +1,109 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source emm_fsm.h
Version 0.1
Date 2012/10/03
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Defines the EPS Mobility Management procedures executed at
the EMMREG Service Access Point.
*****************************************************************************/
#ifndef __EMM_FSM_H__
#define __EMM_FSM_H__
#include "emm_regDef.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 ************************/
/****************************************************************************/
/*
* States of the EPS Mobility Management sublayer
* ----------------------------------------------
* The EMM protocol of the UE and the network is described by means of two
* different state machines.
*/
typedef enum {
EMM_INVALID,
EMM_NULL,
EMM_DEREGISTERED,
EMM_REGISTERED,
EMM_DEREGISTERED_INITIATED,
EMM_DEREGISTERED_NORMAL_SERVICE,
EMM_DEREGISTERED_LIMITED_SERVICE,
EMM_DEREGISTERED_ATTEMPTING_TO_ATTACH,
EMM_DEREGISTERED_PLMN_SEARCH,
EMM_DEREGISTERED_NO_IMSI,
EMM_DEREGISTERED_ATTACH_NEEDED,
EMM_DEREGISTERED_NO_CELL_AVAILABLE,
EMM_REGISTERED_INITIATED,
EMM_REGISTERED_NORMAL_SERVICE,
EMM_REGISTERED_ATTEMPTING_TO_UPDATE,
EMM_REGISTERED_LIMITED_SERVICE,
EMM_REGISTERED_PLMN_SEARCH,
EMM_REGISTERED_UPDATE_NEEDED,
EMM_REGISTERED_NO_CELL_AVAILABLE,
EMM_REGISTERED_ATTEMPTING_TO_UPDATE_MM,
EMM_REGISTERED_IMSI_DETACH_INITIATED,
EMM_TRACKING_AREA_UPDATING_INITIATED,
EMM_SERVICE_REQUEST_INITIATED,
EMM_STATE_MAX
} emm_fsm_state_t;
/****************************************************************************/
/******************** 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 emm_fsm_initialize(void);
int emm_fsm_set_status(emm_fsm_state_t status);
emm_fsm_state_t emm_fsm_get_status(void);
int emm_fsm_process(const emm_reg_t *evt);
#endif /* __EMM_FSM_H__*/
+486
View File
@@ -0,0 +1,486 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source emm_recv.c
Version 0.1
Date 2013/01/30
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Defines functions executed at the EMMAS Service Access
Point upon receiving EPS Mobility Management messages
from the Access Stratum sublayer.
*****************************************************************************/
#include "emm_recv.h"
#include "commonDef.h"
#include "nas_log.h"
#include "emm_msgDef.h"
#include "emm_cause.h"
#include "emm_proc.h"
#include <string.h> // memcpy
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
/*
* --------------------------------------------------------------------------
* Functions executed by both the UE and the MME upon receiving EMM messages
* --------------------------------------------------------------------------
*/
/****************************************************************************
** **
** Name: emm_recv_status() **
** **
** Description: Processes EMM status message **
** **
** Inputs: ueid: UE lower layer identifier **
** msg: The received EMM message **
** Others: None **
** **
** Outputs: emm_cause: EMM cause code **
** Return: RETURNok, RETURNerror **
** Others: None **
** **
***************************************************************************/
int emm_recv_status(unsigned int ueid, emm_status_msg *msg, int *emm_cause)
{
LOG_FUNC_IN;
int rc;
LOG_TRACE(INFO, "EMMAS-SAP - Received EMM Status message (cause=%d)",
msg->emmcause);
/*
* Message checking
*/
*emm_cause = EMM_CAUSE_SUCCESS;
/*
* Message processing
*/
rc = emm_proc_status_ind(ueid, msg->emmcause);
LOG_FUNC_RETURN (rc);
}
/*
* --------------------------------------------------------------------------
* Functions executed by the UE upon receiving EMM message from the network
* --------------------------------------------------------------------------
*/
/****************************************************************************
** **
** Name: emm_recv_attach_accept() **
** **
** Description: Processes Attach Accept message **
** **
** Inputs: msg: The received EMM message **
** Others: None **
** **
** Outputs: emm_cause: EMM cause code **
** Return: RETURNok, RETURNerror **
** Others: None **
** **
***************************************************************************/
int emm_recv_attach_accept(attach_accept_msg *msg, int *emm_cause)
{
LOG_FUNC_IN;
int rc;
int i;
LOG_TRACE(INFO, "EMMAS-SAP - Received Attach Accept message");
/*
* Message checking
*/
if (msg->tailist.typeoflist !=
TRACKING_AREA_IDENTITY_LIST_ONE_PLMN_CONSECUTIVE_TACS) {
/* Only list of TACs belonging to one PLMN with consecutive
* TAC values is supported */
*emm_cause = EMM_CAUSE_IE_NOT_IMPLEMENTED;
} else if ( (msg->presencemask & ATTACH_ACCEPT_GUTI_PRESENT) &&
(msg->guti.guti.typeofidentity != EPS_MOBILE_IDENTITY_GUTI) ) {
/* The only supported type of EPS mobile identity is GUTI */
*emm_cause = EMM_CAUSE_IE_NOT_IMPLEMENTED;
}
/* Handle message checking error */
if (*emm_cause != EMM_CAUSE_SUCCESS) {
LOG_FUNC_RETURN (RETURNerror);
}
/*
* Message processing
*/
/* Compute timers value */
long T3412, T3402 = -1, T3423 = -1;
T3412 = gprs_timer_value(&msg->t3412value);
if (msg->presencemask & ATTACH_ACCEPT_T3402_VALUE_PRESENT) {
T3402 = gprs_timer_value(&msg->t3402value);
}
if (msg->presencemask & ATTACH_ACCEPT_T3423_VALUE_PRESENT) {
T3423 = gprs_timer_value(&msg->t3423value);
}
/* Get the tracking area list the UE is registered to */
/* LW: number of elements is coded as N-1 (0 -> 1 element, 1 -> 2 elements...),
* see 3GPP TS 24.301, section 9.9.3.33.1 */
int n_tais = msg->tailist.numberofelements + 1;
tai_t tai[n_tais];
for (i = 0; i < n_tais; i++) {
tai[i].plmn.MCCdigit1 = msg->tailist.mccdigit1;
tai[i].plmn.MCCdigit2 = msg->tailist.mccdigit2;
tai[i].plmn.MCCdigit3 = msg->tailist.mccdigit3;
tai[i].plmn.MNCdigit1 = msg->tailist.mncdigit1;
tai[i].plmn.MNCdigit2 = msg->tailist.mncdigit2;
tai[i].plmn.MNCdigit3 = msg->tailist.mncdigit3;
tai[i].tac = msg->tailist.tac + i;
}
/* Get the GUTI */
GUTI_t *pguti = NULL;
GUTI_t guti;
if (msg->presencemask & ATTACH_ACCEPT_GUTI_PRESENT) {
pguti = &guti;
guti.gummei.plmn.MCCdigit1 = msg->guti.guti.mccdigit1;
guti.gummei.plmn.MCCdigit2 = msg->guti.guti.mccdigit2;
guti.gummei.plmn.MCCdigit3 = msg->guti.guti.mccdigit3;
guti.gummei.plmn.MNCdigit1 = msg->guti.guti.mncdigit1;
guti.gummei.plmn.MNCdigit2 = msg->guti.guti.mncdigit2;
guti.gummei.plmn.MNCdigit3 = msg->guti.guti.mncdigit3;
guti.gummei.MMEgid = msg->guti.guti.mmegroupid;
guti.gummei.MMEcode = msg->guti.guti.mmecode;
guti.m_tmsi = msg->guti.guti.mtmsi;
}
/* Get the list of equivalent PLMNs */
int n_eplmns = 0;
plmn_t eplmn;
if (msg->presencemask & ATTACH_ACCEPT_EQUIVALENT_PLMNS_PRESENT) {
n_eplmns = 1;
eplmn.MCCdigit1 = msg->equivalentplmns.mccdigit1;
eplmn.MCCdigit2 = msg->equivalentplmns.mccdigit2;
eplmn.MCCdigit3 = msg->equivalentplmns.mccdigit3;
eplmn.MNCdigit1 = msg->equivalentplmns.mncdigit1;
eplmn.MNCdigit2 = msg->equivalentplmns.mncdigit2;
eplmn.MNCdigit3 = msg->equivalentplmns.mncdigit3;
}
/* Execute attach procedure accepted by the network */
rc = emm_proc_attach_accept(T3412, T3402, T3423, n_tais, tai, pguti,
n_eplmns, &eplmn,
&msg->esmmessagecontainer.esmmessagecontainercontents);
LOG_FUNC_RETURN (rc);
}
/****************************************************************************
** **
** Name: emm_recv_attach_reject() **
** **
** Description: Processes Attach Reject message **
** **
** Inputs: msg: The received EMM message **
** Others: None **
** **
** Outputs: emm_cause: EMM cause code **
** Return: RETURNok, RETURNerror **
** Others: None **
** **
***************************************************************************/
int emm_recv_attach_reject(attach_reject_msg *msg, int *emm_cause)
{
LOG_FUNC_IN;
int rc;
LOG_TRACE(INFO, "EMMAS-SAP - Received Attach Reject message (cause=%d)",
msg->emmcause);
/*
* Message checking
*/
if ( (msg->emmcause == EMM_CAUSE_ESM_FAILURE) &&
!(msg->presencemask & ATTACH_REJECT_ESM_MESSAGE_CONTAINER_PRESENT) ) {
/* The ATTACH REJECT message shall be combined with a PDN
* CONNECTIVITY REJECT message contained in the ESM message
* container information element */
*emm_cause = EMM_CAUSE_INVALID_MANDATORY_INFO;
}
/* Handle message checking error */
if (*emm_cause != EMM_CAUSE_SUCCESS) {
LOG_FUNC_RETURN (RETURNerror);
}
/*
* Message processing
*/
if (msg->presencemask & ATTACH_REJECT_ESM_MESSAGE_CONTAINER_PRESENT) {
/* Execute attach procedure rejected by the network */
rc = emm_proc_attach_reject(msg->emmcause,
&msg->esmmessagecontainer.esmmessagecontainercontents);
} else {
/* Execute attach procedure rejected by the network */
rc = emm_proc_attach_reject(msg->emmcause, NULL);
}
LOG_FUNC_RETURN (rc);
}
/****************************************************************************
** **
** Name: emm_recv_detach_accept() **
** **
** Description: Processes Detach Accept message **
** **
** Inputs: msg: The received EMM message **
** Others: None **
** **
** Outputs: emm_cause: EMM cause code **
** Return: RETURNok, RETURNerror **
** Others: None **
** **
***************************************************************************/
int emm_recv_detach_accept(detach_accept_msg *msg, int *emm_cause)
{
LOG_FUNC_IN;
int rc;
LOG_TRACE(INFO, "EMMAS-SAP - Received Detach Accept message");
/*
* Message processing
*/
/* Execute the UE initiated detach procedure completion by the UE */
rc = emm_proc_detach_accept();
LOG_FUNC_RETURN (rc);
}
/****************************************************************************
** **
** Name: emm_recv_identity_request() **
** **
** Description: Processes Identity Request message **
** **
** Inputs: msg: The received EMM message **
** Others: None **
** **
** Outputs: emm_cause: EMM cause code **
** Return: RETURNok, RETURNerror **
** Others: None **
** **
***************************************************************************/
int emm_recv_identity_request(identity_request_msg *msg, int *emm_cause)
{
LOG_FUNC_IN;
int rc;
LOG_TRACE(INFO, "EMMAS-SAP - Received Identity Request message");
/*
* Message processing
*/
/* Get the requested identity type */
emm_proc_identity_type_t type;
if (msg->identitytype == IDENTITY_TYPE_2_IMSI) {
type = EMM_IDENT_TYPE_IMSI;
} else if (msg->identitytype == IDENTITY_TYPE_2_IMEI) {
type = EMM_IDENT_TYPE_IMEI;
} else if (msg->identitytype == IDENTITY_TYPE_2_IMEISV) {
type = EMM_IDENT_TYPE_IMEISV;
} else if (msg->identitytype == IDENTITY_TYPE_2_TMSI) {
type = EMM_IDENT_TYPE_TMSI;
} else {
/* All other values are interpreted as IMSI */
type = EMM_IDENT_TYPE_IMSI;
}
/* Execute the identification procedure initiated by the network */
rc = emm_proc_identification_request(type);
LOG_FUNC_RETURN (rc);
}
/****************************************************************************
** **
** Name: emm_recv_authentication_request() **
** **
** Description: Processes Authentication Request message **
** **
** Inputs: msg: The received EMM message **
** Others: None **
** **
** Outputs: emm_cause: EMM cause code **
** Return: RETURNok, RETURNerror **
** Others: None **
** **
***************************************************************************/
int emm_recv_authentication_request(authentication_request_msg *msg,
int *emm_cause)
{
LOG_FUNC_IN;
int rc;
LOG_TRACE(INFO, "EMMAS-SAP - Received Authentication Request message");
/*
* Message checking
*/
if ( (msg->authenticationparameterrand.rand.length == 0) ||
(msg->authenticationparameterautn.autn.length == 0) ) {
/* RAND and AUTN parameters shall not be null */
*emm_cause = EMM_CAUSE_INVALID_MANDATORY_INFO;
}
/* Handle message checking error */
if (*emm_cause != EMM_CAUSE_SUCCESS) {
LOG_FUNC_RETURN (RETURNerror);
}
/*
* Message processing
*/
/* Execute the authentication procedure initiated by the network */
rc = emm_proc_authentication_request(
msg->naskeysetidentifierasme.tsc != NAS_KEY_SET_IDENTIFIER_MAPPED,
msg->naskeysetidentifierasme.naskeysetidentifier,
&msg->authenticationparameterrand.rand,
&msg->authenticationparameterautn.autn);
LOG_FUNC_RETURN (rc);
}
/****************************************************************************
** **
** Name: emm_recv_authentication_reject() **
** **
** Description: Processes Authentication Reject message **
** **
** Inputs: msg: The received EMM message **
** Others: None **
** **
** Outputs: emm_cause: EMM cause code **
** Return: RETURNok, RETURNerror **
** Others: None **
** **
***************************************************************************/
int emm_recv_authentication_reject(authentication_reject_msg *msg,
int *emm_cause)
{
LOG_FUNC_IN;
int rc;
LOG_TRACE(INFO, "EMMAS-SAP - Received Authentication Reject message");
/*
* Message processing
*/
/* Execute the authentication procedure not accepted by the network */
rc = emm_proc_authentication_reject();
LOG_FUNC_RETURN (rc);
}
/****************************************************************************
** **
** Name: emm_recv_security_mode_command() **
** **
** Description: Processes Security Mode Command message **
** **
** Inputs: msg: The received EMM message **
** Others: None **
** **
** Outputs: emm_cause: EMM cause code **
** Return: RETURNok, RETURNerror **
** Others: None **
** **
***************************************************************************/
int emm_recv_security_mode_command(security_mode_command_msg *msg,
int *emm_cause)
{
LOG_FUNC_IN;
int rc;
LOG_TRACE(INFO, "EMMAS-SAP - Received Security Mode Command message");
/*
* Message processing
*/
/* Execute the security mode control procedure initiated by the network */
rc = emm_proc_security_mode_command(
msg->naskeysetidentifier.tsc != NAS_KEY_SET_IDENTIFIER_MAPPED,
msg->naskeysetidentifier.naskeysetidentifier,
msg->selectednassecurityalgorithms.typeofcipheringalgorithm,
msg->selectednassecurityalgorithms.typeofintegrityalgorithm,
msg->replayeduesecuritycapabilities.eea,
msg->replayeduesecuritycapabilities.eia);
LOG_FUNC_RETURN (rc);
}
+111
View File
@@ -0,0 +1,111 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source emm_recv.h
Version 0.1
Date 2013/01/30
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Defines functions executed at the EMMAS Service Access
Point upon receiving EPS Mobility Management messages
from the Access Stratum sublayer.
*****************************************************************************/
#ifndef __EMM_RECV_H__
#define __EMM_RECV_H__
#include "EmmStatus.h"
#include "DetachRequest.h"
#include "DetachAccept.h"
#include "AttachAccept.h"
#include "AttachReject.h"
#include "TrackingAreaUpdateAccept.h"
#include "TrackingAreaUpdateReject.h"
#include "ServiceReject.h"
#include "GutiReallocationCommand.h"
#include "AuthenticationRequest.h"
#include "AuthenticationReject.h"
#include "IdentityRequest.h"
#include "NASSecurityModeCommand.h"
#include "EmmInformation.h"
#include "DownlinkNasTransport.h"
#include "CsServiceNotification.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 ******************/
/****************************************************************************/
/*
* --------------------------------------------------------------------------
* Functions executed by both the UE and the MME upon receiving EMM messages
* --------------------------------------------------------------------------
*/
int emm_recv_status(unsigned int ueid, emm_status_msg *msg, int *emm_cause);
/*
* --------------------------------------------------------------------------
* Functions executed by the UE upon receiving EMM message from the network
* --------------------------------------------------------------------------
*/
int emm_recv_attach_accept(attach_accept_msg *msg, int *emm_cause);
int emm_recv_attach_reject(attach_reject_msg *msg, int *emm_cause);
int emm_recv_detach_accept(detach_accept_msg *msg, int *emm_cause);
int emm_recv_identity_request(identity_request_msg *msg, int *emm_cause);
int emm_recv_authentication_request(authentication_request_msg *msg,
int *emm_cause);
int emm_recv_authentication_reject(authentication_reject_msg *msg,
int *emm_cause);
int emm_recv_security_mode_command(security_mode_command_msg *msg,
int *emm_cause);
#endif /* __EMM_RECV_H__*/
+126
View File
@@ -0,0 +1,126 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source emm_reg.c
Version 0.1
Date 2012/10/16
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Defines the EMMREG Service Access Point that provides
registration services for location updating and attach/detach
procedures.
*****************************************************************************/
#include "emm_reg.h"
#include "commonDef.h"
#include "nas_log.h"
#include "emm_fsm.h"
#include <assert.h>
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: emm_reg_initialize() **
** **
** Description: Initializes the EMMREG Service Access Point **
** **
** Inputs: None **
** Others: None **
** **
** Outputs: None **
** Return: None **
** Others: NONE **
** **
***************************************************************************/
void emm_reg_initialize(void)
{
LOG_FUNC_IN;
/* Initialize the EMM state machine */
emm_fsm_initialize();
LOG_FUNC_OUT;
}
/****************************************************************************
** **
** Name: emm_reg_send() **
** **
** Description: Processes the EMMREG Service Access Point primitive **
** **
** Inputs: msg: The EMMREG-SAP primitive to process **
** Others: None **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: None **
** **
***************************************************************************/
int emm_reg_send(const emm_reg_t *msg)
{
LOG_FUNC_IN;
int rc;
/* Check the EMM-SAP primitive */
emm_reg_primitive_t primitive = msg->primitive;
assert( (primitive > _EMMREG_START) && (primitive < _EMMREG_END));
/* Execute the EMM procedure */
rc = emm_fsm_process(msg);
LOG_FUNC_RETURN (rc);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+73
View File
@@ -0,0 +1,73 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source emm_reg.h
Version 0.1
Date 2012/10/16
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Defines the EMMREG Service Access Point that provides
registration services for location updating and attach/detach
procedures.
*****************************************************************************/
#ifndef __EMM_REG_H__
#define __EMM_REG_H__
#include "emm_regDef.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 emm_reg_initialize(void);
int emm_reg_send(const emm_reg_t *msg);
#endif /* __EMM_REG_H__*/
+147
View File
@@ -0,0 +1,147 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source emm_regDef.h
Version 0.1
Date 2012/10/16
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Defines the EMMREG Service Access Point that provides
registration services for location updating and attach/detach
procedures.
*****************************************************************************/
#ifndef __EMM_REGDEF_H__
#define __EMM_REGDEF_H__
#include "commonDef.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
/*
* EMMREG-SAP primitives
*/
typedef enum {
_EMMREG_START = 0,
_EMMREG_S1_ENABLED, /* S1 mode is enabled */
_EMMREG_S1_DISABLED, /* S1 mode is disabled */
_EMMREG_NO_IMSI, /* The UE is powered on without a valid USIM */
_EMMREG_NO_CELL, /* No available cell has been found */
_EMMREG_REGISTER_REQ, /* Network registration procedure requested */
_EMMREG_REGISTER_CNF, /* Network registration procedure succeed */
_EMMREG_REGISTER_REJ, /* Network registration procedure rejected */
_EMMREG_ATTACH_INIT, /* EPS network attach initiated */
_EMMREG_ATTACH_REQ, /* EPS network attach requested */
_EMMREG_ATTACH_FAILED, /* Attach attempt failed */
_EMMREG_ATTACH_EXCEEDED, /* Attach attempt exceeded */
_EMMREG_AUTH_REJ, /* Authentication rejected */
_EMMREG_ATTACH_CNF, /* EPS network attach accepted */
_EMMREG_ATTACH_REJ, /* EPS network attach rejected */
_EMMREG_DETACH_INIT, /* Network detach initiated */
_EMMREG_DETACH_REQ, /* Network detach requested */
_EMMREG_DETACH_FAILED, /* Network detach attempt failed */
_EMMREG_DETACH_CNF, /* Network detach accepted */
_EMMREG_TAU_REQ,
_EMMREG_TAU_CNF,
_EMMREG_TAU_REJ,
_EMMREG_SERVICE_REQ,
_EMMREG_SERVICE_CNF,
_EMMREG_SERVICE_REJ,
_EMMREG_LOWERLAYER_SUCCESS, /* Data successfully delivered */
_EMMREG_LOWERLAYER_FAILURE, /* Lower layer failure indication */
_EMMREG_LOWERLAYER_RELEASE, /* NAS signalling connection released */
_EMMREG_END
} emm_reg_primitive_t;
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
/****************************************************************************/
/*
* EMMREG primitive for network registration procedure
* ----------------------------------------------------
*/
typedef struct {
int index; /* Index of the currently selected PLMN in the ordered
* list of available PLMNs */
} emm_reg_register_t;
/*
* EMMREG primitive for attach procedure
* -------------------------------------
*/
typedef struct {
int is_emergency; /* TRUE if the UE was attempting to register to
* the network for emergency services only */
} emm_reg_attach_t;
/*
* EMMREG primitive for detach procedure
* -------------------------------------
*/
typedef struct {
int switch_off; /* TRUE if the UE is switched off */
int type; /* Network detach type */
} emm_reg_detach_t;
/*
* Structure of EMMREG-SAP primitive
*/
typedef struct {
emm_reg_primitive_t primitive;
unsigned int ueid;
void *ctx;
union {
emm_reg_attach_t attach;
emm_reg_detach_t detach;
emm_reg_register_t regist;
} u;
} emm_reg_t;
/****************************************************************************/
/******************** 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 ******************/
/****************************************************************************/
#endif /* __EMM_REGDEF_H__*/
+143
View File
@@ -0,0 +1,143 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source emm_sap.c
Version 0.1
Date 2012/10/01
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Defines the EMM Service Access Points at which the EPS
Mobility Management sublayer provides procedures for the
control of security and mobility when the User Equipment
is using the Evolved UTRA Network.
*****************************************************************************/
#include "emm_sap.h"
#include "commonDef.h"
#include "nas_log.h"
#include "emm_reg.h"
#include "emm_esm.h"
#include "emm_as.h"
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/****************************************************************************
** **
** Name: emm_sap_initialize() **
** **
** Description: Initializes the EMM Service Access Points **
** **
** Inputs: None **
** Others: None **
** **
** Outputs: None **
** Return: None **
** Others: NONE **
** **
***************************************************************************/
void emm_sap_initialize(void)
{
LOG_FUNC_IN;
emm_reg_initialize();
emm_esm_initialize();
emm_as_initialize();
LOG_FUNC_OUT;
}
/****************************************************************************
** **
** Name: emm_sap_send() **
** **
** Description: Processes the EMM Service Access Point primitive **
** **
** Inputs: msg: The EMM-SAP primitive to process **
** Others: None **
** **
** Outputs: msg: The EMM-SAP primitive to process **
** Return: RETURNok, RETURNerror **
** Others: None **
** **
***************************************************************************/
int emm_sap_send(emm_sap_t *msg)
{
int rc = RETURNerror;
emm_primitive_t primitive = msg->primitive;
LOG_FUNC_IN;
/* Check the EMM-SAP primitive */
if ( (primitive > (emm_primitive_t)EMMREG_PRIMITIVE_MIN) &&
(primitive < (emm_primitive_t)EMMREG_PRIMITIVE_MAX) ) {
/* Forward to the EMMREG-SAP */
msg->u.emm_reg.primitive = primitive;
rc = emm_reg_send(&msg->u.emm_reg);
} else if ( (primitive > (emm_primitive_t)EMMESM_PRIMITIVE_MIN) &&
(primitive < (emm_primitive_t)EMMESM_PRIMITIVE_MAX) ) {
/* Forward to the EMMESM-SAP */
msg->u.emm_esm.primitive = primitive;
rc = emm_esm_send(&msg->u.emm_esm);
} else if ( (primitive > (emm_primitive_t)EMMAS_PRIMITIVE_MIN) &&
(primitive < (emm_primitive_t)EMMAS_PRIMITIVE_MAX) ) {
/* Forward to the EMMAS-SAP */
msg->u.emm_as.primitive = primitive;
rc = emm_as_send(&msg->u.emm_as);
}
else {
LOG_TRACE(WARNING, "EMM-SAP - Out of range primitive (%d)", primitive);
}
LOG_FUNC_RETURN (rc);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+170
View File
@@ -0,0 +1,170 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source emm_sap.h
Version 0.1
Date 2012/10/01
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Defines the EMM Service Access Points at which the EPS
Mobility Management sublayer provides procedures for the
control of security and mobility when the User Equipment
is using the Evolved UTRA Network.
*****************************************************************************/
#ifndef __EMM_SAP_H__
#define __EMM_SAP_H__
#include "emmData.h"
#include "emm_regDef.h"
#include "emm_esmDef.h"
#include "emm_asDef.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
/*
* EPS Mobility Management primitives
* ----------------------------------
* EMMREG-SAP provides registration services for location updating and
* attach/detach procedures;
* EMMESM-SAP provides interlayer services to the EPS Session Management
* sublayer for service registration and activate/deactivate PDP context;
* EMMAS-SAP provides services to the Access Stratum sublayer for NAS message
* transfer;
*/
typedef enum {
/* EMMREG-SAP */
EMMREG_S1_ENABLED = _EMMREG_S1_ENABLED,
EMMREG_S1_DISABLED = _EMMREG_S1_DISABLED,
EMMREG_NO_IMSI = _EMMREG_NO_IMSI,
EMMREG_NO_CELL = _EMMREG_NO_CELL,
EMMREG_REGISTER_REQ = _EMMREG_REGISTER_REQ,
EMMREG_REGISTER_CNF = _EMMREG_REGISTER_CNF,
EMMREG_REGISTER_REJ = _EMMREG_REGISTER_REJ,
EMMREG_ATTACH_INIT = _EMMREG_ATTACH_INIT,
EMMREG_ATTACH_REQ = _EMMREG_ATTACH_REQ,
EMMREG_ATTACH_FAILED = _EMMREG_ATTACH_FAILED,
EMMREG_ATTACH_EXCEEDED = _EMMREG_ATTACH_EXCEEDED,
EMMREG_AUTH_REJ = _EMMREG_AUTH_REJ,
EMMREG_ATTACH_CNF = _EMMREG_ATTACH_CNF,
EMMREG_ATTACH_REJ = _EMMREG_ATTACH_REJ,
EMMREG_DETACH_INIT = _EMMREG_DETACH_INIT,
EMMREG_DETACH_REQ = _EMMREG_DETACH_REQ,
EMMREG_DETACH_FAILED = _EMMREG_DETACH_FAILED,
EMMREG_DETACH_CNF = _EMMREG_DETACH_CNF,
EMMREG_TAU_REQ = _EMMREG_TAU_REQ,
EMMREG_TAU_CNF = _EMMREG_TAU_CNF,
EMMREG_TAU_REJ = _EMMREG_TAU_REJ,
EMMREG_SERVICE_REQ = _EMMREG_SERVICE_REQ,
EMMREG_SERVICE_CNF = _EMMREG_SERVICE_CNF,
EMMREG_SERVICE_REJ = _EMMREG_SERVICE_REJ,
EMMREG_LOWERLAYER_SUCCESS = _EMMREG_LOWERLAYER_SUCCESS,
EMMREG_LOWERLAYER_FAILURE = _EMMREG_LOWERLAYER_FAILURE,
EMMREG_LOWERLAYER_RELEASE = _EMMREG_LOWERLAYER_RELEASE,
/* EMMESM-SAP */
EMMESM_ESTABLISH_REQ = _EMMESM_ESTABLISH_REQ,
EMMESM_ESTABLISH_CNF = _EMMESM_ESTABLISH_CNF,
EMMESM_ESTABLISH_REJ = _EMMESM_ESTABLISH_REJ,
EMMESM_RELEASE_IND = _EMMESM_RELEASE_IND,
EMMESM_UNITDATA_REQ = _EMMESM_UNITDATA_REQ,
EMMESM_UNITDATA_IND = _EMMESM_UNITDATA_IND,
/* EMMAS-SAP */
EMMAS_SECURITY_REQ = _EMMAS_SECURITY_REQ,
EMMAS_SECURITY_IND = _EMMAS_SECURITY_IND,
EMMAS_SECURITY_RES = _EMMAS_SECURITY_RES,
EMMAS_SECURITY_REJ = _EMMAS_SECURITY_REJ,
EMMAS_ESTABLISH_REQ = _EMMAS_ESTABLISH_REQ,
EMMAS_ESTABLISH_CNF = _EMMAS_ESTABLISH_CNF,
EMMAS_ESTABLISH_REJ = _EMMAS_ESTABLISH_REJ,
EMMAS_RELEASE_REQ = _EMMAS_RELEASE_REQ,
EMMAS_RELEASE_IND = _EMMAS_RELEASE_IND,
EMMAS_DATA_REQ = _EMMAS_DATA_REQ,
EMMAS_DATA_IND = _EMMAS_DATA_IND,
EMMAS_PAGE_IND = _EMMAS_PAGE_IND,
EMMAS_STATUS_IND = _EMMAS_STATUS_IND,
EMMAS_CELL_INFO_REQ = _EMMAS_CELL_INFO_REQ,
EMMAS_CELL_INFO_RES = _EMMAS_CELL_INFO_RES,
EMMAS_CELL_INFO_IND = _EMMAS_CELL_INFO_IND,
} emm_primitive_t;
/*
* Minimal identifier for EMM-SAP primitives
*/
#define EMMREG_PRIMITIVE_MIN _EMMREG_START
#define EMMESM_PRIMITIVE_MIN _EMMESM_START
#define EMMAS_PRIMITIVE_MIN _EMMAS_START
#define EMMCN_PRIMITIVE_MIN _EMMCN_START
/*
* Maximal identifier for EMM-SAP primitives
*/
#define EMMREG_PRIMITIVE_MAX _EMMREG_END
#define EMMESM_PRIMITIVE_MAX _EMMESM_END
#define EMMAS_PRIMITIVE_MAX _EMMAS_END
#define EMMCN_PRIMITIVE_MAX _EMMCN_END
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
/****************************************************************************/
/*
* Structure of EPS Mobility Management primitive
*/
typedef struct emm_sap_s {
emm_primitive_t primitive;
union {
emm_reg_t emm_reg; /* EMMREG-SAP primitives */
emm_esm_t emm_esm; /* EMMESM-SAP primitives */
emm_as_t emm_as; /* EMMAS-SAP primitives */
} u;
} emm_sap_t;
/****************************************************************************/
/******************** 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 emm_sap_initialize(void);
int emm_sap_send(emm_sap_t *msg);
#endif /* __EMM_SAP_H__*/
+909
View File
@@ -0,0 +1,909 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source emm_send.c
Version 0.1
Date 2013/01/30
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Defines functions executed at the EMMAS Service Access
Point to send EPS Mobility Management messages to the
Access Stratum sublayer.
*****************************************************************************/
#include "emm_send.h"
#include "commonDef.h"
#include "nas_log.h"
#include "emm_msgDef.h"
#include "emm_proc.h"
#include <string.h> // strlen
/****************************************************************************/
/**************** E X T E R N 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 *******************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
/*
* --------------------------------------------------------------------------
* Functions executed by both the UE and the MME to send EMM messages
* --------------------------------------------------------------------------
*/
/****************************************************************************
** **
** Name: emm_send_status() **
** **
** Description: Builds EMM status message **
** **
** The EMM status message is sent by the UE or the network **
** at any time to report certain error conditions. **
** **
** Inputs: emm_cause: EMM cause code **
** Others: None **
** **
** Outputs: emm_msg: The EMM message to be sent **
** Return: The size of the EMM message **
** Others: None **
** **
***************************************************************************/
int emm_send_status(const emm_as_status_t *msg, emm_status_msg *emm_msg)
{
LOG_FUNC_IN;
int size = EMM_HEADER_MAXIMUM_LENGTH;
LOG_TRACE(WARNING, "EMMAS-SAP - Send EMM Status message (cause=%d)",
msg->emm_cause);
/* Mandatory - Message type */
emm_msg->messagetype = EMM_STATUS;
/* Mandatory - EMM cause */
size += EMM_CAUSE_MAXIMUM_LENGTH;
emm_msg->emmcause = msg->emm_cause;
LOG_FUNC_RETURN (size);
}
/****************************************************************************
** **
** Name: emm_send_detach_accept() **
** **
** Description: Builds Detach Accept message **
** **
** The Detach Accept message is sent by the UE or the net- **
** work to indicate that the detach procedure has been com- **
** pleted. **
** **
** Inputs: msg: The EMMAS-SAP primitive to process **
** Others: None **
** **
** Outputs: emm_msg: The EMM message to be sent **
** Return: The size of the EMM message **
** Others: None **
** **
***************************************************************************/
int emm_send_detach_accept(const emm_as_data_t *msg,
detach_accept_msg *emm_msg)
{
LOG_FUNC_IN;
int size = EMM_HEADER_MAXIMUM_LENGTH;
LOG_TRACE(INFO, "EMMAS-SAP - Send Detach Accept message");
/* Mandatory - Message type */
emm_msg->messagetype = DETACH_ACCEPT;
LOG_FUNC_RETURN (size);
}
/*
* --------------------------------------------------------------------------
* Functions executed by the UE to send EMM messages to the network
* --------------------------------------------------------------------------
*/
/****************************************************************************
** **
** Name: emm_send_attach_request() **
** **
** Description: Builds Attach Request message **
** **
** The Attach Request message is sent by the UE to the net- **
** work in order to perform an attach procedure. **
** **
** Inputs: msg: The EMMAS-SAP primitive to process **
** Others: None **
** **
** Outputs: emm_msg: The EMM message to be sent **
** Return: The size of the EMM message **
** Others: None **
** **
***************************************************************************/
int emm_send_attach_request(const emm_as_establish_t *msg,
attach_request_msg *emm_msg)
{
LOG_FUNC_IN;
int size = EMM_HEADER_MAXIMUM_LENGTH;
LOG_TRACE(INFO, "EMMAS-SAP - Send Attach Request message");
/* Mandatory - Message type */
emm_msg->messagetype = ATTACH_REQUEST;
/* Mandatory - EPS attach type */
size += EPS_ATTACH_TYPE_MAXIMUM_LENGTH;
if (msg->type == EMM_ATTACH_TYPE_EPS) {
emm_msg->epsattachtype = EPS_ATTACH_TYPE_EPS;
} else if (msg->type == EMM_ATTACH_TYPE_IMSI) {
emm_msg->epsattachtype = EPS_ATTACH_TYPE_IMSI;
} else if (msg->type == EMM_ATTACH_TYPE_EMERGENCY) {
emm_msg->epsattachtype = EPS_ATTACH_TYPE_EMERGENCY;
} else if (msg->type == EMM_ATTACH_TYPE_RESERVED) {
emm_msg->epsattachtype = EPS_ATTACH_TYPE_RESERVED;
} else {
/* All other values shall be interpreted as "EPS attach" */
emm_msg->epsattachtype = EPS_ATTACH_TYPE_EPS;
}
/* Mandatory - NAS key set identifier */
size += NAS_KEY_SET_IDENTIFIER_MAXIMUM_LENGTH;
if (msg->ksi != EMM_AS_NO_KEY_AVAILABLE) {
emm_msg->naskeysetidentifier.naskeysetidentifier = msg->ksi;
} else {
emm_msg->naskeysetidentifier.naskeysetidentifier =
NAS_KEY_SET_IDENTIFIER_NOT_AVAILABLE;
}
/* Mandatory - EPS mobile identity */
size += EPS_MOBILE_IDENTITY_MAXIMUM_LENGTH;
if (msg->UEid.guti) {
LOG_TRACE(INFO, "EMMAS-SAP - Send Attach Request message with GUTI");
/* Set GUTI mobile identity */
GutiEpsMobileIdentity_t *guti = &emm_msg->oldgutiorimsi.guti;
guti->typeofidentity = EPS_MOBILE_IDENTITY_GUTI;
guti->oddeven = EPS_MOBILE_IDENTITY_EVEN;
guti->mmegroupid = msg->UEid.guti->gummei.MMEgid;
guti->mmecode = msg->UEid.guti->gummei.MMEcode;
guti->mtmsi = msg->UEid.guti->m_tmsi;
guti->mccdigit1 = msg->UEid.guti->gummei.plmn.MCCdigit1;
guti->mccdigit2 = msg->UEid.guti->gummei.plmn.MCCdigit2;
guti->mccdigit3 = msg->UEid.guti->gummei.plmn.MCCdigit3;
guti->mncdigit1 = msg->UEid.guti->gummei.plmn.MNCdigit1;
guti->mncdigit2 = msg->UEid.guti->gummei.plmn.MNCdigit2;
guti->mncdigit3 = msg->UEid.guti->gummei.plmn.MNCdigit3;
} else if (msg->UEid.imsi) {
LOG_TRACE(INFO, "EMMAS-SAP - Send Attach Request message with IMSI");
/* Set IMSI mobile identity */
ImsiEpsMobileIdentity_t *imsi = &emm_msg->oldgutiorimsi.imsi;
imsi->typeofidentity = EPS_MOBILE_IDENTITY_IMSI;
imsi->oddeven = msg->UEid.imsi->u.num.parity;
imsi->digit1 = msg->UEid.imsi->u.num.digit1;
imsi->digit2 = msg->UEid.imsi->u.num.digit2;
imsi->digit3 = msg->UEid.imsi->u.num.digit3;
imsi->digit4 = msg->UEid.imsi->u.num.digit4;
imsi->digit5 = msg->UEid.imsi->u.num.digit5;
imsi->digit6 = msg->UEid.imsi->u.num.digit6;
imsi->digit7 = msg->UEid.imsi->u.num.digit7;
imsi->digit8 = msg->UEid.imsi->u.num.digit8;
imsi->digit9 = msg->UEid.imsi->u.num.digit9;
imsi->digit10 = msg->UEid.imsi->u.num.digit10;
imsi->digit11 = msg->UEid.imsi->u.num.digit11;
imsi->digit12 = msg->UEid.imsi->u.num.digit12;
imsi->digit13 = msg->UEid.imsi->u.num.digit13;
imsi->digit14 = msg->UEid.imsi->u.num.digit14;
imsi->digit15 = msg->UEid.imsi->u.num.digit15;
} else if (msg->UEid.imei) {
LOG_TRACE(INFO, "EMMAS-SAP - Send Attach Request message with IMEI");
/* Set IMEI mobile identity */
ImeiEpsMobileIdentity_t *imei = &emm_msg->oldgutiorimsi.imei;
imei->typeofidentity = EPS_MOBILE_IDENTITY_IMEI;
imei->oddeven = msg->UEid.imei->u.num.parity;
imei->digit1 = msg->UEid.imei->u.num.digit1;
imei->digit2 = msg->UEid.imei->u.num.digit2;
imei->digit3 = msg->UEid.imei->u.num.digit3;
imei->digit4 = msg->UEid.imei->u.num.digit4;
imei->digit5 = msg->UEid.imei->u.num.digit5;
imei->digit6 = msg->UEid.imei->u.num.digit6;
imei->digit7 = msg->UEid.imei->u.num.digit7;
imei->digit8 = msg->UEid.imei->u.num.digit8;
imei->digit9 = msg->UEid.imei->u.num.digit9;
imei->digit10 = msg->UEid.imei->u.num.digit10;
imei->digit11 = msg->UEid.imei->u.num.digit11;
imei->digit12 = msg->UEid.imei->u.num.digit12;
imei->digit13 = msg->UEid.imei->u.num.digit13;
imei->digit14 = msg->UEid.imei->u.num.digit14;
imei->digit15 = msg->UEid.imei->u.num.digit15;
}
/* Mandatory - UE network capability */
size += UE_NETWORK_CAPABILITY_MAXIMUM_LENGTH;
emm_msg->uenetworkcapability.eea = (0x80 >> msg->encryption);
emm_msg->uenetworkcapability.eia = (0x80 >> msg->integrity);
emm_msg->uenetworkcapability.uea = 0;
emm_msg->uenetworkcapability.ucs2 = 0;
emm_msg->uenetworkcapability.uia = 0;
emm_msg->uenetworkcapability.csfb = 0;
emm_msg->uenetworkcapability.lpp = 0;
emm_msg->uenetworkcapability.lcs = 0;
emm_msg->uenetworkcapability.srvcc = 0;
emm_msg->uenetworkcapability.nf = 0;
/* Mandatory - ESM message container */
size += ESM_MESSAGE_CONTAINER_MINIMUM_LENGTH + msg->NASmsg.length;
emm_msg->esmmessagecontainer.esmmessagecontainercontents = msg->NASmsg;
/* Optional - Last visited registered TAI */
if (msg->UEid.tai) {
size += TRACKING_AREA_IDENTITY_MAXIMUM_LENGTH;
emm_msg->presencemask |= ATTACH_REQUEST_LAST_VISITED_REGISTERED_TAI_PRESENT;
emm_msg->lastvisitedregisteredtai.mccdigit2 =
msg->UEid.tai->plmn.MCCdigit2;
emm_msg->lastvisitedregisteredtai.mccdigit1 =
msg->UEid.tai->plmn.MCCdigit1;
emm_msg->lastvisitedregisteredtai.mncdigit3 =
msg->UEid.tai->plmn.MNCdigit3;
emm_msg->lastvisitedregisteredtai.mccdigit3 =
msg->UEid.tai->plmn.MCCdigit3;
emm_msg->lastvisitedregisteredtai.mncdigit2 =
msg->UEid.tai->plmn.MNCdigit2;
emm_msg->lastvisitedregisteredtai.mncdigit1 =
msg->UEid.tai->plmn.MNCdigit1;
emm_msg->lastvisitedregisteredtai.tac = msg->UEid.tai->tac;
}
/* Optional - Old GUTI type */
if (msg->UEid.guti) {
size += GUTI_TYPE_MAXIMUM_LENGTH;
emm_msg->presencemask |= ATTACH_REQUEST_OLD_GUTI_TYPE_PRESENT;
emm_msg->oldgutitype = GUTI_NATIVE;
}
LOG_FUNC_RETURN (size);
}
/****************************************************************************
** **
** Name: emm_send_attach_complete() **
** **
** Description: Builds Attach Complete message **
** **
** The Attach Complete message is sent by the UE to the net- **
** work in response to an Attach Accept message. **
** **
** Inputs: msg: The EMMAS-SAP primitive to process **
** Others: None **
** **
** Outputs: emm_msg: The EMM message to be sent **
** Return: The size of the EMM message **
** Others: None **
** **
***************************************************************************/
int emm_send_attach_complete(const emm_as_data_t *msg,
attach_complete_msg *emm_msg)
{
LOG_FUNC_IN;
int size = EMM_HEADER_MAXIMUM_LENGTH;
LOG_TRACE(INFO, "EMMAS-SAP - Send Attach Complete message");
/* Mandatory - Message type */
emm_msg->messagetype = ATTACH_COMPLETE;
/* Mandatory - ESM message container */
size += ESM_MESSAGE_CONTAINER_MINIMUM_LENGTH + msg->NASmsg.length;
emm_msg->esmmessagecontainer.esmmessagecontainercontents = msg->NASmsg;
LOG_FUNC_RETURN (size);
}
/****************************************************************************
** **
** Name: emm_send_initial_detach_request() **
** **
** Description: Builds Detach Request message **
** **
** The Detach Request message is sent by the UE to request **
** the release of an EMM context. **
** **
** Inputs: msg: The EMMAS-SAP primitive to process **
** Others: None **
** **
** Outputs: emm_msg: The EMM message to be sent **
** Return: The size of the EMM message **
** Others: None **
** **
***************************************************************************/
int emm_send_initial_detach_request(const emm_as_establish_t *msg,
detach_request_msg *emm_msg)
{
LOG_FUNC_IN;
int size = EMM_HEADER_MAXIMUM_LENGTH;
LOG_TRACE(INFO, "EMMAS-SAP - Send Detach Request message");
/* Mandatory - Message type */
emm_msg->messagetype = DETACH_REQUEST;
/* Mandatory - Detach type */
size += DETACH_TYPE_MAXIMUM_LENGTH;
if (msg->switch_off) {
emm_msg->detachtype.switchoff = DETACH_TYPE_SWITCH_OFF;
} else {
emm_msg->detachtype.switchoff = DETACH_TYPE_NORMAL_DETACH;
}
if (msg->type == EMM_DETACH_TYPE_EPS) {
emm_msg->detachtype.typeofdetach = DETACH_TYPE_EPS;
} else if (msg->type == EMM_DETACH_TYPE_IMSI) {
emm_msg->detachtype.typeofdetach = DETACH_TYPE_IMSI;
} else if (msg->type == EMM_DETACH_TYPE_EPS_IMSI) {
emm_msg->detachtype.typeofdetach = DETACH_TYPE_EPS_IMSI;
} else if (msg->type == EMM_DETACH_TYPE_RESERVED) {
emm_msg->detachtype.typeofdetach = DETACH_TYPE_RESERVED_1;
} else {
/* All other values are interpreted as "combined EPS/IMSI detach" */
emm_msg->detachtype.typeofdetach = DETACH_TYPE_EPS_IMSI;
}
/* Mandatory - NAS key set identifier */
size += NAS_KEY_SET_IDENTIFIER_MAXIMUM_LENGTH;
if (msg->ksi != EMM_AS_NO_KEY_AVAILABLE) {
emm_msg->naskeysetidentifier.naskeysetidentifier = msg->ksi;
} else {
emm_msg->naskeysetidentifier.naskeysetidentifier =
NAS_KEY_SET_IDENTIFIER_NOT_AVAILABLE;
}
/* Mandatory - EPS mobile identity */
size += EPS_MOBILE_IDENTITY_MAXIMUM_LENGTH;
if (msg->UEid.guti) {
/* Set GUTI mobile identity */
GutiEpsMobileIdentity_t *guti = &emm_msg->gutiorimsi.guti;
guti->typeofidentity = EPS_MOBILE_IDENTITY_GUTI;
guti->oddeven = EPS_MOBILE_IDENTITY_EVEN;
guti->mmegroupid = msg->UEid.guti->gummei.MMEgid;
guti->mmecode = msg->UEid.guti->gummei.MMEcode;
guti->mtmsi = msg->UEid.guti->m_tmsi;
guti->mccdigit1 = msg->UEid.guti->gummei.plmn.MCCdigit1;
guti->mccdigit2 = msg->UEid.guti->gummei.plmn.MCCdigit2;
guti->mccdigit3 = msg->UEid.guti->gummei.plmn.MCCdigit3;
guti->mncdigit1 = msg->UEid.guti->gummei.plmn.MNCdigit1;
guti->mncdigit2 = msg->UEid.guti->gummei.plmn.MNCdigit2;
guti->mncdigit3 = msg->UEid.guti->gummei.plmn.MNCdigit3;
} else if (msg->UEid.imsi) {
/* Set IMSI mobile identity */
ImsiEpsMobileIdentity_t *imsi = &emm_msg->gutiorimsi.imsi;
imsi->typeofidentity = EPS_MOBILE_IDENTITY_IMSI;
imsi->oddeven = msg->UEid.imsi->u.num.parity;
imsi->digit1 = msg->UEid.imsi->u.num.digit1;
imsi->digit2 = msg->UEid.imsi->u.num.digit2;
imsi->digit3 = msg->UEid.imsi->u.num.digit3;
imsi->digit4 = msg->UEid.imsi->u.num.digit4;
imsi->digit5 = msg->UEid.imsi->u.num.digit5;
imsi->digit6 = msg->UEid.imsi->u.num.digit6;
imsi->digit7 = msg->UEid.imsi->u.num.digit7;
imsi->digit8 = msg->UEid.imsi->u.num.digit8;
imsi->digit9 = msg->UEid.imsi->u.num.digit9;
imsi->digit10 = msg->UEid.imsi->u.num.digit10;
imsi->digit11 = msg->UEid.imsi->u.num.digit11;
imsi->digit12 = msg->UEid.imsi->u.num.digit12;
imsi->digit13 = msg->UEid.imsi->u.num.digit13;
imsi->digit14 = msg->UEid.imsi->u.num.digit14;
imsi->digit15 = msg->UEid.imsi->u.num.digit15;
} else if (msg->UEid.imei) {
/* Set IMEI mobile identity */
ImeiEpsMobileIdentity_t *imei = &emm_msg->gutiorimsi.imei;
imei->typeofidentity = EPS_MOBILE_IDENTITY_IMEI;
imei->oddeven = msg->UEid.imei->u.num.parity;
imei->digit1 = msg->UEid.imei->u.num.digit1;
imei->digit2 = msg->UEid.imei->u.num.digit2;
imei->digit3 = msg->UEid.imei->u.num.digit3;
imei->digit4 = msg->UEid.imei->u.num.digit4;
imei->digit5 = msg->UEid.imei->u.num.digit5;
imei->digit6 = msg->UEid.imei->u.num.digit6;
imei->digit7 = msg->UEid.imei->u.num.digit7;
imei->digit8 = msg->UEid.imei->u.num.digit8;
imei->digit9 = msg->UEid.imei->u.num.digit9;
imei->digit10 = msg->UEid.imei->u.num.digit10;
imei->digit11 = msg->UEid.imei->u.num.digit11;
imei->digit12 = msg->UEid.imei->u.num.digit12;
imei->digit13 = msg->UEid.imei->u.num.digit13;
imei->digit14 = msg->UEid.imei->u.num.digit14;
imei->digit15 = msg->UEid.imei->u.num.digit15;
}
LOG_FUNC_RETURN (size);
}
/****************************************************************************
** **
** Name: emm_send_detach_request() **
** **
** Description: Builds Detach Request message **
** **
** The Detach Request message is sent by the UE to request **
** the release of an EMM context. **
** **
** Inputs: msg: The EMMAS-SAP primitive to process **
** Others: None **
** **
** Outputs: emm_msg: The EMM message to be sent **
** Return: The size of the EMM message **
** Others: None **
** **
***************************************************************************/
int emm_send_detach_request(const emm_as_data_t *msg,
detach_request_msg *emm_msg)
{
LOG_FUNC_IN;
int size = EMM_HEADER_MAXIMUM_LENGTH;
LOG_TRACE(INFO, "EMMAS-SAP - Send Detach Request message");
/* Mandatory - Message type */
emm_msg->messagetype = DETACH_REQUEST;
/* Mandatory - Detach type */
size += DETACH_TYPE_MAXIMUM_LENGTH;
if (msg->switch_off) {
emm_msg->detachtype.switchoff = DETACH_TYPE_SWITCH_OFF;
} else {
emm_msg->detachtype.switchoff = DETACH_TYPE_NORMAL_DETACH;
}
if (msg->type == EMM_DETACH_TYPE_EPS) {
emm_msg->detachtype.typeofdetach = DETACH_TYPE_EPS;
} else if (msg->type == EMM_DETACH_TYPE_IMSI) {
emm_msg->detachtype.typeofdetach = DETACH_TYPE_IMSI;
} else if (msg->type == EMM_DETACH_TYPE_EPS_IMSI) {
emm_msg->detachtype.typeofdetach = DETACH_TYPE_EPS_IMSI;
} else if (msg->type == EMM_DETACH_TYPE_RESERVED) {
emm_msg->detachtype.typeofdetach = DETACH_TYPE_RESERVED_1;
} else {
/* All other values are interpreted as "combined EPS/IMSI detach" */
emm_msg->detachtype.typeofdetach = DETACH_TYPE_EPS_IMSI;
}
/* Mandatory - NAS key set identifier */
size += NAS_KEY_SET_IDENTIFIER_MAXIMUM_LENGTH;
if (msg->sctx.ksi != EMM_AS_NO_KEY_AVAILABLE) {
emm_msg->naskeysetidentifier.naskeysetidentifier = msg->sctx.ksi;
} else {
emm_msg->naskeysetidentifier.naskeysetidentifier =
NAS_KEY_SET_IDENTIFIER_NOT_AVAILABLE;
}
/* Mandatory - EPS mobile identity */
size += EPS_MOBILE_IDENTITY_MAXIMUM_LENGTH;
if (msg->guti) {
/* Set GUTI mobile identity */
GutiEpsMobileIdentity_t *guti = &emm_msg->gutiorimsi.guti;
guti->typeofidentity = EPS_MOBILE_IDENTITY_GUTI;
guti->oddeven = EPS_MOBILE_IDENTITY_EVEN;
guti->mmegroupid = msg->guti->gummei.MMEgid;
guti->mmecode = msg->guti->gummei.MMEcode;
guti->mtmsi = msg->guti->m_tmsi;
guti->mccdigit1 = msg->guti->gummei.plmn.MCCdigit1;
guti->mccdigit2 = msg->guti->gummei.plmn.MCCdigit2;
guti->mccdigit3 = msg->guti->gummei.plmn.MCCdigit3;
guti->mncdigit1 = msg->guti->gummei.plmn.MNCdigit1;
guti->mncdigit2 = msg->guti->gummei.plmn.MNCdigit2;
guti->mncdigit3 = msg->guti->gummei.plmn.MNCdigit3;
}
LOG_FUNC_RETURN (size);
}
/****************************************************************************
** **
** Name: emm_send_initial_tau_request() **
** **
** Description: Builds Tracking Area Update Request message **
** **
** The Tracking Area Update Request message is sent by the **
** UE to the network to update the registration of the ac- **
** tual tracking area of a UE in the network and to periodi- **
** cally notify the availability of the UE to the network. **
** **
** Inputs: msg: The EMMAS-SAP primitive to process **
** Others: None **
** **
** Outputs: emm_msg: The EMM message to be sent **
** Return: The size of the EMM message **
** Others: None **
** **
***************************************************************************/
int emm_send_initial_tau_request(const emm_as_establish_t *msg,
tracking_area_update_request_msg *emm_msg)
{
LOG_FUNC_IN;
int size = EMM_HEADER_MAXIMUM_LENGTH;
LOG_TRACE(INFO, "EMMAS-SAP - Send Tracking Area Update Request message");
/* Mandatory - Message type */
emm_msg->messagetype = TRACKING_AREA_UPDATE_REQUEST;
LOG_FUNC_RETURN (size);
}
/****************************************************************************
** **
** Name: emm_send_initial_sr_request() **
** **
** Description: Build the Service Request message **
** **
** The Service Request message is sent by the UE to the **
** network to request the establishment of a NAS signalling **
** connection and of the radio and S1 bearers. **
** **
** Inputs: msg: The EMMAS-SAP primitive to process **
** Others: None **
** **
** Outputs: emm_msg: The EMM message to be sent **
** Return: The size of the EMM message **
** Others: None **
** **
***************************************************************************/
int emm_send_initial_sr_request(const emm_as_establish_t *msg,
service_request_msg *emm_msg)
{
LOG_FUNC_IN;
int size = EMM_HEADER_MAXIMUM_LENGTH;
LOG_TRACE(INFO, "EMMAS-SAP - Send Service Request message");
LOG_FUNC_RETURN (size);
}
/****************************************************************************
** **
** Name: emm_send_initial_extsr_request() **
** **
** Description: Build the Extended Service Request message **
** **
** The Extended Service Request message is sent by the UE to **
** the network to request the establishment of a NAS signal- **
** ling connection and of the radio and S1 bearers for pa- **
** cket services, if the UE needs to provide additional in- **
** formation that cannot be provided via a SERVICE REQUEST **
** message.
** **
** Inputs: msg: The EMMAS-SAP primitive to process **
** Others: None **
** **
** Outputs: emm_msg: The EMM message to be sent **
** Return: The size of the EMM message **
** Others: None **
** **
***************************************************************************/
int emm_send_initial_extsr_request(const emm_as_establish_t *msg,
extended_service_request_msg *emm_msg)
{
LOG_FUNC_IN;
int size = EMM_HEADER_MAXIMUM_LENGTH;
LOG_TRACE(INFO, "EMMAS-SAP - Send Extended Service Request message");
/* Mandatory - Message type */
emm_msg->messagetype = EXTENDED_SERVICE_REQUEST;
LOG_FUNC_RETURN (size);
}
/****************************************************************************
** **
** Name: emm_send_identity_response() **
** **
** Description: Builds Identity Response message **
** **
** The Identity Response message is sent by the UE to the **
** network in response to an Identity Request message and **
** provides the requested identity. **
** **
** Inputs: msg: The EMMAS-SAP primitive to process **
** Others: None **
** **
** Outputs: emm_msg: The EMM message to be sent **
** Return: The size of the EMM message **
** Others: None **
** **
***************************************************************************/
int emm_send_identity_response(const emm_as_security_t *msg,
identity_response_msg *emm_msg)
{
LOG_FUNC_IN;
int size = EMM_HEADER_MAXIMUM_LENGTH;
LOG_TRACE(INFO, "EMMAS-SAP - Send Identity Response message");
/* Mandatory - Message type */
emm_msg->messagetype = IDENTITY_RESPONSE;
/* Mandatory - Mobile identity */
size += MOBILE_IDENTITY_MAXIMUM_LENGTH;
if (msg->identType == EMM_IDENT_TYPE_IMSI) {
if (msg->imsi) {
ImsiMobileIdentity_t *imsi = &emm_msg->mobileidentity.imsi;
imsi->typeofidentity = MOBILE_IDENTITY_IMSI;
imsi->oddeven = msg->imsi->u.num.parity;
imsi->digit1 = msg->imsi->u.num.digit1;
imsi->digit2 = msg->imsi->u.num.digit2;
imsi->digit3 = msg->imsi->u.num.digit3;
imsi->digit4 = msg->imsi->u.num.digit4;
imsi->digit5 = msg->imsi->u.num.digit5;
imsi->digit6 = msg->imsi->u.num.digit6;
imsi->digit7 = msg->imsi->u.num.digit7;
imsi->digit8 = msg->imsi->u.num.digit8;
imsi->digit9 = msg->imsi->u.num.digit9;
imsi->digit10 = msg->imsi->u.num.digit10;
imsi->digit11 = msg->imsi->u.num.digit11;
imsi->digit12 = msg->imsi->u.num.digit12;
imsi->digit13 = msg->imsi->u.num.digit13;
imsi->digit14 = msg->imsi->u.num.digit14;
imsi->digit15 = msg->imsi->u.num.digit15;
}
} else if (msg->identType == EMM_IDENT_TYPE_TMSI) {
if (msg->tmsi) {
const char *p_tmsi = (char *)(&msg->tmsi);
TmsiMobileIdentity_t *tmsi = &emm_msg->mobileidentity.tmsi;
tmsi->typeofidentity = MOBILE_IDENTITY_TMSI;
tmsi->oddeven = MOBILE_IDENTITY_EVEN;
tmsi->digit1 = 0xf;
tmsi->digit2 = (*p_tmsi & 0xf);
tmsi->digit3 = ((*p_tmsi >> 4) & 0xf);
p_tmsi++;
tmsi->digit4 = (*p_tmsi & 0xf);
tmsi->digit5 = ((*p_tmsi >> 4) & 0xf);
p_tmsi++;
tmsi->digit6 = (*p_tmsi & 0xf);
tmsi->digit7 = ((*p_tmsi >> 4) & 0xf);
p_tmsi++;
tmsi->digit8 = (*p_tmsi & 0xf);
tmsi->digit9 = ((*p_tmsi >> 4) & 0xf);
}
} else if (msg->identType == EMM_IDENT_TYPE_IMEI) {
if (msg->imei) {
ImeiMobileIdentity_t *imei = &emm_msg->mobileidentity.imei;
imei->typeofidentity = MOBILE_IDENTITY_IMEI;
imei->oddeven = msg->imei->u.num.parity;
imei->digit1 = msg->imei->u.num.digit1;
imei->digit2 = msg->imei->u.num.digit2;
imei->digit3 = msg->imei->u.num.digit3;
imei->digit4 = msg->imei->u.num.digit4;
imei->digit5 = msg->imei->u.num.digit5;
imei->digit6 = msg->imei->u.num.digit6;
imei->digit7 = msg->imei->u.num.digit7;
imei->digit8 = msg->imei->u.num.digit8;
imei->digit9 = msg->imei->u.num.digit9;
imei->digit10 = msg->imei->u.num.digit10;
imei->digit11 = msg->imei->u.num.digit11;
imei->digit12 = msg->imei->u.num.digit12;
imei->digit13 = msg->imei->u.num.digit13;
imei->digit14 = msg->imei->u.num.digit14;
imei->digit15 = msg->imei->u.num.digit15;
}
} else if (msg->identType == EMM_IDENT_TYPE_NOT_AVAILABLE) {
NoMobileIdentity_t *no_id = &emm_msg->mobileidentity.no_id;
no_id->typeofidentity = MOBILE_IDENTITY_NOT_AVAILABLE;
}
LOG_FUNC_RETURN (size);
}
/****************************************************************************
** **
** Name: emm_send_authentication_response() **
** **
** Description: Builds Authentication Response message **
** **
** The Authentication Response message is sent by the UE to **
** the network to deliver a calculated authentication res- **
** ponse to the network. **
** **
** Inputs: msg: The EMMAS-SAP primitive to process **
** Others: None **
** **
** Outputs: emm_msg: The EMM message to be sent **
** Return: The size of the EMM message **
** Others: None **
** **
***************************************************************************/
int emm_send_authentication_response(const emm_as_security_t *msg,
authentication_response_msg *emm_msg)
{
int size = EMM_HEADER_MAXIMUM_LENGTH;
LOG_TRACE(INFO, "EMMAS-SAP - Send Authentication Response message");
/* Mandatory - Message type */
emm_msg->messagetype = AUTHENTICATION_RESPONSE;
/* Mandatory - Authentication response parameter */
size += AUTHENTICATION_RESPONSE_PARAMETER_MAXIMUM_LENGTH;
emm_msg->authenticationresponseparameter.res = *msg->res;
LOG_FUNC_RETURN (size);
}
/****************************************************************************
** **
** Name: emm_send_authentication_failure() **
** **
** Description: Builds Authentication Failure message **
** **
** The Authentication Failure message is sent by the UE to **
** the network to indicate that authentication of the net- **
** work has failed **
** **
** Inputs: msg: The EMMAS-SAP primitive to process **
** Others: None **
** **
** Outputs: emm_msg: The EMM message to be sent **
** Return: The size of the EMM message **
** Others: None **
** **
***************************************************************************/
int emm_send_authentication_failure(const emm_as_security_t *msg,
authentication_failure_msg *emm_msg)
{
int size = EMM_HEADER_MAXIMUM_LENGTH;
LOG_TRACE(INFO, "EMMAS-SAP - Send Authentication Failure message (cause=%d)",
msg->emm_cause);
/* Mandatory - Message type */
emm_msg->messagetype = AUTHENTICATION_FAILURE;
/* Mandatory - EMM cause */
size += EMM_CAUSE_MAXIMUM_LENGTH;
emm_msg->emmcause = msg->emm_cause;
/* Optional - Authentication response parameter */
if (msg->auts && msg->auts->length > 0) {
size += AUTHENTICATION_RESPONSE_PARAMETER_MAXIMUM_LENGTH;
emm_msg->presencemask |=
AUTHENTICATION_FAILURE_AUTHENTICATION_FAILURE_PARAMETER_PRESENT;
emm_msg->authenticationfailureparameter.auts = *msg->auts;
}
LOG_FUNC_RETURN (size);
}
/****************************************************************************
** **
** Name: emm_send_security_mode_complete() **
** **
** Description: Builds Security Mode Complete message **
** **
** The Security Mode Complete message is sent by the UE to **
** the network in response to a Security Mode Command mes- **
** sage. **
** **
** Inputs: msg: The EMMAS-SAP primitive to process **
** Others: None **
** **
** Outputs: emm_msg: The EMM message to be sent **
** Return: The size of the EMM message **
** Others: None **
** **
***************************************************************************/
int emm_send_security_mode_complete(const emm_as_security_t *msg,
security_mode_complete_msg *emm_msg)
{
LOG_FUNC_IN;
int size = EMM_HEADER_MAXIMUM_LENGTH;
LOG_TRACE(INFO, "EMMAS-SAP - Send Security Mode Complete message");
/* Mandatory - Message type */
emm_msg->messagetype = SECURITY_MODE_COMPLETE;
LOG_FUNC_RETURN (size);
}
/****************************************************************************
** **
** Name: emm_send_security_mode_reject() **
** **
** Description: Builds Security Mode Reject message **
** **
** The Security Mode Reject message is sent by the UE to the **
** network to indicate that the corresponding security mode **
** command has been rejected. **
** **
** Inputs: msg: The EMMAS-SAP primitive to process **
** Others: None **
** **
** Outputs: emm_msg: The EMM message to be sent **
** Return: The size of the EMM message **
** Others: None **
** **
***************************************************************************/
int emm_send_security_mode_reject(const emm_as_security_t *msg,
security_mode_reject_msg *emm_msg)
{
LOG_FUNC_IN;
int size = EMM_HEADER_MAXIMUM_LENGTH;
LOG_TRACE(INFO, "EMMAS-SAP - Send Security Mode Reject message (cause=%d)",
msg->emm_cause);
/* Mandatory - Message type */
emm_msg->messagetype = SECURITY_MODE_REJECT;
/* Mandatory - EMM cause */
size += EMM_CAUSE_MAXIMUM_LENGTH;
emm_msg->emmcause = msg->emm_cause;
LOG_FUNC_RETURN (size);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
+132
View File
@@ -0,0 +1,132 @@
/*******************************************************************************
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@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*****************************************************************************
Source emm_send.h
Version 0.1
Date 2013/01/30
Product NAS stack
Subsystem EPS Mobility Management
Author Frederic Maurel
Description Defines functions executed at the EMMAS Service Access
Point to send EPS Mobility Management messages to the
Access Stratum sublayer.
*****************************************************************************/
#ifndef __EMM_SEND_H__
#define __EMM_SEND_H__
#include "EmmStatus.h"
#include "DetachRequest.h"
#include "DetachAccept.h"
#include "AttachRequest.h"
#include "AttachComplete.h"
#include "TrackingAreaUpdateRequest.h"
#include "TrackingAreaUpdateComplete.h"
#include "ServiceRequest.h"
#include "ExtendedServiceRequest.h"
#include "GutiReallocationComplete.h"
#include "AuthenticationResponse.h"
#include "AuthenticationFailure.h"
#include "IdentityResponse.h"
#include "NASSecurityModeComplete.h"
#include "SecurityModeReject.h"
#include "UplinkNasTransport.h"
#include "emm_asDef.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 ******************/
/****************************************************************************/
/*
* --------------------------------------------------------------------------
* Functions executed by both the UE and the MME to send EMM messages
* --------------------------------------------------------------------------
*/
int emm_send_status(const emm_as_status_t *, emm_status_msg *);
int emm_send_detach_accept(const emm_as_data_t *, detach_accept_msg *);
/*
* --------------------------------------------------------------------------
* Functions executed by the UE to send EMM messages to the network
* --------------------------------------------------------------------------
*/
int emm_send_attach_request(const emm_as_establish_t *, attach_request_msg *);
int emm_send_attach_complete(const emm_as_data_t *, attach_complete_msg *);
int emm_send_initial_detach_request(const emm_as_establish_t *,
detach_request_msg *);
int emm_send_detach_request(const emm_as_data_t *, detach_request_msg *);
int emm_send_initial_tau_request(const emm_as_establish_t *,
tracking_area_update_request_msg *);
int emm_send_initial_sr_request(const emm_as_establish_t *,
service_request_msg *);
int emm_send_initial_extsr_request(const emm_as_establish_t *,
extended_service_request_msg *);
int emm_send_identity_response(const emm_as_security_t *,
identity_response_msg *);
int emm_send_authentication_response(const emm_as_security_t *,
authentication_response_msg *);
int emm_send_authentication_failure(const emm_as_security_t *,
authentication_failure_msg *);
int emm_send_security_mode_complete(const emm_as_security_t *,
security_mode_complete_msg *);
int emm_send_security_mode_reject(const emm_as_security_t *,
security_mode_reject_msg *);
#endif /* __EMM_SEND_H__*/