This is my first question so please bear with me, I'm trying to find a good compiler to parse the following standard, I've tried asn1c and I wasn't able compile it successfully, the problem is that I didn't get any error, I tried with "-P" and there was no output, this is what I did
sn1c MAP-ShortMessageServiceOperations.EXP -P
The files in the link have been generated by SIEMENS and for some reason they are not the standard ASN.1
The question is how can I compile all these ASN files with asn1c or any other asn compiler?
and also I've tried snacc and didn't get anything useful from it either.
I'm trying to write a C application that will be running on Red-hat Linux
A great place to start is http://www.itu.int/ITU-T/asn1/links/index.htm which list several ASN.1 compilers (both free and commercial).
You can also try your specification in the free online compiler and encoder/decoder at http://asn1-playground.oss.com.
For 3gpp specifications, you are likely to be better off using a commercial tool rather than one of the free tools. OSS Nokalva offers free trials of its ASN.1 Tools at http://www.oss.com/asn1/products/asn1-download.html.
http://www.itu.int/en/ITU-T/asn1/Pages/Tools.aspx mentions two free ASN.1 compilers, one of which is
http://lionet.info/asn1c/compiler.html which is FOSS and seems to be well received (http://lionet.info/asn1c/quotes.html)
The second “free” compiler listed seems to have gone commercial (http://www.oss.com/asn1/products/asn1-c/asn1-c.html), BUT the same company offer a free online encode/decode service at http://asn1-playground.oss.com/
I can’t figure out if this one is free or requires purchase - http://www.obj-sys.com/products/asn1c/index.php
This one is FOSS and might be worth examining - https://github.com/ttsiodras/asn1scc
Another tool for 3GPP specifications is online encoder/decoder http://3gpp-message-analyser.com It supports UTRAN RANAP SABP RNSAP NBAP PCAP RUA HNBAP, E-UTRAN S1AP X2AP M2AP M3AP
You can also find various free online ASN.1 decoder here:
https://www.marben-products.com/decoder-asn1/
I hope it helps.
Anto
I came across this compiler that works well for generating C code from ASN.1
https://github.com/ttsiodras/asn1scc
There is also a nice introduction that will get you started, here:
https://www.thanassis.space/asn1.html
This is the only compiler that worked for me so far.
Related
I'm using IAR Embedded Workbench for ARM Cortex-M3 programming. The library I have to use is huge and I need a dependency graph to understand some parts. Can IAR create it or give me a useful report from a compiled code?
Thanks
Behnam
Have you tried giving the --dependencies option directly to the IAR compiler?
You should be able to take that output and use it to generate a dependency graph with, say, graphviz. If you use the --dependencies=m variant, then you will get a makefile-like output which will give you each header file required by each object file.
The IAR compiler manual is here; --dependencies is described on p 132
There's also makegrapher, which, if not exactly what you're after might be a good starting point :D
(Please excuse the delay in reply - I actually found your question while searching for answers to my own about using --dependencies!)
I learned to program with Pascal in high school, and more recently I decided to get out of the sandbox and try to figure out how my computer actually works. So I installed ubuntu on my iMac (i686) and started learning C, which seemed like a good way to get "under the hood."
One of the basic things I'm trying to figure out is where the kernel ends and the standard libraries begin. A book told me that the linux system calls (which I understand to be the interface between the kernel and the libraries) could be found in the header file unistd.h, so this seemed like a good place to start. But when I tried to find the header on my system (using locate unistd.h), I got this result:
/usr/include/unistd.h
/usr/include/asm-generic/unistd.h
/usr/include/i386-linux-gnu/asm/unistd.h
/usr/include/i386-linux-gnu/bits/unistd.h
/usr/include/i386-linux-gnu/sys/unistd.h
/usr/include/linux/unistd.h
/usr/lib/syslinux/com32/include/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/alpha/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/arm/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/avr32/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/blackfin/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/c6x/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/cris/include/arch-v10/arch/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/cris/include/arch-v32/arch/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/cris/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/frv/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/h8300/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/hexagon/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/ia64/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/m32r/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/m68k/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/microblaze/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/mips/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/mn10300/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/openrisc/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/parisc/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/powerpc/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/s390/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/score/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/sh/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/sparc/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/tile/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/unicore32/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/x86/include/asm/ia32_unistd.h
/usr/src/linux-headers-3.5.0-27/arch/x86/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/arch/xtensa/include/asm/unistd.h
/usr/src/linux-headers-3.5.0-27/include/asm-generic/unistd.h
/usr/src/linux-headers-3.5.0-27/include/linux/unistd.h
/usr/src/linux-headers-3.5.0-27-generic/include/linux/unistd.h
Why the heck are there so many versions of this file--and other header files--in my system? Some of them seem to be for other CPUs (like sparc), so why did ubuntu bother to install them on my computer? And how does the all of this fit with what Eric Raymond calls the SPOT rule: "every piece of knowledge must have a single, unambiguous, authoritative representation within a system." (The Art of Unix Programming, p. 91.)
Thanks in advance for any help. I'm happy to read big books if necessary.
I think these header files are directly from linux-3.5.0-27 source code. Ubuntu developers didn't know what kind of target they are dealing with. Maybe Intel x86/powerPC/ or even a mobile hand set(ARM), so they just copy all the head files and make a simple link.
I am learning c programming in Linux. There are a lot of linux functions I need to look at. Is there a website that gives me the details of the Linux functions?
Are you referring to system calls in Linux? There are lots of sources. The man pages are your good friends in this regard. Try also http://linux.die.net/man/2/syscalls. I am sure there are lots of others.
The standard reference by far is "Advanced programming in the UNIX environment" by Richard Stevens. Unfortunately this book is quite old, so there is a revised edition by Eric Raymond, which covers new stuff in Linux. This -- more than anything else -- is the de facto standard for learning "old world" systems programming in Linux. (And most other *ixes, there are of course differences, but you won't notice them until you're much more advanced, and by that point you'll be familiar with the man pages and know where to look.)
You can look at the LSB (Linux Standard Base) website:
http://www.linuxfoundation.org/collaborate/workgroups/lsb
Here are is the last Linux Standard Base Core Specification:
http://refspecs.linuxfoundation.org/lsb.shtml
IMHO http://linux.die.net/man/ is the easiest to get to start with.
It has useful sections introductions, so you can get your bearings
Most usefully are the one line synopsis pages, e.g. http://linux.die.net/man/3/
This shows the scale of what you are asking, and also lets you search for a key word describing each function within your browser, which can be very handy.
As has been pointed out, it is not the most up-to-date, but IMHO it is easier for a beginner to use than the alternative I've seen (not that there can't be something better, just google doesn't bother to show it).
Also worth trying apropos or man 3 -K or aman -k`
I find the glibc manual very good. It is organized by topic and contains concise background material and examples. It'll allow you to get the big picture and serves as a reference. Manpages are a quicker way to access function descriptions but there are only useful if you already know what you are looking for.
Coming from Java environment, I feel I got spoiled a lot when it comes to documentation. In C, using Eclipse, mouseover putchar() shows:
__CRT_INLINE int __cdecl __MINGW_NOTHROW putchar(int __c)
{
return (--stdout->_cnt >= 0)
? (int) (unsigned char) (*stdout->_ptr++ = (char)__c)
: _flsbuf (__c, stdout);}
While all this is terrific, I was wondering if any IDE includes more information about the specifics of what a given function does, ie, "prints a character to the output device"? Something similar to this as part of an IDE would be awesome.
Is there a way to get this level of detailed as part of Eclipse or any other IDE?
The question, obviously is not about putchar(), but rather is about a general approach to documentation using C programming language.
NetBeans will show you the man page inline: http://netbeans.org/kb/docs/cnd/navigating-editing.html
I don't have a solution for eclipse or an IDE, but my approach usually involves googling the function's manpage. eg, man putchar, which you've already found.
I'll also suggest this, at the risk of downvotes: The IBM C documentation is, in my experience, really good. Often it has real working understandable code examples and everything.
Now, IBM C is different from GNU C, so there are differences or features that do not apply to gcc. That said, Take a look at its page on the putchar() function.
There are plenty of things to complain about in C99, but it is still the authoritative reference and imo the best source for answers to the question, "what does it do?"
MS Visual Studio wraps a little skin around the C99 bones.
And MSDN goes further: docs on MSDN are beginning actually to resemble real papers by real writers that communicate useful info to a wide audience of neophytes and pros alike.
All credit goes to Let_Me_Be.
The following link provides a complete solution to what i was looking for
eclipse.org/linuxtools/projectPages/libhover
I am looking for ANSI C HAT-trie implementation released under some free license. I have not found one. Can you point me to some standalone implementation or a program that uses
HAT-tries to get at least slight idea how to implement it the roght way, please?
The original paper on HAT-trie can be found here:
http://crpit.com/confpapers/CRPITV62Askitis.pdf
PS: In case faster cache-conscious data structured well-suited for strings evolved since
the time the above paper was written, please point me to the papers or example source codes rather.
Someone is implementing it in C++ over on github
https://github.com/chris-vaszauskas/hat-trie
If you need a plain C implementation, this would be a good base to start from.
Java is also fairly readable for a C programmer
http://www.stochasticgeometry.ie/2008/05/06/implementing-hat-tries-in-java/
Please see the HAT-trie implementation site at code.google.com/p/hat-trie for implementation notes and source code.