prpl_release_for_841

This commit is contained in:
Release Engineer 2020-01-13 06:22:52 +05:30
commit 0607aea7f9
74 changed files with 90332 additions and 0 deletions

0
ABOUT-NLS Normal file
View file

0
AUTHORS Normal file
View file

0
COPYING Normal file
View file

1041
ChangeLog Normal file

File diff suppressed because it is too large Load diff

368
LICENSE Normal file
View file

@ -0,0 +1,368 @@
This source code is distributed under a dual license of GPL and BSD (2-clause).
Please choose the appropriate license for your intended usage.
1. BSD license (2-clause BSD license)
Copyright (c) 2009-2015, LANTIQ BETEILIGUNGS-GMBH & CO. KG
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2. GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

52
Makefile.am Normal file
View file

@ -0,0 +1,52 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = foreign 1.9 nostdinc
SUBDIRS = src tools/pipe
DISTCHECK_CONFIGURE_FLAGS=@CONFIGURE_OPTIONS@
dsl_cpe_control_docdir = ${prefix}/doc/dsl_cpe_control
dsl_cpe_control_doc_DATA = \
ChangeLog
EXTRA_DIST = $(dsl_cpe_control_doc_DATA) \
build_vxworks/control_dsl_cpe_api.wpj \
build_win32/dsl_cpe_control_version.h \
build_win32/vc7/dsl_cpe_control.sln \
build_win32/vc7/dsl_cpe_control.vcproj \
README\
AUTHORS\
NEWS\
TODO
# Copy all the spec files. Of cource, only one is actually used.
dist-hook:
for specfile in *.spec; do \
if test -f $$specfile; then \
cp -p $$specfile $(distdir); \
fi \
done
# Check for correct line ends (reduce scope to 'src' because Win32 files can have CRLF)
distcheck-hook:
chmod a+w $(distdir)
echo "Checking line ends ...!!!"; \
find $(distdir)/src -type f -exec file {} \; | grep -e "CRLF" -e "Non-ISO" && exit 1; \
echo "Checking line ends ... done."
lint:
@target=lint; \
list='$(SUBDIRS)'; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done;

928
Makefile.in Normal file
View file

@ -0,0 +1,928 @@
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/src/dsl_cpe_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(dsl_cpe_control_docdir)"
DATA = $(dsl_cpe_control_doc_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in ABOUT-NLS AUTHORS COPYING \
ChangeLog NEWS README TODO compile config.rpath depcomp \
install-sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
DIST_TARGETS = dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
ADD_APPL_CFLAGS = @ADD_APPL_CFLAGS@
ADD_APPL_LDFLAGS = @ADD_APPL_LDFLAGS@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DISTCHECK_CONFIGURE_PARAMS = @DISTCHECK_CONFIGURE_PARAMS@
DSL_ADD_EXT_APPL_CFLAGS = @DSL_ADD_EXT_APPL_CFLAGS@
DSL_CCA_DBG_MAX_LEVEL_PRE = @DSL_CCA_DBG_MAX_LEVEL_PRE@
DSL_CCA_DBG_MAX_LEVEL_SET = @DSL_CCA_DBG_MAX_LEVEL_SET@
DSL_CONFIG_MODEL_TYPE = @DSL_CONFIG_MODEL_TYPE@
DSL_CPE_DEBUG_DISABLE = @DSL_CPE_DEBUG_DISABLE@
DSL_DBG_MSG_NETLINK_ID = @DSL_DBG_MSG_NETLINK_ID@
DSL_DEBUG_TOOL_INTERFACE = @DSL_DEBUG_TOOL_INTERFACE@
DSL_DEVICE_DRIVER_INCL_PATH = @DSL_DEVICE_DRIVER_INCL_PATH@
DSL_DEVICE_NAME = @DSL_DEVICE_NAME@
DSL_DRIVER_INCL_PATH = @DSL_DRIVER_INCL_PATH@
DSL_VRX_DEVICE_NAME = @DSL_VRX_DEVICE_NAME@
DTI_INCL_PATH = @DTI_INCL_PATH@
DTI_LIBRARY_PATH = @DTI_LIBRARY_PATH@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXTRA_APP_CFLAGS = @EXTRA_APP_CFLAGS@
GREP = @GREP@
IFXOS_INCLUDE_PATH = @IFXOS_INCLUDE_PATH@
IFXOS_LIBRARY_PATH = @IFXOS_LIBRARY_PATH@
INCLUDE_DEPRECATED = @INCLUDE_DEPRECATED@
INCLUDE_DEVICE_EXCEPTION_CODES = @INCLUDE_DEVICE_EXCEPTION_CODES@
INCLUDE_DSL_ADSL_MIB = @INCLUDE_DSL_ADSL_MIB@
INCLUDE_DSL_CEOC = @INCLUDE_DSL_CEOC@
INCLUDE_DSL_CONFIG_GET = @INCLUDE_DSL_CONFIG_GET@
INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT = @INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT@
INCLUDE_DSL_CPE_CLI_SUPPORT = @INCLUDE_DSL_CPE_CLI_SUPPORT@
INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH = @INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH@
INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT = @INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT@
INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT = @INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT@
INCLUDE_DSL_CPE_DTI_SUPPORT = @INCLUDE_DSL_CPE_DTI_SUPPORT@
INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT = @INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT@
INCLUDE_DSL_CPE_IFXOS_SUPPORT = @INCLUDE_DSL_CPE_IFXOS_SUPPORT@
INCLUDE_DSL_CPE_MISC_LINE_STATUS = @INCLUDE_DSL_CPE_MISC_LINE_STATUS@
INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS = @INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS@
INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS = @INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS@
INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS = @INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS@
INCLUDE_DSL_CPE_PM_CONFIG = @INCLUDE_DSL_CPE_PM_CONFIG@
INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS = @INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS@
INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS = @INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS@
INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS = @INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS@
INCLUDE_DSL_CPE_PM_HISTORY = @INCLUDE_DSL_CPE_PM_HISTORY@
INCLUDE_DSL_CPE_PM_LINE_COUNTERS = @INCLUDE_DSL_CPE_PM_LINE_COUNTERS@
INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS = @INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS@
INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS = @INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS@
INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS = @INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS@
INCLUDE_DSL_CPE_PM_RETX_COUNTERS = @INCLUDE_DSL_CPE_PM_RETX_COUNTERS@
INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS = @INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS@
INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS = @INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS@
INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS = @INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS@
INCLUDE_DSL_CPE_TRACE_BUFFER = @INCLUDE_DSL_CPE_TRACE_BUFFER@
INCLUDE_DSL_DELT = @INCLUDE_DSL_DELT@
INCLUDE_DSL_EVENT_POLLING = @INCLUDE_DSL_EVENT_POLLING@
INCLUDE_DSL_FILTER_DETECTION = @INCLUDE_DSL_FILTER_DETECTION@
INCLUDE_DSL_FRAMING_PARAMETERS = @INCLUDE_DSL_FRAMING_PARAMETERS@
INCLUDE_DSL_G997_ALARM = @INCLUDE_DSL_G997_ALARM@
INCLUDE_DSL_G997_FRAMING_PARAMETERS = @INCLUDE_DSL_G997_FRAMING_PARAMETERS@
INCLUDE_DSL_G997_LINE_INVENTORY = @INCLUDE_DSL_G997_LINE_INVENTORY@
INCLUDE_DSL_G997_PER_TONE = @INCLUDE_DSL_G997_PER_TONE@
INCLUDE_DSL_G997_STATUS = @INCLUDE_DSL_G997_STATUS@
INCLUDE_DSL_JSON_PARSING = @INCLUDE_DSL_JSON_PARSING@
INCLUDE_DSL_PM = @INCLUDE_DSL_PM@
INCLUDE_DSL_RESOURCE_STATISTICS = @INCLUDE_DSL_RESOURCE_STATISTICS@
INCLUDE_DSL_SYSTEM_INTERFACE = @INCLUDE_DSL_SYSTEM_INTERFACE@
INCLUDE_DTI_AGENT_STANDALONE_SUPPORT = @INCLUDE_DTI_AGENT_STANDALONE_SUPPORT@
INCLUDE_FW_REQUEST_SUPPORT = @INCLUDE_FW_REQUEST_SUPPORT@
INCLUDE_PILOT_TONES_STATUS = @INCLUDE_PILOT_TONES_STATUS@
INCLUDE_REAL_TIME_TRACE = @INCLUDE_REAL_TIME_TRACE@
INCLUDE_SCRIPT_NOTIFICATION = @INCLUDE_SCRIPT_NOTIFICATION@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBJSON_C_INCL_PATH = @LIBJSON_C_INCL_PATH@
LIBJSON_C_LIBRARY_PATH = @LIBJSON_C_LIBRARY_PATH@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
SAFEC_INCL_PATH = @SAFEC_INCL_PATH@
SAFEC_LIB_NAME = @SAFEC_LIB_NAME@
SAFEC_LIB_PATH = @SAFEC_LIB_PATH@
SAFEC_SUPPORT = @SAFEC_SUPPORT@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign 1.9 nostdinc
SUBDIRS = src tools/pipe
DISTCHECK_CONFIGURE_FLAGS = @CONFIGURE_OPTIONS@
dsl_cpe_control_docdir = ${prefix}/doc/dsl_cpe_control
dsl_cpe_control_doc_DATA = \
ChangeLog
EXTRA_DIST = $(dsl_cpe_control_doc_DATA) \
build_vxworks/control_dsl_cpe_api.wpj \
build_win32/dsl_cpe_control_version.h \
build_win32/vc7/dsl_cpe_control.sln \
build_win32/vc7/dsl_cpe_control.vcproj \
README\
AUTHORS\
NEWS\
TODO
all: all-recursive
.SUFFIXES:
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
install-dsl_cpe_control_docDATA: $(dsl_cpe_control_doc_DATA)
@$(NORMAL_INSTALL)
@list='$(dsl_cpe_control_doc_DATA)'; test -n "$(dsl_cpe_control_docdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(dsl_cpe_control_docdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(dsl_cpe_control_docdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dsl_cpe_control_docdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(dsl_cpe_control_docdir)" || exit $$?; \
done
uninstall-dsl_cpe_control_docDATA:
@$(NORMAL_UNINSTALL)
@list='$(dsl_cpe_control_doc_DATA)'; test -n "$(dsl_cpe_control_docdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(dsl_cpe_control_docdir)'; $(am__uninstall_files_from_dir)
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscope: cscope.files
test ! -s cscope.files \
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
-rm -f cscope.files
cscope.files: clean-cscope cscopelist
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__post_remove_distdir)
dist dist-all:
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
$(am__post_remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__post_remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile $(DATA)
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(dsl_cpe_control_docdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am: install-dsl_cpe_control_docDATA
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-dsl_cpe_control_docDATA
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \
dist-zip distcheck distclean distclean-generic distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dsl_cpe_control_docDATA install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
tags-am uninstall uninstall-am \
uninstall-dsl_cpe_control_docDATA
.PRECIOUS: Makefile
# Copy all the spec files. Of cource, only one is actually used.
dist-hook:
for specfile in *.spec; do \
if test -f $$specfile; then \
cp -p $$specfile $(distdir); \
fi \
done
# Check for correct line ends (reduce scope to 'src' because Win32 files can have CRLF)
distcheck-hook:
chmod a+w $(distdir)
echo "Checking line ends ...!!!"; \
find $(distdir)/src -type f -exec file {} \; | grep -e "CRLF" -e "Non-ISO" && exit 1; \
echo "Checking line ends ... done."
lint:
@target=lint; \
list='$(SUBDIRS)'; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done;
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

0
NEWS Normal file
View file

104
README Normal file
View file

@ -0,0 +1,104 @@
/******************************************************************************
Copyright (c) 2011
Lantiq Deutschland GmbH
Am Campeon 3; 85579 Neubiberg, Germany
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
1. CONTENT OF DELIVERY
1.1 SOURCE CODE CONTENT
The DSL CPE API is designed to fulfill a wide spectrum of applications.
Support for both low footprint as well as premium applications results in a
comprehensive source code content/structure. However please note that depending
on the used configuration
a) there are files available that you might not need at all
(for example OS specific files)
b) even the needed files includes various configuration specific parts that
might be not used for the selected configuration
As a result the lines of code (LOC) that are finally compiled/used are usually
much smaller than the available LOC.
For more details please also refer to chapter "3. Getting Started" within
"User's Manual Programmers Reference" (UMPR) of the DSL CPE API
1.2 SOURCE TREE STRUCTURE
Source tree structure for the DSL CPE Control application.
Please note that
a) the following tree does not include ALL files, it is just to get an easier
overview about which parts might be important for the needed configuration
b) the usage of "<device>" indicates that a device specific file will be
available according to the used source code delivery type.
Currently there are deliveries as follows
- "danube": Danube Family (includes Danube, Amazon-SE and ARX100)
- "vrx": VRX200 Family
dsl_cpe_control\
M:.
¦ AUTHORS
¦ ChangeLog
¦ Makefile.am
¦ NEWS
¦ TODO
¦ configure.in
¦ dsl_cpe_control.pjt
¦ LICENSE
¦ README
¦
+---src // ALL sources including header files
¦ ¦ Makefile.am
¦ ¦ dsl_cpe_control.c
¦ ¦ dsl_cpe_control.h
¦ ¦ dsl_cpe_init_cfg.c
¦ ¦ dsl_cpe_init_cfg.h
¦ ¦ dsl_cpe_cli_<device>.c
¦ ¦ dsl_cpe_os.h \
¦ ¦ dsl_cpe_linux.c |
¦ ¦ dsl_cpe_linux.h |
¦ ¦ dsl_cpe_win32.c | API internal OS abstraction for
¦ ¦ dsl_cpe_win32.h + different OS in case of not using
¦ ¦ dsl_cpe_rtems.c | ifx_os
¦ ¦ dsl_cpe_rtems.h |
¦ ¦ dsl_cpe_vxworks.c |
¦ ¦ dsl_cpe_vxworks.h /
¦ ¦ dsl_cpe_simulator.c
¦ ¦ dsl_cpe_simulator.h
¦ ¦ dsl_cpe_cli.c
¦ ¦ dsl_cpe_cli.h
¦ ¦ dsl_cpe_cli_access.c
¦ ¦ dsl_cpe_cli_console.c
¦ ¦ dsl_cpe_cli_console.h
¦ ¦ dsl_cpe_debug.c
¦ ¦ dsl_cpe_debug.h
¦ ¦ dsl_cpe_cli_pipe.c
¦ ¦ dsl_cpe_debug_<device>.c
¦ ¦ dsl_cpe_debug_<device>.h
¦ ¦ dsl_cpe_os_lint_map.h
¦ ¦ dsl_cpe_cli_mib.c
¦ ¦ LLCfg.txt
¦ ¦ Makefile.in
¦ ¦
+---build_win32
¦ ¦ dsl_cpe_control_version.h
¦ ¦ drv_danube_api_intern.h
¦ ¦ dsl_cpe_simulator_config.h
¦ ¦
¦ +---vc7
¦ ¦
¦ +---vc6
¦
+---scripts
¦ dsl_cpe_pipe.sh
¦ alias_dsl_cpe.sh
¦
+---build_vxworks
control_dsl_cpe_api.wpj

0
TODO Normal file
View file

1153
aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,328 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PPC860gnu_BUILDRULE
archive
<END>
<BEGIN> BUILD_PPC860gnu_MACRO_AR
arppc
<END>
<BEGIN> BUILD_PPC860gnu_MACRO_ARCHIVE
$(PRJ_DIR)/PPC860gnu/control_dsl_cpe_api.a
<END>
<BEGIN> BUILD_PPC860gnu_MACRO_AS
ccppc
<END>
<BEGIN> BUILD_PPC860gnu_MACRO_CC
ccppc
<END>
<BEGIN> BUILD_PPC860gnu_MACRO_CFLAGS
-g \
-DINCLUDE_DSL_CPE_CLI_SUPPORT \
-DINCLUDE_DSL_API_CONSOLE \
-DINCLUDE_DSL_API_CONSOLE_EXTRA \
-DDSL_CPE_REMOVE_PIPE_SUPPORT \
-DINCLUDE_DSL_PM \
-DDSL_DEBUG_TOOL_INTERFACE \
-DINCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS \
-DINCLUDE_DSL_CPE_PM_LINE_COUNTERS \
-DINCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS \
-DINCLUDE_DSL_CPE_PM_HISTORY \
-DINCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS \
-DDSL_CHANNELS_PER_LINE=1 \
-DINCLUDE_DSL_CPE_API_VINAX \
-O0 \
-mcpu=860 \
-ansi \
-nostdinc \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-fno-builtin \
-fno-for-scope \
-DCPU=PPC860 \
-DVXWORKS \
-DUSE_LIB_IFXOS=1 \
-D__PROTOTYPE_5_0 \
-Wall \
-I$(WIND_BASE)/target/h \
-I$(PRJ_DIR) \
-I$(PRJ_DIR)/../src \
-I$(PRJ_DIR)/../../../../../comacsd_lib/lib_ifxos/src/include \
-I$(PRJ_DIR)/../../../driver/src/include \
-I$(PRJ_DIR)/../../../../drv_vdsl2_dfe/src
<END>
<BEGIN> BUILD_PPC860gnu_MACRO_CFLAGS_AS
-g \
-mcpu=860 \
-ansi \
-nostdinc \
-fvolatile \
-fno-builtin \
-fno-for-scope \
-P \
-x \
assembler-with-cpp \
-I. \
-I$(WIND_BASE)/target/h \
-DCPU=PPC860
<END>
<BEGIN> BUILD_PPC860gnu_MACRO_CPP
ccppc -E -P -xc
<END>
<BEGIN> BUILD_PPC860gnu_MACRO_LD
ldppc
<END>
<BEGIN> BUILD_PPC860gnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PPC860gnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PPC860gnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PPC860gnu_MACRO_MAKEFLAGS
-ws
<END>
<BEGIN> BUILD_PPC860gnu_MACRO_NM
nmppc
<END>
<BEGIN> BUILD_PPC860gnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PPC860gnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PPC860gnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PPC860gnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PPC860gnu_MACRO_SIZE
sizeppc
<END>
<BEGIN> BUILD_PPC860gnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} {$(WIND_BASE)/target/src/}
<END>
<BEGIN> BUILD_PPC860gnu_TC
::tc_PPC860gnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_control_dsl_cpe_api.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PPC860gnu
<END>
<BEGIN> BUILD__LIST
PPC860gnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_cli.c_objects
dsl_cpe_cli.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_cli.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_access.c_objects
dsl_cpe_cli_access.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_access.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_console.c_objects
dsl_cpe_cli_console.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_console.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_danube.c_objects
dsl_cpe_cli_danube.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_danube.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_pipe.c_objects
dsl_cpe_cli_pipe.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_pipe.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_vinax.c_objects
dsl_cpe_cli_vinax.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_cli_vinax.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_control.c_objects
dsl_cpe_control.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_control.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_debug.c_objects
dsl_cpe_debug.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_debug.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_debug_danube.c_objects
dsl_cpe_debug_danube.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_debug_danube.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_debug_vinax.c_objects
dsl_cpe_debug_vinax.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_debug_vinax.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_init_cfg.c_objects
dsl_cpe_init_cfg.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_init_cfg.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_legacy.c_objects
dsl_cpe_legacy.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_legacy.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_linux.c_objects
dsl_cpe_linux.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_linux.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_simulator.c_objects
dsl_cpe_simulator.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_simulator.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_vxworks.c_objects
dsl_cpe_vxworks.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_vxworks.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_win32.c_objects
dsl_cpe_win32.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../src/dsl_cpe_win32.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/../src/dsl_cpe_cli.c \
$(PRJ_DIR)/../src/dsl_cpe_cli_access.c \
$(PRJ_DIR)/../src/dsl_cpe_cli_console.c \
$(PRJ_DIR)/../src/dsl_cpe_cli_danube.c \
$(PRJ_DIR)/../src/dsl_cpe_cli_pipe.c \
$(PRJ_DIR)/../src/dsl_cpe_cli_vinax.c \
$(PRJ_DIR)/../src/dsl_cpe_control.c \
$(PRJ_DIR)/../src/dsl_cpe_debug.c \
$(PRJ_DIR)/../src/dsl_cpe_debug_danube.c \
$(PRJ_DIR)/../src/dsl_cpe_debug_vinax.c \
$(PRJ_DIR)/../src/dsl_cpe_init_cfg.c \
$(PRJ_DIR)/../src/dsl_cpe_legacy.c \
$(PRJ_DIR)/../src/dsl_cpe_linux.c \
$(PRJ_DIR)/../src/dsl_cpe_simulator.c \
$(PRJ_DIR)/../src/dsl_cpe_win32.c \
$(PRJ_DIR)/../src/dsl_cpe_vxworks.c
<END>
<BEGIN> userComments
DSL CPE API control application
<END>

View file

@ -0,0 +1,25 @@
#ifndef LIB_DSL_VERSION_H_
#define LIB_DSL_VERSION_H_
/* Name of package */
#define PACKAGE "dsl_cpe_control"
/* Version number of package */
#define VERSION "4.21.6"
/* Define to the version of this package. */
#define PACKAGE_VERSION VERSION
/* Define to the full name of this package. */
#define PACKAGE_NAME "DSL CPE Control"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING PACKAGE_NAME " " VERSION
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "dsl_cpe_control"
#endif /*LIB_DSL_VERSION_H_*/

View file

@ -0,0 +1,62 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsl_cpe_control", "dsl_cpe_control.vcproj", "{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}"
ProjectSection(ProjectDependencies) = postProject
{0BE28B50-BAFF-4849-A060-6BD4A5B2C670} = {0BE28B50-BAFF-4849-A060-6BD4A5B2C670}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_ifxos", "..\..\..\..\..\..\comacsd_lib\lib_ifxos\build_win32\vc7\lib_ifxos.vcproj", "{0BE28B50-BAFF-4849-A060-6BD4A5B2C670}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Danube Debug = Danube Debug
Danube Release = Danube Release
Debug - Nucleus Plus = Debug - Nucleus Plus
Debug - SV CPP = Debug - SV CPP
Debug - Win32 = Debug - Win32
Release - Win32 = Release - Win32
VRX Debug = VRX Debug
VRX Release = VRX Release
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Danube Debug.ActiveCfg = Danube Debug|Win32
{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Danube Debug.Build.0 = Danube Debug|Win32
{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Danube Release.ActiveCfg = Danube Release|Win32
{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Danube Release.Build.0 = Danube Release|Win32
{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Debug - Nucleus Plus.ActiveCfg = Debug|Win32
{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Debug - Nucleus Plus.Build.0 = Debug|Win32
{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Debug - SV CPP.ActiveCfg = Debug|Win32
{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Debug - SV CPP.Build.0 = Debug|Win32
{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Debug - Win32.ActiveCfg = Debug|Win32
{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Debug - Win32.Build.0 = Debug|Win32
{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Release - Win32.ActiveCfg = Release|Win32
{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.Release - Win32.Build.0 = Release|Win32
{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.VRX Debug.ActiveCfg = VRX Debug|Win32
{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.VRX Debug.Build.0 = VRX Debug|Win32
{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.VRX Release.ActiveCfg = VRX Release|Win32
{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}.VRX Release.Build.0 = VRX Release|Win32
{0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Danube Debug.ActiveCfg = Debug - Win32|Win32
{0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Danube Debug.Build.0 = Debug - Win32|Win32
{0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Danube Release.ActiveCfg = Debug - Nucleus Plus|Win32
{0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Danube Release.Build.0 = Debug - Nucleus Plus|Win32
{0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Debug - Nucleus Plus.ActiveCfg = Debug - Nucleus Plus|Win32
{0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Debug - Nucleus Plus.Build.0 = Debug - Nucleus Plus|Win32
{0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Debug - SV CPP.ActiveCfg = Debug - Nucleus Plus|Win32
{0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Debug - SV CPP.Build.0 = Debug - Nucleus Plus|Win32
{0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Debug - Win32.ActiveCfg = Debug - Win32|Win32
{0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Debug - Win32.Build.0 = Debug - Win32|Win32
{0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Release - Win32.ActiveCfg = Release - Win32|Win32
{0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.Release - Win32.Build.0 = Release - Win32|Win32
{0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.VRX Debug.ActiveCfg = Debug - Win32|Win32
{0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.VRX Debug.Build.0 = Debug - Win32|Win32
{0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.VRX Release.ActiveCfg = Debug - Nucleus Plus|Win32
{0BE28B50-BAFF-4849-A060-6BD4A5B2C670}.VRX Release.Build.0 = Debug - Nucleus Plus|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,515 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="dsl_cpe_control"
ProjectGUID="{F79EAF4F-E01C-4331-9E2E-BEC06153ACF4}"
RootNamespace="dsl_cpe_control"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="C:\snapshots\hempel_dsl_cpe_api_dev_generic_snapshot\comacsd_driver\drv_dsl_cpe_api\driver\src\include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib"
OutputFile="$(OutDir)/dsl_cpe_control.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/dsl_cpe_control.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/dsl_cpe_control.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Danube Debug|Win32"
OutputDirectory="Danube Debug"
IntermediateDirectory="Danube Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\..\..\comacsd_lib\lib_ifxos\src\include;..\;..\..\..\..\driver\src\include"
PreprocessorDefinitions="IFXOS_USE_DEV_IO=1;WIN32;_DEBUG;_CONSOLE;INCLUDE_DSL_CPE_CLI_SUPPORT;INCLUDE_DSL_CPE_API_DANUBE;DSL_CPE_SIMULATOR;DSL_CPE_REMOVE_PIPE_SUPPORT;INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT;DSL_CHANNELS_PER_LINE=1"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
StructMemberAlignment="1"
BufferSecurityCheck="TRUE"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="4"
CallingConvention="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib"
OutputFile="$(OutDir)/dsl_cpe_control.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/dsl_cpe_control.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="VRX Debug|Win32"
OutputDirectory="VRX Debug"
IntermediateDirectory="VRX Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\..\..\comacsd_lib\lib_ifxos\src\include;..\;..\..\..\..\driver\src\include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;DSL_CPE_REMOVE_PIPE_SUPPORT;INCLUDE_DSL_CPE_CLI_SUPPORT;INCLUDE_DSL_CPE_IFXOS_SUPPORT;IFXOS_USE_DEV_IO=1;INCLUDE_DSL_CPE_API_VRX;DSL_CPE_SIMULATOR;DSL_CHANNELS_PER_LINE=1"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib"
OutputFile="$(OutDir)/dsl_cpe_control.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/dsl_cpe_control.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Danube Release|Win32"
OutputDirectory="Danube Release"
IntermediateDirectory="Danube Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="..\;..\..\..\..\driver\src\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;INCLUDE_DSL_CPE_CLI_SUPPORT;INCLUDE_DSL_CPE_API_DANUBE;DSL_CPE_SIMULATOR"
StringPooling="TRUE"
RuntimeLibrary="3"
StructMemberAlignment="1"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/dsl_cpe_control.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="VRX Release|Win32"
OutputDirectory="VRX Release"
IntermediateDirectory="VRX Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="..\;..\..\..\..\driver\src\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;INCLUDE_DSL_CPE_API_VRX;DSL_CPE_SIMULATOR"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/dsl_cpe_control.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
SourceControlFiles="FALSE">
<File
RelativePath="..\..\src\dsl_cpe_cli.c">
</File>
<File
RelativePath="..\..\src\dsl_cpe_cli_access.c">
</File>
<File
RelativePath="..\..\src\dsl_cpe_cli_console.c">
</File>
<File
RelativePath="..\..\src\dsl_cpe_cli_danube.c">
<FileConfiguration
Name="VRX Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="VRX Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\dsl_cpe_cli_pipe.c">
</File>
<File
RelativePath="..\..\src\dsl_cpe_cli_vrx.c">
<FileConfiguration
Name="Danube Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Danube Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\dsl_cpe_control.c">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
</FileConfiguration>
<FileConfiguration
Name="Danube Debug|Win32">
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
</FileConfiguration>
<FileConfiguration
Name="VRX Debug|Win32">
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
</FileConfiguration>
<FileConfiguration
Name="Danube Release|Win32">
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
</FileConfiguration>
<FileConfiguration
Name="VRX Release|Win32">
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\dsl_cpe_debug.c">
</File>
<File
RelativePath="..\..\src\dsl_cpe_debug_danube.c">
</File>
<File
RelativePath="..\..\src\dsl_cpe_debug_vrx.c">
</File>
<File
RelativePath="..\..\src\dsl_cpe_init_cfg.c">
</File>
<File
RelativePath="..\..\src\dsl_cpe_legacy.c">
</File>
<File
RelativePath="..\..\src\dsl_cpe_linux.c">
</File>
<File
RelativePath="..\..\src\dsl_cpe_simulator.c">
</File>
<File
RelativePath="..\..\src\dsl_cpe_vxworks.c">
</File>
<File
RelativePath="..\..\src\dsl_cpe_win32.c">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc">
<File
RelativePath="..\..\src\dsl_cpe_cli.h">
</File>
<File
RelativePath="..\..\src\dsl_cpe_cli_console.h">
</File>
<File
RelativePath="..\..\src\dsl_cpe_control.h">
</File>
<File
RelativePath="..\dsl_cpe_control_version.h">
</File>
<File
RelativePath="..\..\src\dsl_cpe_debug.h">
</File>
<File
RelativePath="..\..\src\dsl_cpe_debug_danube.h">
</File>
<File
RelativePath="..\..\src\dsl_cpe_debug_vrx.h">
</File>
<File
RelativePath="..\..\src\dsl_cpe_init_cfg.h">
</File>
<File
RelativePath="..\..\src\dsl_cpe_linux.h">
</File>
<File
RelativePath="..\..\src\dsl_cpe_os.h">
</File>
<File
RelativePath="..\..\src\dsl_cpe_simulator.h">
</File>
<File
RelativePath="..\..\src\dsl_cpe_vxworks.h">
</File>
<File
RelativePath="..\..\src\dsl_cpe_win32.h">
</File>
<File
RelativePath="stdafx.h">
</File>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
</Filter>
<File
RelativePath="..\..\ChangeLog">
</File>
<File
RelativePath="..\..\configure.in">
</File>
<File
RelativePath="..\..\NEWS">
</File>
<File
RelativePath="..\..\README">
</File>
<File
RelativePath="ReadMe.txt">
</File>
<File
RelativePath="..\..\scripts\swig2cli.xsl">
</File>
<File
RelativePath="..\..\TODO">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

348
compile Executable file
View file

@ -0,0 +1,348 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2016-01-11.22; # UTC
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

666
config.rpath Executable file
View file

@ -0,0 +1,666 @@
#! /bin/sh
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
# Copyright 1996-2007 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# The first argument passed to this file is the canonical host specification,
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
# should be set by the caller.
#
# The set of defined variables is at the end of this script.
# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
# than 256 bytes, otherwise the compiler driver will dump core. The only
# known workaround is to choose shorter directory names for the build
# directory and/or the installation directory.
# All known linkers require a `.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
shrext=.so
host="$1"
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
# Code taken from libtool.m4's _LT_CC_BASENAME.
for cc_temp in $CC""; do
case $cc_temp in
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
\-*) ;;
*) break;;
esac
done
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
wl=
if test "$GCC" = yes; then
wl='-Wl,'
else
case "$host_os" in
aix*)
wl='-Wl,'
;;
darwin*)
case $cc_basename in
xlc*)
wl='-Wl,'
;;
esac
;;
mingw* | cygwin* | pw32* | os2*)
;;
hpux9* | hpux10* | hpux11*)
wl='-Wl,'
;;
irix5* | irix6* | nonstopux*)
wl='-Wl,'
;;
newsos6)
;;
linux* | k*bsd*-gnu)
case $cc_basename in
icc* | ecc*)
wl='-Wl,'
;;
pgcc | pgf77 | pgf90)
wl='-Wl,'
;;
ccc*)
wl='-Wl,'
;;
como)
wl='-lopt='
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)
wl='-Wl,'
;;
esac
;;
esac
;;
osf3* | osf4* | osf5*)
wl='-Wl,'
;;
rdos*)
;;
solaris*)
wl='-Wl,'
;;
sunos4*)
wl='-Qoption ld '
;;
sysv4 | sysv4.2uw2* | sysv4.3*)
wl='-Wl,'
;;
sysv4*MP*)
;;
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
wl='-Wl,'
;;
unicos*)
wl='-Wl,'
;;
uts4*)
;;
esac
fi
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no
case "$host_os" in
cygwin* | mingw* | pw32*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
if test "$GCC" != yes; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
openbsd*)
with_gnu_ld=no
;;
esac
ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
# Set some defaults for GNU ld with shared library support. These
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
# Unlike libtool, we use -rpath here, not --rpath, since the documented
# option of GNU ld is called -rpath, not --rpath.
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
case "$host_os" in
aix3* | aix4* | aix5*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
fi
;;
amigaos*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
# that the semantics of dynamic libraries on AmigaOS, at least up
# to version 4, is to share data among multiple programs linked
# with the same dynamic library. Since this doesn't match the
# behavior of shared libraries on other platforms, we cannot use
# them.
ld_shlibs=no
;;
beos*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
cygwin* | mingw* | pw32*)
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
interix[3-9]*)
hardcode_direct=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
gnu* | linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
netbsd*)
;;
solaris*)
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
ld_shlibs=no
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
else
ld_shlibs=no
fi
;;
esac
;;
sunos4*)
hardcode_direct=yes
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
esac
if test "$ld_shlibs" = no; then
hardcode_libdir_flag_spec=
fi
else
case "$host_os" in
aix3*)
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
if test "$GCC" = yes; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct=unsupported
fi
;;
aix4* | aix5*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
else
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[23]|aix4.[23].*|aix5*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
break
fi
done
;;
esac
fi
hardcode_direct=yes
hardcode_libdir_separator=':'
if test "$GCC" = yes; then
case $host_os in aix4.[012]|aix4.[012].*)
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" && \
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
:
else
# We have old collect2
hardcode_direct=unsupported
hardcode_minus_L=yes
hardcode_libdir_flag_spec='-L$libdir'
hardcode_libdir_separator=
fi
;;
esac
fi
# Begin _LT_AC_SYS_LIBPATH_AIX.
echo 'int main () { return 0; }' > conftest.c
${CC} ${LDFLAGS} conftest.c -o conftest
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
fi
if test -z "$aix_libpath"; then
aix_libpath="/usr/lib:/lib"
fi
rm -f conftest.c conftest
# End _LT_AC_SYS_LIBPATH_AIX.
if test "$aix_use_runtimelinking" = yes; then
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
else
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
fi
fi
;;
amigaos*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
# see comment about different semantics on the GNU ld section
ld_shlibs=no
;;
bsdi[45]*)
;;
cygwin* | mingw* | pw32*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec=' '
libext=lib
;;
darwin* | rhapsody*)
hardcode_direct=no
if test "$GCC" = yes ; then
:
else
case $cc_basename in
xlc*)
;;
*)
ld_shlibs=no
;;
esac
fi
;;
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
freebsd1*)
ld_shlibs=no
;;
freebsd2.2*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
freebsd2*)
hardcode_direct=yes
hardcode_minus_L=yes
;;
freebsd* | dragonfly*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
hpux9*)
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
hpux10*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
fi
;;
hpux11*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
case $host_cpu in
hppa*64*|ia64*)
hardcode_direct=no
;;
*)
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
esac
fi
;;
irix5* | irix6* | nonstopux*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
netbsd*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
newsos6)
hardcode_direct=yes
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
else
case "$host_os" in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
hardcode_libdir_flag_spec='-R$libdir'
;;
*)
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
esac
fi
else
ld_shlibs=no
fi
;;
os2*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
osf3*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
osf4* | osf5*)
if test "$GCC" = yes; then
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
# Both cc and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
fi
hardcode_libdir_separator=:
;;
solaris*)
hardcode_libdir_flag_spec='-R$libdir'
;;
sunos4*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
;;
sysv4)
case $host_vendor in
sni)
hardcode_direct=yes # is this really true???
;;
siemens)
hardcode_direct=no
;;
motorola)
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
;;
esac
;;
sysv4.3*)
;;
sysv4*MP*)
if test -d /usr/nec; then
ld_shlibs=yes
fi
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
;;
sysv5* | sco3.2v5* | sco5v6*)
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
hardcode_libdir_separator=':'
;;
uts4*)
hardcode_libdir_flag_spec='-L$libdir'
;;
*)
ld_shlibs=no
;;
esac
fi
# Check dynamic linker characteristics
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
# only about the one the linker finds when passed -lNAME. This is the last
# element of library_names_spec in libtool.m4, or possibly two of them if the
# linker has special search rules.
library_names_spec= # the last element of library_names_spec in libtool.m4
libname_spec='lib$name'
case "$host_os" in
aix3*)
library_names_spec='$libname.a'
;;
aix4* | aix5*)
library_names_spec='$libname$shrext'
;;
amigaos*)
library_names_spec='$libname.a'
;;
beos*)
library_names_spec='$libname$shrext'
;;
bsdi[45]*)
library_names_spec='$libname$shrext'
;;
cygwin* | mingw* | pw32*)
shrext=.dll
library_names_spec='$libname.dll.a $libname.lib'
;;
darwin* | rhapsody*)
shrext=.dylib
library_names_spec='$libname$shrext'
;;
dgux*)
library_names_spec='$libname$shrext'
;;
freebsd1*)
;;
freebsd* | dragonfly*)
case "$host_os" in
freebsd[123]*)
library_names_spec='$libname$shrext$versuffix' ;;
*)
library_names_spec='$libname$shrext' ;;
esac
;;
gnu*)
library_names_spec='$libname$shrext'
;;
hpux9* | hpux10* | hpux11*)
case $host_cpu in
ia64*)
shrext=.so
;;
hppa*64*)
shrext=.sl
;;
*)
shrext=.sl
;;
esac
library_names_spec='$libname$shrext'
;;
interix[3-9]*)
library_names_spec='$libname$shrext'
;;
irix5* | irix6* | nonstopux*)
library_names_spec='$libname$shrext'
case "$host_os" in
irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
case $LD in
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
*) libsuff= shlibsuff= ;;
esac
;;
esac
;;
linux*oldld* | linux*aout* | linux*coff*)
;;
linux* | k*bsd*-gnu)
library_names_spec='$libname$shrext'
;;
knetbsd*-gnu)
library_names_spec='$libname$shrext'
;;
netbsd*)
library_names_spec='$libname$shrext'
;;
newsos6)
library_names_spec='$libname$shrext'
;;
nto-qnx*)
library_names_spec='$libname$shrext'
;;
openbsd*)
library_names_spec='$libname$shrext$versuffix'
;;
os2*)
libname_spec='$name'
shrext=.dll
library_names_spec='$libname.a'
;;
osf3* | osf4* | osf5*)
library_names_spec='$libname$shrext'
;;
rdos*)
;;
solaris*)
library_names_spec='$libname$shrext'
;;
sunos4*)
library_names_spec='$libname$shrext$versuffix'
;;
sysv4 | sysv4.3*)
library_names_spec='$libname$shrext'
;;
sysv4*MP*)
library_names_spec='$libname$shrext'
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='$libname$shrext'
;;
uts4*)
library_names_spec='$libname$shrext'
;;
esac
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
# How to pass a linker flag through the compiler.
wl="$escaped_wl"
# Static library suffix (normally "a").
libext="$libext"
# Shared library suffix (normally "so").
shlibext="$shlibext"
# Format of library name prefix.
libname_spec="$escaped_libname_spec"
# Library names that the linker finds when passed -lNAME.
library_names_spec="$escaped_library_names_spec"
# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator="$hardcode_libdir_separator"
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct="$hardcode_direct"
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
# resulting binary.
hardcode_minus_L="$hardcode_minus_L"
EOF

11682
configure vendored Executable file

File diff suppressed because it is too large Load diff

2228
configure.in Normal file

File diff suppressed because it is too large Load diff

791
depcomp Executable file
View file

@ -0,0 +1,791 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2016-01-11.22; # UTC
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The second -e expression handles DOS-style file names with drive
# letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
aix_post_process_depfile
;;
tcc)
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# FIXME: That version still under development at the moment of writing.
# Make that this statement remains true also for stable, released
# versions.
# It will wrap lines (doesn't matter whether long or short) with a
# trailing '\', as in:
#
# foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
# Libtool generates 2 separate objects for the 2 libraries. These
# two compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir$base.o.d # libtool 1.5
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
# Same post-processing that is required for AIX mode.
aix_post_process_depfile
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this sed invocation
# correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process the last invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E \
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
| sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

501
install-sh Executable file
View file

@ -0,0 +1,501 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2016-01-11.22; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
tab=' '
nl='
'
IFS=" $tab$nl"
# Set DOITPROG to "echo" to test this script.
doit=${DOITPROG-}
doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t)
is_target_a_directory=always
dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.
if test -n "$dir_arg"; then
if test -n "$dst_arg"; then
echo "$0: target directory not allowed when installing a directory." >&2
exit 1
fi
fi
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
if test $# -gt 1 || test "$is_target_a_directory" = always; then
if test ! -d "$dst_arg"; then
echo "$0: $dst_arg: Is not a directory." >&2
exit 1
fi
fi
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
oIFS=$IFS
IFS=/
set -f
set fnord $dstdir
shift
set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

215
missing Executable file
View file

@ -0,0 +1,215 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
scriptversion=2016-01-11.22; # UTC
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try '$0 --help' for more information"
exit 1
fi
case $1 in
--is-lightweight)
# Used by our autoconf macros to check whether the available missing
# script is modern enough.
exit 0
;;
--run)
# Back-compat with the calling convention used by older automake.
shift
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
to PROGRAM being missing or too old.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal autoconf autoheader autom4te automake makeinfo
bison yacc flex lex help2man
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: unknown '$1' option"
echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
# Run the given program, remember its exit status.
"$@"; st=$?
# If it succeeded, we are done.
test $st -eq 0 && exit 0
# Also exit now if we it failed (or wasn't found), and '--version' was
# passed; such an option is passed most likely to detect whether the
# program is present and works.
case $2 in --version|--help) exit $st;; esac
# Exit code 63 means version mismatch. This often happens when the user
# tries to use an ancient version of a tool on a file that requires a
# minimum version.
if test $st -eq 63; then
msg="probably too old"
elif test $st -eq 127; then
# Program was missing.
msg="missing on your system"
else
# Program was found and executed, but failed. Give up.
exit $st
fi
perl_URL=http://www.perl.org/
flex_URL=http://flex.sourceforge.net/
gnu_software_URL=http://www.gnu.org/software
program_details ()
{
case $1 in
aclocal|automake)
echo "The '$1' program is part of the GNU Automake package:"
echo "<$gnu_software_URL/automake>"
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/autoconf>"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
autoconf|autom4te|autoheader)
echo "The '$1' program is part of the GNU Autoconf package:"
echo "<$gnu_software_URL/autoconf/>"
echo "It also requires GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
esac
}
give_advice ()
{
# Normalize program name to check for.
normalized_program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
printf '%s\n' "'$1' is $msg."
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
case $normalized_program in
autoconf*)
echo "You should only need it if you modified 'configure.ac',"
echo "or m4 files included by it."
program_details 'autoconf'
;;
autoheader*)
echo "You should only need it if you modified 'acconfig.h' or"
echo "$configure_deps."
program_details 'autoheader'
;;
automake*)
echo "You should only need it if you modified 'Makefile.am' or"
echo "$configure_deps."
program_details 'automake'
;;
aclocal*)
echo "You should only need it if you modified 'acinclude.m4' or"
echo "$configure_deps."
program_details 'aclocal'
;;
autom4te*)
echo "You might have modified some maintainer files that require"
echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
echo "You should only need it if you modified a '.y' file."
echo "You may want to install the GNU Bison package:"
echo "<$gnu_software_URL/bison/>"
;;
lex*|flex*)
echo "You should only need it if you modified a '.l' file."
echo "You may want to install the Fast Lexical Analyzer package:"
echo "<$flex_URL>"
;;
help2man*)
echo "You should only need it if you modified a dependency" \
"of a man page."
echo "You may want to install the GNU Help2man package:"
echo "<$gnu_software_URL/help2man/>"
;;
makeinfo*)
echo "You should only need it if you modified a '.texi' file, or"
echo "any other file indirectly affecting the aspect of the manual."
echo "You might want to install the Texinfo package:"
echo "<$gnu_software_URL/texinfo/>"
echo "The spurious makeinfo call might also be the consequence of"
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
echo "want to install GNU make:"
echo "<$gnu_software_URL/make/>"
;;
*)
echo "You might have modified some files without having the proper"
echo "tools for further handling them. Check the 'README' file, it"
echo "often tells you about the needed prerequisites for installing"
echo "this package. You may also peek at any GNU archive site, in"
echo "case some other package contains this missing '$1' program."
;;
esac
}
give_advice "$1" | sed -e '1s/^/WARNING: /' \
-e '2,$s/^/ /' >&2
# Propagate the correct exit status (expected to be 127 for a program
# not found, 63 for a program that failed due to version mismatch).
exit $st
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

19
scripts/alias_dsl_cpe.sh Normal file
View file

@ -0,0 +1,19 @@
#
# alias definitions for the "DSL CPE Control Application"
# to simplify the usage of the pipe interface
#
echo ... run alias defs for dsl_cpe_control application
if [ "$DSL_CPE_DIR" = "" ]; then
DSL_CPE_DIR="/opt/ifx"
fi
# main alias to send commands
alias cpe="$DSL_CPE_DIR/dsl_cpe_pipe.sh"
# definitions for message-dumps and events
alias cpe_log_dump_cout='tail -f /tmp/pipe/dsl_cpe0_dump &'
alias cpe_log_dump='tail -f /tmp/pipe/dsl_cpe0_dump > dump.txt &'
alias cpe_log_event_cout='tail -f /tmp/pipe/dsl_cpe0_event &'
alias cpe_log_event='tail -f /tmp/pipe/dsl_cpe0_event > event.txt &'

18
scripts/dsl_cpe_pipe.sh Executable file
View file

@ -0,0 +1,18 @@
#!/bin/sh
pipe_no=0
# use specified pipe no
case "$1" in
0|1|2)
pipe_no=$1; shift; ;;
esac
#echo "Call dsl_pipe with $*"
echo $* > /tmp/pipe/dsl_cpe${pipe_no}_cmd
result=`cat /tmp/pipe/dsl_cpe${pipe_no}_ack`
echo "$result"

245
src/Makefile.am Normal file
View file

@ -0,0 +1,245 @@
## Process this file with automake to produce Makefile.in
bin_PROGRAMS = dsl_cpe_control
AM_CPPFLAGS = -I@srcdir@ @DSL_DRIVER_INCL_PATH@ @DSL_DEVICE_DRIVER_INCL_PATH@ @IFXOS_INCLUDE_PATH@ @DTI_INCL_PATH@
if DSL_CPE_STATIC_LINKING
dsl_cpe_control_common_ldflags = -static
else
dsl_cpe_control_common_ldflags =
endif
dsl_cpe_control_LDADD = -lpthread -lrt
if INCLUDE_DSL_CPE_DTI_SUPPORT
dsl_cpe_control_LDADD += -ldti_agent
dsl_cpe_control_LDADD += -lifxos
endif
if INCLUDE_DSL_CPE_IFXOS_SUPPORT
dsl_cpe_control_LDADD += -lifxos
endif
if SAFEC_SUPPORT
AM_CPPFLAGS += @SAFEC_INCL_PATH@
dsl_cpe_control_LDADD += -l@SAFEC_LIB_NAME@
endif
if INCLUDE_DSL_JSON_PARSING
AM_CPPFLAGS += @LIBJSON_C_INCL_PATH@
dsl_cpe_control_LDADD += -ljson-c
endif
bin_SCRIPTS = ../scripts/alias_dsl_cpe.sh
if DEVICE_VRX
dsl_cpe_control_bnd_sources = \
dsl_cpe_bnd_vrx.c
endif
dsl_cpe_control_cli_sources = \
dsl_cpe_cli.c \
dsl_cpe_cli_pipe.c \
dsl_cpe_cli_access.c \
dsl_cpe_cli_console.c
if INCLUDE_DSL_JSON_PARSING
dsl_cpe_configuration_parser_sources = \
dsl_cpe_configuration_parser.c
dsl_cpe_status_parser_sources = \
dsl_cpe_status_parser.c
else
dsl_cpe_configuration_parser_sources =
dsl_cpe_status_parser_sources =
endif
dsl_cpe_control_cli_autogen_sources = \
dsl_cpe_cli_access2.c \
dsl_cpe_cli_autogen.c
dsl_cpe_control_cli_danube_sources = \
dsl_cpe_cli_danube.c \
dsl_cpe_cli_mib.c
dsl_cpe_control_cli_vrx_sources = \
dsl_cpe_cli_vrx.c
dsl_cpe_control_debug_danube_sources = \
dsl_cpe_debug_danube.c
dsl_cpe_control_debug_vrx_sources = \
dsl_cpe_debug_vrx.c
if INCLUDE_DSL_CPE_DTI_SUPPORT
dsl_cpe_control_dti_sources = \
dsl_cpe_dti.c \
dsl_cpe_dti_vrx.c
else
dsl_cpe_control_dti_sources =
endif
dsl_cpe_control_SOURCES = \
dsl_cpe_control.c \
dsl_cpe_init_cfg.c \
dsl_cpe_linux.c \
dsl_cpe_debug.c
dsl_cpe_control_SOURCES += \
$(dsl_cpe_control_dti_sources)
if DEVICE_DANUBE
dsl_cpe_control_SOURCES += \
$(dsl_cpe_control_debug_danube_sources)
endif
if DEVICE_VRX_LAYER
dsl_cpe_control_SOURCES += \
$(dsl_cpe_control_debug_vrx_sources)
endif
dsl_cpe_control_SOURCES += \
$(dsl_cpe_control_bnd_sources)
if INCLUDE_DSL_CPE_CLI_SUPPORT
dsl_cpe_control_SOURCES += \
$(dsl_cpe_control_cli_sources)
if INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT
dsl_cpe_control_SOURCES += \
$(dsl_cpe_control_cli_autogen_sources)
endif
if DEVICE_DANUBE
dsl_cpe_control_SOURCES += \
$(dsl_cpe_control_cli_danube_sources)
endif
if INCLUDE_DSL_JSON_PARSING
dsl_cpe_control_SOURCES += \
$(dsl_cpe_configuration_parser_sources) \
$(dsl_cpe_status_parser_sources)
endif
if DEVICE_VRX
dsl_cpe_control_SOURCES += \
$(dsl_cpe_control_cli_vrx_sources)
endif
endif
EXTRA_DIST = \
../LICENSE \
$(dsl_cpe_control_bnd_sources) \
$(dsl_cpe_control_cli_sources) \
$(dsl_cpe_control_dti_sources) \
$(dsl_cpe_control_cli_danube_sources) \
$(dsl_cpe_control_cli_vrx_sources) \
$(dsl_cpe_control_debug_danube_sources) \
$(dsl_cpe_control_debug_vrx_sources) \
$(dsl_cpe_configuration_parser_sources) \
$(dsl_cpe_status_parser_sources) \
dsl_cpe_control.h \
dsl_cpe_init_cfg.h \
dsl_cpe_cli.h \
dsl_cpe_dti.h \
dsl_cpe_dti_vrx_ctx.h \
dsl_cpe_bnd_vrx.h \
dsl_cpe_cli_console.h \
dsl_cpe_simulator.c \
dsl_cpe_simulator.h \
dsl_cpe_win32.c \
dsl_cpe_win32.h \
dsl_cpe_os.h \
dsl_cpe_os_lint_map.h \
dsl_cpe_linux.h \
dsl_cpe_vxworks.c \
dsl_cpe_vxworks.h \
dsl_cpe_rtems.c \
dsl_cpe_rtems.h \
dsl_cpe_debug.h \
dsl_cpe_debug_danube.h \
dsl_cpe_debug_vrx.h \
../scripts/alias_dsl_cpe.sh \
../scripts/dsl_cpe_pipe.sh \
../tools/pipe/dsl_pipe_client.h \
dsl_cpe_safec_wrapper.h
if INCLUDE_DSL_JSON_PARSING
EXTRA_DIST += \
dsl_cpe_configuration_parser.h \
dsl_cpe_status_parser.h
endif
if ADD_APPL_CFLAGS_SET
dsl_cpe_control_cflags = $(ADD_APPL_CFLAGS)
else
dsl_cpe_control_cflags =
endif
if ADD_APPL_LDFLAGS_SET
dsl_cpe_control_ldflags = $(ADD_APPL_LDFLAGS)
else
dsl_cpe_control_ldflags =
endif
if INCLUDE_DSL_CPE_IFXOS_SUPPORT
dsl_cpe_control_ifxos_ldflags = @IFXOS_LIBRARY_PATH@
else
dsl_cpe_control_ifxos_ldflags =
endif
if INCLUDE_DSL_CPE_DTI_SUPPORT
dsl_cpe_control_dti_ldflags = @DTI_LIBRARY_PATH@
else
dsl_cpe_control_dti_ldflags =
endif
if SAFEC_SUPPORT
dsl_cpe_control_safec_ldflags = @SAFEC_LIB_PATH@
else
dsl_cpe_control_safec_ldflags =
endif
if INCLUDE_DSL_JSON_PARSING
dsl_cpe_control_json_parsing_cflags = -DINCLUDE_DSL_JSON_PARSING=1
dsl_cpe_control_json_c_ldflags = @LIBJSON_C_LIBRARY_PATH@
else
dsl_cpe_control_json_parsing_cflags =
dsl_cpe_control_json_c_ldflags =
endif
dsl_cpe_control_common_cflags = -Wall -Wimplicit -Wreturn-type -Wunused -Wundef \
-Wswitch -Wno-format -Wcomment -Wuninitialized -DLINUX -g3
# compile cflags
dsl_cpe_control_compile_cflags = $(EXTRA_APP_CFLAGS)
if DSL_CCA_DBG_MAX_LEVEL_SET
dsl_cpe_control_common_cflags += -DDSL_CCA_DBG_MAX_LEVEL=$(DSL_CCA_DBG_MAX_LEVEL_PRE)
endif
if CONFIG_USE_DSL_ADD_EXT_APPL_CFLAGS
dsl_cpe_control_external_cflags= $(DSL_ADD_EXT_APPL_CFLAGS)
endif
dsl_cpe_control_CFLAGS = $(dsl_cpe_control_common_cflags) \
$(dsl_cpe_control_cflags) \
$(dsl_cpe_control_compile_cflags) \
$(dsl_cpe_control_external_cflags) \
$(dsl_cpe_control_json_parsing_cflags)
dsl_cpe_control_LDFLAGS = $(dsl_cpe_control_common_ldflags) \
$(dsl_cpe_control_ldflags) \
$(dsl_cpe_control_compile_cflags) \
$(dsl_cpe_control_ifxos_ldflags) \
$(dsl_cpe_control_dti_ldflags) \
$(dsl_cpe_control_safec_ldflags) \
$(dsl_cpe_control_json_c_ldflags)
lint:
@flint +b -vm \
-i$(shell dirname `$(CC) -print-file-name=include`)/include \
-i@top_srcdir@ std_lx.lnt env-cw6.lnt -i@srcdir@ \
$(DEFS) $(AM_CPPFLAGS) $(CFLAGS) -D__LINUX__ -DLINUX $(dsl_cpe_control_SOURCES)

1209
src/Makefile.in Normal file

File diff suppressed because it is too large Load diff

868
src/dsl_cpe_bnd_vrx.c Normal file
View file

@ -0,0 +1,868 @@
/******************************************************************************
Copyright 2018, Intel Corporation
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#include "dsl_cpe_control.h"
#if defined(INCLUDE_DSL_CPE_API_VRX)
#include "dsl_cpe_bnd_vrx.h"
#include "drv_dsl_cpe_api_ioctl.h"
#undef DSL_CCA_DBG_BLOCK
#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_APP
static DSL_Error_t DSL_CPE_BND_BondingCheck(
DSL_CPE_BND_Context_t *pBndCtx,
DSL_int_t fd,
DSL_uint16_t nPort)
{
DSL_int_t ret = 0, i, j;
DSL_BND_HsStatusGet_t status;
DSL_BND_HsContinue_t HsContinue;
/* read bonding status */
memset (&status, 0, sizeof(DSL_BND_HsStatusGet_t));
ret = DSL_CPE_Ioctl(fd, DSL_FIO_BND_HS_STATUS_GET, (DSL_int_t)&status);
if ((ret < 0) || (status.accessCtl.nReturn < DSL_SUCCESS))
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - DSL_FIO_BND_HS_STATUS_GET ioctl call failed!" DSL_CPE_CRLF));
return DSL_ERROR;
}
/* Set RemotePafAvailable */
pBndCtx->lineMonitorStateMachine[nPort].RemotePafAvailable =
(DSL_uint16_t)status.data.nRemotePafSupported;
/* clear if same */
if ((status.data.nActivationMode & DSL_BND_DISCOVERY_CLEAR_IF_SAME))
{
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Clear If Same Command Received" DSL_CPE_CRLF));
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Remote Discovery code: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x" DSL_CPE_CRLF,
pBndCtx->remoteDiscoveryCode[0], pBndCtx->remoteDiscoveryCode[1],
pBndCtx->remoteDiscoveryCode[2], pBndCtx->remoteDiscoveryCode[3],
pBndCtx->remoteDiscoveryCode[4], pBndCtx->remoteDiscoveryCode[5]));
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Discovery code: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x" DSL_CPE_CRLF,
status.data.nDiscoveryCode[0], status.data.nDiscoveryCode[1],
status.data.nDiscoveryCode[2], status.data.nDiscoveryCode[3],
status.data.nDiscoveryCode[4], status.data.nDiscoveryCode[5]));
/* if received discovery code = current Remote Discovery Register,
then clear the Remote Discovery and Aggregate Register */
for (i = 0; i < 6; i++)
{
if (status.data.nDiscoveryCode[i] != pBndCtx->remoteDiscoveryCode[i])
break;
}
if (i == 6)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Update Remote Discovery code" DSL_CPE_CRLF));
memset(pBndCtx->remoteDiscoveryCode, 0x0, 6);
pBndCtx->aggregateReg = 0;
for (j = 0; j < DSL_CPE_DSL_ENTITIES; j++)
{
pBndCtx->lineMonitorStateMachine[j].PafAggregate = 0;
}
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Remote Discovery code: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x" DSL_CPE_CRLF,
pBndCtx->remoteDiscoveryCode[0], pBndCtx->remoteDiscoveryCode[1],
pBndCtx->remoteDiscoveryCode[2], pBndCtx->remoteDiscoveryCode[3],
pBndCtx->remoteDiscoveryCode[4], pBndCtx->remoteDiscoveryCode[5]));
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Aggregation Register: 0x%X" DSL_CPE_CRLF,
pBndCtx->aggregateReg));
}
}
/* set if clear */
if ((status.data.nActivationMode & DSL_BND_DISCOVERY_SET_IF_CLEAR))
{
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Set If Clear Command Received" DSL_CPE_CRLF));
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Remote Discovery code: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x" DSL_CPE_CRLF,
pBndCtx->remoteDiscoveryCode[0], pBndCtx->remoteDiscoveryCode[1],
pBndCtx->remoteDiscoveryCode[2], pBndCtx->remoteDiscoveryCode[3],
pBndCtx->remoteDiscoveryCode[4], pBndCtx->remoteDiscoveryCode[5]));
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Discovery code: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x" DSL_CPE_CRLF,
status.data.nDiscoveryCode[0], status.data.nDiscoveryCode[1],
status.data.nDiscoveryCode[2], status.data.nDiscoveryCode[3],
status.data.nDiscoveryCode[4], status.data.nDiscoveryCode[5]));
/* if current Remote Discovery Register is 0,
then set the Remote Discovery Register to received discovery code */
for (i = 0; i < 6; i++)
{
if (pBndCtx->remoteDiscoveryCode[i] != 0)
break;
}
if (i == 6)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Update Remote Discovery code" DSL_CPE_CRLF));
cpe_control_memcpy_s(pBndCtx->remoteDiscoveryCode, sizeof(pBndCtx->remoteDiscoveryCode),
status.data.nDiscoveryCode, sizeof(status.data.nDiscoveryCode));
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Remote Discovery code: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x" DSL_CPE_CRLF,
pBndCtx->remoteDiscoveryCode[0], pBndCtx->remoteDiscoveryCode[1],
pBndCtx->remoteDiscoveryCode[2], pBndCtx->remoteDiscoveryCode[3],
pBndCtx->remoteDiscoveryCode[4], pBndCtx->remoteDiscoveryCode[5]));
}
}
/* aggregate set */
if ((status.data.nActivationMode & DSL_BND_AGGREGATE_SET))
{
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - AggregateSet Command Received" DSL_CPE_CRLF));
pBndCtx->aggregateReg |= (1 << nPort);
pBndCtx->lineMonitorStateMachine[nPort].PafAggregate = 1;
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Aggregation Register: 0x%X" DSL_CPE_CRLF,
pBndCtx->aggregateReg));
}
/* aggregate clear */
if ((status.data.nActivationMode & DSL_BND_AGGREGATE_CLR) != 0)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - AggregateClr Command Received" DSL_CPE_CRLF));
pBndCtx->aggregateReg &= (~(1 << nPort));
pBndCtx->lineMonitorStateMachine[nPort].PafAggregate = 0;
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Aggregation Register: 0x%X" DSL_CPE_CRLF,
pBndCtx->aggregateReg));
}
/* set continue flag after bonding registers processed */
memset (&HsContinue, 0, sizeof(DSL_BND_HsContinue_t));
cpe_control_memcpy_s(HsContinue.data.nDiscoveryCode, sizeof(HsContinue.data.nDiscoveryCode),
pBndCtx->remoteDiscoveryCode, sizeof(pBndCtx->remoteDiscoveryCode));
HsContinue.data.nAggregateData = pBndCtx->aggregateReg;
ret = DSL_CPE_Ioctl(fd, DSL_FIO_BND_HS_CONTINUE, (DSL_int_t)&HsContinue);
if ((ret < 0) || (HsContinue.accessCtl.nReturn < DSL_SUCCESS))
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - DSL_FIO_BND_HS_CONTINUE ioctl call failed!" DSL_CPE_CRLF));
return DSL_ERROR;
}
return DSL_SUCCESS;
}
DSL_Error_t DSL_CPE_BND_RemotePafAvailableCheck(
DSL_int_t fd,
DSL_uint16_t *pRemotePafAvailable)
{
DSL_int_t ret = 0;
DSL_BND_HsStatusGet_t status;
/* read bonding status */
memset (&status, 0, sizeof(DSL_BND_HsStatusGet_t));
ret = DSL_CPE_Ioctl(fd, DSL_FIO_BND_HS_STATUS_GET, (DSL_int_t)&status);
if ((ret < 0) || (status.accessCtl.nReturn < DSL_SUCCESS))
{
if (status.accessCtl.nReturn != DSL_ERR_NOT_SUPPORTED_BY_FIRMWARE)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - DSL_FIO_BND_HS_STATUS_GET ioctl call failed!" DSL_CPE_CRLF));
return DSL_ERROR;
}
}
/* Set RemotePafAvailable */
*pRemotePafAvailable = (DSL_uint16_t)status.data.nRemotePafSupported;
return DSL_SUCCESS;
}
static DSL_Error_t DSL_CPE_BND_LocalPafAvailableCheck(
DSL_int_t fd,
DSL_uint16_t *pLocalPafAvailable)
{
DSL_int_t ret = 0;
DSL_BND_ConfigGet_t bndConfig;
/* read bonding status */
memset (&bndConfig, 0, sizeof(DSL_BND_ConfigGet_t));
ret = DSL_CPE_Ioctl(fd, DSL_FIO_BND_CONFIG_GET, (DSL_int_t)&bndConfig);
if ((ret < 0) || (bndConfig.accessCtl.nReturn < DSL_SUCCESS))
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - DSL_FIO_BND_CONFIG_GET ioctl call failed!" DSL_CPE_CRLF));
return DSL_ERROR;
}
*pLocalPafAvailable = (DSL_uint16_t)bndConfig.data.bPafEnable;
return DSL_SUCCESS;
}
DSL_Error_t DSL_CPE_BND_AutobootStatusRestartWait(
DSL_CPE_BND_Context_t *pBndCtx,
DSL_uint_t nDevice)
{
return DSL_SUCCESS;
}
DSL_Error_t DSL_CPE_BND_DeviceFirmwareDownload(
DSL_CPE_BND_Context_t *pBndCtx,
DSL_int_t nDevice,
DSL_FirmwareRequestType_t nFwReqType,
DSL_PortMode_t nPortMode,
DSL_boolean_t bMaster,
DSL_boolean_t bSlave)
{
DSL_Error_t nErrorCode = DSL_SUCCESS;
DSL_CPE_Control_Context_t *pContext = pBndCtx->pCtrlCtx;
if (bMaster)
{
/* Download MASTER*/
nErrorCode = DSL_CPE_DownloadFirmware(pContext->fd[0], nDevice, nFwReqType,
nPortMode, DSL_NULL, DSL_NULL);
if (nErrorCode != DSL_SUCCESS)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - Master line FW download failed!" DSL_CPE_CRLF));
return nErrorCode;
}
}
if (bSlave)
{
/* Download MASTER*/
nErrorCode = DSL_CPE_DownloadFirmware(pContext->fd[1], nDevice, nFwReqType,
nPortMode, DSL_NULL, DSL_NULL);
if (nErrorCode != DSL_SUCCESS)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - Slave line FW download failed!" DSL_CPE_CRLF));
return nErrorCode;
}
}
return nErrorCode;
}
#define DSL_CPE_SLAVE_READY_WAIT_CNT_MAX 10
DSL_Error_t DSL_CPE_BND_SyncDownloadFirmware(
DSL_CPE_BND_Context_t *pBndCtx,
DSL_int_t nDevice,
DSL_FirmwareRequestType_t nFwReqType,
DSL_PortMode_t nPortMode)
{
DSL_Error_t nErrorCode = DSL_SUCCESS;
DSL_CPE_Control_Context_t *pContext = pBndCtx->pCtrlCtx;
DSL_AutobootControl_t pAcs;
DSL_boolean_t bSlavePort;
DSL_uint32_t nMasterDevNum, nSlaveDevNum, wait_cnt;
DSL_int_t ret;
DSL_AutobootStatus_t nAutobootStatus;
DSL_BND_PortModeSync_t PortModeSync;
bSlavePort = nDevice % DSL_CPE_LINES_PER_DEVICE ? DSL_TRUE : DSL_FALSE;
nMasterDevNum = bSlavePort ? nDevice - 1 : nDevice;
nSlaveDevNum = bSlavePort ? nDevice : nDevice + 1;
if (nPortMode == DSL_PORT_MODE_DUAL)
{
if (!pBndCtx->bInitialFwRequestHandled)
{
pBndCtx->bFwRequested[nDevice] = DSL_TRUE;
if (pBndCtx->bFwRequested[nMasterDevNum] && pBndCtx->bFwRequested[nSlaveDevNum])
{
/* Download firmware for MASTER and SLAVE*/
nErrorCode = DSL_CPE_BND_DeviceFirmwareDownload(
pBndCtx, nDevice, nFwReqType, nPortMode, DSL_TRUE, DSL_TRUE);
if (nErrorCode != DSL_SUCCESS)
{
return nErrorCode;
}
pBndCtx->bInitialFwRequestHandled = DSL_TRUE;
return nErrorCode;
}
else
{
return nErrorCode;
}
}
if (bSlavePort)
{
/* restart MASTER*/
pAcs.data.nCommand = DSL_AUTOBOOT_CTRL_RESTART_FULL;
DSL_CPE_Ioctl(pContext->fd[nMasterDevNum],
DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t) &pAcs);
}
else
{
memset (&nAutobootStatus, 0, sizeof(DSL_AutobootStatus_t));
ret = DSL_CPE_Ioctl(pContext->fd[nSlaveDevNum], DSL_FIO_AUTOBOOT_STATUS_GET, (DSL_int_t)&nAutobootStatus);
if (ret < 0)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - line %d Autoboot Status get failed!" DSL_CPE_CRLF, nSlaveDevNum));
return DSL_ERROR;
}
/* check SLAVE status*/
if (nAutobootStatus.data.nStatus != DSL_AUTOBOOT_STATUS_FW_WAIT)
{
/* restart SLAVE*/
pAcs.data.nCommand = DSL_AUTOBOOT_CTRL_RESTART_FULL;
DSL_CPE_Ioctl(pContext->fd[nSlaveDevNum],
DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t) &pAcs);
return DSL_SUCCESS;
}
/* Download firmware for MASTER and SLAVE*/
nErrorCode = DSL_CPE_BND_DeviceFirmwareDownload(
pBndCtx, nDevice, nFwReqType, nPortMode, DSL_TRUE, DSL_TRUE);
if (nErrorCode != DSL_SUCCESS)
{
return nErrorCode;
}
}
}
else
{
pBndCtx->bFwRequested[nDevice] = DSL_TRUE;
/* Disable SLAVE*/
pAcs.data.nCommand = DSL_AUTOBOOT_CTRL_DISABLE;
DSL_CPE_Ioctl(pContext->fd[nSlaveDevNum], DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t) &pAcs);
/* wait for the disabled SLAVE*/
for (wait_cnt = 0; wait_cnt < DSL_CPE_SLAVE_READY_WAIT_CNT_MAX; wait_cnt++)
{
memset (&nAutobootStatus, 0, sizeof(DSL_AutobootStatus_t));
ret = DSL_CPE_Ioctl(pContext->fd[nSlaveDevNum], DSL_FIO_AUTOBOOT_STATUS_GET, (DSL_int_t)&nAutobootStatus);
if (ret < 0)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - line %d Autoboot Status get failed!" DSL_CPE_CRLF, nSlaveDevNum));
return DSL_ERROR;
}
if (nAutobootStatus.data.nStatus == DSL_AUTOBOOT_STATUS_STOPPED ||
nAutobootStatus.data.nStatus == DSL_AUTOBOOT_STATUS_DISABLED ||
nAutobootStatus.data.nStatus == DSL_AUTOBOOT_STATUS_FW_WAIT)
{
break;
}
DSL_CPE_Sleep(1);
}
if (wait_cnt >= DSL_CPE_SLAVE_READY_WAIT_CNT_MAX)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - line %d disable failed!" DSL_CPE_CRLF, nSlaveDevNum));
return DSL_ERROR;
}
if (!bSlavePort)
{
/* Download firmware for MASTER*/
nErrorCode = DSL_CPE_BND_DeviceFirmwareDownload(
pBndCtx, nDevice, nFwReqType, nPortMode, DSL_TRUE, DSL_FALSE);
if (nErrorCode != DSL_SUCCESS)
{
return nErrorCode;
}
}
else
{
/* Set MASTER Port Mode sync*/
memset(&PortModeSync, 0, sizeof(PortModeSync));
PortModeSync.data.nPortMode = DSL_PORT_MODE_SINGLE;
ret = DSL_CPE_Ioctl(pContext->fd[nMasterDevNum], DSL_FIO_BND_PORT_MODE_SYNC_SET, (DSL_int_t)&PortModeSync);
if (ret < 0)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - line %d Port Mode sync set failed!" DSL_CPE_CRLF, nMasterDevNum));
return DSL_ERROR;
}
/* restart MASTER*/
pAcs.data.nCommand = DSL_AUTOBOOT_CTRL_RESTART_FULL;
ret = DSL_CPE_Ioctl(pContext->fd[nMasterDevNum],
DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t) &pAcs);
if (ret < 0)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - line %d full restart failed failed!" DSL_CPE_CRLF, nMasterDevNum));
return DSL_ERROR;
}
}
}
return nErrorCode;
}
DSL_Error_t DSL_CPE_BND_SystemInterfaceStatusHandle(
DSL_CPE_BND_Context_t *pBndCtx,
DSL_int_t fd,
DSL_uint_t nDevice)
{
DSL_Error_t nErrorCode = DSL_SUCCESS;
DSL_uint32_t nCurrentLine, nOppositeLine, nLine;
DSL_AutobootControl_t nAcs;
DSL_boolean_t bDisableLine = DSL_FALSE;
nCurrentLine = nDevice % DSL_CPE_DSL_ENTITIES;
nOppositeLine = (nDevice + 1) % DSL_CPE_DSL_ENTITIES;
#ifdef INCLUDE_SCRIPT_NOTIFICATION
nErrorCode = DSL_CPE_SetEnv("DSL_BONDING_STATUS",
pBndCtx->lineBondingConfig[nCurrentLine].nRemotePafAvailable ? "ACTIVE" : "INACTIVE");
if (nErrorCode != DSL_SUCCESS)
{
return nErrorCode;
}
#endif
if(!pBndCtx->lineBondingConfig[nCurrentLine].nPafLineDisabled &&
!pBndCtx->lineBondingConfig[nOppositeLine].nPafLineDisabled)
{
/**
* One bonding and one non-bonding lines (CO) are connected to a
* bonding (CPE) board
*/
if(pBndCtx->lineBondingConfig[nCurrentLine].nFullInitReached &&
pBndCtx->lineBondingConfig[nCurrentLine].nRemotePafAvailable &&
pBndCtx->lineBondingConfig[nOppositeLine].nFullInitReached &&
!pBndCtx->lineBondingConfig[nOppositeLine].nRemotePafAvailable)
{
bDisableLine = DSL_TRUE;
nLine = nOppositeLine;
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Device=%d PAF mismatch #2a (disable #%d)"
DSL_CPE_CRLF, nCurrentLine, nLine));
}
else if(pBndCtx->lineBondingConfig[nOppositeLine].nFullInitReached &&
pBndCtx->lineBondingConfig[nOppositeLine].nRemotePafAvailable &&
pBndCtx->lineBondingConfig[nCurrentLine].nFullInitReached &&
!pBndCtx->lineBondingConfig[nCurrentLine].nRemotePafAvailable)
{
bDisableLine = DSL_TRUE;
nLine = nCurrentLine;
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Device=%d PAF mismatch #2b (disable #%d)"
DSL_CPE_CRLF, nCurrentLine, nLine));
}
/**
* 2 non-bonded CO lines are connected to a bonding (CPE) board
*/
else if(pBndCtx->lineBondingConfig[nCurrentLine].nFullInitReached &&
!pBndCtx->lineBondingConfig[nCurrentLine].nRemotePafAvailable)
{
bDisableLine = DSL_TRUE;
nLine = nOppositeLine;
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Device=%d PAF mismatch #1a (disable #%d)"
DSL_CPE_CRLF, nCurrentLine, nLine));
}
else if(pBndCtx->lineBondingConfig[nOppositeLine].nFullInitReached &&
!pBndCtx->lineBondingConfig[nOppositeLine].nRemotePafAvailable)
{
bDisableLine = DSL_TRUE;
nLine = nCurrentLine;
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Device=%d PAF mismatch #1b (disable #%d)"
DSL_CPE_CRLF, nCurrentLine, nLine));
}
}
if(bDisableLine)
{
pBndCtx->lineBondingConfig[nLine].nPafLineDisabled = 1;
memset(&nAcs, 0x0, sizeof(DSL_AutobootControl_t));
nAcs.data.nCommand = DSL_AUTOBOOT_CTRL_DISABLE;
nErrorCode = DSL_CPE_Ioctl(pBndCtx->pCtrlCtx->fd[nLine],
DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t) &nAcs);
if ((nErrorCode < 0) || (nAcs.accessCtl.nReturn < DSL_SUCCESS))
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"DSL_FIO_AUTOBOOT_CONTROL_SET ioctl call failed!" DSL_CPE_CRLF));
return DSL_ERROR;
}
}
return nErrorCode;
}
DSL_Error_t DSL_CPE_BND_LineStateHandle(
DSL_CPE_BND_Context_t *pBndCtx,
DSL_int_t fd,
DSL_uint_t nDevice,
DSL_LineStateValue_t nLineState,
DSL_LineStateValue_t nPrevLineState)
{
DSL_Error_t nErrorCode = DSL_SUCCESS;
DSL_uint32_t nCurrentLine, nOppositeLine;
DSL_AutobootControl_t nAcs;
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Device=%d nLineState=0x%x nPrevLineState=0x%x" DSL_CPE_CRLF,
nDevice, nLineState,nPrevLineState));
nCurrentLine = nDevice % DSL_CPE_DSL_ENTITIES;
nOppositeLine = (nDevice + 1) % DSL_CPE_DSL_ENTITIES;
if (nLineState == DSL_LINESTATE_FULL_INIT)
{
pBndCtx->lineBondingConfig[nCurrentLine].nFullInitReached = 1;
nErrorCode = DSL_CPE_BND_RemotePafAvailableCheck(fd,
(DSL_uint16_t *)&(pBndCtx->lineBondingConfig[nCurrentLine].nRemotePafAvailable));
if (nErrorCode != DSL_SUCCESS)
{
return nErrorCode;
}
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - Device=%d remote PAF is %ssupported"
DSL_CPE_CRLF, nCurrentLine,
pBndCtx->lineBondingConfig[nCurrentLine].nRemotePafAvailable ? "" : "not "));
}
/* Link drop condition */
if ((nLineState == DSL_LINESTATE_EXCEPTION) &&
(nPrevLineState >= DSL_LINESTATE_IDLE))
{
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Device=%d link DROP detected"
DSL_CPE_CRLF, nCurrentLine));
pBndCtx->lineBondingConfig[nCurrentLine].nFullInitReached = 0;
pBndCtx->lineBondingConfig[nCurrentLine].nRemotePafAvailable = 0;
if (pBndCtx->lineBondingConfig[nOppositeLine].nPafLineDisabled)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Device=%d Try to enable opposite line(%d)"
DSL_CPE_CRLF, nCurrentLine, nOppositeLine));
memset(&nAcs, 0x0, sizeof(DSL_AutobootControl_t));
nAcs.data.nCommand = DSL_AUTOBOOT_CTRL_ENABLE;
nErrorCode = DSL_CPE_Ioctl(pBndCtx->pCtrlCtx->fd[nOppositeLine],
DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t) &nAcs);
if ((nErrorCode < 0) || (nAcs.accessCtl.nReturn < DSL_SUCCESS))
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"DSL_FIO_AUTOBOOT_CONTROL_SET ioctl call failed!" DSL_CPE_CRLF));
return DSL_ERROR;
}
pBndCtx->lineBondingConfig[nOppositeLine].nPafLineDisabled = 0;
}
}
/**
* One bonding line 0 and one non-bonding line 1 connected to the board.
* See: DSLCPE_SW-707 Test B Scenario 2
*/
if (nLineState == DSL_LINESTATE_SILENT)
{
if (pBndCtx->lineBondingConfig[nOppositeLine].nPafLineDisabled)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Device=%d Try to enable opposite line(%d)"
DSL_CPE_CRLF, nCurrentLine, nOppositeLine));
memset(&nAcs, 0x0, sizeof(DSL_AutobootControl_t));
nAcs.data.nCommand = DSL_AUTOBOOT_CTRL_ENABLE;
nErrorCode = DSL_CPE_Ioctl(pBndCtx->pCtrlCtx->fd[nOppositeLine],
DSL_FIO_AUTOBOOT_CONTROL_SET, (DSL_int_t) &nAcs);
if ((nErrorCode < 0) || (nAcs.accessCtl.nReturn < DSL_SUCCESS))
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"DSL_FIO_AUTOBOOT_CONTROL_SET ioctl call failed!" DSL_CPE_CRLF));
return DSL_ERROR;
}
pBndCtx->lineBondingConfig[nOppositeLine].nPafLineDisabled = 0;
}
}
/* BONDING CLR state*/
if (nLineState == DSL_LINESTATE_BONDING_CLR)
{
nErrorCode = DSL_CPE_BND_BondingCheck(pBndCtx, fd, nDevice);
if (nErrorCode != DSL_SUCCESS)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - Bonding Check failed, Device=%d" DSL_CPE_CRLF, nDevice));
return nErrorCode;
}
}
/* Entry to SHOWTIME */
if ( (nLineState == DSL_LINESTATE_SHOWTIME_TC_SYNC) &&
(nPrevLineState != DSL_LINESTATE_SHOWTIME_TC_SYNC) )
{
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Device=%d entering SHOWTIME_TC_SYNC" DSL_CPE_CRLF, nDevice));
/* Check CL information for RemotePafAvailable */
nErrorCode = DSL_CPE_BND_RemotePafAvailableCheck(
fd,
&(pBndCtx->lineMonitorStateMachine[nDevice].RemotePafAvailable));
if (nErrorCode != DSL_SUCCESS)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - Remote Paf Check failed, Device=%d" DSL_CPE_CRLF, nDevice));
return nErrorCode;
}
/* Check CL information for PafAvailable */
nErrorCode = DSL_CPE_BND_LocalPafAvailableCheck(
fd,
&(pBndCtx->lineMonitorStateMachine[nDevice].PafAvailable));
if (nErrorCode != DSL_SUCCESS)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - Local Paf Check failed, Device=%d" DSL_CPE_CRLF, nDevice));
return nErrorCode;
}
/* enable/disable bonding */
if ((pBndCtx->lineMonitorStateMachine[nDevice].PafAvailable) &&
(pBndCtx->lineMonitorStateMachine[nDevice].RemotePafAvailable == 1) &&
(pBndCtx->lineMonitorStateMachine[nDevice].PafAggregate == 1) )
{
pBndCtx->lineMonitorStateMachine[nDevice].PafEnable = 1;
}
else
{
pBndCtx->lineMonitorStateMachine[nDevice].PafEnable = 0;
}
/* Check M/S status*/
if (pBndCtx->lineMonitorStateMachine[1-nDevice].MsStatus == DSL_BND_SLAVE)
{
pBndCtx->lineMonitorStateMachine[nDevice].MsStatus = DSL_BND_MASTER;
}
else
{
if (pBndCtx->lineMonitorStateMachine[1-nDevice].PafEnable != 1)
{
return DSL_SUCCESS;
}
if (pBndCtx->lineMonitorStateMachine[nDevice].PafEnable != 1)
{
return DSL_SUCCESS;
}
}
}
else if ((nLineState != DSL_LINESTATE_SHOWTIME_TC_SYNC) &&
(nPrevLineState == DSL_LINESTATE_SHOWTIME_TC_SYNC) )
{
/* Exit from SHOWTIME */
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"BND - Device=%d leaving SHOWTIME_TC_SYNC" DSL_CPE_CRLF, nDevice));
pBndCtx->lineMonitorStateMachine[nDevice].RemotePafAvailable = 0;
if (pBndCtx->lineMonitorStateMachine[nDevice].MsStatus == DSL_BND_MASTER)
{
pBndCtx->lineMonitorStateMachine[nDevice].MsStatus = DSL_BND_SLAVE;
if ((pBndCtx->lineMonitorStateMachine[nDevice].PafEnable == 1) &&
(pBndCtx->lineMonitorStateMachine[1-nDevice].PafEnable == 1) )
{
/* Exchange line mastership*/
pBndCtx->lineMonitorStateMachine[1-nDevice].MsStatus = DSL_BND_MASTER;
}
}
else
{
if (pBndCtx->lineMonitorStateMachine[nDevice].PafEnable != 1)
{
return DSL_SUCCESS;
}
if (pBndCtx->lineMonitorStateMachine[1-nDevice].PafEnable != 1)
{
return DSL_SUCCESS;
}
}
}
return DSL_SUCCESS;
}
static DSL_Error_t DSL_CPE_BND_HwInit(
DSL_CPE_BND_Context_t *pBndCtx,
DSL_int_t fd)
{
DSL_int_t ret = 0;
DSL_BND_HwInit_t bndHwInit;
if (pBndCtx == DSL_NULL)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - HW init: expecting non-zero bonding context pointer!" DSL_CPE_CRLF));
return DSL_ERROR;
}
DSL_CCA_DEBUG(DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX
"dsl_cpe_control - VDSL BONDING version!" DSL_CPE_CRLF));
memset(&bndHwInit, 0x0, sizeof(DSL_BND_HwInit_t));
ret = DSL_CPE_Ioctl (fd, DSL_FIO_BND_HW_INIT, (int) &bndHwInit);
if ((ret < 0) || (bndHwInit.accessCtl.nReturn < DSL_SUCCESS))
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - DSL_FIO_BND_HW_INIT ioctl call failed!" DSL_CPE_CRLF));
return DSL_ERROR;
}
return DSL_SUCCESS;
}
DSL_Error_t DSL_CPE_BND_Start(
DSL_CPE_Control_Context_t *pCtrlCtx,
DSL_int_t fd)
{
DSL_Error_t ret = DSL_SUCCESS;
DSL_int_t i;
DSL_CPE_BND_Context_t *pBndCtx = DSL_NULL;
if (pCtrlCtx == DSL_NULL)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - missing CPE context pointer pCtrlCtx!" DSL_CPE_CRLF));
return DSL_ERROR;
}
pBndCtx = DSL_CPE_Malloc(sizeof(DSL_CPE_BND_Context_t));
if (pBndCtx == DSL_NULL)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"BND - Bonding context memory allocation failed!" DSL_CPE_CRLF));
return DSL_ERROR;
}
pBndCtx->lineMonitorStateMachine[0].Port = 0;
pBndCtx->lineMonitorStateMachine[1].Port = 1;
for (i = 0; i < DSL_CPE_DSL_ENTITIES; i++)
{
pBndCtx->lineMonitorStateMachine[i].PafAvailable = -1;
pBndCtx->lineMonitorStateMachine[i].RemotePafAvailable = -1;
pBndCtx->lineMonitorStateMachine[i].PafAggregate = -1;
pBndCtx->lineMonitorStateMachine[i].PafEnable = 0;
pBndCtx->lineMonitorStateMachine[i].TxDataRate = 0;
pBndCtx->lineMonitorStateMachine[i].MsStatus = DSL_BND_SLAVE;
pBndCtx->lineBondingConfig[i].nFullInitReached = 0;
pBndCtx->lineBondingConfig[i].nRemotePafAvailable = 0;
pBndCtx->lineBondingConfig[i].nPafLineDisabled = 0;
}
memset(&(pBndCtx->remoteDiscoveryCode), 0x0, 6);
pBndCtx->aggregateReg = 0;
pBndCtx->nPafLineHandled = -1;
pBndCtx->nPafLineDisabled = -1;
pBndCtx->pCtrlCtx = pCtrlCtx;
/* Initialize Bonding HW*/
ret = DSL_CPE_BND_HwInit(pBndCtx, fd);
if (ret < DSL_SUCCESS)
{
DSL_CPE_Free(pBndCtx);
pCtrlCtx->pBnd = DSL_NULL;
}
else
{
pCtrlCtx->pBnd = (DSL_void_t*)pBndCtx;
}
return ret;
}
DSL_void_t DSL_CPE_BND_Stop(
DSL_CPE_BND_Context_t *pBndContext)
{
if (pBndContext != DSL_NULL)
{
DSL_CPE_Free(pBndContext);
}
return;
}
#endif /* INCLUDE_DSL_BONDING*/

172
src/dsl_cpe_bnd_vrx.h Normal file
View file

@ -0,0 +1,172 @@
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
*******************************************************************************/
#ifndef _DSL_CPE_BND_VRX_H_
#define _DSL_CPE_BND_VRX_H_
#ifdef __cplusplus
extern "C" {
#endif
/** \file
Bonding implementation/interface for CPE Control Application
*/
#define DSL_CPE_BND_TX_RATE_RATIO_UNITY (0x0100)
typedef enum
{
DSL_BND_MASTER = 0,
DSL_BND_SLAVE = 1
} DSL_CPE_BND_MsStatus_t;
/*
LineMonitorStateMachine
*/
typedef struct {
DSL_uint16_t Port;
DSL_uint16_t PafAvailable;
DSL_uint16_t RemotePafAvailable;
DSL_uint16_t PafAggregate;
DSL_uint16_t PafEnable;
DSL_uint32_t TxDataRate;
DSL_CPE_BND_MsStatus_t MsStatus;
} DSL_CPE_BND_LineMonitorStateMachine_t;
/*
LineBondingConfiguration
*/
typedef struct {
/**
Indicates that a line has reached FULL_INIT during link activation handling.
SET : It will be set (to 1) for the current line in case of current line
reaches FULL_INIT line state (0x380).
RESET: It will be (unconditionally) reset (to 0) for the current line in
case of link drop happens on current line.
\note Link drop condition will be detected at its earliest possible
link activation handling state. */
DSL_boolean_t nFullInitReached;
/**
Indicates that a line received information from CO side that PAF is supported
SET : It will be set (to 1) for the current line if nFullInitReached for
the current line equals 1 and RemotePafAvailableCheck indicates that
the CO supports PAF (bonding)
RESET: It will be (unconditionally) reset (to 0) for the current line in
case of link drop happens on current line.
\note Link drop condition will be detected at its earliest possible
link activation handling state. */
DSL_boolean_t nRemotePafAvailable;
/**
Indicates that a line was disabled due to PAF configuration mismatch between both lines.
SET : It will be set (to 1) for a line in case of PAF (bonding) mismatch is
detected. Depending on the current line activation process it could
be applied to the current or the opposite line. The line for which
this flag is set will be also disabled.
RESET: It will be (unconditionally) reset (to 0) for the opposite line in
case of linkdrop happens on current line. In case of opposite line is
currently disabled it will be re-activated again.
\note Link drop condition will be detected at its earliest possible
link activation handling state. */
DSL_boolean_t nPafLineDisabled;
} DSL_CPE_BND_LineBondingConfiguration_t;
/**
Bonding Context
*/
typedef struct
{
/**
Line Monitor SM data*/
DSL_CPE_BND_LineMonitorStateMachine_t
lineMonitorStateMachine[DSL_CPE_MAX_DSL_ENTITIES];
/**
Remote discovery code*/
DSL_uint8_t remoteDiscoveryCode[6];
/**
Aggregate data state*/
DSL_uint32_t aggregateReg;
/**
CPE API Control Context*/
DSL_CPE_Control_Context_t *pCtrlCtx;
/**
TBD*/
DSL_PortMode_t nPortMode;
/**
TBD*/
DSL_boolean_t bFwRequested[DSL_CPE_MAX_DSL_ENTITIES];
/**
TBD*/
DSL_boolean_t bInitialFwRequestHandled;
/**
Paf line num firts reach FULL_INIT*/
DSL_int8_t nPafLineHandled;
/**
Line num was disabled by absent Paf*/
DSL_int8_t nPafLineDisabled;
DSL_CPE_BND_LineBondingConfiguration_t lineBondingConfig[DSL_CPE_MAX_DSL_ENTITIES];
} DSL_CPE_BND_Context_t;
/*
Function to start Bonding handling
*/
DSL_Error_t DSL_CPE_BND_Start(
DSL_CPE_Control_Context_t *pCtrlCtx,
DSL_int_t fd);
/*
Function to stop Bonding handling
*/
DSL_void_t DSL_CPE_BND_Stop(
DSL_CPE_BND_Context_t *pBndContext);
/*
Function to check the remote PAF status
*/
DSL_Error_t DSL_CPE_BND_RemotePafAvailableCheck(
DSL_int_t fd,
DSL_uint16_t *pRemotePafAvailable);
/*
Bonding handling for the Autoboot Restart Wait state
*/
DSL_Error_t DSL_CPE_BND_AutobootStatusRestartWait(
DSL_CPE_BND_Context_t *pBndCtx,
DSL_uint_t nDevice);
/*
Firmware Download for bonding
*/
DSL_Error_t DSL_CPE_BND_SyncDownloadFirmware(
DSL_CPE_BND_Context_t *pBndCtx,
DSL_int_t nDevice,
DSL_FirmwareRequestType_t nFwReqType,
DSL_PortMode_t nPortMode);
/*
Bonding handling for the Line State change
*/
DSL_Error_t DSL_CPE_BND_LineStateHandle(
DSL_CPE_BND_Context_t *pBndCtx,
DSL_int_t fd, DSL_uint_t nDevice,
DSL_LineStateValue_t nLineState,
DSL_LineStateValue_t nPrevLineState);
/*
Bonding handling for the System Interface status notification
*/
DSL_Error_t DSL_CPE_BND_SystemInterfaceStatusHandle(
DSL_CPE_BND_Context_t *pBndCtx,
DSL_int_t fd,
DSL_uint_t nDevice);
#ifdef __cplusplus
}
#endif
#endif /* _DSL_CPE_BND_VRX_H_ */

1306
src/dsl_cpe_cli.c Normal file

File diff suppressed because it is too large Load diff

233
src/dsl_cpe_cli.h Normal file
View file

@ -0,0 +1,233 @@
/******************************************************************************
Copyright 2018, Intel Corporation
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifndef DSL_CPE_CLI_H
#define DSL_CPE_CLI_H
/** \file
DSL CPE API command line interface
*/
#include "drv_dsl_cpe_api_error.h"
#include "dsl_cpe_safec_wrapper.h"
/** maximum arguments, used for spawning a shell with external commands */
#define DSL_MAX_ARGS 16
#ifdef DSL_CPE_DEBUG_DISABLE
#define USAGE "" DSL_CPE_CRLF
#endif /* DSL_CPE_DEBUG_DISABLE */
#if defined(INCLUDE_DSL_CPE_CLI_SUPPORT) | 1
/** device mask */
#define DSL_CPE_MASK_DEVICE 0x0001
/** g997 mask */
#define DSL_CPE_MASK_G997 0x0002
/** PM mask */
#define DSL_CPE_MASK_PM 0x0004
/** BND (bonding) mask */
#define DSL_CPE_MASK_BND 0x0080
/** DSM (Digital Spectrum Management/vectoring) mask */
#define DSL_CPE_MASK_DSM 0x0010
#define DSL_CPE_MASK_ALL (DSL_CPE_MASK_DEVICE | DSL_CPE_MASK_G997 | \
DSL_CPE_MASK_PM | DSL_CPE_MASK_BND | \
DSL_CPE_MASK_DSM)
/** detailed information (-h) */
#define DSL_CPE_MASK_DETAILED 0x4000
/** long form of the command */
#define DSL_CPE_MASK_LONG 0x8000
/** Deprecated CLI functions */
#define DSL_CPE_MASK_DEPRECATED 0x10000
#define DSL_CPE_CLI_CMD_ADD_COMM(short_name, long_name, pFunc, pHelp) \
DSL_CPE_CLI_CommandAdd(short_name, long_name, pFunc, pHelp, 0x0, NULL)
#define DSL_CPE_CLI_CMD_ADD_DEVICE(short_name, long_name, pFunc, pHelp) \
DSL_CPE_CLI_CommandAdd(short_name, long_name, pFunc, pHelp, 0x0, DSL_CPE_CLI_PrintHelpDevice)
#define DSL_CPE_CLI_CMD_ADD_DEVICE_1ARG(short_name, long_name, pFunc, pHelp) \
DSL_CPE_CLI_CommandAdd(short_name, long_name, pFunc, pHelp, 0x0, DSL_CPE_CLI_PrintHelpDevice1Arg)
#define DSL_CPE_CLI_CMD_ADD_DEPR(short_name, long_name, pFunc, pHelp) \
DSL_CPE_CLI_CommandAdd(short_name, long_name, pFunc, pHelp, DSL_CPE_MASK_DEPRECATED)
#define DSL_CPE_RET "nReturn=%d%s "
#define DSL_CPE_RET_VAL(ret) ret, DSL_CPE_Fd2DevStr(fd)
/** Callback for custom Help display **/
typedef DSL_Error_t (* DSL_CPE_CLI_PrintHelpCallback_t)(const DSL_char_t *psHelp,
DSL_char_t *psCmdLong,
DSL_char_t *psCmdShort,
DSL_uint32_t nCmdMask,
DSL_CPE_File_t *out);
/** Context for a registered CLI */
typedef struct DSL_CLI_Context DSL_CLI_Context_t;
/** buffer for preparing event text decoding */
extern DSL_char_t CLI_EventText[16000];
/** Exit callback with private pointer.
(pointer can be defined with \ref DSL_CPE_CLI_Register) */
typedef DSL_Error_t (*DSL_CPE_Exit_Callback_t) ( DSL_void_t* );
/** Event callback with private pointer (from \ref DSL_CPE_CLI_Register)
and text of decoded event */
typedef DSL_Error_t (*DSL_CLI_Event_Callback_t) ( DSL_void_t*, DSL_char_t* );
DSL_Error_t DSL_CPE_CLI_CommandAdd
(
DSL_char_t *name,
DSL_char_t *long_form,
DSL_int_t (*func)(DSL_int_t, DSL_char_t*, DSL_CPE_File_t*),
const DSL_char_t *psHelp,
DSL_uint32_t nCmdSortMask,
DSL_CPE_CLI_PrintHelpCallback_t printCallback
);
DSL_Error_t DSL_CPE_CLI_CommandClear(DSL_void_t);
DSL_void_t DSL_CPE_CLI_AccessCommandsRegister(DSL_void_t);
DSL_int_t DSL_CPE_CLI_CommandExecute
(
DSL_int_t fd,
DSL_char_t *cmd,
DSL_char_t *arg,
DSL_CPE_File_t *out
);
char *DSL_CPE_CLI_WhitespaceRemove(char *str);
/**
Checks if the command string includes option to display help text.
\param pCommands
user command line arguments
\return
returns 0 in case of no help request or any other value if help is
requested from user.
*/
DSL_int_t DSL_CPE_CLI_CheckHelp (const DSL_char_t * pCommands);
DSL_int_t DSL_CPE_CLI_HelpPrint
(
DSL_int_t fd,
DSL_char_t *,
DSL_CPE_File_t*
);
typedef enum
{
DSL_CLI_EQUALS = 0,
DSL_CLI_MIN,
DSL_CLI_MAX
} DSL_CLI_ParamCheckType_t;
/**
This structure is used to get resource usage statistics
data
*/
typedef struct
{
/**
Total memory allocated statically (bytes) */
DSL_uint32_t staticMemUsage;
/**
Total memory allocated dynamically (bytes) */
DSL_uint32_t dynamicMemUsage;
} DSL_CLI_ResourceUsageStatisticsData_t;
DSL_boolean_t DSL_CPE_CLI_CheckParamNumber
(
DSL_char_t *pCommands,
DSL_int_t nParams,
DSL_CLI_ParamCheckType_t nCheckType
);
DSL_Error_t DSL_CPE_CLI_Init(DSL_void_t);
DSL_Error_t DSL_CPE_CLI_Shutdown(DSL_void_t);
DSL_Error_t DSL_CPE_CLI_HandleEvent(DSL_char_t *pMsg);
#ifdef INCLUDE_DSL_RESOURCE_STATISTICS
DSL_Error_t DSL_CPE_CLI_ResourceUsageGet(
DSL_CLI_ResourceUsageStatisticsData_t *pData);
#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/
DSL_Error_t DSL_CPE_CLI_Register
(
DSL_CLI_Context_t **pNewCLIContext,
DSL_void_t *pCBContext,
DSL_CPE_Exit_Callback_t pExitCallback,
DSL_CLI_Event_Callback_t pEventCallback
);
#if defined(INCLUDE_DSL_API_CONSOLE_EXTRA) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT)
DSL_Error_t DSL_CPE_CLI_Unregister(DSL_CLI_Context_t *pCLIContext);
#endif /* #if defined(INCLUDE_DSL_API_CONSOLE_EXTRA) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT)*/
/**
Read the firmware binary from file system.
\param sFirmwareName Firmware binary file name [I]
\param pFirmware Firmware binary data [O]
\param nFirmwareSize Firmware size [O]
\remark
The data memory will be allocated via DSL_CPE_Malloc() .
It should be freed after usage with DSL_CPE_Free() .
\return
- DSL_ERROR On error
- DSL_SUCCESS Binary loaded successfully into the memory
*/
DSL_Error_t DSL_FirmwareLoad
(
DSL_char_t const *sFirmwareName,
DSL_uint8_t **pFirmware,
DSL_uint32_t *nFirmwareSize
);
/**
Write a binary to the file system.
\param sFirmwareName Firmware binary file name [I]
\param pFirmware Firmware binary data [I]
\param nFirmwareSize Firmware size [I]
\return
- DSL_ERROR On error
- DSL_SUCCESS Binary loaded successfully into the memory
*/
DSL_Error_t DSL_FirmwareWrite
(
DSL_char_t const *sFirmwareName,
DSL_uint8_t *pFirmware,
DSL_uint32_t nFirmwareSize
);
DSL_Error_t DSL_CPE_CLI_PrintHelpDevice(
const DSL_char_t *psHelp,
DSL_char_t *psCmdLong,
DSL_char_t *psCmdShort,
DSL_uint32_t nCmdMask,
DSL_CPE_File_t *out);
DSL_Error_t DSL_CPE_CLI_PrintHelpDevice1Arg(
const DSL_char_t *psHelp,
DSL_char_t *psCmdLong,
DSL_char_t *psCmdShort,
DSL_uint32_t nCmdMask,
DSL_CPE_File_t *out);
#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */
#endif /* DSL_CPE_CLI_H */

13303
src/dsl_cpe_cli_access.c Normal file

File diff suppressed because it is too large Load diff

3521
src/dsl_cpe_cli_access2.c Normal file

File diff suppressed because it is too large Load diff

11451
src/dsl_cpe_cli_autogen.c Normal file

File diff suppressed because it is too large Load diff

664
src/dsl_cpe_cli_console.c Normal file
View file

@ -0,0 +1,664 @@
/******************************************************************************
Copyright 2018, Intel Corporation
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
/** \file
DSL daemon command line interface for console (single key input)
*/
/*#define DEBUG_CONSOLE*/
/*#define DSL_INTERN*/
#include "dsl_cpe_control.h"
#include "dsl_cpe_os.h"
#include "dsl_cpe_cli.h"
#include "dsl_cpe_cli_console.h"
#include "drv_dsl_cpe_api_error.h"
#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT
#undef DSL_CCA_DBG_BLOCK
#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_CONSOLE
#define KEY_INPUT_NONE 0
#define KEY_INPUT_ENTER 1
#define KEY_INPUT_BS 2
#define KEY_INPUT_UP 3
#define KEY_INPUT_DOWN 4
#define KEY_INPUT_CHAR 5
#define DSL_CPE_MAX_CLI_LEN 1024
#ifndef WIN32
#define BOLD "\033[1;30m"
#define NORMAL "\033[0m"
#define CLREOL "\033[K"
#else
#define BOLD ""
#define NORMAL ""
#define CLREOL ""
#endif
static DSL_Error_t DSL_CPE_Console_Exit
(
DSL_void_t *pContext
);
static DSL_Error_t DSL_CPE_Console_EventCallback
(
DSL_void_t *pContext,
DSL_char_t *pMsg
);
static DSL_int_t DSL_CPE_CommandLineRead
(
DSL_char_t *str,
DSL_uint32_t len,
DSL_CPE_File_t *in,
DSL_CPE_File_t * out
);
/******************************************************************************/
#ifdef INCLUDE_DSL_API_CONSOLE_EXTRA
DSL_Error_t run_dsl_cpe_console(int fd)
{
DSL_CPE_Console_Context_t *pConsoleContext = DSL_NULL;
DSL_Error_t ret = DSL_SUCCESS;
DSL_CPE_Control_Context_t *pContext = DSL_CPE_GetGlobalContext ( );
#ifdef VXWORKS
DSL_int_t i;
DSL_int_t stdfds[3];
#endif
if (pContext == DSL_NULL)
{
DSL_CPE_FPrintf (DSL_CPE_STDOUT, DSL_CPE_PREFIX "'dsl_cpe_control' not running! Exit..." DSL_CPE_CRLF );
return DSL_ERROR;
}
#ifdef VXWORKS
/* FIXME: make sure that this console runs on the serial port (fd 3) */
for (i = 0; i < 3; ++i)
{
stdfds[i] = ioTaskStdGet(0,i);
if (stdfds[i] != ERROR)
ioTaskStdSet(0,i,3);
}
#endif
if (DSL_CPE_CLI_Init () == DSL_ERROR)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"'DSL_CPE_CLI_Init' failed" DSL_CPE_CRLF));
goto console_exit;
}
if (DSL_CPE_Console_Init (&pConsoleContext, pContext, DSL_CPE_STDIN, DSL_CPE_STDOUT) ==
DSL_ERROR)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"'DSL_CPE_Console_Init' failed! Exit..." DSL_CPE_CRLF));
ret = DSL_ERROR;
goto console_exit;
}
do
{
ret = DSL_CPE_Handle_Console (pConsoleContext);
}
while (ret != DSL_ERROR);
if (DSL_CPE_Console_Shutdown (pConsoleContext) == DSL_ERROR)
{
ret = DSL_ERROR;
goto console_exit;
}
console_exit:
#ifdef VXWORKS
/* restore stdio */
for (i = 0; i < 3; ++i)
{
if (stdfds[i] != ERROR)
ioTaskStdSet(0,i,stdfds[i]);
}
#endif
return ret;
}
#endif
DSL_Error_t DSL_CPE_Console_Init (DSL_CPE_Console_Context_t ** pConsoleRefContext,
DSL_CPE_Control_Context_t *pContext, DSL_CPE_File_t * in,
DSL_CPE_File_t * out)
{
DSL_CPE_Console_Context_t *pConsoleContext;
if (*pConsoleRefContext != DSL_NULL)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"expecting zero context pointer '*pConsoleRefContext'" DSL_CPE_CRLF));
return DSL_ERROR;
}
*pConsoleRefContext = malloc (sizeof (DSL_CPE_Console_Context_t));
if (*pConsoleRefContext == DSL_NULL)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"no memory for '*pConsoleRefContext'" DSL_CPE_CRLF));
return DSL_ERROR;
}
pConsoleContext = *pConsoleRefContext;
memset (pConsoleContext, 0x00, sizeof (*pConsoleContext));
pConsoleContext->pContext = pContext;
pConsoleContext->file_in = in;
pConsoleContext->file_out = out;
pConsoleContext->bRun = DSL_TRUE;
if (out == DSL_CPE_STDOUT)
DSL_CPE_EchoOff ();
if (in == DSL_CPE_STDIN)
DSL_CPE_KeypressSet ();
DSL_CCA_DEBUG(DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX
"Welcome to the CLI interface of DSL CPE API" DSL_CPE_CRLF));
#ifdef INCLUDE_DSL_API_CONSOLE_EXTRA
DSL_CCA_DEBUG(DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX
"Enter 'bye' to close console only." DSL_CPE_CRLF));
#endif
DSL_CCA_DEBUG(DSL_CCA_DBG_PRN, (DSL_CPE_PREFIX
"Enter 'help all' for a list of built-in commands." DSL_CPE_CRLF));
DSL_CPE_CLI_Register(&pConsoleContext->pCLIContext, pConsoleContext,
DSL_CPE_Console_Exit, DSL_CPE_Console_EventCallback);
#ifdef RTEMS
gv_pConsoleContext = pConsoleContext;
#endif /* RTEMS*/
return DSL_SUCCESS;
}
DSL_Error_t DSL_CPE_Console_Shutdown (DSL_CPE_Console_Context_t * pConsoleContext)
{
#ifdef INCLUDE_DSL_API_CONSOLE_EXTRA
if (DSL_CPE_CLI_Unregister(pConsoleContext->pCLIContext) == DSL_SUCCESS)
{
free(pConsoleContext->pCLIContext);
pConsoleContext->pCLIContext = DSL_NULL;
}
#endif
if (pConsoleContext->file_in == DSL_CPE_STDIN)
DSL_CPE_KeypressReset ();
if (pConsoleContext->file_out == DSL_CPE_STDOUT)
DSL_CPE_EchoOn ();
free(pConsoleContext);
pConsoleContext = DSL_NULL;
return DSL_SUCCESS;
}
static DSL_Error_t DSL_CPE_Console_Exit (DSL_void_t * pContext)
{
DSL_CPE_Console_Context_t *pConsoleContext = pContext;
#ifdef DEBUG_CONSOLE
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"DSL_CPE_Console_Exit() called" DSL_CPE_CRLF));
#endif
pConsoleContext->pCLIContext = DSL_NULL;
pConsoleContext->bRun = DSL_FALSE;
return DSL_SUCCESS;
}
static DSL_Error_t DSL_CPE_Console_EventCallback(
DSL_void_t *pContext,
DSL_char_t *pMsg)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_PRN, ("%s" DSL_CPE_CRLF, pMsg));
return DSL_SUCCESS;
}
/**
Read command line.
\param str Destination pointer for command line
\param len Maximum length of command line
\param in File for key input (e.g. DSL_CPE_STDIN)
\param out File for output (e.g. DSL_CPE_STDOUT)
\return
Length of command string
*/
static DSL_int_t DSL_CPE_CommandLineRead(
DSL_char_t *str,
DSL_uint32_t len,
DSL_CPE_File_t *in,
DSL_CPE_File_t *out)
{
char c, echo;
int read_len;
int blank_cnt = 0;
int first = 1;
int ret = KEY_INPUT_CHAR;
if (strlen (str))
first = 0;
len -= strlen (str);
str += strlen (str);
while (len--)
{
echo = 0;
read_len = DSL_CPE_FRead (&c, 1, 1, in);
if (read_len == 0)
{
if (DSL_CPE_Feof (in))
ret = KEY_INPUT_NONE;
goto KEY_FINISH;
}
#ifdef DEBUG_CONSOLE
else
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_CRLF " no EOF from getc()" DSL_CPE_CRLF );
#endif
if (first && (c == ' '))
{
len++;
continue;
}
first = 0;
if (c != ' ')
{
blank_cnt = 0;
}
switch (c)
{
default:
echo = c;
break;
case ' ':
if (blank_cnt)
{
len++;
str--;
}
else
{
echo = ' ';
}
blank_cnt++;
break;
/* backspace */
case 127: /* BS in Linux Terminal */
case 8: /* BS in TTY */
#ifdef DEBUG_CONSOLE
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_CRLF" DEL" DSL_CPE_CRLF );
#endif
len++;
str--;
ret = KEY_INPUT_BS;
goto KEY_FINISH;
/* tab */
case 9:
#ifdef DEBUG_CONSOLE
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_CRLF " TAB" DSL_CPE_CRLF );
#endif
break;
case '\n':
DSL_CPE_PutChar ('\n', out);
DSL_CPE_FFlush (out);
ret = KEY_INPUT_ENTER;
goto KEY_FINISH;
case 033:
read_len = DSL_CPE_FRead (&c, 1, 1, in);
if (read_len == 0)
break;
switch (c)
{
case 27:
#ifdef DEBUG_CONSOLE
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_CRLF " ESC" DSL_CPE_CRLF );
#endif
/* escape */
break;
case '[':
read_len = DSL_CPE_FRead (&c, 1, 1, in);
if (read_len == 0)
break;
switch (c)
{
case 'D':
/* left */
break;
case 'C':
/* right */
break;
case 'A':
/* up */
ret = KEY_INPUT_UP;
break;
case 'B':
/* down */
ret = KEY_INPUT_DOWN;
break;
default:
break;
}
break;
default:
break;
}
goto KEY_FINISH;
}
*str++ = c;
if (echo)
DSL_CPE_PutChar (echo, out);
DSL_CPE_FFlush (out);
}
KEY_FINISH:
*str++ = 0;
return ret;
}
/**
This function collects single key input and handles execution of commands.
\param pConsoleContext Pointer to console context structure, [I]
\return
Return values are defined within the DSL_Error_t definition
- DSL_SUCCESS if a command was completely entered and sucessful executed
- DSL_ERROR if an error occured or the command "quit" was entered
*/
DSL_Error_t DSL_CPE_Handle_Console (DSL_CPE_Console_Context_t * pConsoleContext)
{
DSL_int_t result = 0, len = 0, i = 0;
DSL_CPE_File_t *in = pConsoleContext->file_in, *out = pConsoleContext->file_out;
pConsoleContext->cmd[0] = 0;
pConsoleContext->arg[0] = 0;
memset (pConsoleContext->arg, 0x00, sizeof (pConsoleContext->arg));
DSL_CPE_FPrintf(out, "" DSL_CPE_CRLF );
ARROW_KEY:
DSL_CPE_FPrintf(out, "\r" CLREOL BOLD "DSL_CPE#>" NORMAL "%s", pConsoleContext->arg);
DSL_CPE_FFlush (out);
i = pConsoleContext->old_idx;
NEW_LOOP:
#ifndef RTEMS
/* read command line */
switch (DSL_CPE_CommandLineRead
(pConsoleContext->arg, DSL_MAX_COMMAND_LINE_LENGTH, in, out))
{
case KEY_INPUT_UP:
if (pConsoleContext->old_idx)
pConsoleContext->old_idx--;
else
pConsoleContext->old_idx = MAX_OLD_COMMAND - 1;
if (strlen (pConsoleContext->old_command[pConsoleContext->old_idx]))
{
cpe_control_strncpy_s(pConsoleContext->arg,
DSL_MAX_COMMAND_LINE_LENGTH,
pConsoleContext->old_command[pConsoleContext->old_idx],
strlen(pConsoleContext->old_command[pConsoleContext->old_idx]));
goto ARROW_KEY;
}
else
{
pConsoleContext->old_idx = i;
goto NEW_LOOP;
}
case KEY_INPUT_DOWN:
if (++pConsoleContext->old_idx >= MAX_OLD_COMMAND)
pConsoleContext->old_idx = 0;
if (strlen (pConsoleContext->old_command[pConsoleContext->old_idx]))
{
if (pConsoleContext->old_idx >= MAX_OLD_COMMAND)
pConsoleContext->old_idx = 0;
cpe_control_strncpy_s(pConsoleContext->arg,
DSL_MAX_COMMAND_LINE_LENGTH,
pConsoleContext->old_command[pConsoleContext->old_idx],
strlen(pConsoleContext->old_command[pConsoleContext->old_idx]));
goto ARROW_KEY;
}
else
{
pConsoleContext->old_idx = i;
goto NEW_LOOP;
}
case KEY_INPUT_BS:
/* backspace */
goto ARROW_KEY;
case KEY_INPUT_NONE:
if (pConsoleContext->bRun == DSL_FALSE)
{
/* indicate command "quit" */
return DSL_ERROR;
/* DSL_CPE_FPrintf(DSL_CPE_STDOUT, "KEY_INPUT_NONE" DSL_CPE_CRLF ); */
/* DSL_CPE_Sleep(1); */
}
goto NEW_LOOP;
default:
break;
}
if (pConsoleContext->bRun == DSL_FALSE)
/* indicate command "quit" */
return DSL_ERROR;
#else
while(gv_dsl_cli_wait==0)
{
DSL_CPE_Sleep(1);
}
gv_dsl_cli_wait = 0;
#endif /* RTEMS*/
/* get command name */
sscanf (pConsoleContext->arg, "%"_MKSTR(_DSL_MAX_COMMAND_LINE_LENGTH)"s", pConsoleContext->cmd);
len = (DSL_int_t) strlen (pConsoleContext->cmd);
if (len)
{
#ifdef INCLUDE_DSL_API_CONSOLE_EXTRA
if (strcmp(pConsoleContext->cmd, "bye") == 0)
{
/* indicate command "bye" */
return DSL_ERROR;
}
#endif /* INCLUDE_DSL_API_CONSOLE_EXTRA */
if (strcmp
(pConsoleContext->old_command[pConsoleContext->prev_idx],
pConsoleContext->arg) != 0)
{
cpe_control_strncpy_s(pConsoleContext->old_command[pConsoleContext->idx],
sizeof(pConsoleContext->old_command[pConsoleContext->idx]),
pConsoleContext->arg, sizeof(pConsoleContext->arg));
pConsoleContext->prev_idx = pConsoleContext->idx;
if (++pConsoleContext->idx >= MAX_OLD_COMMAND)
pConsoleContext->idx = 0;
}
pConsoleContext->old_idx = pConsoleContext->idx;
/* find function by name and execute it */
result =
DSL_CPE_CliDeviceCommandExecute (pConsoleContext->pContext, -1,
pConsoleContext->cmd, pConsoleContext->arg + len + 1, out);
}
if (result == 1)
{
/* indicate command "quit" */
return DSL_ERROR;
}
return DSL_SUCCESS;
}
#if defined(RTEMS) && defined(INCLUDE_DSL_CPE_CLI_SUPPORT)
DSL_CPE_Console_Context_t *gv_pConsoleContext = DSL_NULL;
DSL_uint32_t gv_dsl_cli_wait=0;
/******************************************************************************/
// call from cpe_test.c
/*
KAv: Should be renamed to DSL_CPE_CommandHandle
*/
DSL_Error_t DSL_CPE_Handle_Command (char *cmd)
{
DSL_CPE_Console_Context_t * pConsoleContext = gv_pConsoleContext;
DSL_int_t result, len;
DSL_int32_t fd = DSL_NULL;
DSL_CPE_File_t *out = pConsoleContext->file_out;
if (gv_pConsoleContext == DSL_NULL)
{
DSL_CPE_FPrintf (DSL_CPE_STDOUT, DSL_CPE_PREFIX "'DSL_CPE_Handle_Command' Console not initilized..." DSL_CPE_CRLF );
return DSL_ERROR;
}
fd = pConsoleContext->fd;
cpe_control_strncpy_s(gv_pConsoleContext->arg, sizeof(gv_pConsoleContext->arg), cmd, sizeof(gv_pConsoleContext->arg));
/* get command name */
sscanf (pConsoleContext->arg, "%s", pConsoleContext->cmd);
len = (DSL_int_t) strlen (pConsoleContext->cmd);
if (len)
{
cpe_control_strncpy_s(pConsoleContext->arg, sizeof(pConsoleContext->arg), cmd, sizeof(pConsoleContext->arg));
}
/* find function by name and execute it */
result = DSL_CPE_CliDeviceCommandExecute(
pConsoleContext->pContext, -1,
pConsoleContext->cmd,
pConsoleContext->arg + len + 1, out);
if (result == 1)
{
/* indicate command "quit" */
return DSL_ERROR;
}
return DSL_SUCCESS;
}
// call from adsl_dbg.c: adsl_dbg_cmd()
void rtems_DSL_CPE_Handle_Console(char *cmd)
{
while(gv_dsl_cli_wait==1)
{
DSL_CPE_Sleep (1);
}
if (gv_pConsoleContext == DSL_NULL)
{
DSL_CPE_FPrintf (DSL_CPE_STDOUT, DSL_CPE_PREFIX "'rtems_DSL_CPE_Handle_Console' Console not initilized..." DSL_CPE_CRLF );
return DSL_ERROR;
}
cpe_control_strncpy_s(gv_pConsoleContext->arg, sizeof(gv_pConsoleContext->arg), cmd, sizeof(gv_pConsoleContext->arg));
// DSL_CPE_Handle_Console (gv_pConsoleContext);
gv_dsl_cli_wait=1;
}
/*
Implementation below moved from the adsl_dbg.c module
*/
#undef DBG_TARGET
#define DBG_TARGET DIO_NONE
/* adsl_dbg_help -- ATM debug help module callback. */
static void adsl_dbg_help (void)
{
tty_print ("Following ADSL commands are available:\r\n");
tty_print ("dpt : Run DSL production test (with 100 Ohm resistor)\r\n");
tty_print ("other commands : Controlled by DSL CPE Control API:\r\n");
/* call DSL-API CLI handler */
rtems_DSL_CPE_Handle_Console("help");
}
/* adsl_dbg_cmd -- ADSL debug command module callback. */
unsigned long adsl_dbg_cmd (char *str, int *idx, char *cmd)
{
#ifdef INCLUDE_DSL_CPE_PRODUCTION_TEST_SUPPORT
if (!astrncmp (str, "dpt", 3))
{
/* DSL Production test */
dsl_cpe_test();
}
else
#endif /* INCLUDE_DSL_CPE_PRODUCTION_TEST_SUPPORT*/
{
/* call DSL-API CLI handler */
rtems_DSL_CPE_Handle_Console(str);
}
return (1); // 0= command not defined
}
void adsl_dbg_init (void)
{
dbg_link ("ADSL", adsl_dbg_help, adsl_dbg_cmd);
}
#endif /* defined(RTEMS) && defined(INCLUDE_DSL_CPE_CLI_SUPPORT)*/
#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/

58
src/dsl_cpe_cli_console.h Normal file
View file

@ -0,0 +1,58 @@
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifndef DSL_CPE_CLI_CONSOLE_H
#define DSL_CPE_CLI_CONSOLE_H
/** \file
DSL daemon command line interface for console (single key input)
*/
/** \defgroup LIB_DSL_CLI_CON_CONF Configuration of DSL CPE API console
@{ */
/** maximum length of command line */
#define _DSL_MAX_COMMAND_LINE_LENGTH 255
/** maximum length of command line */
#define DSL_MAX_COMMAND_LINE_LENGTH 256
/** maximum length of command names */
#define DSL_MAX_FUNCTION_NAME_LENGTH 64
/** maximum of history elements */
#define MAX_OLD_COMMAND 16
/** @} */
struct DSL_CPE_Console_Context
{
DSL_char_t old_command[MAX_OLD_COMMAND][DSL_MAX_COMMAND_LINE_LENGTH];
DSL_char_t arg[DSL_MAX_COMMAND_LINE_LENGTH];
DSL_char_t cmd[DSL_MAX_FUNCTION_NAME_LENGTH];
DSL_CPE_Control_Context_t *pContext;
DSL_int_t idx;
DSL_int_t old_idx;
DSL_int_t prev_idx;
DSL_CPE_File_t *file_in;
DSL_CPE_File_t *file_out;
volatile DSL_boolean_t bRun;
DSL_CLI_Context_t *pCLIContext;
};
/** Context for console (including simple "editor") */
typedef struct DSL_CPE_Console_Context DSL_CPE_Console_Context_t;
DSL_Error_t DSL_CPE_Console_Init (DSL_CPE_Console_Context_t ** pConsoleRefContext,
DSL_CPE_Control_Context_t *pContext, DSL_CPE_File_t * in,
DSL_CPE_File_t * out);
DSL_Error_t DSL_CPE_Console_Shutdown(DSL_CPE_Console_Context_t *pConsoleContext);
DSL_Error_t DSL_CPE_Handle_Console(DSL_CPE_Console_Context_t *pConsoleContext);
#endif /* DSL_CPE_CLI_CONSOLE_H */

1986
src/dsl_cpe_cli_mib.c Normal file

File diff suppressed because it is too large Load diff

402
src/dsl_cpe_cli_pipe.c Normal file
View file

@ -0,0 +1,402 @@
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
/** \file
DSL CPE Control Application command line interface for pipe
*/
#include "dsl_cpe_control.h"
#ifndef DSL_CPE_REMOVE_PIPE_SUPPORT
#include "dsl_cpe_cli.h"
#undef DSL_CCA_DBG_BLOCK
#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_PIPE
#ifndef MAX_CLI_PIPES
#define MAX_CLI_PIPES 1
#endif
#ifndef MAX_CLI_PIPE_CMD_LEN
#define MAX_CLI_PIPE_CMD_LEN 1024
#endif
#define PIPE_NAME_FORMAT "dsl_cpe%d_%s"
#define DTI_PIPE_NAME_FORMAT "dsl_cpe_dti%d_%s"
#define PIPE_DEBUG 1
typedef struct Pipe_env_s Pipe_env_t;
struct Pipe_env_s
{
/** reference to registered CLI */
DSL_CLI_Context_t *pCLIContext;
/** running status of pipe task */
volatile DSL_boolean_t bRun;
/** thread id of the pipe task */
DSL_CPE_ThreadCtrl_t control;
/** number of this pipe interface */
DSL_int_t number;
/** name of event pipe */
DSL_char_t namePipeEvent[32];
/** command buffer */
DSL_char_t cmd_buffer[MAX_CLI_PIPE_CMD_LEN];
DSL_CPE_File_t *pipe_in;
DSL_CPE_File_t *pipe_out;
};
#ifdef INCLUDE_DTI_AGENT_STANDALONE_SUPPORT
static Pipe_env_t PipeEnv[MAX_CLI_PIPES + 1];
#else
static Pipe_env_t PipeEnv[MAX_CLI_PIPES];
#endif /* INCLUDE_DTI_AGENT_STANDALONE_SUPPORT */
static DSL_Error_t DSL_CPE_Pipe_Exit(DSL_void_t *pContext);
static DSL_int_t DSL_CPE_Pipe_Task(DSL_CPE_Thread_Params_t *params);
static DSL_Error_t DSL_CPE_Pipe_Event(DSL_void_t *pContext, DSL_char_t *pMessage);
static DSL_Error_t DSL_CPE_Pipe_CreateCliEntry(DSL_CPE_Control_Context_t *pContext,
Pipe_env_t *pPipeEnv,
DSL_char_t *pipeNameFormat,
DSL_int_t nPipeNum);
/******************************************************************************/
DSL_Error_t DSL_CPE_Pipe_Init(DSL_CPE_Control_Context_t *pContext)
{
DSL_int_t i = 0;
DSL_Error_t ret = DSL_SUCCESS;
for (i = 0; i < MAX_CLI_PIPES; i++)
{
ret = DSL_CPE_Pipe_CreateCliEntry(pContext, &PipeEnv[i], PIPE_NAME_FORMAT, i);
if (ret < DSL_SUCCESS)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"DSL_CPE_Pipe_Init: could not create "
PIPE_NAME_FORMAT DSL_CPE_CRLF, i, " pipe"));
}
}
#ifdef INCLUDE_DTI_AGENT_STANDALONE_SUPPORT
ret = DSL_CPE_Pipe_CreateCliEntry(pContext,
&PipeEnv[i],
DTI_PIPE_NAME_FORMAT,
i);
if (ret < DSL_SUCCESS)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"DSL_CPE_Pipe_Init: could not create "
DTI_PIPE_NAME_FORMAT DSL_CPE_CRLF, MAX_CLI_PIPES, " pipe"));
}
#endif /* INCLUDE_DTI_AGENT_STANDALONE_SUPPORT */
return ret;
}
DSL_Error_t DSL_CPE_Pipe_CreateCliEntry(DSL_CPE_Control_Context_t *pContext,
Pipe_env_t *pPipeEnv,
DSL_char_t *pipeNameFormat,
DSL_int_t nPipeNum)
{
DSL_Error_t ret = DSL_SUCCESS;
DSL_char_t Name[32];
memset(pPipeEnv, 0, sizeof(Pipe_env_t));
/* remember own number */
pPipeEnv->number = nPipeNum;
DSL_CPE_snprintf(Name, sizeof(Name), pipeNameFormat, nPipeNum, "cmd");
ret = DSL_CPE_PipeCreate(Name);
if (ret < DSL_SUCCESS)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"DSL_CPE_PipeCreate: could not create %s pipe"
DSL_CPE_CRLF, Name));
}
DSL_CPE_snprintf(Name, sizeof(Name), pipeNameFormat, nPipeNum, "ack");
ret = DSL_CPE_PipeCreate(Name);
if (ret < DSL_SUCCESS)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"DSL_CPE_PipeCreate: could not create %s pipe"
DSL_CPE_CRLF, Name));
}
DSL_CPE_snprintf(pPipeEnv->namePipeEvent, sizeof(pPipeEnv->namePipeEvent),
pipeNameFormat, nPipeNum, "event");
ret = DSL_CPE_PipeCreate(pPipeEnv->namePipeEvent);
if (ret < DSL_SUCCESS)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"DSL_CPE_PipeCreate: could not create %s pipe"
DSL_CPE_CRLF, pPipeEnv->namePipeEvent));
}
DSL_CPE_snprintf(Name, sizeof(Name), "tPipe_%d", nPipeNum);
pPipeEnv->bRun = DSL_TRUE;
/* start task to handle pipe */
DSL_CPE_ThreadInit(&pPipeEnv->control, Name, DSL_CPE_Pipe_Task,
DSL_CPE_PIPE_STACK_SIZE, DSL_CPE_PIPE_PRIORITY, (DSL_uint32_t)pContext,
(DSL_uint32_t)pPipeEnv);
return DSL_CPE_CLI_Register(&pPipeEnv->pCLIContext,
pPipeEnv,
DSL_CPE_Pipe_Exit,
DSL_CPE_Pipe_Event);
}
static DSL_Error_t DSL_CPE_Pipe_Exit(DSL_void_t *pContext)
{
Pipe_env_t *env = pContext;
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (DSL_CPE_PREFIX
"DSL_CPE_Pipe_Exit(%d)" DSL_CPE_CRLF, env->number));
/*env->bRun = DSL_FALSE;*/
DSL_CPE_ThreadShutdown(&env->control, 1000);
if (env->pipe_in != DSL_NULL)
{
DSL_CPE_PipeClose(env->pipe_in);
env->pipe_in = DSL_NULL;
}
/* wait for task to exit */
/*DSL_CPE_MSecSleep(200);*/
return DSL_SUCCESS;
}
/**
Split the command buffer in single lines and execute them
*/
static DSL_int_t DSL_CPE_Pipe_Exec(DSL_Context_t * pContext, DSL_char_t *pCommand,
DSL_int_t len, DSL_CPE_File_t *out)
{
DSL_int_t ret=0;
DSL_char_t *arg = DSL_NULL;
DSL_char_t *line, *tokbuf;
DSL_char_t *cmd, *cmd_tok;
line = strtok_r(pCommand, "" DSL_CPE_CRLF , &tokbuf);
if (line == DSL_NULL)
{
DSL_CPE_CLI_CommandExecute (0, DSL_NULL, DSL_NULL, out);
}
else
{
while (line != DSL_NULL)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, ("line = *%s*" DSL_CPE_CRLF, line));
if (strlen(line)>0)
{
/* get command name */
cmd = strtok_r(line, " \t" DSL_CPE_CRLF , &cmd_tok);
if (cmd == DSL_NULL)
{
goto skip;
}
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, ("cmd = *%s*" DSL_CPE_CRLF, cmd));
arg = strtok_r(NULL, "" DSL_CPE_CRLF , &cmd_tok);
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, ("arg ="));
if (arg != DSL_NULL)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, ("*%s*" DSL_CPE_CRLF , arg));
}
else
{
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, ("*NULL*" DSL_CPE_CRLF));
}
if (DSL_CPE_CliDeviceCommandExecute(DSL_CPE_GetGlobalContext(), -1, cmd, arg, out) == 1)
{
/* "quit" was found, ignore following commands */
return 1;
}
}
skip:
line = strtok_r(NULL, "" DSL_CPE_CRLF , &tokbuf);
};
}
return ret;
}
/**
Task for handling the commands received in the ..._cmd pipe
*/
static DSL_int_t DSL_CPE_Pipe_Task(DSL_CPE_Thread_Params_t *params)
{
DSL_Context_t * pContext = (DSL_Context_t *)params->nArg1;
Pipe_env_t *pPipeEnv = (Pipe_env_t *)params->nArg2;
DSL_char_t pipe_name_cmd[50];
DSL_char_t pipe_name_ack[50];
DSL_char_t *pPipeFormat = DSL_NULL;
DSL_int_t len = 0;
DSL_int_t ret = 0;
if (pPipeEnv == DSL_NULL) {
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (
"DSL_CPE_Pipe_Task() started failed, pipe env is NULL" DSL_CPE_CRLF));
return -1;
}
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (
" DSL_CPE_Pipe_Task(%d) started" DSL_CPE_CRLF , pPipeEnv->number));
if (pPipeEnv->number == MAX_CLI_PIPES)
{
pPipeFormat = DTI_PIPE_NAME_FORMAT;
}
else
{
pPipeFormat = PIPE_NAME_FORMAT;
}
DSL_CPE_snprintf(pipe_name_ack, sizeof(pipe_name_ack), pPipeFormat,
pPipeEnv->number, "ack");
DSL_CPE_snprintf(pipe_name_cmd, sizeof(pipe_name_cmd), pPipeFormat,
pPipeEnv->number, "cmd");
do
{
pPipeEnv->pipe_in = DSL_CPE_PipeOpen(pipe_name_cmd, DSL_TRUE, DSL_TRUE);
if (pPipeEnv->pipe_in == DSL_NULL)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (
"DSL_CPE_Pipe_Task() cannot open %s, errno=%d" DSL_CPE_CRLF , pipe_name_cmd, errno));
ret = -1;
goto error;
}
if (!pPipeEnv->bRun)
{
break;
}
memset(&pPipeEnv->cmd_buffer[0], 0,
sizeof(pPipeEnv->cmd_buffer));
len = sizeof(pPipeEnv->cmd_buffer);
#ifndef _lint
if (len>0)
#endif /* _lint*/
{
ret = DSL_CPE_FRead(&pPipeEnv->cmd_buffer[0], 1, (DSL_uint32_t)len, pPipeEnv->pipe_in);
if (!pPipeEnv->bRun)
{
break;
}
if (ret>0)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (
"Pipe%d: cmd len %d, feof=%d ferror=%d " DSL_CPE_CRLF "%s" DSL_CPE_CRLF,
pPipeEnv->number, len,
feof(pPipeEnv->pipe_in),
ferror(pPipeEnv->pipe_in),
pPipeEnv->cmd_buffer));
DSL_CPE_PipeClose(pPipeEnv->pipe_in);
pPipeEnv->pipe_in = DSL_NULL;
pPipeEnv->pipe_out = DSL_CPE_PipeOpen(pipe_name_ack, DSL_FALSE, DSL_TRUE);
if (pPipeEnv->pipe_out == DSL_NULL)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (
"DSL_CPE_Pipe_Task() cannot open %s" DSL_CPE_CRLF, pipe_name_ack));
ret = -1;
goto error;
}
DSL_CPE_Pipe_Exec(pContext, pPipeEnv->cmd_buffer,
len, pPipeEnv->pipe_out);
DSL_CPE_FFlush(pPipeEnv->pipe_out);
DSL_CPE_PipeClose(pPipeEnv->pipe_out);
pPipeEnv->pipe_out = DSL_NULL;
}
else
{
DSL_CPE_PipeClose(pPipeEnv->pipe_in);
pPipeEnv->pipe_in = DSL_NULL;
DSL_CPE_MSecSleep(50);
}
}
} while (pPipeEnv->bRun);
error:
if (pPipeEnv->pipe_out != DSL_NULL)
{
DSL_CPE_PipeClose(pPipeEnv->pipe_out);
pPipeEnv->pipe_out = DSL_NULL;
}
if (pPipeEnv->pipe_in != DSL_NULL)
{
DSL_CPE_PipeClose(pPipeEnv->pipe_in);
pPipeEnv->pipe_in = DSL_NULL;
}
DSL_CCA_DEBUG(DSL_CCA_DBG_MSG, (
" DSL_CPE_Pipe_Task(%d) exit" DSL_CPE_CRLF , pPipeEnv->number));
return ret;
}
static DSL_Error_t DSL_CPE_Pipe_Event(DSL_void_t *pContext, DSL_char_t *pMessage)
{
DSL_CPE_File_t *file;
Pipe_env_t *env = pContext;
file = DSL_CPE_PipeOpen(env->namePipeEvent, DSL_FALSE, DSL_FALSE);
if (file != DSL_NULL)
{
if (fprintf(file, "%s" DSL_CPE_CRLF, pMessage) <= 0)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (
"Pipe[%d]Event: Error %d during print!" DSL_CPE_CRLF, env->number, errno));
}
DSL_CPE_PipeClose(file);
}
return DSL_SUCCESS;
}
#ifdef INCLUDE_DSL_RESOURCE_STATISTICS
DSL_Error_t DSL_CPE_Pipe_StaticResourceUsageGet(DSL_uint32_t *pStatResUsage)
{
if (pStatResUsage == DSL_NULL)
{
return DSL_ERROR;
}
else
{
*pStatResUsage = sizeof(PipeEnv);
return DSL_SUCCESS;
}
}
#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/
#endif /* DSL_CPE_REMOVE_PIPE_SUPPORT */

2974
src/dsl_cpe_cli_vrx.c Normal file

File diff suppressed because it is too large Load diff

300
src/dsl_cpe_config.h.in Normal file
View file

@ -0,0 +1,300 @@
/* src/dsl_cpe_config.h.in. Generated from configure.in by autoheader. */
#ifndef _DSL_CPE_CONFIG_H
#define _DSL_CPE_CONFIG_H
/* Debug level = local */
#undef DSL_CCA_DBG_MAX_LEVEL_PRE
/* Preselection of max. debug level = no (using default) */
#undef DSL_CCA_DBG_MAX_LEVEL_SET
/* Disabled debug prints */
#undef DSL_CPE_DEBUG_DISABLE
/* Debug netlink ID number. */
#undef DSL_DBG_MSG_NETLINK_ID
/* Include DSL TCP debug support */
#undef DSL_DEBUG_TOOL_INTERFACE
/* Add VR10 support */
#undef DSL_VRX_DEVICE_VR10
/* Add VR10_320 support */
#undef DSL_VRX_DEVICE_VR10_320
/* Add VR11 support */
#undef DSL_VRX_DEVICE_VR11
/* Add VR9 support */
#undef DSL_VRX_DEVICE_VR9
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the <float.h> header file. */
#undef HAVE_FLOAT_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <json-c/json.h> header file. */
#undef HAVE_JSON_C_JSON_H
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define to 1 if you have the <safe_lib.h> header file. */
#undef HAVE_SAFE_LIB_H
/* Define to 1 if stdbool.h conforms to C99. */
#undef HAVE_STDBOOL_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if the system has the type `_Bool'. */
#undef HAVE__BOOL
/* Include deprecated functions */
#undef INCLUDE_DEPRECATED
/* Include Device Exception Codes */
#undef INCLUDE_DEVICE_EXCEPTION_CODES
/* Include ADSL MIB support */
#undef INCLUDE_DSL_ADSL_MIB
/* Include DSL CEOC support */
#undef INCLUDE_DSL_CEOC
/* Include configuration get support */
#undef INCLUDE_DSL_CONFIG_GET
/* Add DANUBE support */
#undef INCLUDE_DSL_CPE_API_DANUBE
/* Add VRX support */
#undef INCLUDE_DSL_CPE_API_VRX
/* Enable Autogen CLI support */
#undef INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT
/* Enable CLI support */
#undef INCLUDE_DSL_CPE_CLI_SUPPORT
/* Enable CMV scripts math support */
#undef INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH
/* Enable CMV scripts parser support */
#undef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT
/* Enable debug logger support */
#undef INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT
/* Include DTI support */
#undef INCLUDE_DSL_CPE_DTI_SUPPORT
/* Include filesystem support */
#undef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT
/* Include IFXOS support */
#undef INCLUDE_DSL_CPE_IFXOS_SUPPORT
/* Include Misc Line Status support */
#undef INCLUDE_DSL_CPE_MISC_LINE_STATUS
/* Include DSL PM channel counters support */
#undef INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS
/* Include DSL PM channel extended counters support */
#undef INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS
/* Include DSL PM channel thresholds support */
#undef INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS
/* Include PM config support */
#undef INCLUDE_DSL_CPE_PM_CONFIG
/* Include DSL PM datapath counters support */
#undef INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS
/* Include DSL PM datapath failure counters support */
#undef INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS
/* Include DSL PM datapath thresholds support */
#undef INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS
/* Include DSL PM history support */
#undef INCLUDE_DSL_CPE_PM_HISTORY
/* Include DSL PM line counters support */
#undef INCLUDE_DSL_CPE_PM_LINE_COUNTERS
/* Include DSL PM line event showtime counters support */
#undef INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS
/* Include DSL PM line thresholds support */
#undef INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS
/* Include DSL PM optional parameters support */
#undef INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS
/* Include DSL PM retransmission counters support */
#undef INCLUDE_DSL_CPE_PM_RETX_COUNTERS
/* Include DSL PM retransmission thresholds support */
#undef INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS
/* Include DSL PM showtime counters support */
#undef INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS
/* Include DSL PM total counters support */
#undef INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS
/* Include ADSL showtime event logging support */
#undef INCLUDE_DSL_CPE_TRACE_BUFFER
/* Include DELT support */
#undef INCLUDE_DSL_DELT
/* Include FW request support */
#undef INCLUDE_DSL_EVENT_POLLING
/* Include Filter Detection support */
#undef INCLUDE_DSL_FILTER_DETECTION
/* Include Framing Parameters support */
#undef INCLUDE_DSL_FRAMING_PARAMETERS
/* Include G997 alarm support */
#undef INCLUDE_DSL_G997_ALARM
/* Include G997 Framing Parameters support */
#undef INCLUDE_DSL_G997_FRAMING_PARAMETERS
/* Include G997 Line Inventory support */
#undef INCLUDE_DSL_G997_LINE_INVENTORY
/* Include G997 per tone values support */
#undef INCLUDE_DSL_G997_PER_TONE
/* Include G997 status support */
#undef INCLUDE_DSL_G997_STATUS
/* Include JSON parsing */
#undef INCLUDE_DSL_JSON_PARSING
/* Include DSL PM support */
#undef INCLUDE_DSL_PM
/* Include Resource Statistics support */
#undef INCLUDE_DSL_RESOURCE_STATISTICS
/* Include System Interface configuration support */
#undef INCLUDE_DSL_SYSTEM_INTERFACE
/* Enable DTI stand-alone agent support */
#undef INCLUDE_DTI_AGENT_STANDALONE_SUPPORT
/* Include FW request support */
#undef INCLUDE_FW_REQUEST_SUPPORT
/* Pilot Tones Status support */
#undef INCLUDE_PILOT_TONES_STATUS
/* Include DSL RTT support */
#undef INCLUDE_REAL_TIME_TRACE
/* Enable script notification support */
#undef INCLUDE_SCRIPT_NOTIFICATION
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Safe-C lib ver3.3 support */
#undef SAFEC_SUPPORT
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME
/* Version number of package */
#undef VERSION
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
/* Define to empty if the keyword `volatile' does not work. Warning: valid
code using `volatile' can become incorrect without. Disable with care. */
#undef volatile
#endif /* _DSL_CPE_CONFIG_H */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,352 @@
/******************************************************************************
Copyright 2018 - 2019 Intel Corporation
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
*******************************************************************************/
#ifndef _DSL_CPE_CONFIGURATION_PARSER_H
#define _DSL_CPE_CONFIGURATION_PARSER_H
#if defined(INCLUDE_DSL_JSON_PARSING) && (INCLUDE_DSL_JSON_PARSING == 1)
typedef struct
{
/**
NextMode (DSL) to be used on API startup
Only of relevance if xDSL multimode is enabled by using VDSL and ADSL
G997 XTU octet bits.
NextMode
0: use API-default value (if A+V modes are selected VDSL will be used)
1: use ADSL mode as initial one for multimode handling
2: use VDSL mode as initial one for multimode handling
*/
unsigned int nNextMode;
/** MaxDeviceNumber provided by the MEI Driver */
unsigned int nMaxDeviceNumber;
/** LinesPerDevice provided by the MEI Driver */
unsigned int nLinesPerDevice;
/** ChannelsPerLine provided by the MEI Driver */
unsigned int nChannelsPerLine;
} DSL_CFG_StartupInit_t;
typedef struct
{
/** Bitswap config for US in VDSL */
bool Us_Vdsl;
/** Bitswap config for DS in VDSL */
bool Ds_Vdsl;
/** Bitswap config for US in ADSL */
bool Us_Adsl;
/** Bitswap config for DS in ADSL */
bool Ds_Adsl;
} DSL_CFG_Bitswap_t;
typedef struct
{
/** Retransmission config for US in ADSL */
unsigned int Us_Adsl;
/** Retransmission config for DS in ADSL */
unsigned int Ds_Adsl;
/** Retransmission config for US in VDSL */
unsigned int Us_Vdsl;
/** Retransmission config for DS in VDSL */
unsigned int Ds_Vdsl;
} DSL_CFG_Retransmission_t;
typedef struct
{
/** SRA config for US in ADSL */
unsigned int Us_Adsl;
/** SRA config for DS in ADSL */
unsigned int Ds_Adsl;
/** SRA config for US in VDSL */
unsigned int Us_Vdsl;
/** SRA config for DS in VDSL */
unsigned int Ds_Vdsl;
} DSL_CFG_Sra_t;
typedef struct
{
/** Virtual Noise config for US */
bool Us;
/** Virtual Noise config for DS */
bool Ds;
} DSL_CFG_VirtualNoise_t;
typedef struct
{
/**
The value selects the activated reboot criteria's according to the
following bitmask definitions.
Please note that some values are used only within ADSL or VDSL. For
details please refer to the UMPR of the DSL CPE API.
DEFAULT value for ADSL is "4F"
DEFAULT value for VDSL is "F"
0: CLEANED (no reboot criteria active)
1: LOM - default ON
2: LOF - default ON
4: LOS - default ON
8: ESE - default ON
10: ES90 - default OFF
20: SES30 - default OFF
40: NEGATIVE_MARGIN - default ON for ADSL / OFF for VDSL
80: OOS_BC0 - default OFF
100: OOS_BC1 - default OFF
200: NCD_BC0 - default OFF
400: NCD_BC1 - default OFF
800: LCD_BC0 - default OFF
1000: LCD_BC1 - default OFF
*/
unsigned int Adsl;
unsigned int Vdsl;
} DSL_CFG_RebootCriteria_t;
typedef struct
{
/**
The value selects the activated handshake tones according to the
following bitmask definitions.
The default values are related to the DSL operation mode. Please refer to
the UMPR of the DSL CPE API for all details.
1: VDSL2 B43
2: VDSL2 A43
4: VDSL2 V43
8: VDSL1 V43POTS
10: VDSL1 V43ISDN
20: ADSL1 C43
40: ADSL2 J43
80: ADSL2 B43C
100: ADSL2 A43C
*/
unsigned int Adsl;
unsigned int Vdsl;
} DSL_CFG_LowLevelHsTones_t;
typedef struct
{
/**
The value selects the system interface configuration for ADSL and VDSL modes
according to the following bitmask definitions:
0: Use API internal defaults
1: ATM-TC
2: EFM/PTM-TC
4: Auto-TC
*/
unsigned int nTcLayer_Adsl;
unsigned int nTcLayer_Vdsl;
} DSL_CFG_SystemInterface_t;
typedef struct
{
/**
Configuration of test and debug interface usage
0: Do not use debug and test interfaces.
Independent from feature availability.
1: Use debug and test interfaces on LAN interfaces only. - DEFAULT
Dependent on feature availability.
2: Use debug and test interfaces on ALL available interfaces.
Dependent on feature availability. Former default value.
*/
unsigned int nDebugAndTestInterfaces;
} DSL_CFG_Debugging_t;
typedef struct
{
/**
The message selects a DSL operator.
The information is used to configure operator specific settings inside the DSL firmware.
*/
unsigned int nOperatorSelect;
/**
Configuration of API shutdown handling in case of using autoboot control
command "acs <nLine> 7" (DSL_CFG_AUTOBOOT_CTRL_STOP_PD)
LdAfeShutdown
0: Do not shutdown the Line Driver and the AFE
This option should be used for example in case of underlying
ISDN service is used and an impedance change of the line should
be avoided
1: Shutdown the Line Driver and the AFE - DEFAULT
This option is selected by default and make use of a specific DSL FW
messages (if supported) to power down the LD/AFE
*/
unsigned int LdAfeShutdown;
/**
Configuration of test and debug specific vectoring setting
VectoringEnable
0: Disable any vectoring operation
1: Enables the G.993.5 full G.Vector for US and DS)
2: Enables the G.993.2 Annex Y (G.Vector friendly)
3: Enables automatic detection for the best fitting configuration
Notes:
- Vectoring is only supported for VDSL
- There are some additional conditions that needs to be fulfilled for
successful enabling of the full G.Vector functionality (Annex N)
+ DSL Firmware needs to support vectoring, means that the last digit of the
firmware version has to be "7"
+ The DSL Subsystem has to be compiled to support vectoring
*/
unsigned int VectoringEnable;
/**
VdslProfileVal
The value selects the activated Vdsl profile according to the
following bitmask definitions.
Please note that 12A/12B/17A/30A are not supported for the Dual port mode.
DEFAULT value is "0xFF" (single port mode), "0xF" (dual port mode).
1: 8A
2: 8B
4: 8C
8: 8D
10: 12A
20: 12B
40: 17A
80: 30A
100: 35B
*/
unsigned int VdslProfileVal;
/**
Configuration of Non-standard activation sequence
ActSeq
0: Automatic detection from XTSE configuration (enables Non-standard
activation sequence in case of T1.413 is enabled as well)
1: Standard Handshake (G.HS) - DEFAULT
2: Non-standard activation sequence ("Telefonica switching mode")
*/
unsigned int ActSeq;
/**
Configuration of initial activation mode
ActMode (only used if "ActMode" equals "2" or
"ActMode" equals "0" and T1.413 mode is included within XTSE octets)
1: Start with G.HS activation mode - DEFAULT
2: Start with ANSI-T1.413 activation mode
*/
unsigned int ActMode;
/**
Configuration of remember functionality used in case of activated xDSL multimode
Remember
0: disable remember functionality
1: enable remember functionality
*/
unsigned int Remember;
/**
Test and debug configuration to enable event based (autonomous FW message
handling) mode instead of polling (which is default within API and strictly
recommended to be used!)
xDSL_Dbg_FwMsgPollingOnly
0: Use autonomous FW message handling (instead of polling)
1: Use polling mode only - DEFAULT
*/
bool FWMsgPollingOnly;
DSL_CFG_LowLevelHsTones_t sLowLevelHsTonesConfig;
} DSL_CFG_Common_t;
typedef struct
{
/** Debugging configuration */
DSL_CFG_Debugging_t sDebuggingConfig;
/** StartupInit configuration */
DSL_CFG_StartupInit_t sStartupInitConfig;
/** Bitswap configuration */
DSL_CFG_Bitswap_t sBitswapConfig;
/** Retransmission configuration */
DSL_CFG_Retransmission_t sRetransmissionConfig;
/** Sra configuration */
DSL_CFG_Sra_t sSraConfig;
/** VirtualNoise configuration */
DSL_CFG_VirtualNoise_t sVirtualNoiseConfig;
/** Reboot criteria configuration */
DSL_CFG_RebootCriteria_t sRebootCriteriaConfig;
/** SystemInterface configuration */
DSL_CFG_SystemInterface_t sSystemIfConfig;
/** Common configuration */
DSL_CFG_Common_t sCommonConfig;
/**
Configuration of test and debug specific DSL activation mode settings
G997 XTU octet bits.
G997XtuVal (only used in case of "G997XtuVal" equals "1")
*/
unsigned char G997XtuVal[DSL_G997_NUM_XTSE_OCTETS];
} DSL_ConfigurationData_t;
typedef struct
{
/**
Structure that contains initialization data */
DSL_ConfigurationData_t data;
} DSL_Configuration_t;
/*
This function initialize internal structures of Configuration module.
\remark Should be called only once and at application startup.
\return Return values are defined within the \ref DSL_Error_t definition
- DSL_SUCCESS in case of success
- DSL_ERROR if operation failed
*/
DSL_Error_t DSL_CPE_ConfigInit();
/*
This function provides accesss to current configuration params.
\param pConfiguration Pointer to pointer to
DSL_Configuration_t structure, [O]
\return Return values are defined within the \ref DSL_Error_t definition
- DSL_SUCCESS in case of success
- DSL_ERROR if operation failed
*/
DSL_Error_t DSL_CPE_ConfigGet(
const DSL_Configuration_t **pConfiguration
);
/*
This function executes readout of configuration file then
validation and appliance of configuration params.
\param pControlContext Pointer to DSL CPE Control context structure, [I]
\return Return values are defined within the \ref DSL_Error_t definition
- DSL_SUCCESS in case of success
- DSL_ERROR if operation failed
*/
DSL_Error_t DSL_CPE_ConfigUpdate(
DSL_CPE_Control_Context_t *pCtrlCtx
);
#endif /* defined(INCLUDE_DSL_JSON_PARSING) && (INCLUDE_DSL_JSON_PARSING == 1) */
#endif /* _LIB_DSL_CONFIGURATION_PARSER_H */

8161
src/dsl_cpe_control.c Normal file

File diff suppressed because it is too large Load diff

564
src/dsl_cpe_control.h Normal file
View file

@ -0,0 +1,564 @@
/******************************************************************************
Copyright 2016 - 2019 Intel Corporation
Copyright 2015 - 2016 Lantiq Beteiligungs-GmbH & Co. KG
Copyright 2009 - 2014 Lantiq Deutschland GmbH
Copyright 2007 - 2008 Infineon Technologies AG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifndef _DSL_CPE_CONTROL_H
#define _DSL_CPE_CONTROL_H
/** \defgroup DSL_CPE_CONTROL Lantiq DSL CPE API Control Application
Lists the entire modules to the DSL CPE_API Control Application.
@{ */
/**
\defgroup DSL_CPE_CLI Implementation of Command Line Interface access commands
This module implements the Command Line Interface.
*/
/** @} */
#ifdef HAVE_CONFIG_H
#include "dsl_cpe_config.h"
#endif
/* To disable patch version handling set up definition below.*/
/* #define DISABLE_DSL_PATCH_VERSION*/
#ifndef DSL_DOC_GENERATION_EXCLUDE_UNWANTED
#include "dsl_cpe_os.h"
#ifdef WIN32
#include "dsl_cpe_win32.h"
#endif /* WIN32*/
/* Maximum number of FW reload retries in case of a failed FW download*/
#define DSL_CPE_MAX_FW_RELOAD_RETRY_COUNT (5)
#if defined(INCLUDE_DSL_ADSL_MIB) && defined (INCLUDE_DSL_CPE_API_VRX)
#error "MIB not supported for the VRX devices yet!!!"
#endif
extern DSL_char_t *g_sFirmwareName1;
extern DSL_FirmwareFeatures_t g_nFwFeatures1;
extern DSL_char_t *g_sFirmwareName2;
extern DSL_FirmwareFeatures_t g_nFwFeatures2;
extern DSL_uint8_t g_nDevices;
extern DSL_uint8_t g_nLines;
extern DSL_uint8_t g_nChannels;
/* Maximum lines per DSL device to support */
#define DSL_CPE_LINES_PER_DEVICE ((const DSL_uint8_t) g_nLines)
/* Maximum channels per line */
#define DSL_CPE_CHANNELS_PER_LINE ((const DSL_uint8_t) g_nChannels)
/* Configured number of devices */
#define DSL_CPE_DEVICE_NUMBER ((const DSL_uint8_t) g_nDevices)
/* Number of entries in the "bonding_group" table */
#define DSL_CPE_BND_GROUP_ENTRIES 0 /* currently not supported */
/* Bonding flag */
#define INCLUDE_DSL_BONDING (g_nLines * g_nDevices > 1)
/* Maximum number of devices */
#define DSL_CPE_DSL_ENTITIES (g_nLines * g_nDevices)
#define DSL_CPE_MAX_DEVICE_NUMBER 2
/*
#if defined(DSL_DEBUG_TOOL_INTERFACE) && (!defined(INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT))
#error "DSL Debug Interface can be used with Linux and file \
system support enabled only"
#endif
*/
#if defined(DSL_DEBUG_TOOL_INTERFACE) && !defined(INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT)
#error "Debug Tool Interface needs --enable-cmv-scripts option enabled!"
#endif
/* \todo [RTT] Temporary exclude RTT because of important bugfix is needed first! */
#if defined(INCLUDE_REAL_TIME_TRACE)
#error Real Time Trace functionality is currently not supported.
#endif
#if defined(DSL_DEBUG_TOOL_INTERFACE) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT)
#ifdef LINUX
#define DSL_DEBUG_TOOL_INTERFACE_DEFAULT_IFACE "eth0"
#elif defined(VXWORKS)
#define DSL_DEBUG_TOOL_INTERFACE_DEFAULT_IFACE "ei0"
#else
#error "OS type undefined!"
#endif
#endif /* DSL_DEBUG_TOOL_INTERFACE*/
#if defined (INCLUDE_DSL_CPE_API_DANUBE)
#define DSL_CPE_DSL_LOW_DEV "/dev/ifx_mei"
#elif defined (INCLUDE_DSL_CPE_API_VRX)
#define DSL_CPE_DSL_LOW_DEV "/dev/mei_cpe"
#else
#error "Device undefined!"
#endif
/**
This define specifies the maximum number of device instances
*/
#define DSL_CPE_MAX_DSL_ENTITIES 2
#include "drv_dsl_cpe_api.h"
#include "drv_dsl_cpe_api_types.h"
#include "drv_dsl_cpe_api_error.h"
#include "dsl_cpe_safec_wrapper.h"
#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT
#include "dsl_cpe_cli.h"
#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */
#define DSL_DEV_TIMEOUT_SELECT 1000
#define DSL_CPE_FW_CHUNK_SIZE (64 * 1024)
/*#define INCLUDE_DSL_API_CLI_LEGACY*/
/*
Security checks for configure options
*/
#if defined(INCLUDE_DSL_CPE_DTI_SUPPORT) && defined(INCLUDE_DSL_CPE_API_DANUBE)
#ifndef INCLUDE_DSL_CPE_CLI_SUPPORT
#error "DTI support for Danube requires CLI please define 'INCLUDE_DSL_CPE_CLI_SUPPORT'"
#endif
#endif /* INCLUDE_DSL_CPE_DTI_SUPPORT */
#if !defined(INCLUDE_DSL_CPE_CLI_SUPPORT)
#define DSL_CPE_REMOVE_PIPE_SUPPORT
#endif
extern DSL_boolean_t g_bWaitBeforeLinkActivation[DSL_CPE_MAX_DSL_ENTITIES];
extern DSL_boolean_t g_bWaitBeforeConfigWrite[DSL_CPE_MAX_DSL_ENTITIES];
extern DSL_boolean_t g_bWaitBeforeRestart[DSL_CPE_MAX_DSL_ENTITIES];
#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT
extern DSL_char_t *g_sAdslScript;
extern DSL_char_t *g_sVdslScript;
extern DSL_boolean_t g_bAutoContinueWaitBeforeLinkActivation[DSL_CPE_MAX_DSL_ENTITIES];
extern DSL_boolean_t g_bAutoContinueWaitBeforeConfigWrite[DSL_CPE_MAX_DSL_ENTITIES];
extern DSL_boolean_t g_bAutoContinueWaitBeforeRestart[DSL_CPE_MAX_DSL_ENTITIES];
#endif
#ifdef INCLUDE_SCRIPT_NOTIFICATION
extern DSL_char_t *g_sRcScript;
DSL_void_t DSL_CPE_ScriptRun(DSL_void_t);
#endif /* INCLUDE_SCRIPT_NOTIFICATION*/
#define MAX_WHAT_STRING_LEN 64
#define WHAT_STRING_CHUNK_LEN (64*1024)
#define DSL_CPE_DEVICE_NAME "/dev/dsl_cpe_api"
#define DSL_CPE_PREFIX "DSL_CPE: "
#define DSL_CPE_SCRIPT_PREFIX "DSL_CPE_SCRIPT: "
#define DSL_SCRIPT_PRINTF (void) DSL_CPE_FPrintf
#define DSL_SCRIPT_DEBUG(echo, body) \
{ \
if (echo) \
{ \
DSL_SCRIPT_PRINTF body; \
} \
}
#ifdef INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT
#define DSL_CPE_SHOWTIME_EVENT_LOGGING_FILENAME "/tmp/post_mortem_data.txt"
#endif
#ifndef _MKSTR_1
#define _MKSTR_1(x) #x
#define _MKSTR(x) _MKSTR_1(x)
#endif
typedef unsigned int DSL_size_t;
typedef void (DSL_CliFunction_t) (DSL_int32_t fd,
DSL_char_t *pCommands,
DSL_CPE_File_t *out);
typedef struct
{
char *sShortCommand;
char *sLongCommand;
DSL_CliFunction_t *pFunction;
} DSL_CliCommand_t;
DSL_int32_t DSL_CPE_sscanf (DSL_char_t * buf, DSL_char_t const *fmt, ...)
#if __GNUC__ >= 3
__attribute__ ((__format__ (__scanf__, 2, 3)))
#endif
;
#ifdef INCLUDE_DSL_API_CLI_LEGACY
#define GET_ADSL_LINE_STATUS 0
#define DANUBE_MEI_CMV_WINHOST 0
#define LINE_RATE_DATA_RATEDS_FLAG 1
#define LINE_RATE_DATA_RATEUS_FLAG 2
typedef struct
{
DSL_uint32_t dummy;
} adslLineStatusInfo;
typedef struct
{
DSL_uint32_t flags;
DSL_uint32_t adslDataRateus;
DSL_uint32_t adslDataRateds;
} adslLineRateInfo;
#endif /* INCLUDE_DSL_API_CLI_LEGACY */
#if defined(INCLUDE_DSL_CPE_API_VRX)
/* Structure to keep the decoded Firmware Verion information
contained in the 32bit Version number */
typedef struct
{
/* Revision 1, 2, ... */
DSL_uint8_t nPlatform;
/* */
DSL_uint8_t nFeatureSet;
/* */
DSL_uint8_t nMajor;
/* */
DSL_uint8_t nMinor;
/* Pre, Verification, Development */
DSL_uint8_t nReleaseStatus;
/* VDSL1/2, ADSL, ... */
DSL_uint8_t nApplication;
} DSL_VRX_FwVersion_t;
#endif /* defined(INCLUDE_DSL_CPE_API_VRX)*/
#ifdef INCLUDE_DSL_CPE_API_DANUBE
/* Structure to keep the decoded Firmware Verion information
contained in the 32bit Version number */
typedef struct
{
/* Major version*/
DSL_uint8_t nMajor;
/* Minor version*/
DSL_uint8_t nMinor;
/* Release State */
DSL_uint8_t nRelState;
/* Annex A, Annex B*/
DSL_uint8_t nApplication;
/* External Version*/
DSL_uint8_t nExtVersion;
/* Internal Version */
DSL_uint8_t nIntVersion;
} DSL_DANUBE_FwVersion_t;
#endif /* INCLUDE_DSL_CPE_API_DANUBE*/
/*
Structure for the SW (driver, application) version*/
typedef struct
{
/* Major version*/
DSL_int_t nMajor;
/* Minor version*/
DSL_int_t nMinor;
/* Development version*/
DSL_int_t nDevelopment;
/* Maintenance version*/
DSL_int_t nMaintenance;
#ifndef DISABLE_DSL_PATCH_VERSION
/* Patch number*/
DSL_int_t nPatch;
#endif /*#ifndef DISABLE_DSL_PATCH_VERSION*/
} DSL_SwVersion_t;
/*
This structure is used to get resource usage statistics
data
*/
typedef struct
{
/*
Total memory allocated statically (bytes) */
DSL_uint32_t staticMemUsage;
/*
Total memory allocated dynamically (bytes) */
DSL_uint32_t dynamicMemUsage;
} DSL_CPE_ResourceUsageStatisticsData_t;
typedef struct
{
/*
File name is only used in case of using firmware binary that is located
within file system. If firmware that is used which is already stored
within context of DSL CPE Control Applicationthis pointer shall be DSL_NULL.*/
DSL_char_t *pFileName;
/*
Pointer to firmware binary in case of using data stored within context of
DSL CPE Control Application. In case of using reference to file instead
(pFileName does not equal DSL_NULL) this pointer shall be DSL_NULL. */
DSL_uint8_t *pData;
/*
Size of firmware binary in case of using data stored within context of
DSL CPE Control Application. In case of using reference to file instead
(pFileName does not equal DSL_NULL) this parameter shall be zero. */
DSL_uint32_t nSize;
/*
Includes information about xDSL mode related firmware features */
DSL_FirmwareFeatures_t fwFeatures;
} DSL_CPE_Firmware_t;
typedef struct
{
DSL_int_t fd[DSL_CPE_MAX_DSL_ENTITIES];
DSL_boolean_t bRun;
DSL_CPE_ThreadCtrl_t EventControl;
DSL_boolean_t bEvtRun;
DSL_boolean_t bBackwardCompMode;
DSL_int_t nDevNum;
#ifdef DSL_DEBUG_TOOL_INTERFACE
DSL_CPE_ThreadCtrl_t nTcpMsgHandler;
DSL_void_t *pDebugClientInfo;
#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT
DSL_CPE_ThreadCtrl_t nTcpCliHandler;
DSL_void_t *pDebugCliClientInfo;
#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/
#endif /* DSL_DEBUG_TOOL_INTERFACE*/
#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT
DSL_CLI_Context_t *pCLI_List_head;
#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */
#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT
DSL_FirmwareStatusType_t nFwModeStatus;
#endif /* INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT*/
/* DSL CPE API driver version*/
DSL_SwVersion_t driverVer;
/* DSL CPE API control application version*/
DSL_SwVersion_t applicationVer;
DSL_void_t *pBnd;
DSL_boolean_t bForceFirmwareDownload[DSL_CPE_MAX_DSL_ENTITIES];
} DSL_CPE_Control_Context_t;
#include "dsl_cpe_debug.h"
#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT
#define DSL_CPE_SCRIPT_WAIT_FOR_CONFIGURATION_TAG "WaitForConfiguration"
#define DSL_CPE_SCRIPT_WAIT_FOR_LINK_ACTIVATE_TAG "WaitForLinkActivate"
#define DSL_CPE_SCRIPT_WAIT_BEFORE_RESTART_TAG "WaitForRestart"
#define DSL_CPE_SCRIPT_COMMON_TAG "Common"
typedef enum
{
/* Specifies common section.*/
DSL_SCRIPT_SECTION_COMMON = 1,
/* Specifies "WaitForConfiguration" section within
Autoboot script*/
DSL_SCRIPT_SECTION_WAIT_FOR_CONFIFURATION = 2,
/* Specifies "WaitForLinkActivate" section within
Autoboot script*/
DSL_SCRIPT_SECTION_WAIT_FOR_LINK_ACTIVATE = 3,
/* Specifies "WaitBeforeRestart" section within
Autoboot script*/
DSL_SCRIPT_SECTION_WAIT_BEFORE_RESTART = 4
} DSL_CPE_ScriptSection_t;
#endif /* #ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT*/
#define MAX_SCRIPT_CMD_LEN 1023
/**
Structure for dynamic script buffers.
*/
typedef struct
{
/** dynamic buffer */
DSL_char_t *buffer_cmd;
/** dynamic buffer */
DSL_char_t *buffer_tmp;
/** buffer size */
DSL_int_t nSize;
} DSL_CPE_ScriptBuffer_t;
/**
Structure for parsing startup arguments.
*/
typedef struct
{
/** element value (to be returned) */
DSL_int_t nValue;
/** element base (for strtoul function,
e.g. 10 for decimal or 16 for hex values) */
DSL_int_t nBase;
} DSL_CPE_ArgElement_t;
/*
A structure for event type<->string conversion tables.
*/
typedef struct
{
/** event type */
DSL_EventType_t eventType;
/** event string */
DSL_char_t const *string;
} DSL_CPE_EVT_CodeString_t;
DSL_CPE_Control_Context_t *DSL_CPE_GetGlobalContext(DSL_void_t);
#if defined(INCLUDE_DSL_CPE_API_VRX)
DSL_Error_t DSL_CPE_LowLevelConfigurationCheck(
DSL_int_t fd);
#endif
DSL_Error_t DSL_CPE_LoadFirmwareFromFile
(
DSL_char_t *psFirmwareName,
DSL_uint8_t **pFirmware,
DSL_uint32_t *pnFirmwareSize
);
DSL_Error_t DSL_CPE_DownloadFirmware
(
DSL_int_t fd,
DSL_int_t nDevice,
DSL_FirmwareRequestType_t nFwReqType,
DSL_PortMode_t nPortMode,
DSL_char_t *pcFw,
DSL_char_t *pcFw2
);
DSL_Error_t DSL_CPE_FwFeaturesGet
(
DSL_char_t *pcFw,
DSL_FirmwareFeatures_t *pFwFeatures
);
#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT
typedef enum
{
/* Format as hey values */
DSL_ARRAY_FORMAT_HEX,
/* Format as string */
DSL_ARRAY_FORMAT_STRING,
/* Format as string (print dots instead of non print symbols) */
DSL_ARRAY_FORMAT_PRINT_STRING
} DSL_CPE_ArrayPrintFormat_t;
DSL_void_t DSL_CPE_ArraySPrintF
(
DSL_char_t *pDst,
DSL_void_t *pSrc,
DSL_uint16_t nSrcSize,
DSL_uint16_t nSrcElementSize,
DSL_CPE_ArrayPrintFormat_t nFormat
);
DSL_Error_t DSL_CPE_MoveCharPtr
(
DSL_char_t *pCommands,
DSL_int_t nParamNr,
DSL_char_t *pSeps,
DSL_char_t **pCmdOffset
);
#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT
DSL_char_t *DSL_CPE_Fd2DevStr(DSL_int_t fd);
DSL_Error_t DSL_CPE_Fd2DevNum(DSL_int_t fd, DSL_uint32_t *nDevice);
DSL_boolean_t DSL_CPE_IsFileExists(DSL_char_t *path);
#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/
DSL_int_t DSL_CPE_CliDeviceCommandExecute(
DSL_CPE_Control_Context_t *pContext,
DSL_int_t nDevice,
DSL_char_t *cmd,
DSL_char_t *arg,
DSL_CPE_File_t *out);
#if defined(INCLUDE_DSL_CPE_API_VRX)
typedef struct
{
DSL_uint8_t nAdr[DSL_MAC_ADDRESS_OCTETS];
} DSL_CPE_MacAddress_t;
DSL_Error_t DSL_CPE_GetMacAdrFromString
(
DSL_char_t *pString,
DSL_CPE_MacAddress_t *pMacAdr
);
#endif /* defined(INCLUDE_DSL_CPE_API_VRX) */
#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT */
/*
Start Event handler thread
*/
DSL_Error_t DSL_CPE_EventHandlerStart (
DSL_CPE_Control_Context_t * pContext
);
#ifdef INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT
DSL_void_t DSL_CPE_Echo
(
DSL_char_t *buf
);
DSL_Error_t DSL_CPE_ScriptExecute
(
DSL_CPE_Control_Context_t * pContext,
DSL_int_t nDevice,
DSL_CPE_File_t *pFile,
DSL_CPE_ScriptSection_t searchSection,
DSL_CPE_ScriptBuffer_t *script_buf
);
DSL_Error_t DSL_CPE_ScriptFileParse
(
DSL_CPE_Control_Context_t * pContext,
DSL_int_t nDevice,
DSL_char_t *sFileName,
DSL_CPE_ScriptSection_t searchSection
);
#endif /* INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT */
#ifdef INCLUDE_DSL_RESOURCE_STATISTICS
DSL_Error_t DSL_CPE_ResourceUsageStatisticsGet
(
DSL_CPE_Control_Context_t *pContext,
DSL_CPE_ResourceUsageStatisticsData_t *pData
);
#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/
#endif /* #ifndef DSL_DOC_GENERATION_EXCLUDE_UNWANTED*/
/**
Returns the smaller of the two parameters.
Take care to use compatible types!
\param a first element to compare, [I]
\param b second element to compare, [I]
*/
#define DSL_MIN(a,b) ((a)<(b)?(a):(b))
/**
Returns the biggest of the two parameters.
Take care to use compatible types!
\param a first element to compare, [I]
\param b second element to compare, [I]
*/
#define DSL_MAX(a,b) ((a)>(b)?(a):(b))
#endif /* _DSL_CPE_CONTROL_H */

1100
src/dsl_cpe_debug.c Normal file

File diff suppressed because it is too large Load diff

388
src/dsl_cpe_debug.h Normal file
View file

@ -0,0 +1,388 @@
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifndef _DSL_CPE_DEBUG_H
#define _DSL_CPE_DEBUG_H
/** Defines the max. string length for group names (including termination '0') */
#define DSL_MAX_CMV_NAME_LENGTH 5
/** Defines the max. string length for group names (excluding termination '0') */
#define DSL_MAX_CMV_NAME_LENGTH_NO_TERM 4
/**
Max level of debug printouts. Compiler will automatically omit all debug
code during optimizations
*/
#ifndef DSL_CCA_DBG_MAX_LEVEL
#define DSL_CCA_DBG_MAX_LEVEL DSL_CCA_DBG_ERR
#endif
#define DSL_CCA_DBG_MAX_ENTRIES 11
#ifdef DSL_CCA_DBG_BLOCK
#undef DSL_CCA_DBG_BLOCK
#endif
#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_NO_BLOCK
/** Definitions for defining the debug level.
The smaller the value the less debug output will be printed
*/
typedef enum
{
/** no output */
DSL_CCA_DBG_NONE = 0x00,
/** */
DSL_CCA_DBG_PRN = 0x01,
/** errors will be printed */
DSL_CCA_DBG_ERR = 0x02,
/** warnings and errors are printed */
DSL_CCA_DBG_WRN = 0x40,
/** verbose output */
DSL_CCA_DBG_MSG = 0x80,
/** */
DSL_CCA_DBG_LOCAL = 0xFF
} DSL_CCA_debugLevels_t;
/**
Defines all available debug modules
*/
typedef enum
{
/** no block selected */
DSL_CCA_DBG_NO_BLOCK = 0,
/** Application function block */
DSL_CCA_DBG_APP = 1,
/** Operating system block */
DSL_CCA_DBG_OS = 2,
/** CLI specific block */
DSL_CCA_DBG_CLI = 3,
/** Pipe specific block */
DSL_CCA_DBG_PIPE = 4,
/** Console specific block */
DSL_CCA_DBG_CONSOLE = 6,
/** TCP Message specific block */
DSL_CCA_DBG_TCPMSG = 7,
/** Multimode debug messages */
DSL_CCA_DBG_MULTIMODE = 8,
/** Debug output for notification related information's.
The related output can be used to checked that DSL Subsystem 'deliveres'
the required information towards the higher layer. For example the script
notification handling that includes important information for TC-Layer
configuration requirement. */
DSL_CCA_DBG_NOTIFICATIONS = 9,
/** Last entry for debug blocks - only used as delimiter! */
DSL_CCA_DBG_LAST_BLOCK
} DSL_CCA_debugModules_t;
/**
Structure that is used to build up a list of debug modules and its names.
Structure that is used for printing out the names of available debug levels only.
*/
typedef struct
{
/** Debug level according to debug level definition */
DSL_CCA_debugLevels_t nDbgLvl;
/** Name of debug level */
DSL_char_t *pcName;
} DSL_CCA_debugLevelEntry_t;
#ifdef INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT
/**
Definitions for defining the debug destination.
*/
typedef enum
{
/** output will be passed to the console */
DSL_CCA_DBG_DST_CONSOLE = 0x00,
/** output will be passed to the logger application */
DSL_CCA_DBG_DST_LOGGER = 0x01
} DSL_CCA_debugDestinations_t;
#endif /* INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT */
#define DSL_CCA_DBG_MAX_PRINT_CHAR 256
#undef DSL_CCA_DBG_PRINTF
/** debug outputs mapped to standard special DSL printf() function */
#define DSL_CCA_DBG_PRINTF (void) DSL_CPE_debug_printf
/* Macro __FUNCTION__ defined in C99, use it if available, define empty macro if not. */
#if defined( __FUNCTION__)
/** debug print function */
#define DSL_CCA_DBG_PRINTF_FUNCTION DSL_CCA_DBG_PRINTF(DSL_NULL, __FUNCTION__)
#else
/** debug print function */
#define DSL_CCA_DBG_PRINTF_FUNCTION do {} while(0)
#endif
#ifdef DSL_CPE_DEBUG_DISABLE
/*
* Kill debug defines for maximum speed and minimum code size.
*/
/** Macro to print debug info contained in "body" with a prepended header that
contains current file name, current function name (if available) and
current source line no. */
#define DSL_CCA_DEBUG_HDR(level, body) ((void)0)
/** Macro to just print debug body without header. */
#define DSL_CCA_DEBUG(level, body) ((void)0)
/** Terminate execution if assertion fails */
#define DSL_CCA_ASSERT(exp) ((void)0)
#else
/**
Macro to print debug info contained in "body" with a prepended header that
contains current file name, current function name (if available) and
current source line no.
This macro does not exist for dumping information to a external
application using a registered callback. Thus it should be only used for
critical errors that will be printed to the standard output (console)
in any case. */
#define DSL_CCA_DEBUG_HDR(level, body) \
{ \
/*lint -save -e568 -e685 -e774 -e506 */ \
/* Warning 568 non-negative quantity is never less than zero */ \
/* Warning 685 Relational operator '<=' always evaluates to 'true' */ \
if ( (DSL_CCA_DBG_MAX_LEVEL >= level) && \
((((level) <= DSL_CCA_g_dbgLvl[DSL_CCA_DBG_BLOCK].nDbgLvl) && (DSL_CCA_g_globalDbgLvl == DSL_CCA_DBG_LOCAL)) \
|| (((level) <= DSL_CCA_g_globalDbgLvl) && (DSL_CCA_g_globalDbgLvl != DSL_CCA_DBG_LOCAL)))) \
{ \
DSL_CCA_DBG_PRINTF(DSL_NULL, __FILE__":"); \
DSL_CCA_DBG_PRINTF_FUNCTION; \
DSL_CCA_DBG_PRINTF(DSL_NULL, ":Line %i:" DSL_CPE_CRLF,__LINE__); \
DSL_CCA_DBG_PRINTF body; \
} \
/*lint -restore */ \
}
/**
Macro to dump debug body if line is in specified range for debug output
and if the debug level is set to an appropriate value.
The handling of the debug output is related to the former registration of
a callback function as follows:
Callback function is registered
The debug string will be passed to the upper layer software using the
callback itself in case of appropriate debug level.
NO callback function is registered
The debug string will be printed to the standard output (console) in
case of appropriate debug level.
\attention The implementation of this macro needs a valid context pointer
from the DSL API. Thus you shall use this macro AFTER complete
initialization of the DSL API only!
*/
#define DSL_CCA_DEBUG(level, body) \
{ \
/*lint -save -e568 -e685 -e774 -e506 */ \
/* Warning 568 non-negative quantity is never less than zero */ \
/* Warning 685 Relational operator '<=' always evaluates to 'true' */ \
if ( (DSL_CCA_DBG_MAX_LEVEL >= level) ) \
{ \
if ( ((((level) <= DSL_CCA_g_dbgLvl[DSL_CCA_DBG_BLOCK].nDbgLvl) && (DSL_CCA_g_globalDbgLvl == DSL_CCA_DBG_LOCAL))) \
|| (((level) <= DSL_CCA_g_globalDbgLvl) && (DSL_CCA_g_globalDbgLvl != DSL_CCA_DBG_LOCAL)) ) \
{ \
DSL_CCA_DBG_PRINTF body; \
} \
} \
/*lint -restore */ \
}
/** Macro to get debug level for actual debug block */
#define DSL_CCA_DEBUG_LEVEL_GET (DSL_CCA_g_dbgLvl[DSL_CCA_DBG_BLOCK].nDbgLvl)
/** Terminate execution if assertion fails */
#define DSL_CCA_ASSERT(exp) \
{ \
if (!(exp)) \
{ \
DSL_CCA_DBG_PRINTF(DSL_NULL, __FILE__":"); \
DSL_CCA_DBG_PRINTF_FUNCTION; \
DSL_CCA_DBG_PRINTF(DSL_NULL, ":Line %i:" DSL_CPE_CRLF,__LINE__); \
DSL_CCA_DBG_PRINTF(DSL_NULL, "Assertion failed." DSL_CPE_CRLF ); \
while(1) ; \
} \
}
/* Import global variables from lib_dsl_debug.c */
extern DSL_CCA_debugLevelEntry_t DSL_CCA_g_dbgLvl[DSL_CCA_DBG_MAX_ENTRIES];
extern DSL_CCA_debugLevels_t DSL_CCA_g_globalDbgLvl;
#ifdef INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT
extern DSL_CCA_debugDestinations_t DSL_CCA_g_dbgDestination;
#endif /* INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT */
#ifndef _lint
extern DSL_CCA_debugLevelEntry_t DSL_CCA_g_dbgLvlNames[];
extern const DSL_uint8_t DSL_CCA_g_dbgLvlNumber;
#endif /* _lint*/
#endif /* ifdef DSL_CPE_DEBUG_DISABLE */
/**
A structure for event type<->string conversion tables.
*/
typedef struct
{
/** group name string */
DSL_char_t *psGroupName;
/** group ID */
DSL_int_t nGroupId;
} DSL_CmvGroupEntry_t;
DSL_Error_t DSL_CMV_Read
(
DSL_CPE_Control_Context_t *pContext,
DSL_char_t *str_group,
DSL_uint16_t address,
DSL_uint16_t index,
DSL_int_t size,
DSL_uint16_t *pData
);
DSL_Error_t DSL_CMV_Write
(
DSL_CPE_Control_Context_t *pContext,
DSL_char_t *str_group,
DSL_uint16_t address,
DSL_uint16_t index,
DSL_int_t size,
DSL_uint16_t *pData
);
#if defined (INCLUDE_DSL_CPE_API_DANUBE)
void DSL_CMV_Prepare
(
DSL_uint8_t opcode,
DSL_uint8_t group,
DSL_uint16_t address,
DSL_uint16_t index,
DSL_int_t size,
DSL_uint16_t *data,
DSL_uint16_t *Message
);
#endif /* defined (INCLUDE_DSL_CPE_API_DANUBE)*/
#if defined (INCLUDE_DSL_CPE_API_DANUBE)
#include "dsl_cpe_debug_danube.h"
#elif defined (INCLUDE_DSL_CPE_API_VRX)
#include "dsl_cpe_debug_vrx.h"
#else
#error "xDSL chip not specified!"
#endif
/** TCP messages debug stuff, for Danube for the time present */
#ifdef DSL_DEBUG_TOOL_INTERFACE
/* Tcp debug messages stuff */
typedef struct {
DSL_int_t fd;
DSL_sockaddr_in_t client_addr;
DSL_void_t *pDevData;
} DSL_CPE_TcpDebugClientInfo_t;
#ifdef INCLUDE_DSL_CPE_CLI_SUPPORT
typedef struct {
DSL_int_t fd;
DSL_sockaddr_in_t client_addr;
DSL_char_t *buf;
DSL_char_t *pPos;
DSL_CPE_File_t *out;
} DSL_CPE_TcpDebugCliClientInfo_t;
#endif /* INCLUDE_DSL_CPE_CLI_SUPPORT*/
/**
This structure is used to get resource usage statistics
data
*/
typedef struct
{
/**
Total memory allocated statically (bytes) */
DSL_uint32_t staticMemUsage;
/**
Total memory allocated dynamically (bytes) */
DSL_uint32_t dynamicMemUsage;
} DSL_CPE_TcpDebugResourceUsageStatisticsData_t;
DSL_void_t DSL_CPE_DEV_DeviceDataFree(DSL_void_t *pDevData);
DSL_int_t DSL_CPE_DEV_TcpMessageHandle
(
DSL_CPE_TcpDebugClientInfo_t *pDevData
);
#ifdef INCLUDE_DSL_RESOURCE_STATISTICS
DSL_Error_t DSL_CPE_DEV_TcpDebugMessageResourceUsageGet(
DSL_CPE_TcpDebugClientInfo_t *clientInfo,
DSL_uint32_t *pStaticMemUsage,
DSL_uint32_t *pDynamicMemUsage);
#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/
#ifdef INCLUDE_DSL_RESOURCE_STATISTICS
DSL_Error_t DSL_CPE_TcpDebugMessageResourceUsageGet (
DSL_CPE_Control_Context_t * pContext,
DSL_CPE_TcpDebugResourceUsageStatisticsData_t *pResUsage);
#endif /* INCLUDE_DSL_RESOURCE_STATISTICS*/
DSL_Error_t DSL_CPE_TcpDebugMessageIntfStart (
DSL_CPE_Control_Context_t * pContext,
DSL_uint16_t nTcpListenPort, DSL_char_t *sTcpServerIp);
DSL_Error_t DSL_CPE_TcpDebugMessageIntfStop (
DSL_CPE_Control_Context_t * pContext);
DSL_Error_t DSL_CPE_TcpDebugCliIntfStart (
DSL_CPE_Control_Context_t * pContext,
DSL_boolean_t bEnableTcpCli);
DSL_Error_t DSL_CPE_TcpDebugCliIntfStop (
DSL_CPE_Control_Context_t * pContext);
#ifdef DSL_DEBUG_TOOL_INTERFACE
/** TCP messages server ip address */
extern DSL_char_t *g_sTcpMessagesSocketAddr;
/** TCP messages server port */
extern DSL_uint16_t g_nTcpMessagesSocketPort;
extern DSL_boolean_t g_bEnableTcpCli;
#endif
/** TCP messages server port */
#define DSL_CPE_TCP_MESSAGES_PORT 2000
/** default value for enabling TCP CLI */
#define DSL_CPE_ENABLE_TCP_CLI_DEFAULT DSL_TRUE
/** TCP CLI server port */
#define DSL_CPE_TCP_CLI_PORT 2001
/** TCP CLI command maximum length */
#define DSL_CPE_TCP_CLI_COMMAND_LENGTH_MAX 2048
/** TCP messages select timeout */
#define DSL_CPE_TCP_LISTEN_SELECT_TIMEOUT 100
/** TCP messages thread shutdown timeout */
#define DSL_CPE_TCP_THREAD_SHUTDOWN_TIMEOUT 1000
#endif /* #ifdef DSL_DEBUG_TOOL_INTERFACE*/
#endif /* _DSL_CPE_DEBUG_H */

1646
src/dsl_cpe_debug_vrx.c Normal file

File diff suppressed because it is too large Load diff

319
src/dsl_cpe_debug_vrx.h Normal file
View file

@ -0,0 +1,319 @@
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifndef _DSL_CPE_DEBUG_VRX_H
#define _DSL_CPE_DEBUG_VRX_H
#ifdef DSL_DEBUG_TOOL_INTERFACE
#include "cmv_message_format.h"
#if defined(INCLUDE_DSL_CPE_API_VRX)
/* MEI CPE driver specific headers*/
#include "drv_mei_cpe_interface.h"
#else
#error "Device undefined!"
#endif
#if defined(INCLUDE_DSL_CPE_API_VRX)
#define DSL_CPE_IFX_LOW_DEV "/dev/mei_cpe"
#endif
#if defined(INCLUDE_DSL_CPE_API_VRX)
/* MEI CPE driver interface IOCTLs wrappers*/
#define FIO_VRX_REQ_CONFIG FIO_MEI_REQ_CONFIG
#define FIO_VRX_MBOX_MSG_RAW_SEND FIO_MEI_MBOX_MSG_RAW_SEND
#define FIO_VRX_REG_GET FIO_MEI_REG_GET
#define FIO_VRX_REG_SET FIO_MEI_REG_SET
#define FIO_VRX_DBG_LS_WRITE FIO_MEI_DBG_LS_WRITE
#define FIO_VRX_DBG_LS_READ FIO_MEI_DBG_LS_READ
/* MEI CPE driver interface data types wrappers*/
typedef IOCTL_MEI_reqCfg_t IOCTL_VRX_reqCfg_t;
typedef IOCTL_MEI_mboxSend_t IOCTL_VRX_mboxSend_t;
typedef IOCTL_MEI_regInOut_t IOCTL_VRX_regInOut_t;
typedef IOCTL_MEI_dbgAccess_t IOCTL_VRX_dbgAccess_t;
#endif
#define WINHOST_VDSL2_DFE_CHANNELS_AVAILABLE 2
typedef struct
{
DSL_int_t socket_fd;
/* device file descriptor */
DSL_int_t arrDeviceFd[WINHOST_VDSL2_DFE_CHANNELS_AVAILABLE];
/* response message*/
CMV_MESSAGE_ALL_T CmvMsg;
/* index of free space in Buffer */
DSL_char_t *pEndReceive;
/* Buffer for the received data*/
DSL_char_t Buffer[3*CMV_MESSAGE_SIZE];
} DSL_VRX_TcpDebugInfo_t;
#ifndef __BYTE_ORDER
#error __BYTE_ORDER has to be defined through including of drv_dsl_cpe_os.h
#endif
#define WINHOST_REMOTE_SW_BYTE_ORDER __BIG_ENDIAN
/*#define WINHOST_REMOTE_SW_BYTE_ORDER __LITTLE_ENDIAN*/
/* ============================================================================
Macros & Definitions
========================================================================= */
#if ((__BYTE_ORDER == __BIG_ENDIAN ) && (WINHOST_REMOTE_SW_BYTE_ORDER == __LITTLE_ENDIAN)) || \
((__BYTE_ORDER == __LITTLE_ENDIAN ) && (WINHOST_REMOTE_SW_BYTE_ORDER == __BIG_ENDIAN))
#define N2H_SWAP_CMV_BLOCK_WORD(cmvMsg, startIdx, count_16)\
N2H_SwapCmvBlockWord(cmvMsg, startIdx, count_16)
#define H2N_SWAP_CMV_BLOCK_WORD(cmvMsg, startIdx, count_16)\
H2N_SwapCmvBlockWord(cmvMsg, startIdx, count_16)
#define N2H_SWAP_CMV_PAYL_DWORD(cmvMsg, startIdx, count_32)\
N2H_SwapCmvPaylDWord(cmvMsg, startIdx, count_32)
#define H2N_SWAP_CMV_PAYL_DWORD(cmvMsg, startIdx, count_32)\
H2N_SwapCmvPaylDWord(cmvMsg, startIdx, count_32)
#else
#define N2H_SWAP_CMV_BLOCK_WORD(cmvMsg, startIdx, count_16)
#define H2N_SWAP_CMV_BLOCK_WORD(cmvMsg, startIdx, count_16)
#define N2H_SWAP_CMV_PAYL_DWORD(cmvMsg, startIdx, count_32)
#define H2N_SWAP_CMV_PAYL_DWORD(cmvMsg, startIdx, count_32)
/*#define SWAP_CMV_PAYL_32_VS_16(cmvMsg, startIdx, count_32) */
#endif
#define SWAP_CMV_PAYL_32_VS_16(cmvMsg, startIdx, count_32)\
SwapCmvPayl_32vs16(cmvMsg, startIdx, count_32)
#if 1
#define TCP_DEBUG_SWAP_HOST32_TARGET8(x) ( (((x)&0xFFFF0000)>>16) \
|(((x)&0x0000FFFF)<<16) )
#define TCP_DEBUG_SWAP_HOST32_TARGET16(x) ( (((x)&0xFFFF0000)>>16) \
|(((x)&0x0000FFFF)<<16) )
#define TCP_DEBUG_SWAP_HOST32_TARGET32(x) ( (((x)&0xFFFF0000)>>16) \
|(((x)&0x0000FFFF)<<16) )
#define TCP_DEBUG_SWAP_HOST16_TARGET16(x) ( (((x)&0xFF00)>>8) \
|(((x)&0x00FF)<<8) )
#else
#define TCP_DEBUG_SWAP_HOST32_TARGET8(x) (x)
#define TCP_DEBUG_SWAP_HOST32_TARGET16(x) (x)
#define TCP_DEBUG_SWAP_HOST32_TARGET32(x) (x)
#define TCP_DEBUG_SWAP_HOST16_TARGET16(x) (x)
#endif
#if 1
#define TCP_DEBUG_SWAP_TARGET8_HOST32(x) ( (((x)&0xFFFF0000)>>16) \
|(((x)&0x0000FFFF)<<16) )
#define TCP_DEBUG_SWAP_TARGET16_HOST32(x) ( (((x)&0xFFFF0000)>>16) \
|(((x)&0x0000FFFF)<<16) )
#define TCP_DEBUG_SWAP_TARGET32_HOST32(x) ( (((x)&0xFFFF0000)>>16) \
|(((x)&0x0000FFFF)<<16) )
#else
#define TCP_DEBUG_SWAP_TARGET8_HOST32(x) (x)
#define TCP_DEBUG_SWAP_TARGET16_HOST32(x) (x)
#define TCP_DEBUG_SWAP_TARGET32_HOST32(x) (x)
#endif
/* ============================================================================
Debug Read/Write Buffer
========================================================================= */
/* two 32bit elements margin, if request address is not 32bit aligned */
typedef union cmv_debug_access_buffer_s
{
unsigned char params_8Bit[CMV_USED_PAYLOAD_8BIT_SIZE + 8];
unsigned short params_16Bit[CMV_USED_PAYLOAD_16BIT_SIZE + 4];
unsigned int params_32Bit[CMV_USED_PAYLOAD_32BIT_SIZE + 2];
} CMV_DEBUG_ACCESS_BUFFER_T;
/* ============================================================================
CMV Message format: offset code [16 bit]
========================================================================= */
#define CMV_MSGHDR_CODE_MBOX_CODE_POS (0)
#define CMV_MSGHDR_CODE_MBOX_CODE_MASK (0x00FF << CMV_MSGHDR_CODE_MBOX_CODE_POS)
#define CMV_MSGHDR_CODE_PORT_NUMBER_POS (8)
#define CMV_MSGHDR_CODE_PORT_NUMBER_MASK (0x003F << CMV_MSGHDR_CODE_PORT_NUMBER_POS)
#define CMV_MSGHDR_CODE_RESERVED_POS (14)
#define CMV_MSGHDR_CODE_RESERVED_MASK (0x0003 << CMV_MSGHDR_CODE_RESERVED_POS)
/*
Access Macros Offset code
*/
#define P_CMV_MSGHDR_CODE_MBOX_CODE_GET(pmsg) \
((pmsg->header.mbxCode & CMV_MSGHDR_CODE_MBOX_CODE_MASK) >> CMV_MSGHDR_CODE_MBOX_CODE_POS)
#define CMV_MSGHDR_CODE_MBOX_CODE_GET(msg) \
((msg.header.mbxCode & CMV_MSGHDR_CODE_MBOX_CODE_MASK) >> CMV_MSGHDR_CODE_MBOX_CODE_POS)
#define P_CMV_MSGHDR_CODE_MBOX_CODE_SET(pmsg, val) ( pmsg->header.mbxCode = \
( (pmsg->header.mbxCode & ~(CMV_MSGHDR_CODE_MBOX_CODE_MASK)) | \
((val << CMV_MSGHDR_CODE_MBOX_CODE_POS) & (CMV_MSGHDR_CODE_MBOX_CODE_MASK)) ) )
#define CMV_MSGHDR_CODE_MBOX_CODE_SET(msg, val) ( msg.header.mbxCode = \
( (msg.header.mbxCode & ~(CMV_MSGHDR_CODE_MBOX_CODE_MASK)) | \
((val << CMV_MSGHDR_CODE_MBOX_CODE_POS) & (CMV_MSGHDR_CODE_MBOX_CODE_MASK)) ) )
#define P_CMV_MSGHDR_CODE_PORT_NUMBER_GET(pmsg) \
((pmsg->header.mbxCode & (CMV_MSGHDR_CODE_PORT_NUMBER_MASK)) >> CMV_MSGHDR_CODE_PORT_NUMBER_POS)
#define CMV_MSGHDR_CODE_PORT_NUMBER_GET(msg) \
((msg.header.mbxCode & (CMV_MSGHDR_CODE_PORT_NUMBER_MASK)) >> CMV_MSGHDR_CODE_PORT_NUMBER_POS)
#define P_CMV_MSGHDR_CODE_PORT_NUMBER_SET(pmsg, val) ( pmsg->header.mbxCode = \
( (pmsg->header.mbxCode & ~(CMV_MSGHDR_CODE_PORT_NUMBER_MASK)) | \
((val << CMV_MSGHDR_CODE_PORT_NUMBER_POS) & (CMV_MSGHDR_CODE_PORT_NUMBER_MASK)) ) )
#define CMV_MSGHDR_CODE_PORT_NUMBER_SET(msg, val) ( msg.header.mbxCode = \
( (msg.header.mbxCode & ~(CMV_MSGHDR_CODE_PORT_NUMBER_MASK)) | \
((val << CMV_MSGHDR_CODE_PORT_NUMBER_POS) & (CMV_MSGHDR_CODE_PORT_NUMBER_MASK)) ) )
#define P_CMV_MSGHDR_CODE_RESERVED_GET(pmsg) \
((pmsg->header.mbxCode & CMV_MSGHDR_CODE_RESERVED_MASK) >> CMV_MSGHDR_CODE_RESERVED_POS)
#define CMV_MSGHDR_CODE_RESERVED_GET(msg) \
((msg.header.mbxCode & CMV_MSGHDR_CODE_RESERVED_MASK) >> CMV_MSGHDR_CODE_RESERVED_POS)
#define P_CMV_MSGHDR_CODE_RESERVED_SET(pmsg, val) ( pmsg->header.mbxCode = \
( (pmsg->header.mbxCode & ~(CMV_MSGHDR_CODE_RESERVED_MASK)) | \
((val << CMV_MSGHDR_CODE_RESERVED_POS) & (CMV_MSGHDR_CODE_RESERVED_MASK)) ) )
#define CMV_MSGHDR_CODE_RESERVED_SET(msg, val) ( msg.header.mbxCode = \
( (msg.header.mbxCode & ~(CMV_MSGHDR_CODE_RESERVED_MASK)) | \
((val << CMV_MSGHDR_CODE_RESERVED_POS) & (CMV_MSGHDR_CODE_RESERVED_MASK)) ) )
/* ============================================================================
CMV Message format: offset 1 [16 bit]
========================================================================= */
#define CMV_RESPONSE_RESULT_CODE_POS (0)
#define CMV_RESPONSE_RESULT_CODE_MASK (0xFFFF << CMV_RESPONSE_RESULT_CODE_POS)
/*
Access Macros Offset 1
*/
#define P_CMV_MSGHDR_RESULT_CODE_GET(pmsg) \
((pmsg->header.MessageID & CMV_RESPONSE_RESULT_CODE_MASK) >> CMV_RESPONSE_RESULT_CODE_POS)
#define CMV_MSGHDR_RESULT_CODE_GET(msg) \
((msg.header.MessageID & CMV_RESPONSE_RESULT_CODE_MASK) >> CMV_RESPONSE_RESULT_CODE_POS)
#define P_CMV_MSGHDR_RESULT_CODE_SET(pmsg, val) ( pmsg->header.MessageID = \
(unsigned short)( (pmsg->header.MessageID & ~(CMV_RESPONSE_RESULT_CODE_MASK)) | \
((val << CMV_RESPONSE_RESULT_CODE_POS) & ~(CMV_RESPONSE_RESULT_CODE_MASK)) ) )
#define CMV_MSGHDR_RESULT_CODE_SET(msg, val) ( msg.header.MessageID = \
(unsigned short)( (msg.header.MessageID & ~(CMV_RESPONSE_RESULT_CODE_MASK)) | \
(((val) << CMV_RESPONSE_RESULT_CODE_POS) & ~(CMV_RESPONSE_RESULT_CODE_MASK)) ) )
/* ============================================================================
CMV Message format: offset 2 [16 bit]
========================================================================= */
/* CMV header MSW debug address field */
#define P_CMV_MSGHDR_ADDR_MSW_GET(pmsg) (pmsg->rawMsg[3])
#define CMV_MSGHDR_ADDR_MSW_GET(msg) (msg.rawMsg[3])
#define P_CMV_MSGHDR_ADDR_MSW_SET(pmsg, val) (pmsg->rawMsg[3] = val)
#define CMV_MSGHDR_ADDR_MSW_SET(msg, val) (msg.rawMsg[3] = val)
/* ============================================================================
CMV Message format: offset 3 [16 bit]
========================================================================= */
/* CMV header LSW debug address field */
#define P_CMV_MSGHDR_MEI_ADDR_GET(pmsg) (pmsg->rawMsg[3])
#define CMV_MSGHDR_MEI_ADDR_GET(msg) (msg.rawMsg[3])
#define P_CMV_MSGHDR_MEI_ADDR_SET(pmsg, val) (pmsg->rawMsg[3] = val)
#define CMV_MSGHDR_MEI_ADDR_SET(msg, val) (msg.rawMsg[3] = val)
/* ============================================================================
CMV Message format: offset 3 [16 bit]
========================================================================= */
/* CMV header LSW debug address field */
#define P_CMV_MSGHDR_ADDR_LSW_GET(pmsg) (pmsg->rawMsg[4])
#define CMV_MSGHDR_ADDR_LSW_GET(msg) (msg.rawMsg[4])
#define P_CMV_MSGHDR_ADDR_LSW_SET(pmsg, val) (pmsg->rawMsg[4] = val)
#define CMV_MSGHDR_ADDR_LSW_SET(msg, val) (msg.rawMsg[4] = val)
/* ========================================================================
Definition of the MESSAGE MAILBOX CODES.
===================================================================== */
/* Must be interpreted by the WinHost task */
#define CMV_MBOX_CODE_ME_MSG 0x80
/* ========================================================================
Definition of the MESSAGE OPCODES.
===================================================================== */
/*
NOTE:
The MESSAGE OPCODE is a combination of thection fields:
OPCODE, MSG MODE and DIRECTION
*/
/* Message Codes: WinHost-to-MEI */
#define H2DCE_DEBUG_REBOOT 0x04
#define H2DCE_DEBUG_DOWNLOAD 0x0A
#define H2DCE_DEBUG_RUN 0x0C
#define H2DCE_DEBUG_HALT 0x0E
#define H2DCE_DEBUG_READ_MEI 0x06
#define H2DCE_DEBUG_WRITE_MEI 0x08
#define H2DCE_DEBUG_READDEBUG 0x14
#define H2DCE_DEBUG_WRITEDEBUG 0x12
#define H2DCE_MBOX_PAYLOAD_SIZE_QUERY 0x16
/* Message Codes: MEI-to-Winhost */
#if 0
#define DCE2H_DEBUG_RESET_ACK 0x03
#define DCE2H_DEBUG_REBOOT_ACK 0x05
#define DCE2H_ERROR_OPCODE_UNKNOWN 0x0B
#define DCE2H_ERROR_ADDR_UNKNOWN 0x0D
#endif
#define DCE2H_RESPONSE 0x0F
#define DCE2H_DEBUG_READ_MEI_REPLY 0x07
#define DCE2H_DEBUG_WRITE_MEI_REPLY 0x09
#define DCE2H_DEBUG_WRITEDEBUG_ACK 0x13
#define DCE2H_DEBUG_READDEBUG_ACK 0x15
#define DCE2H_MBOX_PAYLOAD_SIZE_REPLY 0x17
/* Message Result Codes: MEI-to-Winhost Response */
#define DCE2H_RESPONSE_SUCCESS 0x00
#define DCE2H_RESPONSE_TIMEOUT 0x10
#define DCE2H_RESPONSE_MEI_REG_RD_ERROR 0x20
#define DCE2H_RESPONSE_MEI_REG_WR_ERROR 0x30
#define DCE2H_RESPONSE_HOST_DBG_PORT_RD_ERROR 0x40
#define DCE2H_RESPONSE_HOST_DBG_PORT_WR_ERROR DCE2H_RESPONSE_TIMEOUT
#define DCE2H_RESPONSE_MODEM_READY_TIMEOUT 0x50
#define DCE2H_RESPONSE_MODEM_READY_AC_CLK 0x51
DSL_int_t DSL_CPE_DEV_DeviceOpen(DSL_char_t *pDevName, DSL_uint32_t dev_num);
#endif /* #ifdef DSL_DEBUG_TOOL_INTERFACE*/
#endif /* _DSL_CPE_DEBUG_VRX_H */

527
src/dsl_cpe_dti.c Normal file
View file

@ -0,0 +1,527 @@
/******************************************************************************
Copyright 2018, Intel Corporation
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
/** \file
DSL daemon command line interface for the Debug & Trace Interface
*/
/*#define DEBUG_CONSOLE*/
/* ============================================================================
inlcudes
========================================================================= */
#include "dsl_cpe_control.h"
#if defined(INCLUDE_DSL_CPE_DTI_SUPPORT)
#include "dsl_cpe_os.h"
#include "dsl_cpe_cli.h"
#include "dsl_cpe_dti.h"
/* get the DTI interface defines */
#include "dti_agent_interface.h"
#include "dti_cli_interface.h"
#ifdef DTI_STATIC
#undef DTI_STATIC
#endif
#if (defined(DTI_DEBUG) || 1)
#define DTI_STATIC
#else
#define DTI_STATIC static
#endif
#if (DTI_AGENT_VER_MAJOR >= 1)
/*
Note: With the DTI Version >= 1.0.0 the following changes have been made:
- Build process:
use dynamic libraries
- Device handling:
allow several devices in parallel
separate device handling (device part will be in a own library)
- Interface:
New interface to start and register several devices.
*/
# define DTI_INTERFACE_VERSION 1
#else
# define DTI_INTERFACE_VERSION 0
#endif
#if defined(INCLUDE_DSL_CPE_API_VRX) && (DTI_INTERFACE_VERSION > 0)
extern DTI_DeviceAccessFct_t DTI_DeviceAccessFct_VRX;
#endif
/* ============================================================================
Local defines
========================================================================= */
struct DSL_CPE_Dti_Context_s
{
/* points to the DTI Agent context pointer */
DTI_AgentCtx_t *pDtiAgent;
/* enable / disbale DTI interface */
volatile DSL_boolean_t bEnabled;
/* if number */
volatile DSL_int_t ifNum;
/** dsl cpe api context pointer */
DSL_CPE_Control_Context_t *pDSLContext;
/** console pointer (event handling) */
DSL_CLI_Context_t *pCLIContext;
};
typedef struct DSL_CPE_Dti_Context_s DSL_CPE_Dti_Context_t;
/* ============================================================================
Local Function declarations
========================================================================= */
DTI_STATIC DSL_int_t DSL_CPE_CLI_Dti_Command_Exec(
DSL_CPE_Dti_Context_t *pDtiContext,
const DSL_char_t *pCliDtiCommand,
DSL_CPE_File_t *pOutStream);
DTI_STATIC DSL_Error_t DSL_CPE_CLI_Dti_Event(
DSL_void_t *pContext,
DSL_char_t *pMessage);
DTI_STATIC DSL_Error_t DSL_CPE_CLI_Dti_Exit(
DSL_void_t *pContext);
DTI_STATIC DSL_int_t DSL_CPE_CLI_Dti_Exec(
DSL_void_t *pCliDtiDescriptor,
const DSL_char_t *pCmdIn,
DSL_char_t *pResultOut,
DSL_int_t *pResultBufSize_byte,
DSL_int_t *pResultCode);
/* ============================================================================
Local Variables
========================================================================= */
/* DTI interface - context */
DTI_STATIC DSL_CPE_Dti_Context_t DSL_CPE_GlobalDtiContext = {DSL_NULL, DSL_FALSE, -1, DSL_NULL, DSL_NULL};
/* ============================================================================
Local Function definitons
========================================================================= */
#if defined(INCLUDE_DSL_CPE_CLI_SUPPORT)
/**
Handle a DTI command form the Debug & Trace interface
*/
DTI_STATIC DSL_int_t DSL_CPE_CLI_Dti_Command_Exec(
DSL_CPE_Dti_Context_t *pDtiContext,
const DSL_char_t *pCliDtiCommand,
DSL_CPE_File_t *pOutStream)
{
DSL_int_t retVal = 0;
DSL_char_t cmdBuf[256];
DSL_char_t *pArgBuf = DSL_NULL;
/* get command name */
sscanf(pCliDtiCommand, "%255s", cmdBuf);
cmdBuf[255] = '\0';
if(strlen(cmdBuf) < strlen(pCliDtiCommand))
{
pArgBuf = (DSL_char_t *)pCliDtiCommand + strlen(cmdBuf) + 1;
}
retVal = DSL_CPE_CliDeviceCommandExecute(pDtiContext->pDSLContext, -1, cmdBuf, pArgBuf, pOutStream);
return retVal;
}
/**
Exit the CLI DTI
*/
DTI_STATIC DSL_Error_t DSL_CPE_CLI_Dti_Exit(
DSL_void_t *pContext)
{
DSL_Error_t ret = DSL_SUCCESS;
DSL_CPE_Dti_Context_t *pDtiContext = (DSL_CPE_Dti_Context_t*)pContext;
if (pDtiContext == DSL_NULL)
{
return DSL_ERROR;
}
/* unregister the exec within the DTI module */
#ifdef INCLUDE_DSL_API_CONSOLE_EXTRA
if (pDtiContext->bEnabled == DSL_TRUE)
{
#if defined(INCLUDE_DSL_CPE_CLI_SUPPORT)
if (DSL_CPE_CLI_Unregister(pDtiContext->pCLIContext) == DSL_SUCCESS)
{
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"oops, CLI DTI Exit - unregister failed" DSL_CPECRLF);
DSL_CPE_Free(pDtiContext->pCLIContext);
pDtiContext->pCLIContext = DSL_NULL;
}
#endif /* #if defined(INCLUDE_DSL_CPE_CLI_SUPPORT) */
}
#endif
return ret;
}
/**
CLI DTI Event
*/
DTI_STATIC DSL_Error_t DSL_CPE_CLI_Dti_Event(
DSL_void_t *pContext,
DSL_char_t *pMessage)
{
DSL_uint_t eventOutSize_byte = 0;
DSL_CPE_Dti_Context_t *pDtiContext = (DSL_CPE_Dti_Context_t *)pContext;
eventOutSize_byte = strlen(pMessage) + 1;
if (DTI_CLI_InterfaceEventSend(
pDtiContext->pDtiAgent, pDtiContext->ifNum,
pMessage, eventOutSize_byte) != IFX_SUCCESS)
{
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"CLI DTI Event - event send failed" DSL_CPE_CRLF
"Evt: <%s>" DSL_CPE_CRLF, pMessage);
return DSL_ERROR;
}
return DSL_SUCCESS;
}
/**
Handle a incoming command form the Debug & Trace interface
*/
DTI_STATIC DSL_int_t DSL_CPE_CLI_Dti_Exec(
DSL_void_t *pCliDtiDescriptor,
const DSL_char_t *pCmdIn,
DSL_char_t *pResultOut,
DSL_int_t *pResultBufSize_byte,
DSL_int_t *pResultCode)
{
DSL_int_t retVal = 0, writtenBytes = 0;
DSL_CPE_Dti_Context_t *pCliDtiContext = (DSL_CPE_Dti_Context_t *)pCliDtiDescriptor;
DSL_CPE_File_t *pOutStream = DSL_CPE_STDOUT;
if (pResultOut && pResultBufSize_byte)
{
memset(pResultOut, 0, *pResultBufSize_byte);
}
else
{
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"oops, missing DTI result buffer" DSL_CPE_CRLF);
return DSL_ERROR;
}
if (!pCliDtiDescriptor)
{
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"oops, missing CLI DTI handle" DSL_CPE_CRLF);
writtenBytes = DSL_CPE_snprintf(pResultOut, *pResultBufSize_byte,
"nReturn=-1 nError=\"oops, missing CLI DTI handle\n\r\"");
*pResultBufSize_byte = writtenBytes;
return DSL_ERROR;
}
if (!pCmdIn)
{
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"oops, missing DTI command" DSL_CPE_CRLF);
writtenBytes = DSL_CPE_snprintf(pResultOut, *pResultBufSize_byte,
"nReturn=-1 nError=\"oops, missing DTI command\n\r\"");
*pResultBufSize_byte = writtenBytes;
return DSL_ERROR;
}
#if defined(IFXOS_HAVE_MEMORY_FILE) && (IFXOS_HAVE_MEMORY_FILE == 1)
pOutStream = DSL_CPE_FMemOpen(pResultOut, *pResultBufSize_byte - 1, "w");
if(pOutStream == NULL)
{
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"oops, cannot open DTI stream" DSL_CPE_CRLF);
writtenBytes = DSL_CPE_snprintf(pResultOut, *pResultBufSize_byte,
"nReturn=-1 nError=\"oops, cannot open DTI stream\n\r\"");
*pResultBufSize_byte = writtenBytes;
return DSL_ERROR;
}
#endif
/*
execute the given DTI command.
*/
retVal = DSL_CPE_CLI_Dti_Command_Exec(pCliDtiContext, pCmdIn, pOutStream);
if (retVal)
{
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"nReturn=%d" DSL_CPE_CRLF, retVal);
}
#if defined(IFXOS_HAVE_MEMORY_FILE) && (IFXOS_HAVE_MEMORY_FILE == 1)
DSL_CPE_FClose(pOutStream);
writtenBytes = strlen(pResultOut);
pResultOut[writtenBytes] = '\0';
#else
writtenBytes = DSL_CPE_snprintf(pResultOut, *pResultBufSize_byte,
"nReturn=%d nWarning=\"result written to stdout\n\r\"", retVal);
#endif
*pResultBufSize_byte = writtenBytes;
return DSL_SUCCESS;
}
#endif /* #if defined(INCLUDE_DSL_CPE_CLI_SUPPORT)*/
/* ============================================================================
Global Function definitons
========================================================================= */
/**
Initialize the DTI
*/
DSL_Error_t DSL_CPE_Dti_Start(
DSL_CPE_Control_Context_t *pContext,
DSL_int_t numOfPhyDevices,
DSL_int_t numOfLinesPerPhyDevice,
DSL_uint16_t dtiListenPort,
DSL_char_t *pDtiServerIp,
DSL_boolean_t bEnableCliAutoMsg,
DSL_boolean_t bEnableDevAutoMsg,
DSL_boolean_t bEnableSingleThreadMode)
{
DSL_int_t ret = DSL_SUCCESS;
DTI_AgentCtx_t *pDtiAgent = DSL_NULL;
DTI_AgentStartupSettings_t dtiStartup;
memset(&dtiStartup, 0x00, sizeof(DTI_AgentStartupSettings_t));
#if defined(INCLUDE_DSL_CPE_API_VRX) && (DTI_INTERFACE_VERSION > 0)
DTI_AgentStartupSettingsXDevs_t AgentStartupSettingsXDevs;
DTI_DeviceAccessFct_t *pDeviceAccessFct = IFX_NULL;
if (DSL_CPE_GlobalDtiContext.bEnabled == DSL_TRUE)
{
/* already running */
return DSL_SUCCESS;
}
/* init the DTI control struct */
memset(&DSL_CPE_GlobalDtiContext, 0, sizeof(DSL_CPE_Dti_Context_t));
DSL_CPE_GlobalDtiContext.ifNum = -1;
if (DSL_CPE_GlobalDtiContext.pDtiAgent == DSL_NULL)
{
memset(&AgentStartupSettingsXDevs, 0x00, sizeof(DTI_AgentStartupSettingsXDevs_t));
/* DTI Agent configuration */
AgentStartupSettingsXDevs.debugLevel = 3;
AgentStartupSettingsXDevs.bStartupAutoCliMsgSupport = (bEnableCliAutoMsg == DSL_TRUE) ? 1 : 0;
#if defined(DTI_SUPPORT_SINGLE_THREADED_MODE) && (DTI_SUPPORT_SINGLE_THREADED_MODE == 1)
/*
Out from the DTI Agent interface:
This version ot the DTI Agent supports "single threaded mode"
*/
if (bEnableSingleThreadMode == DSL_TRUE)
{
AgentStartupSettingsXDevs.bSingleThreadedMode = 1;
AgentStartupSettingsXDevs.numOfUsedWorker = 1;
}
else
{
AgentStartupSettingsXDevs.bSingleThreadedMode = 0;
AgentStartupSettingsXDevs.numOfUsedWorker = 4;
}
#endif
/* DTI IP Setup setup */
cpe_control_strncpy_s(AgentStartupSettingsXDevs.serverIpAddr, 16, pDtiServerIp, strlen(pDtiServerIp));
AgentStartupSettingsXDevs.serverIpAddr[15]='\0';
AgentStartupSettingsXDevs.listenPort = (dtiListenPort == 0) ? 9000 : (IFX_uint16_t)dtiListenPort;
pDeviceAccessFct = &DTI_DeviceAccessFct_VRX;
if ( (pDeviceAccessFct != IFX_NULL) &&
(numOfPhyDevices > 0) && (numOfLinesPerPhyDevice > 0) )
{
AgentStartupSettingsXDevs.devIfSettings[0].bStartupAutoDevMsgSupport =
(bEnableDevAutoMsg == DSL_TRUE) ? 1 : 0;
AgentStartupSettingsXDevs.devIfSettings[0].numOfDevices = (IFX_int_t)numOfPhyDevices;
AgentStartupSettingsXDevs.devIfSettings[0].linesPerDevice = (IFX_int_t)numOfLinesPerPhyDevice;
AgentStartupSettingsXDevs.devIfSettings[0].pDeviceAccessFct = pDeviceAccessFct;
}
/*
start the DTI Agent
*/
if ( DTI_AgentStartXDevs(&pDtiAgent, &AgentStartupSettingsXDevs) != DTI_SUCCESS)
{
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX "DSL: ERROR - start DTI agent (several devices)" DSL_CPE_CRLF);
return DSL_ERROR;
}
DSL_CPE_GlobalDtiContext.pDtiAgent = pDtiAgent;
}
else
{
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX "DSL: WARNING - DTI agent already running" DSL_CPE_CRLF);
}
#else /* defined(INCLUDE_DSL_CPE_API_VRX) && (DTI_INTERFACE_VERSION > 0) */
if (DSL_CPE_GlobalDtiContext.pDtiAgent == DSL_NULL)
{
/* init the DTI control struct */
memset(&DSL_CPE_GlobalDtiContext, 0, sizeof(DSL_CPE_Dti_Context_t));
DSL_CPE_GlobalDtiContext.ifNum = -1;
/* physical device setup */
dtiStartup.numOfDevices = (IFX_int_t)numOfPhyDevices;
dtiStartup.linesPerDevice = (IFX_int_t)numOfLinesPerPhyDevice;
/* DTI IP Setup setup */
cpe_control_strncpy_s(dtiStartup.serverIpAddr, 16, pDtiServerIp, strlen(pDtiServerIp));
dtiStartup.listenPort = (dtiListenPort == 0) ? 9000 : (IFX_uint16_t)dtiListenPort;
/* DTI Agent configuration */
dtiStartup.bStartupAutoCliMsgSupport = (bEnableCliAutoMsg == DSL_TRUE) ? 1 : 0;
dtiStartup.bStartupAutoDevMsgSupport = (bEnableDevAutoMsg == DSL_TRUE) ? 1 : 0;
dtiStartup.debugLevel = 3;
#if defined(DTI_SUPPORT_SINGLE_THREADED_MODE) && (DTI_SUPPORT_SINGLE_THREADED_MODE == 1)
/*
Out from the DTI Agent interface:
This version ot the DTI Agent supports "single threaded mode"
*/
if (bEnableSingleThreadMode == DSL_TRUE)
{
dtiStartup.bSingleThreadedMode = 1;
dtiStartup.numOfUsedWorker = 1;
}
else
{
dtiStartup.bSingleThreadedMode = 0;
dtiStartup.numOfUsedWorker = 4;
}
#endif
/*
start the DTI Agent
*/
if ( DTI_AgentStart(&pDtiAgent, &dtiStartup) != DTI_SUCCESS)
{
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"ERROR - start DTI agent" DSL_CPE_CRLF);
return DSL_ERROR;
}
DSL_CPE_GlobalDtiContext.pDtiAgent = pDtiAgent;
}
else
{
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"WARNING - DTI agent already running" DSL_CPE_CRLF);
}
#endif/* defined(INCLUDE_DSL_CPE_API_VRX) && (DTI_INTERFACE_VERSION > 0) */
#if defined(INCLUDE_DSL_CPE_CLI_SUPPORT)
if (DSL_CPE_GlobalDtiContext.bEnabled != DSL_TRUE)
{
DSL_CPE_GlobalDtiContext.pDSLContext = pContext;
if (dtiStartup.bStartupAutoCliMsgSupport == 1)
{
ret = DSL_CPE_CLI_Register(
&DSL_CPE_GlobalDtiContext.pCLIContext,
&DSL_CPE_GlobalDtiContext,
DSL_CPE_CLI_Dti_Exit,
DSL_CPE_CLI_Dti_Event);
}
else
{
ret = DSL_CPE_CLI_Register(
&DSL_CPE_GlobalDtiContext.pCLIContext,
&DSL_CPE_GlobalDtiContext,
DSL_CPE_CLI_Dti_Exit,
IFX_NULL);
}
/* register the exec within the DTI module */
DSL_CPE_GlobalDtiContext.ifNum = DTI_CLI_SendFunctionRegister(
(IFX_void_t *)DSL_CPE_GlobalDtiContext.pDtiAgent,
(IFX_void_t *)&DSL_CPE_GlobalDtiContext,
"DSL_API",
DSL_CPE_CLI_Dti_Exec,
0x10000 /* size of response buffer */);
if (DSL_CPE_GlobalDtiContext.ifNum < 0)
{
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"ERROR - start DTI agent, send fct register" DSL_CPE_CRLF);
if (DSL_CPE_CLI_Unregister(DSL_CPE_GlobalDtiContext.pCLIContext) == DSL_SUCCESS)
{
DSL_CPE_Free(DSL_CPE_GlobalDtiContext.pCLIContext);
DSL_CPE_GlobalDtiContext.pCLIContext = DSL_NULL;
}
return DSL_ERROR;
}
}
else
{
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"WARNING - DTI agent already registered" DSL_CPE_CRLF);
}
#endif /* #if defined(INCLUDE_DSL_CPE_CLI_SUPPORT)*/
DSL_CPE_GlobalDtiContext.bEnabled = DSL_TRUE;
return ret;
}
/**
Initialise the CLI DTI
*/
DSL_Error_t DSL_CPE_Dti_Stop(
DSL_CPE_Control_Context_t *pContext)
{
DTI_AgentCtx_t *pDtiAgent = DSL_NULL;
if (DSL_CPE_GlobalDtiContext.bEnabled == DSL_TRUE)
{
pDtiAgent = DSL_CPE_GlobalDtiContext.pDtiAgent;
DSL_CPE_GlobalDtiContext.pDtiAgent = DSL_NULL;
if ( DTI_AgentStop(&pDtiAgent) != DTI_SUCCESS)
{
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"ERROR - Stop DTI agent" DSL_CPE_CRLF);
return DSL_ERROR;
}
if (DSL_CPE_CLI_Unregister(DSL_CPE_GlobalDtiContext.pCLIContext) == DSL_SUCCESS)
{
DSL_CPE_Free(DSL_CPE_GlobalDtiContext.pCLIContext);
DSL_CPE_GlobalDtiContext.pCLIContext = DSL_NULL;
}
}
else
{
DSL_CPE_FPrintf(DSL_CPE_STDOUT, DSL_CPE_PREFIX"ERROR - Stop DTI agent, not running" DSL_CPE_CRLF);
return DSL_ERROR;
}
return DSL_SUCCESS;
}
#endif /* #if defined(INCLUDE_DSL_CPE_DTI_SUPPORT) */

67
src/dsl_cpe_dti.h Normal file
View file

@ -0,0 +1,67 @@
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
*******************************************************************************/
#ifndef _DSL_CPE_DTI_H_
#define _DSL_CPE_DTI_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "dsl_cpe_control.h"
#define DSL_CPE_DTI_DEFAULT_TCP_PORT (9000)
/** \file
DSL daemon command line interface for DTI control
*/
/**
Start the Debug and Trace Agent
\param pContext DSL CPE API context pointer (used for callback handling)
\param numOfPhyDevices number of used physical devices.
\param numOfLinesPerPhyDevice lines per physical device
\param dtiListenPort DTI Agent listen port number.
\param pDtiServerIp DTI Agent IP address.
\return
- DSL_ERROR On error
- DSL_SUCCESS On success
*/
DSL_Error_t DSL_CPE_Dti_Start(
DSL_CPE_Control_Context_t *pContext,
DSL_int_t numOfPhyDevices,
DSL_int_t numOfLinesPerPhyDevice,
DSL_uint16_t dtiListenPort,
DSL_char_t *pDtiServerIp,
DSL_boolean_t bEnableCliAutoMsg,
DSL_boolean_t bEnableDevAutoMsg,
DSL_boolean_t bEnableSingleThreadMode);
/**
Stop the Debug and Trace Agent
\param pContext DSL CPE API context pointer (used for callback handling)
\return
- DSL_ERROR On error
- DSL_SUCCESS On success
*/
DSL_Error_t DSL_CPE_Dti_Stop(
DSL_CPE_Control_Context_t *pContext);
#ifdef __cplusplus
}
#endif
#endif /* _DSL_CPE_DTI_H_ */

3142
src/dsl_cpe_dti_vrx.c Normal file

File diff suppressed because it is too large Load diff

92
src/dsl_cpe_dti_vrx_ctx.h Normal file
View file

@ -0,0 +1,92 @@
#ifndef _DTI_VRX_CTX_H
#define _DTI_VRX_CTX_H
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/** \file
VRX device context, control struct for xDSL Rev3 access and handling.
*/
/* ==========================================================================
includes
========================================================================== */
#include "ifx_types.h"
#include "ifxos_debug.h"
#include "ifxos_device_access.h"
/* ==========================================================================
defines
========================================================================== */
#ifndef DTI_DEV_MAX_LINE_NUMBER
# define DTI_DEV_MAX_LINE_NUMBER 1
#endif
/* ==========================================================================
macro
========================================================================== */
/* ==========================================================================
types
========================================================================== */
/**
VRX Driver Control Struct
*/
typedef struct DTI_DEV_VrxDriverCtx_s
{
/** number of devices */
IFX_int_t numOfDevs;
/** ports per device */
IFX_int_t portsPerDev;
/** number of ports */
IFX_int_t numOfPorts;
/** points to the array of devices fds */
IFX_int_t *pDevFds;
/*
DTI Config
*/
/** max number of register requests / sets */
IFX_int_t numOfRegAccess;
/** max number of debug requests / sets */
IFX_int_t numOfDebugAccess;
/** auto msg handling - supported */
IFX_boolean_t bAutoDevMsgSupport;
/** auto msg handling - max device fd for select */
IFX_int_t nfcMaxDevFd;
/** auto msg handling - device FDSET */
IFXOS_devFd_set_t nfcDevFds;
/** auto msg handling - for temporary use, device FDSET */
IFXOS_devFd_set_t tmpDevFds;
/** auto msg handling - recv buffer for auto msg's */
IFX_ulong_t *pAutoMsgBuf;
/** auto msg handling - size of the modem message buffer for NFC handling */
IFX_int_t autoMsgBuf_byte;
/** debug stream local user buffer */
IFX_uint8_t *pDbgStreamUserBuf;
/** size of the local user buffer for debug stream handling */
IFX_int_t dbgStreamUserBuf_byte;
} DTI_DEV_VrxDriverCtx_t;
/* ==========================================================================
exports
========================================================================== */
#ifdef __cplusplus
}
#endif
#endif /* _DTI_VRX_CTX_H */

230
src/dsl_cpe_init_cfg.c Normal file
View file

@ -0,0 +1,230 @@
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
/*
Includes
*/
#include "dsl_cpe_control.h"
#include "drv_dsl_cpe_api.h"
#include "dsl_cpe_init_cfg.h"
#undef DSL_CCA_DBG_BLOCK
#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_APP
#ifndef _lint
DSL_InitData_t gInitCfgData =
{
DSL_CPE_FW1_SET(DSL_NULL, 0x0),
DSL_CPE_FW_FEATURE_SET(0, DSL_FW_XDSLMODE_CLEANED, DSL_FW_XDSLFEATURE_CLEANED, \
DSL_FW_XDSLFEATURE_CLEANED),
DSL_CPE_FW2_SET(DSL_NULL, 0x0),
DSL_CPE_XTU_SET(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7),
DSL_CPE_LINE_INV_NE_SET(DSL_NULL),
DSL_CPE_AUTOBOOT_CTRL_SET(DSL_AUTOBOOT_CTRL_STOP),
DSL_CPE_AUTOBOOT_CFG_SET(DSL_FALSE, DSL_FALSE, DSL_FALSE),
DSL_CPE_TEST_MODE_CTRL_SET(DSL_TESTMODE_DISABLE),
DSL_CPE_LINE_ACTIVATE_CTRL_SET(DSL_G997_INHIBIT_LDSF, DSL_G997_INHIBIT_ACSF, DSL_G997_NORMAL_STARTUP),
/** Device specific configuration parameters*/
#if defined(INCLUDE_DSL_CPE_API_VRX)
{
DSL_CPE_LL_CFG_SET(DSL_DEV_FILTER_NA, DSL_DEV_HS_TONE_GROUP_MODE_AUTO, \
DSL_DEV_HS_TONE_GROUP_CLEANED, \
DSL_DEV_HS_TONE_GROUP_CLEANED, \
DSL_DEV_HS_TONE_GROUP_CLEANED, \
0x1E116000, 0x37, -1),
DSL_CPE_SIC_SET(DSL_TC_ATM, DSL_EMF_TC_CLEANED, DSL_EMF_TC_CLEANED, DSL_SYSTEMIF_MII, \
DSL_TC_EFM, DSL_EMF_TC_CLEANED, DSL_EMF_TC_CLEANED, DSL_SYSTEMIF_MII),
DSL_CPE_MAC_CFG_SET(DSL_EFM_SPEED_100, DSL_EFM_DUPLEX_FULL, DSL_EFM_FLOWCTRL_ON, DSL_EFM_AUTONEG_OFF, \
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 1536, DSL_FALSE)
}
#endif
#if defined (INCLUDE_DSL_CPE_API_DANUBE)
{
DSL_CPE_LL_CFG_SET(DSL_DEV_HYBRID_NA),
DSL_CPE_SIC_SET(DSL_TC_ATM, DSL_EMF_TC_NORMAL, DSL_EMF_TC_NORMAL, DSL_SYSTEMIF_MII)
}
#endif
};
#endif /* _lint*/
#if defined(INCLUDE_DSL_CPE_API_VRX)
static DSL_Error_t DSL_VRX_ProcessDevConfigLine(
DSL_char_t *pLine,
DSL_uint32_t cfgLine,
DSL_DeviceLowLevelConfig_t *pRetLLCfg )
{
DSL_Error_t nRet = DSL_SUCCESS;
DSL_int_t nFilter = -1, nHsToneGroupMode = -1,
nIrqNum = 0,
bNtrEnable = -1;
DSL_uint32_t nHsToneGroup_A = -1, nHsToneGroup_V = -1,
nHsToneGroup_AV = -1, nBaseAddr = 0;
switch(cfgLine)
{
case 0:
sscanf(pLine,
"%d",
&nFilter);
pRetLLCfg->nFilter = (DSL_uint32_t)nFilter;
break;
case 1:
sscanf(pLine,
"%d %x %x %x",
&nHsToneGroupMode,
&nHsToneGroup_A,
&nHsToneGroup_V,
&nHsToneGroup_AV);
pRetLLCfg->nHsToneGroupMode = (DSL_uint32_t)nHsToneGroupMode;
pRetLLCfg->nHsToneGroup_A = (DSL_uint32_t)nHsToneGroup_A;
pRetLLCfg->nHsToneGroup_V = (DSL_uint32_t)nHsToneGroup_V;
pRetLLCfg->nHsToneGroup_AV = (DSL_uint32_t)nHsToneGroup_AV;
case 2:
sscanf(pLine,
"%x %d",
&nBaseAddr,
&nIrqNum);
pRetLLCfg->nBaseAddr = (DSL_uint32_t)nBaseAddr;
pRetLLCfg->nIrqNum = (DSL_int8_t)nIrqNum;
break;
case 3:
sscanf(pLine,
"%d",
&bNtrEnable);
pRetLLCfg->bNtrEnable = (DSL_boolean_t)bNtrEnable;
break;
default:
break;
}
return(nRet);
}
/**
This function returns the Initial Low Level Configuration from the give file
or the fixed default settings.
\param pName file name of the given LowLevelConfig
\param ppRetLLCfg Pointer to return the settings.
\return
Return values are defined within the DSL_Error_t definition
- DSL_SUCCESS in case of success
- DSL_ERROR if operation failed
- The return pointer is set to the given configuration or ULL
*/
DSL_Error_t DSL_CPE_GetInitialLowLevelConfig( DSL_char_t const *pName,
DSL_DeviceLowLevelConfig_t *pRetLLCfg )
{
DSL_CPE_File_t *fdCfg = DSL_NULL;
DSL_Error_t nRet = DSL_SUCCESS;
DSL_uint32_t nCfgFileLine;
DSL_char_t line[256];
/*
# VRX Low Level Configuration File
#
# Parameters must be separated by tabs or spaces.
# Empty lines and comments will be ignored.
#
# nFilter
#
# NA = -1
# OFF = 0
# ISDN = 1
# POTS = 2
# POTS_2 = 3
# POTS_3 = 4
#
# (dec)
-1
# nHsToneGroupMode nHsToneGroup_A nHsToneGroup_V nHsToneGroup_AV
#
# NA = -1 NA = -1 see see
# AUTO = 0 VDSL2_B43 = 0x0001 nHsToneGroup_A nHsToneGroup_A
# MANUAL = 1 VDSL2_A43 = 0x0002
# VDSL2_V43 = 0x0004
# VDSL1_V43P = 0x0008
# VDSL1_V43I = 0x0010
# ADSL1_C43 = 0x0020
# ADSL2_J43 = 0x0040
# ADSL2_B43C = 0x0080
# ADSL2_A43C = 0x0100
#
# (dec) (hex) (hex) (hex)
0 0x1 0x1 0x1
# nBaseAddr nIrqNum
#
# (hex) (dec)
0x1e116000 55
# nUtopiaPhyAdr nUtopiaBusWidth nPosPhyParity
# default(16b) = 0 NA = -1
# 8-bit = 1 ODD = 0
# 16-bit = 2
#
#
# (hex) (dec) (dec)
0xFF 0 0
# bNtrEnable
#
# (dec)
0
*/
if (pName != DSL_NULL)
{
fdCfg = DSL_CPE_FOpen(pName, "r");
if (fdCfg == DSL_NULL)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"DSL: Error opening low level configuration file %s " DSL_CPE_CRLF , pName));
return DSL_ERROR;
}
nCfgFileLine = 0;
while( (DSL_CPE_FGets(line, sizeof(line), fdCfg)) != DSL_NULL )
{
if( (line[0] == '\n') || (line[0] == '#') )
{
continue;
}
nRet = DSL_VRX_ProcessDevConfigLine(line, nCfgFileLine, pRetLLCfg);
nCfgFileLine++;
if( nRet != DSL_SUCCESS )
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"DSL: Error processing configuration file %s, line %d "DSL_CPE_CRLF, pName, nCfgFileLine));
break;
}
}
DSL_CPE_FClose (fdCfg);
}
else
{
DSL_CCA_DEBUG(DSL_CCA_DBG_WRN, (DSL_CPE_PREFIX
"DSL: Low Level Configuration file not specified, using default configuration"DSL_CPE_CRLF));
}
return nRet;
}
#endif /* #if defined(INCLUDE_DSL_CPE_API_VRX)*/

96
src/dsl_cpe_init_cfg.h Normal file
View file

@ -0,0 +1,96 @@
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifndef _DSL_CPE_INIT_CFG_H
#define _DSL_CPE_INIT_CFG_H
#ifdef __cplusplus
extern "C" {
#endif
#define DSL_CPE_FW1_SET(pFw1, szFw1) pFirmware: pFw1, nFirmwareSize: szFw1
#define DSL_CPE_FW_FEATURE_SET(nFwPId, nFwFsMode, nFwFsAdsl, nFwFsVdsl) \
{nPlatformId: nFwPId, nFirmwareXdslModes: nFwFsMode, \
nFirmwareAdslFeatures: nFwFsAdsl, nFirmwareVdslFeatures: nFwFsVdsl}
#define DSL_CPE_FW2_SET(pFw2, szFw2) pFirmware2: pFw2, nFirmwareSize2: szFw2
#define DSL_CPE_XTU_SET(oct0, oct1, oct2, oct3, oct4, oct5, oct6, oct7) \
nXtseCfg: {{oct0, oct1, oct2, oct3, oct4, oct5, oct6, oct7}}
#define DSL_CPE_LINE_INV_NE_SET(pLi) pInventory: pLi
#define DSL_CPE_AUTOBOOT_CTRL_SET(opt) nAutobootStartupMode: opt
#define DSL_CPE_AUTOBOOT_CFG_SET(opt1, opt2, opt3) \
{{bWaitBeforeConfigWrite: opt1, bWaitBeforeLinkActivation: opt2, bWaitBeforeRestart: opt3}}
#define DSL_CPE_TEST_MODE_CTRL_SET(opt) nTestModeControl: opt
#define DSL_CPE_LINE_ACTIVATE_CTRL_SET(LDSF, ACSF, STARTUP_MODE) \
{nLDSF: LDSF, nACSF: ACSF, nStartupMode: STARTUP_MODE}
#if defined(INCLUDE_DSL_CPE_API_DANUBE)
#define DSL_CPE_LL_CFG_SET(HYBRID) {nHybrid: HYBRID}
#define DSL_CPE_SIC_SET(TCLAYER, EFM_TC_CFG_US, EFM_TC_CFG_DS, SICS) \
{{nTcLayer: TCLAYER, nEfmTcConfigUs: EFM_TC_CFG_US, \
nEfmTcConfigDs: EFM_TC_CFG_DS, nSystemIf: SICS}}
#endif /* #if defined(INCLUDE_DSL_CPE_API_DANUBE)*/
#if defined(INCLUDE_DSL_CPE_API_VRX)
#define DSL_CPE_LL_CFG_SET(FILTER, HS_TONE_GROUP_MODE, HS_TONE_GROUP_A, \
HS_TONE_GROUP_V, HS_TONE_GROUP_AV, BASEADDR, IRQNUM, NTR_ENABLE) \
{nFilter: FILTER, nHsToneGroupMode: HS_TONE_GROUP_MODE, \
nHsToneGroup_A: HS_TONE_GROUP_A, nHsToneGroup_V: HS_TONE_GROUP_V, \
nHsToneGroup_AV: HS_TONE_GROUP_AV, nBaseAddr: BASEADDR, nIrqNum: IRQNUM, \
bNtrEnable: NTR_ENABLE}
#define DSL_CPE_SIC_SET(TCLAYER_A, EFM_TC_CFG_US_A, EFM_TC_CFG_DS_A, SICS_A, \
TCLAYER_V, EFM_TC_CFG_US_V, EFM_TC_CFG_DS_V, SICS_V) \
{{nTcLayer: TCLAYER_A, nEfmTcConfigUs: EFM_TC_CFG_US_A, \
nEfmTcConfigDs:EFM_TC_CFG_DS_A, nSystemIf: SICS_A}, \
{nTcLayer: TCLAYER_V, nEfmTcConfigUs: EFM_TC_CFG_US_V, \
nEfmTcConfigDs: EFM_TC_CFG_DS_V, nSystemIf: SICS_V}}
#endif /* #ifdef INCLUDE_DSL_CPE_API_VRX*/
#define DSL_CPE_MAC_CFG_SET(SPEED, DUPLEX, FLOW, ANEGOT, MAC_OCT_0, MAC_OCT_1, MAC_OCT_2, \
MAC_OCT_3, MAC_OCT_4, MAC_OCT_5, MAX_FRAME_SIZE, EXT_ETH_OAM) \
{SPEED, DUPLEX, FLOW, ANEGOT, {MAC_OCT_0, MAC_OCT_1, MAC_OCT_2, MAC_OCT_3, MAC_OCT_4, MAC_OCT_5}, \
MAX_FRAME_SIZE, EXT_ETH_OAM}
extern DSL_InitData_t gInitCfgData;
#if defined(INCLUDE_DSL_CPE_API_VRX)
/**
This function returns the Initial Low Level Configuration from the give file
or the fixed default settings.
\param pName file name of the given LowLevelConfig
\param ppRetLLCfg Pointer to return the settings.
\return
Return values are defined within the DSL_Error_t definition
- DSL_SUCCESS in case of success
- DSL_ERROR if operation failed
- The return pointer is set to the given configuration or ULL
*/
DSL_Error_t DSL_CPE_GetInitialLowLevelConfig( DSL_char_t const *pName,
DSL_DeviceLowLevelConfig_t *pRetLLCfg );
#endif /* #ifdef INCLUDE_DSL_CPE_API_VRX*/
#ifdef __cplusplus
}
#endif
#endif /* _DSL_CPE_INIT_CFG_H */

1651
src/dsl_cpe_linux.c Normal file

File diff suppressed because it is too large Load diff

572
src/dsl_cpe_linux.h Normal file
View file

@ -0,0 +1,572 @@
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifdef LINUX
#include "drv_dsl_cpe_api_types.h"
#ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT
#define _GNU_SOURCE 1
#include <features.h>
#include <stdlib.h>
#include <getopt.h>
#include <stdio.h> /* fdopen */
#include <sys/fcntl.h> /* open */
#include <sys/ioctl.h> /* ioctl */
#include <string.h> /* memset, strstr, strlen */
#include <stdlib.h> /* strtoul */
#include <sys/time.h> /* fd_set */
#include <sys/select.h> /* select */
#include <sys/ipc.h> /* ftok */
#include <ctype.h>
#include <unistd.h> /* daemon */
#include <sys/types.h>
#include <sys/wait.h>
#include <pthread.h>
#include <signal.h>
#include <stdarg.h> /* va_start... */
#include <errno.h>
#include <sys/stat.h> /* stat */
#include <math.h> /* log10, fabs, ceil */
#include <malloc.h>
#include <termios.h> /* tcgetattr, tcsetattr */
#include <netinet/in.h>
#include <net/if.h>
#include <arpa/inet.h>
#include <sys/socket.h> /* socket */
#include <sys/sem.h> /* semget */
#include <semaphore.h> /* sem_t */
#ifdef DSL_DEBUG_TOOL_INTERFACE
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <net/if.h>
#endif /* DSL_DEBUG_TOOL_INTERFACE*/
#else
#include <stdlib.h>
#include <getopt.h>
#include <stdio.h> /* fdopen */
#include <string.h> /* memset, strstr, strlen */
#include <stdlib.h> /* strtoul */
#include <sys/time.h> /* fd_set */
#include <ctype.h>
#include <unistd.h> /* daemon */
#include <sys/types.h>
#include <sys/wait.h>
#include <stdarg.h> /* va_start... */
#include <signal.h>
#include <errno.h>
#include <termios.h>
#include <netinet/in.h>
#include <net/if.h>
#include <arpa/inet.h>
#ifdef DSL_DEBUG_TOOL_INTERFACE
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <net/if.h>
#endif /* DSL_DEBUG_TOOL_INTERFACE*/
/** IFXOS includes*/
#include "ifxos_common.h"
#include "ifxos_print_io.h"
#include "ifxos_memory_alloc.h"
#include "ifxos_device_access.h"
#include "ifxos_file_access.h"
#include "ifxos_time.h"
#include "ifxos_lock.h"
#include "ifxos_thread.h"
#include "ifxos_termios.h"
#include "ifxos_pipe.h"
#include "ifxos_misc.h"
#include "ifxos_socket.h"
#endif /* INCLUDE_DSL_CPE_IFXOS_SUPPORT*/
/** \file
OS interface, Linux adaptation
*/
/*
***************** Common definitions ********************************
*/
#define DSL_CPE_STRNCASECMP strncasecmp
#ifndef FD_SETSIZE
#define DSL_FD_SETSIZE 1024
#else
#define DSL_FD_SETSIZE FD_SETSIZE
#endif
/* arpa/inet.h mapping */
#define DSL_CPE_StringToAddress(strAddr, iAddr) inet_aton(strAddr, (iAddr))
#define DSL_CPE_AddressToString inet_ntoa
/* sys/socket.h mapping */
#define DSL_CPE_SockOptSet setsockopt
/** map FILE to own type */
typedef FILE DSL_CPE_File_t;
/** map timeval structure */
typedef struct timeval DSL_TimeVal_t;
/** map the sockaddr_in to own type */
typedef struct linger DSL_SockOptLinger_t;
#ifdef INCLUDE_SCRIPT_NOTIFICATION
typedef struct DSL_CPE_EnvList
{
struct DSL_CPE_EnvList *pNext;
DSL_char_t *pEnvEntry;
} DSL_CPE_EnvList_t;
#define DSL_CPE_MAX_ENV_VAR_LENGTH (40)
#endif /* #ifdef INCLUDE_SCRIPT_NOTIFICATION*/
/**
Installs system dependant handlers (e.g. signal handler on linux)
*/
DSL_void_t DSL_CPE_HandlerInstall(DSL_void_t);
void DSL_CPE_KeypressSet (void);
void DSL_CPE_KeypressReset (void);
#ifdef INCLUDE_SCRIPT_NOTIFICATION
/**
Set environment variable
*/
DSL_Error_t DSL_CPE_SetEnv(const DSL_char_t *sName, const DSL_char_t *sValue);
/**
Clear all environment variables
*/
DSL_void_t DSL_CPE_EnvVarFree(DSL_void_t);
/**
Execute a shell command
*/
DSL_Error_t DSL_CPE_System(const DSL_char_t *sCommand);
#endif /* #ifdef INCLUDE_SCRIPT_NOTIFICATION*/
DSL_uint16_t DSL_CPE_Htons(DSL_uint16_t hVal);
DSL_uint32_t DSL_CPE_Htonl(DSL_uint32_t hVal);
#if defined(DSL_DEBUG_TOOL_INTERFACE) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT)
DSL_char_t* DSL_CPE_OwnAddrStringGet(DSL_void_t);
#endif /* DSL_DEBUG_TOOL_INTERFACE*/
/**
Print to a file, pipe, stdout, stderr or memory file.
*/
DSL_int_t DSL_CPE_FPrintf(DSL_CPE_File_t *stream, const DSL_char_t *format, ...)
#ifdef __GNUC__
__attribute__ ((format (printf, 2, 3)))
#endif
;
/*
***************** IFXOS dependent definitions **************************
*/
#ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT
#ifndef __BIG_ENDIAN
#define __BIG_ENDIAN 1
#define __LITTLE_ENDIAN 2
#endif
#ifndef __BYTE_ORDER
#define __BYTE_ORDER __BIG_ENDIAN
#endif
/** LINUX User - LOCK, user space semaphore for synchronisation. */
typedef struct
{
/** lock id */
sem_t object;
/** valid flag */
DSL_boolean_t bValid;
} DSL_CPE_Lock_t;
#define DSL_LOCK_INIT_VALID(P_LOCK_ID)\
(((P_LOCK_ID)) ? (((P_LOCK_ID)->bValid == DSL_TRUE) ? DSL_TRUE : DSL_FALSE) : DSL_FALSE)
/** map the fd_set to own type */
typedef fd_set DSL_CPE_fd_set_t;
typedef int DSL_Socket_t;
/** map the sockaddr_in to own type */
typedef struct sockaddr_in DSL_sockaddr_in_t;
/** map the sockaddr to own type */
typedef struct sockaddr DSL_sockaddr_t;
/** map the socklen_t to own type */
typedef socklen_t DSL_socklen_t;
/** map stat structure */
typedef struct stat DSL_CPE_stat_t;
/** map to stderr */
#define DSL_CPE_STDERR stderr
/** map to stdout */
#define DSL_CPE_STDOUT stdout
/** map to stdin */
#define DSL_CPE_STDIN stdin
#define DSL_CPE_snprintf snprintf
/* stdio.h mapping */
#define DSL_CPE_FdOpen fdopen
#define DSL_CPE_INADDR_ANY INADDR_ANY
#define DSL_CPE_SocketClose close
#define DSL_CPE_SocketRecv(s,buf,sz) recv(s,buf,sz,0)
#define DSL_CPE_SocketSend(s,buf,sz) send(s,buf,sz,MSG_DONTWAIT)
/**
LINUX User Thread - map the Thread ID.
*/
typedef int DSL_CPE_Thread_t;
/**
LINUX User Thread - function type LINUX User Thread Start Routine.
*/
typedef void *(*DSL_USER_THREAD_StartRoutine)(void*);
#define DSL_CPE_THREAD_NAME_LEN 16
#define DSL_THREAD_DOWN_WAIT_POLL_MS 10
#define DSL_THREAD_DELETE_WAIT_FOREVER 0xFFFFFFFF
typedef struct
{
/** user argument 1 */
DSL_uint32_t nArg1;
/** user argument 2 */
DSL_uint32_t nArg2;
/** name of the thread/task */
DSL_char_t pName[DSL_CPE_THREAD_NAME_LEN];
/** control - signal the run state */
volatile DSL_boolean_t bRunning;
/** control - set to shutdown the thread */
volatile DSL_boolean_t bShutDown;
} DSL_CPE_Thread_Params_t;
typedef DSL_int_t (*DSL_CPE_ThreadFunction_t)(DSL_CPE_Thread_Params_t *);
/**
LINUX User Thread - Control struct for thread handling.
*/
typedef struct
{
/* Contains the user and thread control parameters */
DSL_CPE_Thread_Params_t thrParams;
/* Points to the thread start routine */
DSL_CPE_ThreadFunction_t pThrFct;
/** LINUX User specific for internal - keep the task thread ID */
DSL_CPE_Thread_t tid;
/** requested kernel thread priority */
DSL_int32_t nPriority;
/** flag indicates that the structure is initialized */
DSL_boolean_t bValid;
} DSL_CPE_ThreadCtrl_t;
DSL_int32_t DSL_CPE_ThreadInit( DSL_CPE_ThreadCtrl_t *pThrCntrl,
DSL_char_t *pName,
DSL_CPE_ThreadFunction_t pThreadFunction,
DSL_uint32_t nStackSize,
DSL_uint32_t nPriority,
DSL_uint32_t nArg1,
DSL_uint32_t nArg2);
DSL_int32_t DSL_CPE_ThreadShutdown( DSL_CPE_ThreadCtrl_t *pThrCntrl,
DSL_uint32_t waitTime_ms);
DSL_CPE_Thread_t DSL_CPE_ThreadIdGet(void);
#define DSL_THREAD_INIT_VALID(P_THREAD_ID) (((P_THREAD_ID)) ? (((P_THREAD_ID)->bValid == DSL_TRUE) ? DSL_TRUE : DSL_FALSE) : DSL_FALSE)
/**
Open a device
*/
DSL_int_t DSL_CPE_Open(const DSL_char_t *pName);
/**
Close a device
*/
DSL_int_t DSL_CPE_Close(const DSL_int_t fd);
/**
Write to a device
*/
DSL_int_t DSL_CPE_Write(const DSL_int_t fd, const DSL_void_t *pData, const DSL_uint32_t nSize);
/**
Read from a device
*/
DSL_int_t DSL_CPE_Read(const DSL_int_t fd, DSL_void_t *pData, const DSL_uint32_t nSize);
/**
Control a device
*/
DSL_int_t DSL_CPE_Ioctl(const DSL_int_t fd, const DSL_uint32_t cmd, DSL_int_t param);
/**
Wait for a device wake up
*/
DSL_int_t DSL_CPE_Select(const DSL_int_t max_fd,
const DSL_CPE_fd_set_t *read_fd_in,
DSL_CPE_fd_set_t *read_fd_out,
const DSL_uint32_t timeout_msec);
/**
Fill a descriptor set with zeros.
*/
DSL_void_t DSL_CPE_FD_ZERO(DSL_CPE_fd_set_t *set);
/**
Mark a descriptor in use.
*/
DSL_void_t DSL_CPE_FD_SET(DSL_int_t fd, DSL_CPE_fd_set_t *set);
/**
Clear a descriptor in use flag.
*/
DSL_void_t DSL_CPE_FD_CLR(DSL_int_t fd, DSL_CPE_fd_set_t *set);
/**
Check if a descriptor is set.
*/
DSL_int_t DSL_CPE_FD_ISSET(DSL_int_t fd, const DSL_CPE_fd_set_t *set);
/**
Get a byte from stdin .
*/
DSL_int_t DSL_CPE_GetChar(DSL_void_t);
/**
Write a byte stdout .
*/
DSL_int_t DSL_CPE_PutChar(DSL_char_t c, DSL_CPE_File_t *stream);
/**
Create a pipe.
\param
pName - pipe name
\return
- DSL_SUCCESS on success
- DSL_ERROR on failure
*/
DSL_Error_t DSL_CPE_PipeCreate(DSL_char_t *pName);
/**
Open a pipe.
\param
pName - pipe name
\return
- pointer to FILE structure
- in case of error the return value is NULL
*/
DSL_CPE_File_t *DSL_CPE_PipeOpen(DSL_char_t *pName, DSL_boolean_t reading, DSL_boolean_t blocking);
/**
Close a pipe.
\param
pipe - pipe stream
\return
- (0) on success
- (-1) on failure
*/
DSL_Error_t DSL_CPE_PipeClose(DSL_CPE_File_t *file);
/**
Initialize a semaphore.
\param lock semaphore identifier
\return
0 on success.
*/
DSL_int32_t DSL_CPE_LockCreate(DSL_CPE_Lock_t *lock);
/**
Delete a semaphore.
\param lock semaphore identifier
\return
- DSL_SUCCESS on success
- DSL_ERROR on failure
*/
DSL_int32_t DSL_CPE_LockDelete(DSL_CPE_Lock_t *lock);
/**
Gets a semaphore.
\param lock semaphore identifier
\return
- (0) on success
- (-1) on failure
*/
DSL_int32_t DSL_CPE_LockGet(DSL_CPE_Lock_t *lock);
/**
Get the Lock with timeout.
\param
lockId Provides the pointer to the Lock Object.
\param
timeout_ms Timeout value [ms]
- 0: no wait
- -1: wait forever
- any other value: waiting for specified amount of milliseconds
\param
pRetCode Points to the return code variable. [O]
- If the pointer is NULL the return code will be ignored, else
the corresponding return code will be set
- For timeout the return code is set to 1.
\return
DSL_SUCCESS on success.
DSL_ERROR on error or timeout.
\note
To detect timeouts provide the return code varibale, in case of timeout
the return code is set to 1.
*/
DSL_int32_t DSL_CPE_LockTimedGet(
DSL_CPE_Lock_t *lockId,
DSL_uint32_t timeout_ms,
DSL_int32_t *pRetCode);
/**
Return the semaphore
\param lock semaphore identifier
\return
- (0) on success
- (-1) on failure
*/
DSL_int32_t DSL_CPE_LockSet(DSL_CPE_Lock_t *lock);
/**
Sleep specified number of seconds.
\param nSeconds Number of seconds to sleep
*/
DSL_void_t DSL_CPE_Sleep(DSL_uint32_t nSeconds);
/**
Sleep specified number of milliseconds.
\param nMs Number of milliseconds to sleep
*/
DSL_void_t DSL_CPE_MSecSleep(DSL_uint32_t nMs);
/**
Allocates a memory block
\param size Bytes to allocate
\return
returns a DSL_void_t pointer to the allocated space, NULL if there's not
sufficient memory space available.
*/
DSL_void_t *DSL_CPE_Malloc(DSL_uint32_t size);
/**
Deallocates a memory block
\param memblock Previously allocated memory block that should be freed
*/
void DSL_CPE_Free(DSL_void_t *memblock);
/**
Open a file.
*/
DSL_CPE_File_t *DSL_CPE_FOpen(const DSL_char_t *name, const DSL_char_t *mode);
/**
Close the file or memory file.
*/
DSL_int_t DSL_CPE_FClose(DSL_CPE_File_t *fd);
/**
Flush a file or pipe.
*/
DSL_int_t DSL_CPE_FFlush(DSL_CPE_File_t *fd);
/**
Read from file, stdin .
*/
DSL_int_t DSL_CPE_FRead(DSL_void_t *buf, DSL_uint32_t size, DSL_uint32_t count, DSL_CPE_File_t *stream);
/**
Write to a file, pipe, stdout.
*/
DSL_int_t DSL_CPE_FWrite(const DSL_void_t *buf, DSL_uint32_t size, DSL_uint32_t count, DSL_CPE_File_t *stream);
/**
End of file test of a file.
*/
DSL_int_t DSL_CPE_Feof(DSL_CPE_File_t *stream);
/**
Read a string from the file.
*/
DSL_char_t *DSL_CPE_FGets(DSL_char_t *str, DSL_int_t n, DSL_CPE_File_t *stream);
/**
get file status
*/
DSL_int_t DSL_CPE_FStat(DSL_char_t *str, DSL_CPE_stat_t *st);
DSL_Socket_t DSL_CPE_Accept(DSL_Socket_t socFd, DSL_sockaddr_in_t *pSocAddr);
DSL_int_t DSL_CPE_Socket(DSL_int_t socType, DSL_Socket_t *pSocketFd);
DSL_int_t DSL_CPE_SocketBind(
DSL_Socket_t socFd,
DSL_sockaddr_in_t *pSocAddr);
void DSL_CPE_EchoOff (void);
void DSL_CPE_EchoOn (void);
#endif /* #ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT*/
#endif /* LINUX */

333
src/dsl_cpe_os.h Normal file
View file

@ -0,0 +1,333 @@
/******************************************************************************
Copyright 2016 - 2019 Intel Corporation
Copyright 2015 - 2016 Lantiq Beteiligungs-GmbH & Co. KG
Copyright 2011 - 2014 Lantiq Deutschland GmbH
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifndef DSL_CPE_API_OS_H
#define DSL_CPE_API_OS_H
#ifdef __cplusplus
extern "C" {
#endif
/** \file
Operating System depending files, definitions and functions
*/
#include "drv_dsl_cpe_api_types.h"
#include "drv_dsl_cpe_api.h"
#if defined(INCLUDE_DSL_CPE_IFXOS_SUPPORT) || defined(VXWORKS)
/* support other OS only through lib_ifxos */
#ifndef USE_LIB_IFXOS
#define USE_LIB_IFXOS 1
#endif
#endif /** INCLUDE_DSL_CPE_IFXOS_SUPPORT*/
#ifndef _lint
#ifdef LINUX
#include "dsl_cpe_linux.h"
#elif defined(WIN32)
#include "dsl_cpe_win32.h"
#elif defined(VXWORKS)
#include "dsl_cpe_vxworks.h"
#elif defined(ECOS)
#include "dsl_cpe_ecos.h"
#elif defined(RTEMS)
#include "dsl_cpe_rtems.h"
#elif defined(GENERIC_OS)
#include "dsl_cpe_generic_os.h"
#else
#error please define your OS for the CPE Control adaptation
#endif
#else
#include "dsl_cpe_os_lint_map.h"
#endif /* _lint*/
#ifndef __BIG_ENDIAN
#error please define the __BIG_ENDIAN macro
#endif
#ifndef __BYTE_ORDER
#error please specify the endianess of your target system
#endif
/**
System definitions
*/
#ifndef DSL_CPE_PRIORITY
#define DSL_CPE_PRIORITY (0)
#endif
#ifndef DSL_CPE_STACKSIZE
#define DSL_CPE_STACKSIZE (2048)
#endif
#ifndef DSL_CPE_EVENT_STACKSIZE
#define DSL_CPE_EVENT_STACKSIZE (8192)
#endif
/** Default stack size */
#ifndef DSL_CPE_DEFAULT_STACK_SIZE
#define DSL_CPE_DEFAULT_STACK_SIZE (4096)
#endif
/** Control task stack size */
#ifndef DSL_CPE_CONTROL_STACK_SIZE
#define DSL_CPE_CONTROL_STACK_SIZE (4096)
#endif
/** Pipe task stack size */
#ifndef DSL_CPE_PIPE_STACK_SIZE
#define DSL_CPE_PIPE_STACK_SIZE (8192)
#endif
/** Pipe task priority */
#ifndef DSL_CPE_PIPE_PRIORITY
#define DSL_CPE_PIPE_PRIORITY (0)
#endif
#ifndef DSL_CPE_TCP_MSG_STACKSIZE
#define DSL_CPE_TCP_MSG_STACKSIZE (8192)
#endif
#ifndef DSL_CPE_TCP_MSG_PRIORITY
#define DSL_CPE_TCP_MSG_PRIORITY (0)
#endif
/**
Carriage Return + Line Feed, maybe overwritten by compile switches
or OS-specific adaptation */
#ifndef DSL_CPE_CRLF
#define DSL_CPE_CRLF "\n\r"
#endif
int DSL_CPE_debug_printf(DSL_char_t *fmt, ...)
#if __GNUC__ >= 3
__attribute__ ((__format__ (__printf__, 1, 2)))
#endif
;
#define DSL_CPE
#define DSL_CPE_PRN_USR_ERR_NL IFXOS_PRN_USR_ERR_NL
#define DSL_CPE_STATIC static
#if defined(USE_LIB_IFXOS) && (USE_LIB_IFXOS == 1)
/**
Pointer Struct for alligned buffer allocation and access.
*/
typedef union
{
IFX_uint8_t *pUInt8;
IFX_uint16_t *pUInt16;
IFX_uint32_t *pUInt32;
IFX_ulong_t *pULong;
} DSL_PTR_U;
/** NULL pointer */
#ifndef IFX_NULL
#define IFX_NULL ((void *)0)
#endif
/**
This is the addr pointer datatype (On 32bit systems it is 4 byte wide).
*/
typedef IFX_ulong_t IFX_addr_t;
#ifndef DSL_PTR_CAST_GET_ULONG
# define DSL_PTR_CAST_GET_ULONG(buffer_ptr) \
/*lint -e{506} -e{826} */ \
( (sizeof(IFX_addr_t) == 4) ? \
((((IFX_addr_t)(buffer_ptr).pUInt8 & 0x03) != 0) ? IFX_NULL : (buffer_ptr).pULong) : \
((((IFX_addr_t)(buffer_ptr).pUInt8 & 0x07) != 0) ? IFX_NULL : (buffer_ptr).pULong) )
#endif
#ifndef DSL_PTR_CAST_GET_UINT32
# define DSL_PTR_CAST_GET_UINT32(buffer_ptr) \
((((IFX_addr_t)(buffer_ptr).pUInt8 & 0x03) != 0) ? IFX_NULL : (buffer_ptr).pUInt32)
#endif
#ifndef DSL_PTR_CAST_GET_UINT16
# define DSL_PTR_CAST_GET_UINT16(buffer_ptr) \
((((IFX_addr_t)(buffer_ptr).pUInt8 & 0x03) != 0) ? IFX_NULL : (buffer_ptr).pUInt16)
#endif
#define DSL_PRN_LEVEL_HIGH IFXOS_PRN_LEVEL_HIGH
#define DSL_PRN_LEVEL_NORMAL IFXOS_PRN_LEVEL_NORMAL
#define DSL_PRN_LEVEL_LOW IFXOS_PRN_LEVEL_LOW
#define DSL_PRN_LEVEL_WRN IFXOS_PRN_LEVEL_WRN
#define DSL_PRN_LEVEL_ERR IFXOS_PRN_LEVEL_ERR
/*
common defines - ifxos_common.h"
*/
#define DSL_BYTE_ORDER IFXOS_BYTE_ORDER
#define DSL_LITTLE_ENDIAN IFXOS_LITTLE_ENDIAN
#define DSL_BIG_ENDIAN IFXOS_BIG_ENDIAN
#ifndef __BIG_ENDIAN
#define __BIG_ENDIAN IFXOS_BIG_ENDIAN
#define __LITTLE_ENDIAN IFXOS_LITTLE_ENDIAN
#define __BYTE_ORDER IFXOS_BYTE_ORDER
#endif
#ifndef __BYTE_ORDER
#define __BYTE_ORDER __LITTLE_ENDIAN
#endif
/*
Function map - stdio, string
*/
#define DSL_CPE_GetChar IFXOS_GetChar
#define DSL_CPE_PutChar IFXOS_PutChar
#define DSL_CPE_FGets IFXOS_FGets
/*#define DSL_CPE_FPrintf IFXOS_FPrintf*/
#define DSL_CPE_snprintf IFXOS_SNPrintf
#define DSL_vsnprintf IFXOS_VSNPrintf
/*
Function map - Memory Functions.
*/
#if ( defined(IFXOS_HAVE_MEM_ALLOC) && (IFXOS_HAVE_MEM_ALLOC == 1) )
#define DSL_CPE_Malloc IFXOS_MemAlloc
#define DSL_CPE_Free IFXOS_MemFree
#endif
#define DSL_CPE_StrLen strlen
/*
Function map - Device handling (open, close ...).
*/
#define DSL_CPE_fd_set_t IFXOS_devFd_set_t
#define DSL_CPE_FD_SET IFXOS_DevFdSet
#define DSL_CPE_FD_ISSET IFXOS_DevFdIsSet
#define DSL_CPE_FD_ZERO IFXOS_DevFdZero
#define DSL_CPE_FD_CLR FD_CLR /*KAv: no IFX OS support!*/
#if ( defined(IFXOS_HAVE_DEVICE_ACCESS) && (IFXOS_HAVE_DEVICE_ACCESS == 1) )
#define DSL_CPE_Open IFXOS_DeviceOpen
#define DSL_CPE_Close IFXOS_DeviceClose
#define DSL_CPE_Read IFXOS_DeviceRead
#define DSL_CPE_Write IFXOS_DeviceWrite
#define DSL_CPE_Ioctl IFXOS_DeviceControl
#define DSL_CPE_Select IFXOS_DeviceSelect
#define DSL_CPE_DevFdSet IFXOS_DevFdSet
#define DSL_CPE_DevFdIsSet IFXOS_DevFdIsSet
#endif
/*
function types - "ifxos_file_access.h"
*/
#if ( defined(IFXOS_HAVE_FILE_ACCESS) && (IFXOS_HAVE_FILE_ACCESS == 1) )
#define DSL_CPE_STDERR IFXOS_STDERR
#define DSL_CPE_STDOUT IFXOS_STDOUT
#define DSL_CPE_STDIN IFXOS_STDIN
#define DSL_CPE_stat_t IFXOS_stat_t
#define DSL_CPE_FdOpen fdopen
#define DSL_CPE_FOpen IFXOS_FOpen
#define DSL_CPE_FClose IFXOS_FClose
#define DSL_CPE_FRead IFXOS_FRead
#define DSL_CPE_FWrite IFXOS_FWrite
#define DSL_CPE_FFlush IFXOS_FFlush
#define DSL_CPE_Feof IFXOS_FEof
#define DSL_CPE_FStat IFXOS_Stat
#define DSL_CPE_FMemOpen IFXOS_FMemOpen
#endif
/*
Function map - Time and Wait Functions and Defines.
*/
#define DSL_CPE_Sleep IFXOS_SecSleep
#define DSL_CPE_MSecSleep IFXOS_MSecSleep
/*
Function map - Lock functions and defines.
*/
#define DSL_CPE_Lock_t IFXOS_lock_t
#define DSL_LOCK_INIT_VALID IFXOS_LOCK_INIT_VALID
#define DSL_CPE_LockCreate IFXOS_LockInit
#define DSL_CPE_LockDelete IFXOS_LockDelete
#define DSL_CPE_LockSet IFXOS_LockRelease
#define DSL_CPE_LockTimedGet IFXOS_LockTimedGet
#define DSL_CPE_LockGet IFXOS_LockGet
/*
Function map - Lock functions and defines.
*/
#define DSL_CPE_Thread_t IFXOS_thread_t
#define DSL_CPE_ThreadFunction_t IFXOS_ThreadFunction_t
#define DSL_CPE_ThreadCtrl_t IFXOS_ThreadCtrl_t
#define DSL_CPE_Thread_Params_t IFXOS_ThreadParams_t
#define DSL_CPE_ThreadInit IFXOS_ThreadInit
#define DSL_CPE_ThreadDelete IFXOS_ThreadDelete
#define DSL_CPE_ThreadShutdown IFXOS_ThreadShutdown
#define DSL_CPE_ThreadIdGet IFXOS_ThreadIdGet
/*
Function map - Pipe functions and defines.
*/
#define DSL_CPE_Pipe_t IFXOS_Pipe_t
#define DSL_CPE_PipeCreate IFXOS_PipeCreate
#define DSL_CPE_PipeOpen IFXOS_PipeOpen
#define DSL_CPE_PipeClose IFXOS_PipeClose
/*
Function map - Terminal functions and defines.
*/
#define DSL_CPE_EchoOff IFXOS_EchoOff
#define DSL_CPE_EchoOn IFXOS_EchoOn
/*
function types - "ifxos_socket.h"
*/
#define DSL_CPE_INADDR_ANY IFXOS_SOC_INADDR_ANY
#define DSL_CPE_ADDR_LEN IFXOS_SOC_ADDR_LEN_BYTE
#define DSL_sockaddr_in_t IFXOS_sockAddr_t
#define DSL_sockaddr_t IFXOS_sockAddr_t
#define DSL_Socket_t IFXOS_socket_t
#define DSL_CPE_Socket IFXOS_SocketCreate
#define DSL_CPE_Accept IFXOS_SocketAccept
#define DSL_CPE_SocketBind IFXOS_SocketBind
#define DSL_CPE_SocketClose IFXOS_SocketClose
#define DSL_CPE_SocketRecv IFXOS_SocketRecv
#define DSL_CPE_SocketSend IFXOS_SocketSend
#define DSL_CPE_AddressToString inet_ntoa /*KAv: no IFX OS support!*/
#else /* (USE_LIB_IFXOS == 1) */
/* use the built in OS abstraction layer */
/* this is obsolete, in mid term it will be removed from source tree */
#endif /* (USE_LIB_IFXOS == 1) */
#ifdef __cplusplus
}
#endif
#endif /* DSL_CPE_API_OS_H */

628
src/dsl_cpe_os_lint_map.h Normal file
View file

@ -0,0 +1,628 @@
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifndef DSL_CPE_API_OS_LINT_MAP_H
#define DSL_CPE_API_OS_LINT_MAP_H
#ifdef __cplusplus
extern "C" {
#endif
#include "drv_dsl_cpe_api_types.h"
#define DSL_LOCK_INIT_VALID(P_LOCK_ID)\
(((P_LOCK_ID)) ? (((P_LOCK_ID)->bValid == DSL_TRUE) ? DSL_TRUE : DSL_FALSE) : DSL_FALSE)
#define NULL ((void *)0)
#define ULONG_MAX (0xFFFFFFFF)
#define _IOW(a,b,c) (b)
#define _IOR(a,b,c) (b)
#define _IOWR(a, b, c) (b)
#define _IO(a,b) (b)
#define _IOC_TYPE(x) (((x)>>8) & 0xFF)
#define SIGINT (0x0)
#define SIG_IGN NULL
#define FD_SETSIZE (1024)
#define DSL_FD_SETSIZE FD_SETSIZE
#define AF_INET (0)
#define DSL_CPE_INADDR_ANY (0)
#define SOCK_STREAM (0)
#define SOL_SOCKET (0)
#define SO_REUSEADDR (0)
#define SO_KEEPALIVE (0)
#define SO_DEBUG (0)
#define SO_LINGER (0)
#define SO_SNDTIMEO (0)
#define SO_RCVTIMEO (0)
#define MSG_DONTWAIT (1)
#define O_RDONLY (0)
#define O_RDWR (1)
#define SEEK_SET (0)
#define ENODATA (1)
#define EFAULT (2)
#define ETIMEDOUT (3)
#define ENOENT (4)
extern unsigned short errno;
extern char *optarg;
typedef int sem_t;
typedef int time_t;
typedef int off_t;
typedef unsigned long size_t;
/** LINUX User - LOCK, user space semaphore for synchronisation. */
typedef struct
{
/** lock id */
sem_t object;
/** valid flag */
DSL_boolean_t bValid;
} DSL_CPE_Lock_t;
typedef struct
{
int l_onoff;
int l_linger;
} DSL_SockOptLinger_t;
struct timeval
{
unsigned int tv_sec; /* seconds */
unsigned int tv_usec; /* microseconds */
};
struct in_addr {
unsigned long s_addr;
};
struct sockaddr_in{
short sin_family;
unsigned short sin_port;
struct in_addr sin_addr;
char sin_zero[8];
};
struct sockaddr {
unsigned short sa_family;
char sa_data[14];
};
struct stat {
unsigned st_dev;
long st_pad1[3]; /* Reserved for network id */
unsigned st_rdev;
unsigned st_size;
long st_pad2[2];
long st_pad3;
/*
* Actually this should be timestruc_t st_atime, st_mtime and st_ctime
* but we don't have it under Linux.
*/
time_t st_atime;
long st_atime_nsec;
time_t st_mtime;
long st_mtime_nsec;
time_t st_ctime;
long st_ctime_nsec;
long st_blksize;
long st_blocks;
long st_pad4[14];
};
#define NCC 8
struct termios {
unsigned short c_iflag; /* input mode flags */
unsigned short c_oflag; /* output mode flags */
unsigned short c_cflag; /* control mode flags */
unsigned short c_lflag; /* local mode flags */
char c_line; /* line discipline */
unsigned char c_cc[NCC]; /* control characters */
};
struct option
{
const char *name;
int has_arg;
int *flag;
int val;
};
/** map the fd_set to own type */
typedef int DSL_CPE_fd_set_t;
typedef int DSL_Socket_t;
/** map the sockaddr_in to own type */
typedef struct sockaddr_in DSL_sockaddr_in_t;
/** map the sockaddr to own type */
typedef struct sockaddr DSL_sockaddr_t;
/** map the socklen_t to own type */
typedef int DSL_socklen_t;
/** map FILE to own type */
typedef int DSL_CPE_File_t;
/** map stat structure */
typedef struct stat DSL_CPE_stat_t;
typedef struct timeval DSL_TimeVal_t;
/**
LINUX User Thread - map the Thread ID.
*/
typedef int DSL_CPE_Thread_t;
/**
LINUX User Thread - function type LINUX User Thread Start Routine.
*/
typedef void *(*DSL_USER_THREAD_StartRoutine)(void*);
#define DSL_CPE_THREAD_NAME_LEN 16
#define DSL_THREAD_DOWN_WAIT_POLL_MS 10
#define DSL_THREAD_DELETE_WAIT_FOREVER 0xFFFFFFFF
typedef struct
{
/** user argument 1 */
DSL_uint32_t nArg1;
/** user argument 2 */
DSL_uint32_t nArg2;
/** name of the thread/task */
DSL_char_t pName[DSL_CPE_THREAD_NAME_LEN];
/** control - signal the run state */
volatile DSL_boolean_t bRunning;
/** control - set to shutdown the thread */
volatile DSL_boolean_t bShutDown;
} DSL_CPE_Thread_Params_t;
typedef DSL_int_t (*DSL_CPE_ThreadFunction_t)(DSL_CPE_Thread_Params_t *);
/**
LINUX User Thread - Control struct for thread handling.
*/
typedef struct
{
/* Contains the user and thread control parameters */
DSL_CPE_Thread_Params_t thrParams;
/* Points to the thread start routine */
DSL_CPE_ThreadFunction_t pThrFct;
/** LINUX User specific for internal - keep the task thread ID */
DSL_CPE_Thread_t tid;
/** requested kernel thread priority */
DSL_int32_t nPriority;
/** flag indicates that the structure is initialized */
DSL_boolean_t bValid;
} DSL_CPE_ThreadCtrl_t;
/** map to stderr */
#define DSL_CPE_STDERR ((DSL_CPE_File_t*)0)
/** map to stdout */
#define DSL_CPE_STDOUT ((DSL_CPE_File_t*)1)
/** map to stdin */
#define DSL_CPE_STDIN ((DSL_CPE_File_t*)2)
DSL_int32_t DSL_CPE_ThreadInit( DSL_CPE_ThreadCtrl_t *pThrCntrl,
DSL_char_t *pName,
DSL_CPE_ThreadFunction_t pThreadFunction,
DSL_uint32_t nStackSize,
DSL_uint32_t nPriority,
DSL_uint32_t nArg1,
DSL_uint32_t nArg2);
DSL_int32_t DSL_CPE_ThreadShutdown( DSL_CPE_ThreadCtrl_t *pThrCntrl,
DSL_uint32_t waitTime_ms);
DSL_CPE_Thread_t DSL_CPE_ThreadIdGet(void);
#define DSL_THREAD_INIT_VALID(P_THREAD_ID) (((P_THREAD_ID)) ? (((P_THREAD_ID)->bValid == DSL_TRUE) ? DSL_TRUE : DSL_FALSE) : DSL_FALSE)
int FD_ISSET(int fd, const int *set);
int lstat(char*, struct stat* );
int open(char* , int );
unsigned short ntohs(unsigned short);
unsigned short htons(unsigned short);
int ioctl(const int , const unsigned, int );
int close(int);
int recv(int, char*, int, int);
int send(int , const char *, int , int );
int listen(int, int);
int setsockopt(int, int, int, const void*, unsigned int);
int inet_aton(const char*, struct in_addr *);
char *inet_ntoa(struct in_addr);
int getopt_long(int, char* const*, const char*, const struct option*, int*);
int feof(DSL_CPE_File_t* stream );
int ferror(DSL_CPE_File_t* stream );
int fprintf(DSL_CPE_File_t* stream, const char* format, ...);
char *strpbrk( const char *string, const char *strCharSet );
void lseek(int , int , int );
int strtol( const char *nptr, char **endptr, int base );
int strtoul( const char *nptr, char **endptr, int base );
void *malloc(unsigned int size);
void *memset(void* dest, int c, size_t count);
void *memcpy(void* dest, const void* src, unsigned int count );
int isspace(int c);
int isprint(int c);
int read(int , void*, unsigned int);
int write(int , const void* , unsigned int );
void FD_ZERO(DSL_CPE_fd_set_t*);
void free(void* memblock);
int sscanf( const char *buffer, const char *format , ... );
int printf(const char* format, ...);
int signal (int , void*);
char *strstr( const char *string, const char *strCharSet );
int sprintf( char *buffer, const char *format ,... );
char *strncpy( char *strDest, const char *strSource, size_t count );
char *strtok( char *strToken, const char *strDelimit );
char *strtok_r(char*, const char*, char**);
size_t strlen( const char *string );
int strcmp( const char *string1, const char *string2 );
char *strcpy( char *strDestination, const char *strSource );
int DSL_CPE_snprintf(char *buffer, size_t count, const char *format , ... );
/**
Open a device
*/
DSL_int_t DSL_CPE_Open(const DSL_char_t *pName);
/**
Close a device
*/
DSL_int_t DSL_CPE_Close(const DSL_int_t fd);
/**
Write to a device
*/
DSL_int_t DSL_CPE_Write(const DSL_int_t fd, const DSL_void_t *pData, const DSL_uint32_t nSize);
/**
Read from a device
*/
DSL_int_t DSL_CPE_Read(const DSL_int_t fd, DSL_void_t *pData, const DSL_uint32_t nSize);
/**
Control a device
*/
DSL_int_t DSL_CPE_Ioctl(const DSL_int_t fd, const DSL_uint32_t cmd, DSL_int_t param);
/**
Wait for a device wake up
*/
DSL_int_t DSL_CPE_Select(const DSL_int_t max_fd,
const DSL_CPE_fd_set_t *read_fd_in,
DSL_CPE_fd_set_t *read_fd_out,
const DSL_uint32_t timeout_msec);
/**
Fill a descriptor set with zeros.
*/
DSL_void_t DSL_CPE_FD_ZERO(DSL_CPE_fd_set_t *set);
/**
Mark a descriptor in use.
*/
DSL_void_t DSL_CPE_FD_SET(DSL_int_t fd, DSL_CPE_fd_set_t *set);
/**
Clear a descriptor in use flag.
*/
DSL_void_t DSL_CPE_FD_CLR(DSL_int_t fd, DSL_CPE_fd_set_t *set);
/**
Check if a descriptor is set.
*/
DSL_int_t DSL_CPE_FD_ISSET(DSL_int_t fd, const DSL_CPE_fd_set_t *set);
/**
Get a byte from stdin .
*/
DSL_int_t DSL_CPE_GetChar(DSL_void_t);
/**
Write a byte stdout .
*/
DSL_int_t DSL_CPE_PutChar(DSL_char_t c, DSL_CPE_File_t *stream);
/**
Create a pipe.
\param
pName - pipe name
\return
- DSL_SUCCESS on success
- DSL_ERROR on failure
*/
DSL_Error_t DSL_CPE_PipeCreate(DSL_char_t *pName);
/**
Open a pipe.
\param
pName - pipe name
\return
- pointer to FILE structure
- in case of error the return value is NULL
*/
DSL_CPE_File_t *DSL_CPE_PipeOpen(DSL_char_t *pName, DSL_boolean_t reading, DSL_boolean_t blocking);
/**
Close a pipe.
\param
pipe - pipe stream
\return
- (0) on success
- (-1) on failure
*/
DSL_Error_t DSL_CPE_PipeClose(DSL_CPE_File_t *file);
/**
Initialize a semaphore.
\param lock semaphore identifier
\return
0 on success.
*/
DSL_int32_t DSL_CPE_LockCreate(DSL_CPE_Lock_t *lock);
/**
Delete a semaphore.
\param lock semaphore identifier
\return
- DSL_SUCCESS on success
- DSL_ERROR on failure
*/
DSL_int32_t DSL_CPE_LockDelete(DSL_CPE_Lock_t *lock);
/**
Gets a semaphore.
\param lock semaphore identifier
\return
- (0) on success
- (-1) on failure
*/
DSL_int32_t DSL_CPE_LockGet(DSL_CPE_Lock_t *lock);
/**
Get the Lock with timeout.
\param
lockId Provides the pointer to the Lock Object.
\param
timeout_ms Timeout value [ms]
- 0: no wait
- -1: wait forever
- any other value: waiting for specified amount of milliseconds
\param
pRetCode Points to the return code variable. [O]
- If the pointer is NULL the return code will be ignored, else
the corresponding return code will be set
- For timeout the return code is set to 1.
\return
DSL_SUCCESS on success.
DSL_ERROR on error or timeout.
\note
To detect timeouts provide the return code varibale, in case of timeout
the return code is set to 1.
*/
DSL_int32_t DSL_CPE_LockTimedGet(
DSL_CPE_Lock_t *lockId,
DSL_uint32_t timeout_ms,
DSL_int32_t *pRetCode);
/**
Return the semaphore
\param lock semaphore identifier
\return
- (0) on success
- (-1) on failure
*/
DSL_int32_t DSL_CPE_LockSet(DSL_CPE_Lock_t *lock);
/**
Sleep specified number of seconds.
\param nSeconds Number of seconds to sleep
*/
DSL_void_t DSL_CPE_Sleep(DSL_uint32_t nSeconds);
/**
Sleep specified number of milliseconds.
\param nMs Number of milliseconds to sleep
*/
DSL_void_t DSL_CPE_MSecSleep(DSL_uint32_t nMs);
/**
Allocates a memory block
\param size Bytes to allocate
\return
returns a DSL_void_t pointer to the allocated space, NULL if there's not
sufficient memory space available.
*/
DSL_void_t *DSL_CPE_Malloc(DSL_uint32_t size);
/**
Deallocates a memory block
\param memblock Previously allocated memory block that should be freed
*/
void DSL_CPE_Free(DSL_void_t *memblock);
/**
Print to a file, pipe, stdout, stderr or memory file.
*/
DSL_int_t DSL_CPE_FPrintf(DSL_CPE_File_t *stream, const DSL_char_t *format, ...);
/**
Open a file.
*/
DSL_CPE_File_t *DSL_CPE_FOpen(const DSL_char_t *name, const DSL_char_t *mode);
/**
Close the file or memory file.
*/
DSL_int_t DSL_CPE_FClose(DSL_CPE_File_t *fd);
/**
Flush a file or pipe.
*/
DSL_int_t DSL_CPE_FFlush(DSL_CPE_File_t *fd);
/**
Read from file, stdin .
*/
DSL_int_t DSL_CPE_FRead(DSL_void_t *buf, DSL_uint32_t size, DSL_uint32_t count, DSL_CPE_File_t *stream);
/**
Write to a file, pipe, stdout.
*/
DSL_int_t DSL_CPE_FWrite(const DSL_void_t *buf, DSL_uint32_t size, DSL_uint32_t count, DSL_CPE_File_t *stream);
/**
End of file test of a file.
*/
DSL_int_t DSL_CPE_Feof(DSL_CPE_File_t *stream);
/**
Read a string from the file.
*/
DSL_char_t *DSL_CPE_FGets(DSL_char_t *str, DSL_int_t n, DSL_CPE_File_t *stream);
/**
get file status
*/
DSL_int_t DSL_CPE_FStat(DSL_char_t *str, DSL_CPE_stat_t *st);
DSL_Socket_t DSL_CPE_Accept(DSL_Socket_t socFd, DSL_sockaddr_in_t *pSocAddr);
DSL_int_t DSL_CPE_Socket(DSL_int_t socType, DSL_Socket_t *pSocketFd);
DSL_int_t DSL_CPE_SocketBind(
DSL_Socket_t socFd,
DSL_sockaddr_in_t *pSocAddr);
void DSL_CPE_EchoOff (void);
void DSL_CPE_EchoOn (void);
/**
Installs system dependant handlers (e.g. signal handler on linux)
*/
DSL_void_t DSL_CPE_HandlerInstall(DSL_void_t);
void DSL_CPE_KeypressSet (void);
void DSL_CPE_KeypressReset (void);
/**
Set environment variable
*/
DSL_Error_t DSL_CPE_SetEnv(const DSL_char_t *sName, const DSL_char_t *sValue);
/**
Execute a shell command
*/
DSL_Error_t DSL_CPE_System(const DSL_char_t *sCommand);
DSL_uint16_t DSL_CPE_Htons(DSL_uint16_t hVal);
DSL_uint32_t DSL_CPE_Htonl(DSL_uint32_t hVal);
#if defined(DSL_DEBUG_TOOL_INTERFACE) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT)
DSL_char_t* DSL_CPE_OwnAddrStringGet(DSL_void_t);
#endif /* DSL_DEBUG_TOOL_INTERFACE*/
#define DSL_CPE_StringToAddress(strAddr, iAddr) inet_aton(strAddr, (iAddr))
#define DSL_CPE_AddressToString inet_ntoa
#define DSL_CPE_SocketClose close
#define DSL_CPE_SocketRecv(s,buf,sz) recv(s,buf,sz,0)
#define DSL_CPE_SocketSend(s,buf,sz) send(s,buf,sz,MSG_DONTWAIT)
DSL_CPE_File_t *DSL_CPE_FdOpen(int , char*);
/* sys/socket.h mapping */
#define DSL_CPE_SockOptSet setsockopt
#ifdef __cplusplus
}
#endif
#endif /* DSL_CPE_API_OS_LINT_MAP_H */

68
src/dsl_cpe_rtems.c Normal file
View file

@ -0,0 +1,68 @@
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifdef RTEMS
#include "dsl_cpe_rtems.h"
#include "dsl_cpe_control.h"
#include "dsl_cpe_os.h"
#include "dsl_cpe_simulator.h"
/** \file
Operating System access implementation
*/
/**
For a detailed description of the function, its arguments and return value
please refer to the description in the header file 'dsl_cpe_os.h'
*/
int DSL_CPE_debug_printf(DSL_char_t *fmt, ...)
{
va_list ap; /* points to each unnamed arg in turn */
DSL_int_t nLength = 0, nRet = 0;
DSL_boolean_t bPrint = DSL_FALSE;
DSL_char_t msg[DSL_DBG_MAX_DEBUG_PRINT_CHAR + 1] = "\0";
va_start(ap, fmt); /* set ap pointer to 1st unnamed arg */
if (bPrint == DSL_FALSE)
{
nRet = vsprintf(msg, fmt, ap);
if (nRet < 0)
{
nLength = DSL_DBG_MAX_DEBUG_PRINT_CHAR;
printf("DSL CPE API: WARNING - printout truncated in 'DSL_CPE_debug_printf'!" DSL_DRV_CRLF );
}
else
{
nLength = nRet;
}
nRet = printf(msg);
}
va_end(ap);
return nRet;
}
/**
For a detailed description of the function, its arguments and return value
please refer to the description in the header file 'dsl_cpe_os.h'
*/
DSL_int_t DSL_Ioctl(const DSL_int_t fd, const DSL_uint32_t cmd, DSL_int_t param)
{
return DSL_DRV_Ioctls(0,cmd, param);
}
#endif /* RTEMS */

66
src/dsl_cpe_rtems.h Normal file
View file

@ -0,0 +1,66 @@
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifdef RTEMS
/** \file
OS interface, RTEMS adaptation
*/
#include "drv_dsl_cpe_api_types.h"
#include <ctype.h>
#include <stdio.h>
#include <stddef.h>
#include <string.h>
#include "dispatch.h"
#include "print.h"
#include "dbgio.h"
#include "xapi.h"
#include "ifxos_common.h"
#include "ifxos_debug.h"
#include "ifxos_thread.h"
#include "ifxos_memory_alloc.h"
#include "ifxos_lock.h"
#include "ifxos_select.h"
#include "ifxos_common.h"
#include "ifxos_print_io.h"
#include "ifxos_device_access.h"
#include "ifxos_file_access.h"
#include "ifxos_time.h"
#include "ifxos_thread.h"
#include "ifxos_termios.h"
#include "ifxos_pipe.h"
#include "ifxos_misc.h"
#include "ifxos_socket.h"
#include "ifx_getopt.h"
#define INCLUDE_DSL_DRV_STATIC_LINKED_FIRMWARE
#define PACKAGE_VERSION ""
#define DSL_CPE_STACKSIZE 2048
#define DSL_CPE_PRIORITY 64
#define DSL_CPE_PIPE_PRIORITY 64
#define DSL_CPE_TCP_MSG_PRIORITY 64
#define DSL_CPE_STRNCASECMP(a,b,c) stricmp(a,b)
#define DSL_CPE_FD_ZERO IFXOS_DevFdZero
/** context from DSL_DRV_Open()*/
extern DSL_OpenContext_t *gv_drv_dsl_pOpenCtx;
#endif /* RTEMS */

View file

@ -0,0 +1,38 @@
/******************************************************************************
Copyright 2018 - 2019 Intel Corporation
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifndef _SAFEC_WRAPPER_H
#define _SAFEC_WRAPPER_H
#if defined (SAFEC_SUPPORT) && (SAFEC_SUPPORT == 3)
#include "safe_mem_lib.h"
#include "safe_str_lib.h"
#define cpe_control_memcpy_s memcpy_s
#define cpe_control_memset_s memset_s
#define cpe_control_strncpy_s strncpy_s
#else
#warning "Safe C library is not available!"
#include <stddef.h> /* size_t */
static __inline__ size_t safec_wrapper_min(size_t a, size_t b)
{
return a > b ? b : a;
}
#define cpe_control_memcpy_s(dest, destsz, src, srcsz) memcpy(dest, src, safec_wrapper_min(destsz,srcsz))
#define cpe_control_memset_s(dest, destsz, src, srcsz) memset(dest, src, safec_wrapper_min(destsz,srcsz))
#define cpe_control_strncpy_s(dest, destsz, src, srcsz) strncpy(dest, src, safec_wrapper_min(destsz,srcsz))
#endif /* defined (SAFEC_SUPPORT) && (SAFEC_SUPPORT == 3) */
#endif /* _SAFEC_WRAPPER_H */

200
src/dsl_cpe_simulator.c Normal file
View file

@ -0,0 +1,200 @@
/******************************************************************************
Copyright 2018, Intel Corporation
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
/** \file
Simulator
*/
#include "dsl_cpe_control.h"
#include "dsl_cpe_os.h"
#include "dsl_cpe_simulator.h"
#include "drv_dsl_cpe_api.h"
#include "drv_dsl_cpe_api_ioctl.h"
#include "drv_dsl_cpe_debug.h"
#undef DSL_CCA_DBG_BLOCK
#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_OS
#ifdef DSL_CPE_SIMULATOR_CONTROL
#define DSL_SIM_RX_BUFFER_SIZE 1024
/*static DSL_uint32_t device_fd=0;*/
static DSL_boolean_t g_bFirst = DSL_TRUE;
static DSL_boolean_t g_bVerbose = DSL_TRUE;
static DSL_CPE_Lock_t semData;
static DSL_DBG_ModuleLevelData_t g_nDbgLevelData[DSL_DBG_MAX_ENTRIES];
typedef struct
{
DSL_uint8_t msg_buffer[DSL_SIM_RX_BUFFER_SIZE];
DSL_uint8_t msg_count;
DSL_uint8_t device_count;
} dsl_line_t;
dsl_line_t dsl_line;
DSL_int_t DSL_CPE_SIM_Open( void *device, const char *appendix )
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "open simulated" DSL_CPE_CRLF));
return (int)device;
}
DSL_int_t DSL_SIM_Close( void *pprivate )
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "close simulated" DSL_CPE_CRLF));
return 0;
}
DSL_int_t DSL_SIM_Write(void *pprivate, const char *buf, const int len )
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "write simulated" DSL_CPE_CRLF ));
return 0;
}
DSL_int_t DSL_SIM_Read( void *pprivate, char *buf, const int len )
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "read simulated %d" DSL_CPE_CRLF));
return 0;
}
DSL_int_t DSL_SIM_Ioctl( void *pprivate, unsigned int cmd, unsigned int arg )
{
DSL_int_t nRet = 0;
dsl_line_t *ctx = (dsl_line_t *)pprivate;
DSL_CPE_LockTimedGet(&semData, 0xFFFF, DSL_NULL);
switch(cmd)
{
case DSL_FIO_VERSION_INFORMATION_GET:
if(g_bVerbose)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX "ioctl simulated - VersionInformationGet (cmd=0x%08X)" DSL_CPE_CRLF, cmd));
}
{
DSL_VersionInformation_t *pData = (DSL_VersionInformation_t *)arg;
DSL_char_t verApi[10] = "2.9.9";
DSL_char_t ver[10] = "0.0.0";
#if defined (INCLUDE_DSL_CPE_API_DANUBE)
DSL_char_t chip[15] = "Lantiq-Danube";
#else
DSL_char_t chip[15] = "Lantiq-Unknown";
#endif
memset(&(pData->data), 0, sizeof(pData->data));
memset(&(pData->accessCtl), 0, sizeof(pData->accessCtl));
cpe_control_memcpy_s(pData->data.DSL_DriverVersionApi, sizeof(pData->data.DSL_DriverVersionApi),
verApi, sizeof(verApi));
cpe_control_memcpy_s(pData->data.DSL_ChipSetFWVersion,sizeof(pData->data.DSL_ChipSetFWVersion),
ver, sizeof(ver));
cpe_control_memcpy_s(pData->data.DSL_ChipSetHWVersion, sizeof(pData->data.DSL_ChipSetHWVersion),
ver, sizeof(ver));
cpe_control_memcpy_s(pData->data.DSL_ChipSetType, sizeof(pData->data.DSL_ChipSetType),
chip, sizeof(chip));
cpe_control_memcpy_s(pData->data.DSL_DriverVersionMeiBsp, sizeof(pData->data.DSL_DriverVersionMeiBsp),
ver, sizeof(ver));
}
break;
case DSL_FIO_DBG_MODULE_LEVEL_GET:
{
DSL_DBG_ModuleLevel_t *pData = (DSL_DBG_ModuleLevel_t *)arg;
memset(&(pData->accessCtl), 0, sizeof(pData->accessCtl));
pData->data.nDbgLevel = g_nDbgLevelData[pData->data.nDbgModule].nDbgLevel;
}
break;
case DSL_FIO_DBG_MODULE_LEVEL_SET:
{
DSL_DBG_ModuleLevel_t *pData = (DSL_DBG_ModuleLevel_t *)arg;
memset(&(pData->accessCtl), 0, sizeof(pData->accessCtl));
g_nDbgLevelData[pData->data.nDbgModule].nDbgLevel = pData->data.nDbgLevel;
g_nDbgLevelData[pData->data.nDbgModule].nDbgModule = pData->data.nDbgModule;
}
break;
case DSL_FIO_AUTOBOOT_CONTROL_SET:
break;
case DSL_FIO_AUTOBOOT_LOAD_FIRMWARE:
break;
case DSL_FIO_AUTOBOOT_STATUS_GET:
{
DSL_AutobootStatus_t *pData = (DSL_AutobootStatus_t *)arg;
memset(&(pData->data), 0, sizeof(pData->data));
memset(&(pData->accessCtl), 0, sizeof(pData->accessCtl));
pData->data.nStatus = DSL_AUTOBOOT_STATUS_STOPPED;
}
break;
default:
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"unhandled simulated ioctl (cmd=0x%08X)" DSL_CPE_CRLF, cmd));
nRet = -1;
break;
}
DSL_CPE_LockSet(&semData);
return nRet;
}
DSL_int_t DSL_SIM_Poll( void *pprivate )
{
dsl_line_t *ctx = (dsl_line_t *)pprivate;
return ctx->msg_count;
}
#endif /* DSL_CPE_SIMULATOR_CONTROL */
#ifdef DSL_CPE_SIMULATOR_CONTROL
DSL_Error_t DSL_SimulatorInitialize(DSL_void_t)
{
#ifndef DSL_CPE_SIMULATOR_DRIVER
int drv_num;
if(g_bFirst)
{
g_bFirst = DSL_FALSE;
DSL_CPE_LockCreate(&semData);
drv_num = (int)DEVIO_driver_install(
DSL_CPE_SIM_Open,
DSL_SIM_Close,
DSL_SIM_Read,
DSL_SIM_Write,
DSL_SIM_Ioctl,
DSL_SIM_Poll );
DEVIO_device_add(&dsl_line, "/dev/dsl_cpe_api", drv_num);
}
#else
/* Create DSL CPE API driver Simulator device*/
if (DSL_DRV_SIM_DeviceCreate() < 0)
{
return DSL_ERROR;
}
#endif /* DSL_CPE_SIMULATOR_DRIVER*/
return DSL_SUCCESS;
}
#endif /* DSL_CPE_SIMULATOR_CONTROL*/

33
src/dsl_cpe_simulator.h Normal file
View file

@ -0,0 +1,33 @@
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
/** \file
DSL Device Simulator
*/
#include "dsl_cpe_control.h"
#include "dsl_cpe_os.h"
#ifdef DSL_CPE_SIMULATOR_DRIVER
#include "drv_dsl_cpe_os_win32.h"
#endif /* DSL_CPE_SIMULATOR_DRIVER*/
#if defined(DSL_CPE_SIMULATOR_CONTROL) && !defined(DSL_CPE_SIMULATOR_DRIVER)
DSL_int_t DSL_CPE_SIM_Open(void *device, const char *appendix);
DSL_int_t DSL_SIM_Close( void *pprivate );
DSL_int_t DSL_SIM_Write( void *pprivate, const char *buf, const int len );
DSL_int_t DSL_SIM_Read( void *pprivate, char *buf, const int len );
DSL_int_t DSL_SIM_Ioctl( void *pprivate, unsigned int cmd, unsigned long arg );
DSL_int_t DSL_SIM_Poll( void *pprivate );
#endif /* defined(DSL_CPE_SIMULATOR_CONTROL) && !defined(DSL_CPE_SIMULATOR_DRIVER)*/
#if defined(DSL_CPE_SIMULATOR_CONTROL)
DSL_Error_t DSL_SimulatorInitialize(DSL_void_t);
#endif /* defined(DSL_CPE_SIMULATOR_CONTROL)*/

6050
src/dsl_cpe_status_parser.c Normal file

File diff suppressed because it is too large Load diff

374
src/dsl_cpe_status_parser.h Normal file
View file

@ -0,0 +1,374 @@
/******************************************************************************
Copyright (c) 2019 Intel Corporation
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
*******************************************************************************/
#ifndef _DSL_CPE_STATUS_PARSER_H
#define _DSL_CPE_STATUS_PARSER_H
#if defined(INCLUDE_DSL_JSON_PARSING) && (INCLUDE_DSL_JSON_PARSING == 1)
#include "dsl_cpe_control.h"
/**
Definitions for all specified JSON Status File nodes
(these definitions will be used for different type
parameters' updates)
*/
typedef enum
{
DSL_ROOT = 0,
/* common section */
DSL_LINE_ENTRIES,/*1*/
DSL_CHANNEL_ENTRIES,/*2*/
DSL_BND_GROUP_ENTRIES,/*3*/
DSL_API_VERSION,/*4*/
DSL_MEI_VERSION,/*5*/
DSL_HW_VERSION,/*6*/
DSL_CHIPSET_TYPE,/*7*/
/* <dsl.status> section */
DSL_STATUS,/*8*/
DSL_STATUS_LINE,/*9*/
/* <dsl.status.line.0> section */
DSL_STATUS_LINE_0,/*10*/
DSL_STATUS_LINE_0_STATUS,/*11*/
DSL_STATUS_LINE_0_UPSTREAM,/*12*/
DSL_STATUS_LINE_0_FW_VERSION,/*13*/
DSL_STATUS_LINE_0_LINK_STATUS,/*14*/
DSL_STATUS_LINE_0_STD_SUPPORTED,/*15*/
DSL_STATUS_LINE_0_XTSE,/*16*/
DSL_STATUS_LINE_0_STD_USED,/*17*/
DSL_STATUS_LINE_0_XTSE_USED,/*18*/
DSL_STATUS_LINE_0_ENCODING,/*19*/
DSL_STATUS_LINE_0_ALLOWED_PROFILES,/*20*/
DSL_STATUS_LINE_0_CURRENT_PROFILE,/*21*/
DSL_STATUS_LINE_0_PWR_MGMT_STATE,/*22*/
DSL_STATUS_LINE_0_SUCC_FAIL_CAUSE,/*23*/
DSL_STATUS_LINE_0_LAST_STATE_TRANSM,/*24*/
DSL_STATUS_LINE_0_LAST_STATE_TRANSM_US,/*25*/
DSL_STATUS_LINE_0_LAST_STATE_TRANSM_DS,/*26*/
DSL_STATUS_LINE_0_US0_MASK,/*27*/
DSL_STATUS_LINE_0_TRELLIS,/*28*/
DSL_STATUS_LINE_0_TRELLIS_US,/*29*/
DSL_STATUS_LINE_0_TRELLIS_DS,/*30*/
DSL_STATUS_LINE_0_ACT_SNR_MODE,/*31*/
DSL_STATUS_LINE_0_ACT_SNR_MODE_US,/*32*/
DSL_STATUS_LINE_0_ACT_SNR_MODE_DS,/*33*/
DSL_STATUS_LINE_0_LINE_NR,/*34*/
DSL_STATUS_LINE_0_MAX_BIT_RATE,/*35*/
DSL_STATUS_LINE_0_MAX_BIT_RATE_US,/*36*/
DSL_STATUS_LINE_0_MAX_BIT_RATE_DS,/*37*/
DSL_STATUS_LINE_0_NOISE_MARGIN,/*38*/
DSL_STATUS_LINE_0_NOISE_MARGIN_US,/*39*/
DSL_STATUS_LINE_0_NOISE_MARGIN_DS,/*40*/
DSL_STATUS_LINE_0_SNR_MPB,/*41*/
DSL_STATUS_LINE_0_SNR_MPB_US,/*42*/
DSL_STATUS_LINE_0_SNR_MPB_DS,/*43*/
DSL_STATUS_LINE_0_POWER,/*44*/
DSL_STATUS_LINE_0_POWER_US,/*45*/
DSL_STATUS_LINE_0_POWER_DS,/*46*/
DSL_STATUS_LINE_0_XTUR_VENDOR,/*47*/
DSL_STATUS_LINE_0_XTUR_COUNTRY,/*48*/
DSL_STATUS_LINE_0_XTUR_ANSI_STD,/*49*/
DSL_STATUS_LINE_0_XTUR_ANSI_REV,/*50*/
DSL_STATUS_LINE_0_XTUC_VENDOR,/*51*/
DSL_STATUS_LINE_0_XTUC_COUNTRY,/*52*/
DSL_STATUS_LINE_0_XTUC_ANSI_STD,/*53*/
DSL_STATUS_LINE_0_XTUC_ANSI_REV,/*54*/
DSL_STATUS_LINE_0_UPBOKLER_PB,/*55*/
DSL_STATUS_LINE_0_RXTHRSH_DS,/*56*/
DSL_STATUS_LINE_0_ACT_RA_MODE,/*57*/
DSL_STATUS_LINE_0_ACT_RA_MODE_US,/*58*/
DSL_STATUS_LINE_0_ACT_RA_MODE_DS,/*59*/
DSL_STATUS_LINE_0_SNR_MROC,/*60*/
DSL_STATUS_LINE_0_SNR_MROC_US,/*61*/
DSL_STATUS_LINE_0_SNR_MROC_DS,/*62*/
DSL_STATUS_LINE_0_ATTENUATION,/*63*/
DSL_STATUS_LINE_0_ATTENUATION_US,/*64*/
DSL_STATUS_LINE_0_ATTENUATION_DS,/*65*/
/* <dsl.status.line.0.channel> section */
DSL_STATUS_LINE_0_CHANNEL,/*66*/
DSL_STATUS_LINE_0_CHANNEL_STATUS,/*67*/
DSL_STATUS_LINE_0_CHANNEL_LINKENC_SUPP,/*68*/
DSL_STATUS_LINE_0_CHANNEL_LINKENC_USED,/*69*/
DSL_STATUS_LINE_0_CHANNEL_LPATH,/*70*/
DSL_STATUS_LINE_0_CHANNEL_INTLVDEPTH,/*71*/
DSL_STATUS_LINE_0_CHANNEL_INTLVBLOCK,/*72*/
DSL_STATUS_LINE_0_CHANNEL_ACT_INTERL_DELAY,/*73*/
DSL_STATUS_LINE_0_CHANNEL_ACTINP,/*74*/
DSL_STATUS_LINE_0_CHANNEL_INPREPORT,/*75*/
DSL_STATUS_LINE_0_CHANNEL_NFEC,/*76*/
DSL_STATUS_LINE_0_CHANNEL_RFEC,/*77*/
DSL_STATUS_LINE_0_CHANNEL_LSYMB,/*78*/
DSL_STATUS_LINE_0_CHANNEL_DATARATE,/*79*/
DSL_STATUS_LINE_0_CHANNEL_DATARATE_US,/*80*/
DSL_STATUS_LINE_0_CHANNEL_DATARATE_DS,/*81*/
DSL_STATUS_LINE_0_CHANNEL_ACTNDR,/*82*/
DSL_STATUS_LINE_0_CHANNEL_ACTNDR_US,/*83*/
DSL_STATUS_LINE_0_CHANNEL_ACTNDR_DS,/*84*/
DSL_STATUS_LINE_0_CHANNEL_ACTINPREIN,/*85*/
DSL_STATUS_LINE_0_CHANNEL_ACTINPREIN_US,/*86*/
DSL_STATUS_LINE_0_CHANNEL_ACTINPREIN_DS,/*87*/
/* <dsl.status.line.1> section */
DSL_STATUS_LINE_1,/*88*/
DSL_STATUS_LINE_1_STATUS,/*89*/
DSL_STATUS_LINE_1_UPSTREAM,/*90*/
DSL_STATUS_LINE_1_FW_VERSION,/*91*/
DSL_STATUS_LINE_1_LINK_STATUS,/*92*/
DSL_STATUS_LINE_1_STD_SUPPORTED,/*93*/
DSL_STATUS_LINE_1_XTSE,/*94*/
DSL_STATUS_LINE_1_STD_USED,/*95*/
DSL_STATUS_LINE_1_XTSE_USED,/*96*/
DSL_STATUS_LINE_1_ENCODING,/*97*/
DSL_STATUS_LINE_1_ALLOWED_PROFILES,/*98*/
DSL_STATUS_LINE_1_CURRENT_PROFILE,/*99*/
DSL_STATUS_LINE_1_PWR_MGMT_STATE,/*100*/
DSL_STATUS_LINE_1_SUCC_FAIL_CAUSE,/*101*/
DSL_STATUS_LINE_1_LAST_STATE_TRANSM,/*102*/
DSL_STATUS_LINE_1_LAST_STATE_TRANSM_US,/*103*/
DSL_STATUS_LINE_1_LAST_STATE_TRANSM_DS,/*104*/
DSL_STATUS_LINE_1_US0_MASK,/*105*/
DSL_STATUS_LINE_1_TRELLIS,/*106*/
DSL_STATUS_LINE_1_TRELLIS_US,/*107*/
DSL_STATUS_LINE_1_TRELLIS_DS,/*108*/
DSL_STATUS_LINE_1_ACT_SNR_MODE,/*109*/
DSL_STATUS_LINE_1_ACT_SNR_MODE_US,/*110*/
DSL_STATUS_LINE_1_ACT_SNR_MODE_DS,/*111*/
DSL_STATUS_LINE_1_LINE_NR,/*112*/
DSL_STATUS_LINE_1_MAX_BIT_RATE,/*113*/
DSL_STATUS_LINE_1_MAX_BIT_RATE_US,/*114*/
DSL_STATUS_LINE_1_MAX_BIT_RATE_DS,/*115*/
DSL_STATUS_LINE_1_NOISE_MARGIN,/*116*/
DSL_STATUS_LINE_1_NOISE_MARGIN_US,/*117*/
DSL_STATUS_LINE_1_NOISE_MARGIN_DS,/*118*/
DSL_STATUS_LINE_1_SNR_MPB,/*119*/
DSL_STATUS_LINE_1_SNR_MPB_US,/*120*/
DSL_STATUS_LINE_1_SNR_MPB_DS,/*121*/
DSL_STATUS_LINE_1_POWER,/*122*/
DSL_STATUS_LINE_1_POWER_US,/*123*/
DSL_STATUS_LINE_1_POWER_DS,/*124*/
DSL_STATUS_LINE_1_XTUR_VENDOR,/*125*/
DSL_STATUS_LINE_1_XTUR_COUNTRY,/*126*/
DSL_STATUS_LINE_1_XTUR_ANSI_STD,/*127*/
DSL_STATUS_LINE_1_XTUR_ANSI_REV,/*128*/
DSL_STATUS_LINE_1_XTUC_VENDOR,/*129*/
DSL_STATUS_LINE_1_XTUC_COUNTRY,/*130*/
DSL_STATUS_LINE_1_XTUC_ANSI_STD,/*131*/
DSL_STATUS_LINE_1_XTUC_ANSI_REV,/*132*/
DSL_STATUS_LINE_1_UPBOKLER_PB,/*133*/
DSL_STATUS_LINE_1_RXTHRSH_DS,/*134*/
DSL_STATUS_LINE_1_ACT_RA_MODE,/*135*/
DSL_STATUS_LINE_1_ACT_RA_MODE_US,/*136*/
DSL_STATUS_LINE_1_ACT_RA_MODE_DS,/*137*/
DSL_STATUS_LINE_1_SNR_MROC,/*138*/
DSL_STATUS_LINE_1_SNR_MROC_US,/*139*/
DSL_STATUS_LINE_1_SNR_MROC_DS,/*140*/
DSL_STATUS_LINE_1_ATTENUATION,/*141*/
DSL_STATUS_LINE_1_ATTENUATION_US,/*142*/
DSL_STATUS_LINE_1_ATTENUATION_DS,/*143*/
/* <dsl.status.line.1.channel> section */
DSL_STATUS_LINE_1_CHANNEL,/*144*/
DSL_STATUS_LINE_1_CHANNEL_STATUS,/*145*/
DSL_STATUS_LINE_1_CHANNEL_LINKENC_SUPP,/*146*/
DSL_STATUS_LINE_1_CHANNEL_LINKENC_USED,/*147*/
DSL_STATUS_LINE_1_CHANNEL_LPATH,/*148*/
DSL_STATUS_LINE_1_CHANNEL_INTLVDEPTH,/*149*/
DSL_STATUS_LINE_1_CHANNEL_INTLVBLOCK,/*150*/
DSL_STATUS_LINE_1_CHANNEL_ACT_INTERL_DELAY,/*151*/
DSL_STATUS_LINE_1_CHANNEL_ACTINP,/*152*/
DSL_STATUS_LINE_1_CHANNEL_INPREPORT,/*153*/
DSL_STATUS_LINE_1_CHANNEL_NFEC,/*154*/
DSL_STATUS_LINE_1_CHANNEL_RFEC,/*155*/
DSL_STATUS_LINE_1_CHANNEL_LSYMB,/*156*/
DSL_STATUS_LINE_1_CHANNEL_DATARATE,/*157*/
DSL_STATUS_LINE_1_CHANNEL_DATARATE_US,/*158*/
DSL_STATUS_LINE_1_CHANNEL_DATARATE_DS,/*159*/
DSL_STATUS_LINE_1_CHANNEL_ACTNDR,/*160*/
DSL_STATUS_LINE_1_CHANNEL_ACTNDR_US,/*161*/
DSL_STATUS_LINE_1_CHANNEL_ACTNDR_DS,/*162*/
DSL_STATUS_LINE_1_CHANNEL_ACTINPREIN,/*163*/
DSL_STATUS_LINE_1_CHANNEL_ACTINPREIN_US,/*164*/
DSL_STATUS_LINE_1_CHANNEL_ACTINPREIN_DS,/*165*/
/* <dsl.stats> section */
DSL_STATS,/*166*/
DSL_STATS_LINE,/*167*/
/* <dsl.stats.line.0> section */
DSL_STATS_LINE_0,/*168*/
DSL_STATS_LINE_0_TOTAL_START,/*169*/
DSL_STATS_LINE_0_SHOWTIME_START,/*170*/
DSL_STATS_LINE_0_LAST_SHOWTIME_START,/*171*/
DSL_STATS_LINE_0_CURRENT_DAY_START,/*172*/
DSL_STATS_LINE_0_QUARTER_HOUR_START,/*173*/
DSL_STATS_LINE_0_TOTAL,/*174*/
DSL_STATS_LINE_0_TOTAL_ERR_SECS,/*175*/
DSL_STATS_LINE_0_TOTAL_SEV_ERR_SECS,/*176*/
DSL_STATS_LINE_0_SHOWTIME,/*177*/
DSL_STATS_LINE_0_SHOWTIME_ERR_SECS,/*178*/
DSL_STATS_LINE_0_SHOWTIME_SEV_ERR_SECS,/*179*/
DSL_STATS_LINE_0_LAST_SHOWTIME,/*180*/
DSL_STATS_LINE_0_LAST_SHOWTIME_ERR_SECS,/*181*/
DSL_STATS_LINE_0_LAST_SHOWTIME_SEV_ERR_SECS,/*182*/
DSL_STATS_LINE_0_CURRENT_DAY,/*183*/
DSL_STATS_LINE_0_CURRENT_DAY_ERR_SECS,/*184*/
DSL_STATS_LINE_0_CURRENT_DAY_SEV_ERR_SECS,/*185*/
DSL_STATS_LINE_0_QUARTER_HOUR,/*186*/
DSL_STATS_LINE_0_QUARTER_HOUR_ERR_SECS,/*187*/
DSL_STATS_LINE_0_QUARTER_HOUR_SEV_ERR_SECS,/*188*/
/* <dsl.stats.line.0.channel> section */
DSL_STATS_LINE_0_CHANNEL,/*189*/
DSL_STATS_LINE_0_CHANNEL_TOTAL_START,/*190*/
DSL_STATS_LINE_0_CHANNEL_SHOWTIME_START,/*191*/
DSL_STATS_LINE_0_CHANNEL_LAST_SHOWTIME_START,/*192*/
DSL_STATS_LINE_0_CHANNEL_CURRENT_DAY_START,/*193*/
DSL_STATS_LINE_0_CHANNEL_QUARTER_HOUR_START,/*194*/
DSL_STATS_LINE_0_CHANNEL_TOTAL,/*195*/
DSL_STATS_LINE_0_CHANNEL_TOTAL_XTUR_FEC_ERRORS,/*196*/
DSL_STATS_LINE_0_CHANNEL_TOTAL_XTUR_CRC_ERRORS,/*197*/
DSL_STATS_LINE_0_CHANNEL_TOTAL_XTUC_FEC_ERRORS,/*198*/
DSL_STATS_LINE_0_CHANNEL_TOTAL_XTUC_CRC_ERRORS,/*199*/
DSL_STATS_LINE_0_CHANNEL_TOTAL_XTUR_HEC_ERRORS,/*200*/
DSL_STATS_LINE_0_CHANNEL_TOTAL_XTUC_HEC_ERRORS,/*201*/
DSL_STATS_LINE_0_CHANNEL_SHOWTIME,/*202*/
DSL_STATS_LINE_0_CHANNEL_SHOWTIME_XTUR_FEC_ERRORS,/*203*/
DSL_STATS_LINE_0_CHANNEL_SHOWTIME_XTUR_CRC_ERRORS,/*204*/
DSL_STATS_LINE_0_CHANNEL_SHOWTIME_XTUC_FEC_ERRORS,/*205*/
DSL_STATS_LINE_0_CHANNEL_SHOWTIME_XTUC_CRC_ERRORS,/*206*/
DSL_STATS_LINE_0_CHANNEL_SHOWTIME_XTUR_HEC_ERRORS,/*207*/
DSL_STATS_LINE_0_CHANNEL_SHOWTIME_XTUC_HEC_ERRORS,/*208*/
DSL_STATS_LINE_0_CHANNEL_LAST_SHOWTIME,/*209*/
DSL_STATS_LINE_0_CHANNEL_LAST_SHOWTIME_XTUR_FEC_ERRORS,/*210*/
DSL_STATS_LINE_0_CHANNEL_LAST_SHOWTIME_XTUR_CRC_ERRORS,/*211*/
DSL_STATS_LINE_0_CHANNEL_LAST_SHOWTIME_XTUC_FEC_ERRORS,/*212*/
DSL_STATS_LINE_0_CHANNEL_LAST_SHOWTIME_XTUC_CRC_ERRORS,/*213*/
DSL_STATS_LINE_0_CHANNEL_LAST_SHOWTIME_XTUR_HEC_ERRORS,/*214*/
DSL_STATS_LINE_0_CHANNEL_LAST_SHOWTIME_XTUC_HEC_ERRORS,/*215*/
DSL_STATS_LINE_0_CHANNEL_CURRENT_DAY,/*216*/
DSL_STATS_LINE_0_CHANNEL_CURRENT_DAY_XTUR_FEC_ERRORS,/*217*/
DSL_STATS_LINE_0_CHANNEL_CURRENT_DAY_XTUR_CRC_ERRORS,/*218*/
DSL_STATS_LINE_0_CHANNEL_CURRENT_DAY_XTUC_FEC_ERRORS,/*219*/
DSL_STATS_LINE_0_CHANNEL_CURRENT_DAY_XTUC_CRC_ERRORS,/*220*/
DSL_STATS_LINE_0_CHANNEL_CURRENT_DAY_XTUR_HEC_ERRORS,/*221*/
DSL_STATS_LINE_0_CHANNEL_CURRENT_DAY_XTUC_HEC_ERRORS,/*222*/
DSL_STATS_LINE_0_CHANNEL_QUARTER_HOUR,/*223*/
DSL_STATS_LINE_0_CHANNEL_QUARTER_HOUR_XTUR_FEC_ERRORS,/*224*/
DSL_STATS_LINE_0_CHANNEL_QUARTER_HOUR_XTUR_CRC_ERRORS,/*225*/
DSL_STATS_LINE_0_CHANNEL_QUARTER_HOUR_XTUC_FEC_ERRORS,/*226*/
DSL_STATS_LINE_0_CHANNEL_QUARTER_HOUR_XTUC_CRC_ERRORS,/*227*/
DSL_STATS_LINE_0_CHANNEL_QUARTER_HOUR_XTUR_HEC_ERRORS,/*228*/
DSL_STATS_LINE_0_CHANNEL_QUARTER_HOUR_XTUC_HEC_ERRORS,/*229*/
/* <dsl.stats.line.1> section */
DSL_STATS_LINE_1,/*230*/
DSL_STATS_LINE_1_TOTAL_START,/*231*/
DSL_STATS_LINE_1_SHOWTIME_START,/*232*/
DSL_STATS_LINE_1_LAST_SHOWTIME_START,/*233*/
DSL_STATS_LINE_1_CURRENT_DAY_START,/*234*/
DSL_STATS_LINE_1_QUARTER_HOUR_START,/*235*/
DSL_STATS_LINE_1_TOTAL,/*236*/
DSL_STATS_LINE_1_TOTAL_ERR_SECS,/*237*/
DSL_STATS_LINE_1_TOTAL_SEV_ERR_SECS,/*238*/
DSL_STATS_LINE_1_SHOWTIME,/*239*/
DSL_STATS_LINE_1_SHOWTIME_ERR_SECS,/*240*/
DSL_STATS_LINE_1_SHOWTIME_SEV_ERR_SECS,/*241*/
DSL_STATS_LINE_1_LAST_SHOWTIME,/*242*/
DSL_STATS_LINE_1_LAST_SHOWTIME_ERR_SECS,/*243*/
DSL_STATS_LINE_1_LAST_SHOWTIME_SEV_ERR_SECS,/*244*/
DSL_STATS_LINE_1_CURRENT_DAY,/*245*/
DSL_STATS_LINE_1_CURRENT_DAY_ERR_SECS,/*246*/
DSL_STATS_LINE_1_CURRENT_DAY_SEV_ERR_SECS,/*247*/
DSL_STATS_LINE_1_QUARTER_HOUR,/*248*/
DSL_STATS_LINE_1_QUARTER_HOUR_ERR_SECS,/*249*/
DSL_STATS_LINE_1_QUARTER_HOUR_SEV_ERR_SECS,/*250*/
/* <dsl.stats.line.1.channel> section */
DSL_STATS_LINE_1_CHANNEL,/*251*/
DSL_STATS_LINE_1_CHANNEL_TOTAL_START,/*252*/
DSL_STATS_LINE_1_CHANNEL_SHOWTIME_START,/*253*/
DSL_STATS_LINE_1_CHANNEL_LAST_SHOWTIME_START,/*254*/
DSL_STATS_LINE_1_CHANNEL_CURRENT_DAY_START,/*255*/
DSL_STATS_LINE_1_CHANNEL_QUARTER_HOUR_START,/*256*/
DSL_STATS_LINE_1_CHANNEL_TOTAL,/*257*/
DSL_STATS_LINE_1_CHANNEL_TOTAL_XTUR_FEC_ERRORS,/*258*/
DSL_STATS_LINE_1_CHANNEL_TOTAL_XTUR_CRC_ERRORS,/*259*/
DSL_STATS_LINE_1_CHANNEL_TOTAL_XTUC_FEC_ERRORS,/*260*/
DSL_STATS_LINE_1_CHANNEL_TOTAL_XTUC_CRC_ERRORS,/*261*/
DSL_STATS_LINE_1_CHANNEL_TOTAL_XTUR_HEC_ERRORS,/*262*/
DSL_STATS_LINE_1_CHANNEL_TOTAL_XTUC_HEC_ERRORS,/*263*/
DSL_STATS_LINE_1_CHANNEL_SHOWTIME,/*264*/
DSL_STATS_LINE_1_CHANNEL_SHOWTIME_XTUR_FEC_ERRORS,/*265*/
DSL_STATS_LINE_1_CHANNEL_SHOWTIME_XTUR_CRC_ERRORS,/*266*/
DSL_STATS_LINE_1_CHANNEL_SHOWTIME_XTUC_FEC_ERRORS,/*267*/
DSL_STATS_LINE_1_CHANNEL_SHOWTIME_XTUC_CRC_ERRORS,/*268*/
DSL_STATS_LINE_1_CHANNEL_SHOWTIME_XTUR_HEC_ERRORS,/*269*/
DSL_STATS_LINE_1_CHANNEL_SHOWTIME_XTUC_HEC_ERRORS,/*270*/
DSL_STATS_LINE_1_CHANNEL_LAST_SHOWTIME,/*271*/
DSL_STATS_LINE_1_CHANNEL_LAST_SHOWTIME_XTUR_FEC_ERRORS,/*272*/
DSL_STATS_LINE_1_CHANNEL_LAST_SHOWTIME_XTUR_CRC_ERRORS,/*273*/
DSL_STATS_LINE_1_CHANNEL_LAST_SHOWTIME_XTUC_FEC_ERRORS,/*274*/
DSL_STATS_LINE_1_CHANNEL_LAST_SHOWTIME_XTUC_CRC_ERRORS,/*275*/
DSL_STATS_LINE_1_CHANNEL_LAST_SHOWTIME_XTUR_HEC_ERRORS,/*276*/
DSL_STATS_LINE_1_CHANNEL_LAST_SHOWTIME_XTUC_HEC_ERRORS,/*277*/
DSL_STATS_LINE_1_CHANNEL_CURRENT_DAY,/*278*/
DSL_STATS_LINE_1_CHANNEL_CURRENT_DAY_XTUR_FEC_ERRORS,/*279*/
DSL_STATS_LINE_1_CHANNEL_CURRENT_DAY_XTUR_CRC_ERRORS,/*280*/
DSL_STATS_LINE_1_CHANNEL_CURRENT_DAY_XTUC_FEC_ERRORS,/*281*/
DSL_STATS_LINE_1_CHANNEL_CURRENT_DAY_XTUC_CRC_ERRORS,/*282*/
DSL_STATS_LINE_1_CHANNEL_CURRENT_DAY_XTUR_HEC_ERRORS,/*283*/
DSL_STATS_LINE_1_CHANNEL_CURRENT_DAY_XTUC_HEC_ERRORS,/*284*/
DSL_STATS_LINE_1_CHANNEL_QUARTER_HOUR,/*285*/
DSL_STATS_LINE_1_CHANNEL_QUARTER_HOUR_XTUR_FEC_ERRORS,/*286*/
DSL_STATS_LINE_1_CHANNEL_QUARTER_HOUR_XTUR_CRC_ERRORS,/*287*/
DSL_STATS_LINE_1_CHANNEL_QUARTER_HOUR_XTUC_FEC_ERRORS,/*288*/
DSL_STATS_LINE_1_CHANNEL_QUARTER_HOUR_XTUC_CRC_ERRORS,/*289*/
DSL_STATS_LINE_1_CHANNEL_QUARTER_HOUR_XTUR_HEC_ERRORS,/*290*/
DSL_STATS_LINE_1_CHANNEL_QUARTER_HOUR_XTUC_HEC_ERRORS/*291*/
} DSL_CPE_StatusNodeIdx_t;
/**
This function creates the initial Status File
and updates the init parameters values
\param pContext - Pointer to dsl cpe library context structure, [I]
\return
Return values are defined within the DSL_Error_t definition
- DSL_SUCCESS in case of success
- DSL_ERROR if operation failed
*/
DSL_Error_t DSL_CPE_StatusFileInitialize(
DSL_CPE_Control_Context_t *pContext);
/**
This function updates Status File parameters
triggered by events
\param pContext - Pointer to dsl cpe library context structure, [I]
\return
Return values are defined within the DSL_Error_t definition
- DSL_SUCCESS in case of success
- DSL_ERROR if operation failed
*/
DSL_Error_t DSL_CPE_StatusFileEvtUpdate(
DSL_CPE_Control_Context_t *pContext,
const DSL_CPE_StatusNodeIdx_t eNodeIdx);
/**
This function updates Status File parameters
triggered by the polling timer
\param pContext - Pointer to dsl cpe library context structure, [I]
\return
Return values are defined within the DSL_Error_t definition
- DSL_SUCCESS in case of success
- DSL_ERROR if operation failed
*/
DSL_Error_t DSL_CPE_StatusFilePollUpdate(
DSL_CPE_Control_Context_t *pContext,
const DSL_CPE_StatusNodeIdx_t ePollSectionIdx);
#endif /* defined(INCLUDE_DSL_JSON_PARSING) && (INCLUDE_DSL_JSON_PARSING == 1) */
#endif /* _LIB_DSL_STATUS_PARSER_H */

116
src/dsl_cpe_vxworks.c Normal file
View file

@ -0,0 +1,116 @@
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifdef VXWORKS
#include "dsl_cpe_vxworks.h"
#include "dsl_cpe_control.h"
/** \file
Operating System access implementation
*/
/**
For a detailed description of the function, its arguments and return value
please refer to the description in the header file 'dsl_cpe_os.h'
*/
int DSL_CPE_debug_printf(DSL_char_t *fmt, ...)
{
va_list ap; /* points to each unnamed arg in turn */
DSL_int_t nRet = 0;
va_start(ap, fmt); /* set ap pointer to 1st unnamed arg */
/* For VxWorks printout will be only done to console only at the moment */
nRet = vprintf(fmt, ap);
va_end(ap);
return nRet;
}
/**
Enable the console line mode.
In this mode the input from the device is available only after receiving NEWLINE .
This allows to modify the command line until the Enter key is pressed.
*/
void DSL_CPE_KeypressSet (void)
{
#ifndef _lint
int options;
int iofd = fileno(stdin);
options = ioctl(iofd, FIOGETOPTIONS, 0);
ioctl(iofd, FIOSETOPTIONS, (int)(options & ~OPT_LINE));
#endif
}
/**
Disable the console line mode.
Plesae refer to \ref IFXOS_KeypressSet .
*/
void DSL_CPE_KeypressReset (void)
{
#ifndef _lint
int options;
int iofd = fileno(stdin);
options = ioctl(iofd, FIOGETOPTIONS, 0);
ioctl(iofd, FIOSETOPTIONS, (int)(options | OPT_LINE));
#endif
}
DSL_uint16_t DSL_CPE_Htons(DSL_uint16_t hVal)
{
#if __BYTE_ORDER == __LITTLE_ENDIAN
return (((hVal >> 8) & 0xFF) | (hVal << 8));
#else
return hVal;
#endif
}
DSL_uint32_t DSL_CPE_Htonl(DSL_uint32_t hVal)
{
#if __BYTE_ORDER == __LITTLE_ENDIAN
return (((hVal >> 24) & 0x000000ff) | ((hVal >> 8) & 0x0000ff00) | ((hVal << 8) & 0x00ff0000) | ((hVal << 24) & 0xff000000));
#else
return hVal;
#endif
}
/**
For a detailed description of the function, its arguments and return value
please refer to the description in the header file 'dsl_cpe_os.h'
*/
DSL_int_t DSL_CPE_FPrintf(DSL_CPE_File_t *stream, const DSL_char_t *format, ...)
{
va_list ap; /* points to each unnamed arg in turn */
DSL_int_t nRet = 0;
va_start(ap, format); /* set ap pointer to 1st unnamed arg */
nRet = vfprintf(stream, format, ap);
fflush(stream);
va_end(ap);
return nRet;
}
#if defined(DSL_DEBUG_TOOL_INTERFACE) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT)
DSL_char_t * DSL_CPE_OwnAddrStringGet(DSL_void_t)
{
return DSL_NULL;
}
#endif /* DSL_DEBUG_TOOL_INTERFACE*/
#endif /* VXWORKS */

90
src/dsl_cpe_vxworks.h Normal file
View file

@ -0,0 +1,90 @@
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifdef VXWORKS
/** \file
OS interface, WIN32 adaptation
*/
#include "drv_dsl_cpe_api_types.h"
#include <signal.h>
#include <ctype.h>
#ifdef DSL_DEBUG_TOOL_INTERFACE
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <net/if.h>
#endif
#include "ifxos_common.h"
#include "ifxos_debug.h"
#include "ifxos_thread.h"
#include "ifxos_memory_alloc.h"
#include "ifxos_lock.h"
#include "ifxos_select.h"
#include "ifxos_common.h"
#include "ifxos_print_io.h"
#include "ifxos_device_access.h"
#include "ifxos_file_access.h"
#include "ifxos_time.h"
#include "ifxos_thread.h"
#include "ifxos_termios.h"
#include "ifxos_pipe.h"
#include "ifxos_misc.h"
#include "ifxos_socket.h"
#include "ifx_getopt.h"
#define PACKAGE_VERSION ""
#define DSL_CPE_STACKSIZE 2048
#define DSL_CPE_PRIORITY 64
#define DSL_CPE_PIPE_PRIORITY 64
#define DSL_CPE_TCP_MSG_PRIORITY 64
#define DSL_CPE_STRNCASECMP(a,b,c) stricmp(a,b)
#define DSL_CPE_StringToAddress(strAddr, iAddr) inet_aton(strAddr, (iAddr))
#define DSL_CPE_AddressToString inet_ntoa
#ifndef FD_SETSIZE
#define DSL_FD_SETSIZE 1024
#else
#define DSL_FD_SETSIZE FD_SETSIZE
#endif
#define DSL_CPE_File_t IFXOS_File_t
void DSL_CPE_KeypressSet (void);
void DSL_CPE_KeypressReset (void);
DSL_uint16_t DSL_CPE_Htons(DSL_uint16_t hVal);
DSL_uint32_t DSL_CPE_Htonl(DSL_uint32_t hVal);
#if defined(DSL_DEBUG_TOOL_INTERFACE) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT)
DSL_char_t* DSL_CPE_OwnAddrStringGet(DSL_void_t);
#endif /* DSL_DEBUG_TOOL_INTERFACE*/
/**
Print to a file, pipe, stdout, stderr or memory file.
*/
DSL_int_t DSL_CPE_FPrintf(DSL_CPE_File_t *stream, const DSL_char_t *format, ...)
#ifdef __GNUC__
__attribute__ ((format (printf, 2, 3)))
#endif
;
#endif /* VXWORKS */

112
src/dsl_cpe_win32.c Normal file
View file

@ -0,0 +1,112 @@
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
/** \file
Operating System access implementation
*/
/*#define DSL_INTERN*/
#include "dsl_cpe_os.h"
#if defined(WIN32)
#include <time.h>
#include <process.h>
#undef DSL_CCA_DBG_BLOCK
#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_OS
/**
For a detailed description of the function, its arguments and return value
please refer to the description in the header file 'dsl_cpe_os.h'
*/
DSL_Error_t DSL_SetEnv(const DSL_char_t *sName, const DSL_char_t *sValue)
{
return ((SetEnvironmentVariable(sName, sValue) == 0) ? DSL_ERROR : DSL_SUCCESS);
}
/**
Installing of system handler routines.
\remarks not used
*/
DSL_void_t DSL_HandlerInstall(DSL_void_t)
{
}
/**
For a detailed description of the function, its arguments and return value
please refer to the description in the header file 'dsl_cpe_os.h'
*/
int DSL_CPE_debug_printf(DSL_char_t *fmt, ...)
{
va_list ap; /* points to each unnamed arg in turn */
DSL_int_t nRet = 0;
va_start(ap, fmt); /* set ap pointer to 1st unnamed arg */
/* For VxWorks printout will be only done to console only at the moment */
nRet = vprintf(fmt, ap);
va_end(ap);
return nRet;
}
DSL_uint16_t DSL_CPE_Htons(DSL_uint16_t hVal)
{
return htons(hVal);
}
DSL_uint32_t DSL_CPE_Htonl(DSL_uint32_t hVal)
{
return htonl(hVal);
}
#if defined(DSL_DEBUG_TOOL_INTERFACE) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT)
DSL_char_t * DSL_CPE_OwnAddrStringGet(DSL_void_t)
{
return DSL_NULL;
}
#endif /* DSL_DEBUG_TOOL_INTERFACE*/
/**
For a detailed description of the function, its arguments and return value
please refer to the description in the header file 'dsl_cpe_os.h'
*/
DSL_int_t DSL_CPE_FPrintf(DSL_CPE_File_t *stream, const DSL_char_t *format, ...)
{
va_list ap; /* points to each unnamed arg in turn */
DSL_int_t nRet = 0;
va_start(ap, format); /* set ap pointer to 1st unnamed arg */
nRet = vfprintf(stream, format, ap);
fflush(stream);
va_end(ap);
return nRet;
}
DSL_Error_t DSL_CPE_System(const DSL_char_t *sCommand)
{
return DSL_SUCCESS;
}
DSL_Error_t DSL_CPE_SetEnv(const DSL_char_t *sName, const DSL_char_t *sValue)
{
return DSL_SUCCESS;
}
DSL_void_t DSL_CPE_EnvVarFree(DSL_void_t)
{
}
#endif /* WIN32 */

129
src/dsl_cpe_win32.h Normal file
View file

@ -0,0 +1,129 @@
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifdef WIN32
/** \file
OS interface, WIN32 adaptation
*/
#pragma pack(1)
#include <stdio.h>
#include <errno.h>
#include <signal.h>
#include <io.h>
#include <fcntl.h>
#include "drv_dsl_cpe_api_types.h"
#include "ifxos_common.h"
#include "ifxos_debug.h"
#include "ifxos_thread.h"
#include "ifxos_memory_alloc.h"
#include "ifxos_lock.h"
#include "ifxos_select.h"
#include "ifxos_common.h"
#include "ifxos_print_io.h"
#include "ifxos_device_access.h"
#include "ifxos_file_access.h"
#include "ifxos_time.h"
#include "ifxos_thread.h"
#include "ifxos_termios.h"
#include "ifxos_pipe.h"
#include "ifxos_misc.h"
#include "ifxos_socket.h"
#include "ifx_getopt.h"
#ifndef snprintf
#define snprintf sprintf_s
#endif
#ifndef strtok_r
#define strtok_r strtok_s
#endif
#define ULONG_MAX 0xffffffffUL /* maximum unsigned long value */
#define __BIG_ENDIAN IFXOS_BIG_ENDIAN
#define __BYTE_ORDER IFXOS_BYTE_ORDER
#define DSL_CPE_PRIORITY (0)
#define DSL_CPE_STACKSIZE (2048)
#define DSL_CPE_STRNCASECMP(a,b,c) stricmp((a),(b))
/** carriage return for windows */
#define DSL_CPE_CRLF "\n"
#define IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */
#define IOC_VOID 0x20000000 /* no parameters */
#define IOC_OUT 0x40000000 /* copy out parameters */
#define IOC_IN 0x80000000 /* copy in parameters */
#define IOC_INOUT (IOC_IN|IOC_OUT)
#ifndef _IO
#define _IO(x,y) (IOC_VOID|((x)<<8)|y)
#endif /* _IO*/
#ifndef _IOR
#define _IOR(x,y,t) (IOC_OUT|((sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|y)
#endif /* _IOR*/
#ifndef _IOW
#define _IOW(x,y,t) (IOC_IN|((sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|y)
#endif /* _IOW*/
#ifndef _IOWR
#define _IOWR(x,y,t) (IOC_INOUT|((sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|y)
#endif /* _IOWR*/
#define _IOC_TYPE(x) (((x)>>8) & 0xFF)
#define DSL_CPE_StringToAddress(strAddr, iAddr) inet_aton(strAddr, (iAddr))
#define DSL_CPE_AddressToString inet_ntoa
#define DSL_CPE_KeypressSet IFXOS_KeypressSet
#define DSL_CPE_KeypressReset IFXOS_KeypressReset
/** map FILE to own type */
typedef FILE DSL_CPE_File_t;
DSL_uint16_t DSL_CPE_Htons(DSL_uint16_t hVal);
DSL_uint32_t DSL_CPE_Htonl(DSL_uint32_t hVal);
#if defined(DSL_DEBUG_TOOL_INTERFACE) || defined(INCLUDE_DSL_CPE_DTI_SUPPORT)
DSL_char_t* DSL_CPE_OwnAddrStringGet(DSL_void_t);
#endif /* DSL_DEBUG_TOOL_INTERFACE*/
/**
Print to a file, pipe, stdout, stderr or memory file.
*/
DSL_int_t DSL_CPE_FPrintf(DSL_CPE_File_t *stream, const DSL_char_t *format, ...)
#ifdef __GNUC__
__attribute__ ((format (printf, 2, 3)))
#endif
;
#pragma pack()
extern DSL_Error_t DSL_CPE_PipeCreate(DSL_char_t *pName);
extern DSL_Error_t DSL_CPE_PipeClose(DSL_CPE_File_t *file);
extern DSL_CPE_File_t *DSL_CPE_PipeOpen(DSL_char_t *pName,
DSL_boolean_t reading, DSL_boolean_t blocking);
DSL_Error_t DSL_CPE_System(const DSL_char_t *sCommand);
DSL_Error_t DSL_CPE_SetEnv(const DSL_char_t *sName, const DSL_char_t *sValue);
DSL_void_t DSL_CPE_EnvVarFree(DSL_void_t);
#endif /* WIN32 */

32
tools/pipe/Makefile.am Normal file
View file

@ -0,0 +1,32 @@
## Process this file with automake to produce Makefile.in
bin_PROGRAMS = dsl_cpe_pipe
if ADD_APPL_CFLAGS_SET
dsl_cpe_pipe_cflags = $(ADD_APPL_CFLAGS)
else
dsl_cpe_pipe_cflags =
endif
dsl_cpe_pipe_compile_cflags = $(DSL_DRIVER_INCL_PATH) $(IFXOS_INCLUDE_PATH)
if SAFEC_SUPPORT
dsl_cpe_pipe_compile_cflags += @SAFEC_INCL_PATH@
endif
dsl_cpe_pipe_common_cflags = -Wall -Wimplicit -Wreturn-type -Wunused -Wundef \
-Wswitch -Wcomment -Wuninitialized -DLINUX -g -s
dsl_cpe_pipe_SOURCES = dsl_pipe_client.c dsl_pipe_lib.c
dsl_cpe_pipe_CFLAGS = $(dsl_cpe_pipe_common_cflags) \
$(dsl_cpe_pipe_cflags) \
$(dsl_cpe_pipe_compile_cflags)
dsl_cpe_pipe_LDADD = -lifxos -lpthread -lm -lrt
EXTRA_DIST = dsl_cpe_safec_wrapper.h
if SAFEC_SUPPORT
dsl_cpe_pipe_LDADD += -l@SAFEC_LIB_NAME@
endif

687
tools/pipe/Makefile.in Normal file
View file

@ -0,0 +1,687 @@
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
bin_PROGRAMS = dsl_cpe_pipe$(EXEEXT)
@SAFEC_SUPPORT_TRUE@am__append_1 = @SAFEC_INCL_PATH@
@SAFEC_SUPPORT_TRUE@am__append_2 = -l@SAFEC_LIB_NAME@
subdir = tools/pipe
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/src/dsl_cpe_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am_dsl_cpe_pipe_OBJECTS = dsl_cpe_pipe-dsl_pipe_client.$(OBJEXT) \
dsl_cpe_pipe-dsl_pipe_lib.$(OBJEXT)
dsl_cpe_pipe_OBJECTS = $(am_dsl_cpe_pipe_OBJECTS)
am__DEPENDENCIES_1 =
dsl_cpe_pipe_DEPENDENCIES = $(am__DEPENDENCIES_1)
dsl_cpe_pipe_LINK = $(CCLD) $(dsl_cpe_pipe_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(dsl_cpe_pipe_SOURCES)
DIST_SOURCES = $(dsl_cpe_pipe_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADD_APPL_CFLAGS = @ADD_APPL_CFLAGS@
ADD_APPL_LDFLAGS = @ADD_APPL_LDFLAGS@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DISTCHECK_CONFIGURE_PARAMS = @DISTCHECK_CONFIGURE_PARAMS@
DSL_ADD_EXT_APPL_CFLAGS = @DSL_ADD_EXT_APPL_CFLAGS@
DSL_CCA_DBG_MAX_LEVEL_PRE = @DSL_CCA_DBG_MAX_LEVEL_PRE@
DSL_CCA_DBG_MAX_LEVEL_SET = @DSL_CCA_DBG_MAX_LEVEL_SET@
DSL_CONFIG_MODEL_TYPE = @DSL_CONFIG_MODEL_TYPE@
DSL_CPE_DEBUG_DISABLE = @DSL_CPE_DEBUG_DISABLE@
DSL_DBG_MSG_NETLINK_ID = @DSL_DBG_MSG_NETLINK_ID@
DSL_DEBUG_TOOL_INTERFACE = @DSL_DEBUG_TOOL_INTERFACE@
DSL_DEVICE_DRIVER_INCL_PATH = @DSL_DEVICE_DRIVER_INCL_PATH@
DSL_DEVICE_NAME = @DSL_DEVICE_NAME@
DSL_DRIVER_INCL_PATH = @DSL_DRIVER_INCL_PATH@
DSL_VRX_DEVICE_NAME = @DSL_VRX_DEVICE_NAME@
DTI_INCL_PATH = @DTI_INCL_PATH@
DTI_LIBRARY_PATH = @DTI_LIBRARY_PATH@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXTRA_APP_CFLAGS = @EXTRA_APP_CFLAGS@
GREP = @GREP@
IFXOS_INCLUDE_PATH = @IFXOS_INCLUDE_PATH@
IFXOS_LIBRARY_PATH = @IFXOS_LIBRARY_PATH@
INCLUDE_DEPRECATED = @INCLUDE_DEPRECATED@
INCLUDE_DEVICE_EXCEPTION_CODES = @INCLUDE_DEVICE_EXCEPTION_CODES@
INCLUDE_DSL_ADSL_MIB = @INCLUDE_DSL_ADSL_MIB@
INCLUDE_DSL_CEOC = @INCLUDE_DSL_CEOC@
INCLUDE_DSL_CONFIG_GET = @INCLUDE_DSL_CONFIG_GET@
INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT = @INCLUDE_DSL_CPE_CLI_AUTOGEN_SUPPORT@
INCLUDE_DSL_CPE_CLI_SUPPORT = @INCLUDE_DSL_CPE_CLI_SUPPORT@
INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH = @INCLUDE_DSL_CPE_CMV_SCRIPTS_MATH@
INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT = @INCLUDE_DSL_CPE_CMV_SCRIPTS_SUPPORT@
INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT = @INCLUDE_DSL_CPE_DEBUG_LOGGER_SUPPORT@
INCLUDE_DSL_CPE_DTI_SUPPORT = @INCLUDE_DSL_CPE_DTI_SUPPORT@
INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT = @INCLUDE_DSL_CPE_FILESYSTEM_SUPPORT@
INCLUDE_DSL_CPE_IFXOS_SUPPORT = @INCLUDE_DSL_CPE_IFXOS_SUPPORT@
INCLUDE_DSL_CPE_MISC_LINE_STATUS = @INCLUDE_DSL_CPE_MISC_LINE_STATUS@
INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS = @INCLUDE_DSL_CPE_PM_CHANNEL_COUNTERS@
INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS = @INCLUDE_DSL_CPE_PM_CHANNEL_EXT_COUNTERS@
INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS = @INCLUDE_DSL_CPE_PM_CHANNEL_THRESHOLDS@
INCLUDE_DSL_CPE_PM_CONFIG = @INCLUDE_DSL_CPE_PM_CONFIG@
INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS = @INCLUDE_DSL_CPE_PM_DATA_PATH_COUNTERS@
INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS = @INCLUDE_DSL_CPE_PM_DATA_PATH_FAILURE_COUNTERS@
INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS = @INCLUDE_DSL_CPE_PM_DATA_PATH_THRESHOLDS@
INCLUDE_DSL_CPE_PM_HISTORY = @INCLUDE_DSL_CPE_PM_HISTORY@
INCLUDE_DSL_CPE_PM_LINE_COUNTERS = @INCLUDE_DSL_CPE_PM_LINE_COUNTERS@
INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS = @INCLUDE_DSL_CPE_PM_LINE_EVENT_SHOWTIME_COUNTERS@
INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS = @INCLUDE_DSL_CPE_PM_LINE_THRESHOLDS@
INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS = @INCLUDE_DSL_CPE_PM_OPTIONAL_PARAMETERS@
INCLUDE_DSL_CPE_PM_RETX_COUNTERS = @INCLUDE_DSL_CPE_PM_RETX_COUNTERS@
INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS = @INCLUDE_DSL_CPE_PM_RETX_THRESHOLDS@
INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS = @INCLUDE_DSL_CPE_PM_SHOWTIME_COUNTERS@
INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS = @INCLUDE_DSL_CPE_PM_TOTAL_COUNTERS@
INCLUDE_DSL_CPE_TRACE_BUFFER = @INCLUDE_DSL_CPE_TRACE_BUFFER@
INCLUDE_DSL_DELT = @INCLUDE_DSL_DELT@
INCLUDE_DSL_EVENT_POLLING = @INCLUDE_DSL_EVENT_POLLING@
INCLUDE_DSL_FILTER_DETECTION = @INCLUDE_DSL_FILTER_DETECTION@
INCLUDE_DSL_FRAMING_PARAMETERS = @INCLUDE_DSL_FRAMING_PARAMETERS@
INCLUDE_DSL_G997_ALARM = @INCLUDE_DSL_G997_ALARM@
INCLUDE_DSL_G997_FRAMING_PARAMETERS = @INCLUDE_DSL_G997_FRAMING_PARAMETERS@
INCLUDE_DSL_G997_LINE_INVENTORY = @INCLUDE_DSL_G997_LINE_INVENTORY@
INCLUDE_DSL_G997_PER_TONE = @INCLUDE_DSL_G997_PER_TONE@
INCLUDE_DSL_G997_STATUS = @INCLUDE_DSL_G997_STATUS@
INCLUDE_DSL_JSON_PARSING = @INCLUDE_DSL_JSON_PARSING@
INCLUDE_DSL_PM = @INCLUDE_DSL_PM@
INCLUDE_DSL_RESOURCE_STATISTICS = @INCLUDE_DSL_RESOURCE_STATISTICS@
INCLUDE_DSL_SYSTEM_INTERFACE = @INCLUDE_DSL_SYSTEM_INTERFACE@
INCLUDE_DTI_AGENT_STANDALONE_SUPPORT = @INCLUDE_DTI_AGENT_STANDALONE_SUPPORT@
INCLUDE_FW_REQUEST_SUPPORT = @INCLUDE_FW_REQUEST_SUPPORT@
INCLUDE_PILOT_TONES_STATUS = @INCLUDE_PILOT_TONES_STATUS@
INCLUDE_REAL_TIME_TRACE = @INCLUDE_REAL_TIME_TRACE@
INCLUDE_SCRIPT_NOTIFICATION = @INCLUDE_SCRIPT_NOTIFICATION@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBJSON_C_INCL_PATH = @LIBJSON_C_INCL_PATH@
LIBJSON_C_LIBRARY_PATH = @LIBJSON_C_LIBRARY_PATH@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
SAFEC_INCL_PATH = @SAFEC_INCL_PATH@
SAFEC_LIB_NAME = @SAFEC_LIB_NAME@
SAFEC_LIB_PATH = @SAFEC_LIB_PATH@
SAFEC_SUPPORT = @SAFEC_SUPPORT@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
@ADD_APPL_CFLAGS_SET_FALSE@dsl_cpe_pipe_cflags =
@ADD_APPL_CFLAGS_SET_TRUE@dsl_cpe_pipe_cflags = $(ADD_APPL_CFLAGS)
dsl_cpe_pipe_compile_cflags = $(DSL_DRIVER_INCL_PATH) \
$(IFXOS_INCLUDE_PATH) $(am__append_1)
dsl_cpe_pipe_common_cflags = -Wall -Wimplicit -Wreturn-type -Wunused -Wundef \
-Wswitch -Wcomment -Wuninitialized -DLINUX -g -s
dsl_cpe_pipe_SOURCES = dsl_pipe_client.c dsl_pipe_lib.c
dsl_cpe_pipe_CFLAGS = $(dsl_cpe_pipe_common_cflags) \
$(dsl_cpe_pipe_cflags) \
$(dsl_cpe_pipe_compile_cflags)
dsl_cpe_pipe_LDADD = -lifxos -lpthread -lm -lrt $(am__append_2)
EXTRA_DIST = dsl_cpe_safec_wrapper.h
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/pipe/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu tools/pipe/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p \
; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' \
-e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' \
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
dsl_cpe_pipe$(EXEEXT): $(dsl_cpe_pipe_OBJECTS) $(dsl_cpe_pipe_DEPENDENCIES) $(EXTRA_dsl_cpe_pipe_DEPENDENCIES)
@rm -f dsl_cpe_pipe$(EXEEXT)
$(AM_V_CCLD)$(dsl_cpe_pipe_LINK) $(dsl_cpe_pipe_OBJECTS) $(dsl_cpe_pipe_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_pipe-dsl_pipe_client.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsl_cpe_pipe-dsl_pipe_lib.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
dsl_cpe_pipe-dsl_pipe_client.o: dsl_pipe_client.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_pipe_CFLAGS) $(CFLAGS) -MT dsl_cpe_pipe-dsl_pipe_client.o -MD -MP -MF $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_client.Tpo -c -o dsl_cpe_pipe-dsl_pipe_client.o `test -f 'dsl_pipe_client.c' || echo '$(srcdir)/'`dsl_pipe_client.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_client.Tpo $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_client.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_pipe_client.c' object='dsl_cpe_pipe-dsl_pipe_client.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_pipe_CFLAGS) $(CFLAGS) -c -o dsl_cpe_pipe-dsl_pipe_client.o `test -f 'dsl_pipe_client.c' || echo '$(srcdir)/'`dsl_pipe_client.c
dsl_cpe_pipe-dsl_pipe_client.obj: dsl_pipe_client.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_pipe_CFLAGS) $(CFLAGS) -MT dsl_cpe_pipe-dsl_pipe_client.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_client.Tpo -c -o dsl_cpe_pipe-dsl_pipe_client.obj `if test -f 'dsl_pipe_client.c'; then $(CYGPATH_W) 'dsl_pipe_client.c'; else $(CYGPATH_W) '$(srcdir)/dsl_pipe_client.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_client.Tpo $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_client.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_pipe_client.c' object='dsl_cpe_pipe-dsl_pipe_client.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_pipe_CFLAGS) $(CFLAGS) -c -o dsl_cpe_pipe-dsl_pipe_client.obj `if test -f 'dsl_pipe_client.c'; then $(CYGPATH_W) 'dsl_pipe_client.c'; else $(CYGPATH_W) '$(srcdir)/dsl_pipe_client.c'; fi`
dsl_cpe_pipe-dsl_pipe_lib.o: dsl_pipe_lib.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_pipe_CFLAGS) $(CFLAGS) -MT dsl_cpe_pipe-dsl_pipe_lib.o -MD -MP -MF $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_lib.Tpo -c -o dsl_cpe_pipe-dsl_pipe_lib.o `test -f 'dsl_pipe_lib.c' || echo '$(srcdir)/'`dsl_pipe_lib.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_lib.Tpo $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_lib.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_pipe_lib.c' object='dsl_cpe_pipe-dsl_pipe_lib.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_pipe_CFLAGS) $(CFLAGS) -c -o dsl_cpe_pipe-dsl_pipe_lib.o `test -f 'dsl_pipe_lib.c' || echo '$(srcdir)/'`dsl_pipe_lib.c
dsl_cpe_pipe-dsl_pipe_lib.obj: dsl_pipe_lib.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_pipe_CFLAGS) $(CFLAGS) -MT dsl_cpe_pipe-dsl_pipe_lib.obj -MD -MP -MF $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_lib.Tpo -c -o dsl_cpe_pipe-dsl_pipe_lib.obj `if test -f 'dsl_pipe_lib.c'; then $(CYGPATH_W) 'dsl_pipe_lib.c'; else $(CYGPATH_W) '$(srcdir)/dsl_pipe_lib.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_lib.Tpo $(DEPDIR)/dsl_cpe_pipe-dsl_pipe_lib.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dsl_pipe_lib.c' object='dsl_cpe_pipe-dsl_pipe_lib.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dsl_cpe_pipe_CFLAGS) $(CFLAGS) -c -o dsl_cpe_pipe-dsl_pipe_lib.obj `if test -f 'dsl_pipe_lib.c'; then $(CYGPATH_W) 'dsl_pipe_lib.c'; else $(CYGPATH_W) '$(srcdir)/dsl_pipe_lib.c'; fi`
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
distclean distclean-compile distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
install-am install-binPROGRAMS install-data install-data-am \
install-dvi install-dvi-am install-exec install-exec-am \
install-html install-html-am install-info install-info-am \
install-man install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am \
uninstall-binPROGRAMS
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View file

@ -0,0 +1,43 @@
/******************************************************************************
Copyright 2018 - 2019 Intel Corporation
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifndef _SAFEC_WRAPPER_H
#define _SAFEC_WRAPPER_H
#if defined (SAFEC_SUPPORT)
#include "safe_mem_lib.h"
#include "safe_str_lib.h"
#if (SAFEC_SUPPORT == 1) || (SAFEC_SUPPORT == 3)
#define cpe_control_pipe_memcpy_s(dest, destsz, src, srcsz) memcpy_s(dest, destsz, src, srcsz)
#define cpe_control_pipe_strncpy_s(dest, destsz, src, srcsz) strncpy_s(dest, destsz, src, srcsz)
#else
#warning "Safe C library version is unknown!"
#endif /* if (SAFEC_SUPPORT == 1) elif (SAFEC_SUPPORT == 3) */
#else
#warning "Safe C library is not available!"
#include <stddef.h> /* size_t */
static __inline__ size_t safec_wrapper_min(size_t a, size_t b)
{
return a > b ? b : a;
}
#define cpe_control_pipe_memcpy_s(dest, destsz, src, srcsz) memcpy(dest, src, safec_wrapper_min(destsz,srcsz))
#define cpe_control_pipe_strncpy_s(dest, destsz, src, srcsz) strncpy(dest, src, safec_wrapper_min(destsz,srcsz))
#endif /* defined (SAFEC_SUPPORT) */
#endif /* _SAFEC_WRAPPER_H */

View file

@ -0,0 +1,489 @@
/******************************************************************************
Copyright 2016 - 2019 Intel Corporation
Copyright 2015 - 2016 Lantiq Beteiligungs-GmbH & Co. KG
Copyright 2009 - 2014 Lantiq Deutschland GmbH
Copyright 2007 - 2008 Infineon Technologies AG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifdef LINUX
#include "dsl_pipe_client.h"
#define PIPE_PREFIX "/tmp/pipe/dsl_cpe"
#define SYS_NAME_PREFIX "/tmp"
#undef DSL_DBG_BLOCK
#define DSL_DBG_BLOCK DSL_DBG_OS
static char Result[20000];
static int sema;
#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
/* union semun is defined by including <sys/sem.h> */
#else
/* according to X/OPEN we have to define it ourselves */
union semun {
int val; /* value for SETVAL */
struct semid_ds *buf; /* buffer for IPC_STAT, IPC_SET */
unsigned short *array; /* array for GETALL, SETALL */
/* Linux specific part: */
struct seminfo *__buf; /* buffer for IPC_INFO */
};
#endif
#ifndef DSL_DEBUG_DISABLE
static void print_sem_error(int err)
{
switch(err)
{
case E2BIG:
printf( "DSL[Pipe]: The value of nsops is greater than the system-"
"imposed maximum." DSL_PIPE_CRLF);
break;
case EACCES:
printf( "DSL[Pipe]: Operation permission is denied to the calling "
"process, see IPC." DSL_PIPE_CRLF);
break;
case EAGAIN:
printf( "DSL[Pipe]: The operation would result in suspension of the "
"calling process but (sem_flg&IPC_NOWAIT) is non-zero." DSL_PIPE_CRLF);
break;
case EFBIG:
printf( "DSL[Pipe]: The value of sem_num is less than 0 or greater "
"than or equal to the number of semaphores in the set associated "
"with semid. " DSL_PIPE_CRLF);
break;
case EIDRM:
printf( "DSL[Pipe]: The semaphore identifier semid is removed from "
"the system. " DSL_PIPE_CRLF);
break;
case EINTR:
printf( "DSL[Pipe]: The semop() function was interrupted by a signal." DSL_PIPE_CRLF);
break;
case EINVAL:
printf( "DSL[Pipe]: The value of semid is not a valid semaphore "
"identifier, or the number of individual semaphores for which the "
"calling process requests a SEM_UNDO would exceed the system-"
"imposed limit. " DSL_PIPE_CRLF);
break;
case ENOSPC:
printf( "DSL[Pipe]: The limit on the number of individual processes "
"requesting a SEM_UNDO would be exceeded. " DSL_PIPE_CRLF);
break;
case ERANGE:
printf( "DSL[Pipe]: An operation would cause a semval to overflow "
"the system-imposed limit, or an operation would cause a semadj "
"value to overflow the system-imposed limit." DSL_PIPE_CRLF);
break;
default:
break;
}
}
#endif /* DSL_DEBUG_DISABLE */
/** signal handler, will abort blocking semop() call */
static void DSL_PIPE_SemAlarm(int val)
{
}
static int DSL_PIPE_SemaphoreGlobalCreate(DSL_char_t *pName)
{
/* Semaphore ID used in further semaphore operations */
int semid = -1;
int fd;
/* Used to generate the semaphore key in case pName is not a number */
DSL_char_t *sempath = DSL_NULL;
/* the name should be an integer if not the key for semaphore is generated at
runtime*/
DSL_int_t nsemkey;
union semun arg;
arg.val = 0;
if (pName == DSL_NULL)
pName = "";
nsemkey = atoi(pName);
/*incase atoi fails generate a tmp string and try to generate a key
at runtime */
if (nsemkey == 0)
{
sempath = DSL_PIPE_Malloc(strlen(SYS_NAME_PREFIX"/") + strlen(pName) + 1);
if (sempath == DSL_NULL)
{
printf( "DSL: No Mem." DSL_PIPE_CRLF);
return -1;
}
mkdir(SYS_NAME_PREFIX, 0777);
fd = open(SYS_NAME_PREFIX, O_RDONLY);
fchmod(fd, 0777);
close(fd);
memset(sempath, 0, strlen(SYS_NAME_PREFIX"/") + strlen(pName) + 1);
cpe_control_pipe_strncpy_s(sempath, strlen(SYS_NAME_PREFIX"/") + strlen(pName) + 1, SYS_NAME_PREFIX"/\0", strlen(SYS_NAME_PREFIX"/\0"));
strcat(sempath, pName);
/* creat(sempath, 0666); */
creat(sempath, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
/* Access to all */
/*chmod(sempath, 0777);*/
/* generate key */
if ( (nsemkey = ftok(sempath, 5)) < 0)
{
switch(errno)
{
case EBADF:
printf( "DSL: filedes is bad." DSL_PIPE_CRLF);
break;
case ENOENT:
printf( "DSL: A component of the path file_name does not exist, "
"or the path is an empty string." DSL_PIPE_CRLF);
break;
case ENOTDIR:
printf( "DSL: A component of the path is not a directory." DSL_PIPE_CRLF);
break;
case ELOOP:
printf( "DSL: Too many symbolic links encountered while "
"traversing the path." DSL_PIPE_CRLF);
break;
case EFAULT:
printf( "DSL: Bad address." DSL_PIPE_CRLF);
break;
case EACCES:
printf( "DSL: Permission denied." DSL_PIPE_CRLF);
break;
case ENOMEM:
printf( "DSL: Out of memory (i.e. kernel memory)." DSL_PIPE_CRLF);
break;
case ENAMETOOLONG:
printf( "DSL: File name too long." DSL_PIPE_CRLF);
break;
default:
break;
}
DSL_PIPE_Free(sempath);
return -1;
}
DSL_PIPE_Free(sempath);
}
if ( ((semid = semget(nsemkey, 1, 0666|IPC_CREAT|IPC_EXCL)) < 0) )
{
/* ERROR: check errno */
if (errno == EEXIST)
{
/* get without create */
if ( ((semid = semget(nsemkey, 1, 0666|IPC_EXCL)) < 0) )
{
printf( "DSL: create semaphore - semget(0x%X,0), errno=%d\n\r",
nsemkey, errno );
#ifndef DSL_DEBUG_DISABLE
print_sem_error(errno);
#endif
return -1;
}
}
else
{
#ifndef DSL_DEBUG_DISABLE
print_sem_error(errno);
#endif
return -1;
}
}
else
arg.val = 1;
if (arg.val == 1)
{
/* set the value of semaphore to 1 ie released or free to use */
if (semctl(semid, 0, SETVAL, arg) < 0 )
{
printf( "DSL: create semaphore - semctl(0x%X,0), errno=%d\n\r",
semid, errno );
#ifndef DSL_DEBUG_DISABLE
print_sem_error(errno);
#endif
return -1;
}
}
return semid;
}
DSL_Error_t DSL_PIPE_SemaphoreGet(int sem, DSL_uint32_t nTimeout)
{
struct sigaction sa;
struct sembuf sb;
struct timespec timeout;
sb.sem_num = 0;
/* specifies the operation ie to get the semaphore */
sb.sem_op = -1;
sb.sem_flg = SEM_UNDO;
switch(nTimeout)
{
case 0xFFFFFFFF:
/* Blocking call */
break;
case 0:
/* Non Blocking */
sb.sem_flg |= IPC_NOWAIT;
break;
default:
/* Blocking call */
/* Initialize timer expiration value */
timeout.tv_sec = (nTimeout/1000);
timeout.tv_nsec = (nTimeout%1000) * 1000 * 1000;
sa.sa_flags = 0;
sa.sa_handler = DSL_PIPE_SemAlarm;
sigaction(SIGALRM, &sa, DSL_NULL);
alarm(timeout.tv_sec + 1);
break;
}
/* Acquire semaphore */
if (semop(sem, &sb, 1) == 0)
{
alarm(0);
return DSL_SUCCESS;
}
else
{
alarm(0);
if(errno == EINTR)
{
printf( "DSL: semaphore timeout." DSL_PIPE_CRLF);
return DSL_ERR_TIMEOUT;
}
else
{
#ifndef DSL_DEBUG_DISABLE
print_sem_error(errno);
#endif
printf( "DSL: get semaphore %x failed (errno=%d)" DSL_PIPE_CRLF, sem, errno);
return DSL_ERROR;
}
}
}
DSL_Error_t DSL_PIPE_SemaphoreSet(int sem)
{
struct sembuf sb;
sb.sem_num = 0;
/* specifies the operation ie to set the semaphore */
sb.sem_op = 1;
sb.sem_flg = SEM_UNDO;
if (semop(sem, &sb, 1) == 0)
{
return DSL_SUCCESS;
}
else
{
#ifndef DSL_DEBUG_DISABLE
print_sem_error(errno);
#endif
printf( "DSL: set semaphore %x failed (errno=%d)" DSL_PIPE_CRLF, sem, errno);
return DSL_ERROR;
}
}
/* 1 colon means there is a required parameter */
/* 2 colons means there is an optional parameter */
static const char GETOPT_LONG_OPTSTRING[] = "hve:";
int main(int argc, char **argv)
{
char *pCommand = DSL_NULL;
int i, k=0, len=0, ret;
FILE *pipe_cmd, *pipe_ack;
DSL_int8_t instance = 0;
DSL_char_t nameBuf[64], *pChar;
i = 1;
pChar = argv[1];
if (pChar)
{
if (pChar[0] == '-')
{
switch(pChar[1])
{
case 'h':
printf(DSL_PIPE_CRLF);
printf("Client for the pipe interface of the \"DSL CPE API\"" DSL_PIPE_CRLF);
printf("\t%s [-hv] [pipe_no] cmd [params]" DSL_PIPE_CRLF, argv[0]);
printf(DSL_PIPE_CRLF);
printf("\t-h\tthis help" DSL_PIPE_CRLF);
printf("\tpipe_no\tpipe number (default 0)" DSL_PIPE_CRLF);
printf("\tcmd\tcommand to execute" DSL_PIPE_CRLF);
printf("\tparams\tparameters of the command" DSL_PIPE_CRLF);
printf(DSL_PIPE_CRLF);
return 0;
case 'v':
printf("\tdsl_pipe_client v0.0.2" DSL_PIPE_CRLF);
return 0;
}
}
else if (isdigit(pChar[0]))
{
if (argc >= 3)
{
instance = atoi(argv[1]);
if ((instance >= MAX_CLI_PIPES) || (instance < 0))
{
printf("\tpipe_no\toption requires parameter in range [0;%d]"
DSL_PIPE_CRLF, (MAX_CLI_PIPES - 1));
return -1;
}
i = 2;
}
}
k = i;
for(;i<argc;i++)
{
len += strlen(argv[i]) + 1;
}
}
else
{
len = 0;
}
if(len == 0)
{
pCommand = DSL_PIPE_Malloc(16);
if(pCommand == DSL_NULL)
{
printf( "Memory allocation failed" DSL_PIPE_CRLF);
return -1;
}
memset(pCommand, 0, 16);
cpe_control_pipe_strncpy_s(pCommand, 16, "help all", sizeof("help all"));
}
else
{
pCommand = DSL_PIPE_Malloc(len + 1);
if(pCommand == DSL_NULL)
{
printf( "Memory allocation failed" DSL_PIPE_CRLF);
return -1;
}
memset(pCommand, 0, len + 1);
for(i=k;i<argc;i++)
{
strcat(pCommand, argv[i]);
strcat(pCommand, " ");
}
}
sema = DSL_PIPE_SemaphoreGlobalCreate("dsl_pipe");
if (sema == -1)
{
printf( "dsl_pipe already running!" DSL_PIPE_CRLF);
/* semaphore not created */
DSL_PIPE_Free(pCommand);
return -1;
}
if (DSL_PIPE_SemaphoreGet(sema, 100) != DSL_SUCCESS)
{
printf( "dsl_pipe already running!" DSL_PIPE_CRLF);
printf( "Please delete /tmp/dsl_pipe to clean up "
"if dsl_pipe is not running anymore!" DSL_PIPE_CRLF);
DSL_PIPE_Free(pCommand);
return -1;
}
snprintf(nameBuf, sizeof(nameBuf), "%s%d_cmd", PIPE_PREFIX, instance);
pipe_cmd = DSL_PIPE_FOpen(nameBuf, "w");
if (pipe_cmd == DSL_NULL)
{
printf( "fopen %s failed (errno=%d)\r\n", nameBuf, errno);
goto error;
}
/* execute command */
DSL_PIPE_FPrintf(pipe_cmd, "%s\r\n", pCommand);
DSL_PIPE_FClose(pipe_cmd);
snprintf(nameBuf, sizeof(nameBuf), "%s%d_ack", PIPE_PREFIX, instance);
pipe_ack = DSL_PIPE_FOpen(nameBuf, "r");
if (pipe_ack == DSL_NULL)
{
printf( "fdopen %s failed (errno=%d)" DSL_PIPE_CRLF, nameBuf, errno);
goto error;
}
/* read answer */
do
{
ret = DSL_PIPE_FRead(Result,1,sizeof(Result)-1,pipe_ack);
if (ret>0)
{
Result[ret] = '\0';
printf( "%s", Result);
}
}
while ((ret > 0));
DSL_PIPE_FClose(pipe_ack);
DSL_PIPE_SemaphoreSet(sema);
printf( DSL_PIPE_CRLF );
DSL_PIPE_Free(pCommand);
return 0;
error:
DSL_PIPE_SemaphoreSet(sema);
printf( "There were errors!" DSL_PIPE_CRLF);
DSL_PIPE_Free(pCommand);
return -1;
}
#endif /* LINUX */

View file

@ -0,0 +1,174 @@
/******************************************************************************
Copyright 2018, Intel Corporation
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifndef DSL_PIPE_CLIENT_H
#define DSL_PIPE_CLIENT_H
#ifdef HAVE_CONFIG_H
#include "dsl_cpe_config.h"
#endif
#include "drv_dsl_cpe_api_types.h"
#include "drv_dsl_cpe_api_error.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <getopt.h>
#include <stdlib.h>
#include <errno.h>
#include <signal.h>
#include <sys/time.h>
#include <sys/sem.h>
#include <fcntl.h>
#include <unistd.h>
#include <ctype.h>
#ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT
#include <stdarg.h>
#include <sys/stat.h>
#else
/** IFXOS includes*/
#include "ifxos_common.h"
#include "ifxos_print_io.h"
#include "ifxos_memory_alloc.h"
#include "ifxos_device_access.h"
#include "ifxos_file_access.h"
#include "ifxos_time.h"
#include "ifxos_lock.h"
#include "ifxos_thread.h"
#include "ifxos_termios.h"
#include "ifxos_pipe.h"
#include "ifxos_misc.h"
#include "ifxos_socket.h"
#include "dsl_cpe_safec_wrapper.h"
#endif /* INCLUDE_DSL_CPE_IFXOS_SUPPORT*/
#if defined(INCLUDE_DSL_CPE_IFXOS_SUPPORT)
/* support other OS only through lib_ifxos */
#ifndef USE_LIB_IFXOS
#define USE_LIB_IFXOS 1
#endif
#endif /** INCLUDE_DSL_CPE_IFXOS_SUPPORT*/
#ifndef __BIG_ENDIAN
#error please define the __BIG_ENDIAN macro
#endif
#ifndef __BYTE_ORDER
#error please specify the endianess of your target system
#endif
/**
Carriage Return + Line Feed, maybe overwritten by compile switches
or OS-specific adaptation */
#ifndef DSL_PIPE_CRLF
#define DSL_PIPE_CRLF "\n\r"
#endif
#if defined(USE_LIB_IFXOS) && (USE_LIB_IFXOS == 1)
/*
common defines - ifxos_common.h"
*/
#define DSL_BYTE_ORDER IFXOS_BYTE_ORDER
#define DSL_LITTLE_ENDIAN IFXOS_LITTLE_ENDIAN
#define DSL_BIG_ENDIAN IFXOS_BIG_ENDIAN
#ifndef __BIG_ENDIAN
#define __BIG_ENDIAN IFXOS_BIG_ENDIAN
#define __LITTLE_ENDIAN IFXOS_LITTLE_ENDIAN
#define __BYTE_ORDER IFXOS_BYTE_ORDER
#endif
#ifndef __BYTE_ORDER
#define __BYTE_ORDER __LITTLE_ENDIAN
#endif
/*
Function map - stdio, string
*/
#define DSL_PIPE_FPrintf IFXOS_FPrintf
/*
Function map - Memory Functions.
*/
#define DSL_PIPE_Malloc IFXOS_MemAlloc
#define DSL_PIPE_Free IFXOS_MemFree
/*
Function map - Device handling (open, close ...).
*/
#define DSL_PIPE_FOpen IFXOS_FOpen
#define DSL_PIPE_FClose IFXOS_FClose
#define DSL_PIPE_FRead IFXOS_FRead
#else /* (USE_LIB_IFXOS == 1) */
#ifndef __BIG_ENDIAN
#define __BIG_ENDIAN 1
#define __LITTLE_ENDIAN 2
#endif
#ifndef __BYTE_ORDER
#define __BYTE_ORDER __BIG_ENDIAN
#endif
/**
Allocates a memory block
\param size Bytes to allocate
\return
returns a DSL_void_t pointer to the allocated space, NULL if there's not
sufficient memory space available.
*/
DSL_void_t *DSL_PIPE_Malloc(DSL_uint32_t size);
/**
Deallocates a memory block
\param memblock Previously allocated memory block that should be freed
*/
void DSL_PIPE_Free(DSL_void_t *memblock);
/**
Open a file.
*/
FILE *DSL_PIPE_FOpen(const DSL_char_t *name, const DSL_char_t *mode);
/**
Close the file or memory file.
*/
DSL_int_t DSL_PIPE_FClose(FILE *fd);
/**
Read from file, stdin .
*/
DSL_int_t DSL_PIPE_FRead(DSL_void_t *buf, DSL_uint32_t size, DSL_uint32_t count, FILE *stream);
/**
Print out .
*/
DSL_int_t DSL_PIPE_FPrintf(FILE *stream, const DSL_char_t *format, ...);
#endif /* (USE_LIB_IFXOS == 1) */
#endif /* DSL_PIPE_CLIENT_H */

88
tools/pipe/dsl_pipe_lib.c Normal file
View file

@ -0,0 +1,88 @@
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifdef LINUX
#include "dsl_pipe_client.h"
#ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT
/**
For a detailed description of the function, its arguments and return value
please refer to the description in the header file 'dsl_cpe_os.h'
*/
DSL_void_t *DSL_PIPE_Malloc(DSL_uint32_t size)
{
DSL_void_t *memblock;
memblock = (DSL_void_t*) malloc((size_t)size);
return (memblock);
}
/**
For a detailed description of the function, its arguments and return value
please refer to the description in the header file 'dsl_cpe_os.h'
*/
void DSL_PIPE_Free(DSL_void_t *memblock)
{
free(memblock);
}
/**
Open a file.
*/
FILE *DSL_PIPE_FOpen(const DSL_char_t *name, const DSL_char_t *mode)
{
return fopen(name, mode);
}
/**
For a detailed description of the function, its arguments and return value
please refer to the description in the header file 'dsl_cpe_os.h'
*/
DSL_int_t DSL_PIPE_FClose(FILE *fd)
{
if(fd != 0)
return fclose(fd);
return -1;
}
/**
For a detailed description of the function, its arguments and return value
please refer to the description in the header file 'dsl_cpe_os.h'
*/
DSL_int_t DSL_PIPE_FRead(DSL_void_t *buf, DSL_uint32_t size, DSL_uint32_t count, FILE *stream)
{
return fread(buf, size, count, stream);
}
/**
For a detailed description of the function, its arguments and return value
please refer to the description in the header file 'dsl_cpe_os.h'
*/
DSL_int_t DSL_PIPE_FPrintf(FILE *stream, const DSL_char_t *format, ...)
{
va_list ap; /* points to each unnamed arg in turn */
DSL_int_t nRet = 0;
va_start(ap, format); /* set ap pointer to 1st unnamed arg */
nRet = vfprintf(stream, format, ap);
fflush(stream);
va_end(ap);
return nRet;
}
#endif /* #ifndef INCLUDE_DSL_CPE_IFXOS_SUPPORT*/
#endif /* LINUX */