ISO 8583 C Library (v0.0.3) – Benchmarks
The latest version includes a pack/unpack benchmarking module, along with sample MSVC 6.0 project files. The benchmark test is the same as the one published by jPOS.
The benchmarks were run on a Dell Inspiron 6000 laptop (Intel Pentium M – 2.00GHz).
In ‘Static Memory’ mode it is possible to perform in excess of 130,000 pack/unpack operations per second, as shown by the following screenshot:Â
 The throughput in ‘Dynamic Memory’ mode is lower but still manages just under 100,000 pack/unpack operations per second, as shown by the following screenshot:
See the ISO 8583 page for more details…
Thanks for this nice software.
One of the best, if not the only one, out there.
Really helps understand ISO8583.
it’s very good
I can’t believe it, we are not alone and there are people who do care about ISO 8583!
great work man, hope you don’t mind adding some changes (for EMV, security and dynamic simulation) on your program and re-posting it on your site.
I hope you could consider NDC as well as part of your projects
This s/w is really gud.
But there is one problem I am not getting thru..
I tried ur demo.c with following ISO message, I am able to see the dump befor packing … but unpacking gives no output dump..
Was checking the code with the values, that Jpos gives in it website for lightweight C library..
URL :- http://www.jpos.org/products/iso_c_lib
(void)DL_ISO8583_MSG_SetField_Str(0,”0800″,&isoMsg);
(void)DL_ISO8583_MSG_SetField_Str(2,”454000000000003″,&isoMsg);
(void)DL_ISO8583_MSG_SetField_Str(3,”000000″,&isoMsg);
(void)DL_ISO8583_MSG_SetField_Str(11,”000001″,&isoMsg);
(void)DL_ISO8583_MSG_SetField_Str(28,”C1200″,&isoMsg);
(void)DL_ISO8583_MSG_SetField_Str(34,”12345″,&isoMsg);
(void)DL_ISO8583_MSG_SetField_Str(41,”12345678″,&isoMsg);
(void)DL_ISO8583_MSG_SetField_Str(70,”BLAH BLAH”,&isoMsg);
There is another doubt regarding primary bitmap… when we call the function :
(void)DL_ISO8583_MSG_SetField_Str(0,”0800″,&isoMsg); /* from demo.c */
Then what is it exactly doing … fillling up the MTI or Bitmap…
i I understand that other calls are filling up the individual fields… but how is MTI and bitmap handled is pretty much unclear to me..
I will really appreciate if u clear my doubts…
Kas,
The issue is caused by the following line of code from your example:
(void)DL_ISO8583_MSG_SetField_Str(70,â€BLAH BLAHâ€,&isoMsg);
This is because Field #70 is defined as N(3) in both the 1987 and 1993 versions, so the Pack fails with an error.
The basic example in demo.c is not checking for any errors, so the cause of the error isn’t obvious.
The MTI is set by setting a value for Field 0, so the following code is setting the MTI to ‘0800’:
(void)DL_ISO8583_MSG_SetField_Str(0,â€0800″,&isoMsg);
As for the Bitmap, this is done automatically when you Pack the ISO message. If you look in the ‘DL_ISO8583_MSG_Pack’ function, you’ll see that a field is packed if it is set or if the field type corresponds to a Bitmap.
Hi Oscar,
thx for the explaination… I am now able to figure out how the bitmap field is handled in your code. But now few more ?s arises before me and I strongly believe there is no better person than u to answer my queries ..
I am new to ISO 8583 standard and therefore have own array of ?s:
1. MTI size is 4 bytes fixed but Hexdump is simply printing ‘0800’ shouldn’t it be smthing like ‘00000808’
2. I am seeing that bitmap is correctly encoded to my knowledge, but filed #2 is again not visible in proper hexdum format.
It is simply printed as “15 04 54 00 00 00 00 00 03 ” … is here 15 is the length and 0 and 4 in ’04’ are representing 1 byte.
If that is so, why is Bitmap printed differently.
3. In some places u have left a comment for print, if required.
What to do if I want to see the bitmap field output at the time it is being packed.
4. In Unpack function, code is written to unpack bitmap, but what I could grasp is that other fields are being unpacked by checking the “len” value… or is it that unpacking is done based on the bitmap field … may b I m not getting the correct place to look into code..
5. Can I use this library to pack/unpack the ISO 8583 message with Amex platform?
I am really hoping to get my queries answered … and thx once again for clearing my doubts.. ur code rocks !!
If I use the lib in multithreaded environment – e.g. using it in multiple threads simultanuasly with multiple handles will be ok? Great lib, thanks Oscar!
Hello, I was looking around for a while searching for iso and I happened upon this site and your post regarding ISO 8583 C Library (v0.0.3) – Benchmarks, I will definitely this to my iso bookmarks!
Dragomir,
The library works fine in a multi-threaded environment, just make sure that your project is configured to compile with the relevant thread-safe libraries (for ‘memcpy’ and others).
You can share the ISO-8583 Handler structure (DL_ISO8583_HANDLER) between the threads if you want, so long as all threads use the same handler and you initialise it before the threads, as the handler is read-only following initialisation.
All you have to do is ensure that each of the threads have their own ISO-8583 Message structures (DL_ISO8583_MSG).
For optimal performance use Static memory mode, to minimise memory management / fragmentation. Just ensure that the static buffer is private to each thread.
Hello Oscar,
I just want to say that you did excellent work..
But I have one question..
when I want to set field number 12 (Time local transaction hhmmss,
(void)DL_ISO8583_MSG_SetField_Str(12,”174852″,&isoMsg); which have 6 character representation, why I see 6 nulls in hex output before right value ? And after when i output the result i have
[012] 000000174852 instead [012] 174852 ?
I hope you understand my question, if not I will post every changes I made..
Thx a lot.
Leon,
Field 12 is defined differently in the 1987 and 1993 versions, in the later it’s defined as Date / Time (i.e. 12 characters).
Maybe you’re using the 1993 handler (DL_ISO8583_DEFS_1993_GetHandler) instead of the 1987 one (DL_ISO8583_DEFS_1987_GetHandler).
If you think there is an issue then please email me further details…
Hi friends (specially to Oscar),
i am newbie in iso8583, i am writhing a program to send and give a ISO8583 pack with a channel manager, now my question is this ,
could this c program connect to a server for sending and getting packages?
or it just is for translation and i must add code for connecting to the server!
if it could connect how should i change the code?
thanks in advance for you help 😉
ANd another thing is that…. how van i compile it on the linux ?!
when i run gcc -c dll_iso8583.c or another i get eroor with compiling,
it gets some error in code !
please help me…
thanks again
Haamed,
The library is just for encoding/decoding ISO8583 messages, it doesn’t provide support for any communication channels.
What type of communication channel do you need to support?
Haamed,
Regarding the linux compilation… have you setup the environment variables correctly (i.e. PATH)?
It’s generally easier to place all the source files in the same directory when compiling, otherwise you need to ensure that the compiler is aware of all of the different directories…
How do i send ASCII messages using the library without packing?
Eg : 0200…… message hexdump should be
30 32 30 30
Rajesh,
The current version only supports Binary encoding (ie packed). The next version will support both Display (ASCII/EBCDIC) and Binary encodings.
Thank you for you software! It is valuable for me!
I have some comments. Here are the first one. (Maybe I give more comments later.)
You have in the function DL_ISO8583_MSG_Dump fully unnecessary line
DL_ISO8583_FIELD_DEF *fieldDef = DL_ISO8583_GetFieldDef(i,iHandler);
It can be erased because the fieldDef is not used anywhere.
(File dl_iso8583.c)
==============
You have also in the loops complicated expressions which are repeated for every loop if your compiler in not capable to optimize it. Here is one example (file dl_iso8583.c):
—– original —–
DL_UINT16 fieldIdx;
for ( fieldIdx=0 ; (fieldIdx<MIN(iHandler->fieldItems,kDL_ISO8583_MAX_FIELD_IDX+1)) && !err ; fieldIdx++ ) …
— This is more efficient and clear ——
DL_UINT16 fieldIdx, maxFieldIdx = MIN(iHandler->fieldItems,kDL_ISO8583_MAX_FIELD_IDX+1);
for ( fieldIdx=0 ; (fieldIdx<maxFiledIdx) && !err ; fieldIdx++ ) …
You also force the loop counter to have 16 bits. If you use plain “int” instead, you get more efficient code if your computer is not 16 bit computer.
Kribe,
Thanks for the comments.
I’ve updated the source code, the changes will be available in the next version.
Not nice to get so much warnings:
dl_iso8583.c: In function ‘DL_ISO8583_MSG_Dump’:
dl_iso8583.c:278: warning: initialization discards qualifiers from pointer target type
dl_iso8583_common.c: In function ‘_DL_ISO8583_MSG_AllocField’:
dl_iso8583_common.c:64: warning: passing argument 2 of ‘DL_MEM_malloc’ from incompatible pointer type
dl_iso8583_fields.c: In function ‘_unpack_iso_ASCHEX’:
dl_iso8583_fields.c:247: warning: passing argument 1 of ‘VarLen_Get’ from incompatible pointer type
dl_iso8583_fields.c: In function ‘_unpack_iso_ASCII’:
dl_iso8583_fields.c:342: warning: passing argument 1 of ‘VarLen_Get’ from incompatible pointer type
dl_iso8583_fields.c: In function ‘_unpack_iso_BINARY’:
dl_iso8583_fields.c:420: warning: passing argument 1 of ‘VarLen_Get’ from incompatible pointer type
dl_output.c: In function ‘DL_OUTPUT_Hex’:
dl_output.c:46: warning: initialization discards qualifiers from pointer target type
dl_str.c: In function ‘DL_STR_GetEnv’:
dl_str.c:48: warning: pointer type mismatch in conditional expression
dl_str.c: In function ‘DL_STR_StrNDup’:
dl_str.c:209: warning: passing argument 2 of ‘DL_MEM_malloc’ from incompatible pointer type
dl_str.c: In function ‘DL_STR_StrCat’:
dl_str.c:243: warning: passing argument 2 of ‘DL_MEM_malloc’ from incompatible pointer type
dl_str.c: In function ‘DL_STR_EncapsulateStr’:
dl_str.c:433: warning: passing argument 2 of ‘DL_MEM_malloc’ from incompatible pointer type
I am having all these warning…. did you find any solution???
I have built your library with our point of sales source code, its working pretty fine. You save me a lot of work, more grease to your elbow. Keep it up.
Can you ISO 8583 C Library be use in Objective-c language. I would like to use on a iphone application i am developing.
Regards,
Angel Figueroa
Angel,
I’ve never used Objective-C myself, but according to the Objective-C writeup on wikipedia, it should be possible. It seems that at most you’ll just have to wrap the library with an Objective-C class.
Let me know how it goes, sounds interesting…
Thanks Oscar,
I will make the Objective-C Class that wrapper you ISO 8583 Class in order that i can use from my iphone application.
I will let you known my progress.
Regards,
Angel Figueroa
Hi Angel
I am developing an EMV application in nokia N900, how did you implement iso 8583 in your iphone? i want to do the same in nokia N900.Any help? Thnx
Regards
Kegan
Hi Kegan,
Read your posting on the EMV application for Nokia N900, can your email me back on ur progress.’
Thanks
Anbu
Hi Angel,
I saw ur 2009 posting in Oscar Sanderson Site, where u mentioned that u are developing a Objective-C wrapper for ISO8583…for the IPHONE. Can u let me know how sucessful you were in this.
Can u help us out, we can work out a partnership with you, as we plan to make it commercial.
Hi Angel,
I am also implementing this protocol in obj C for iphone application.
I want to know have u implemented this protocol in iphone??
What problems have u faced while implementing this library?
Why so many people make unnecessary variables and substitute a value to them and immediately overwrite it with another value like you do:
————————-
DL_ERR DL_ISO8583_MSG_SetField_Str ( DL_UINT16 iField,
const DL_UINT8 *iDataStr,
DL_ISO8583_MSG *ioMsg )
{
DL_ERR err = kDL_ERR_NONE;
err = DL_ISO8583_MSG_SetField_Bin(iField,
iDataStr,
(DL_UINT16)DL_STR_StrLen(iDataStr),
ioMsg);
return err;
}
———————-
This is exactly same as:
DL_ERR DL_ISO8583_MSG_SetField_Str ( DL_UINT16 iField,
const DL_UINT8 *iDataStr,
DL_ISO8583_MSG *ioMsg )
{
return DL_ISO8583_MSG_SetField_Bin(iField,
iDataStr,
(DL_UINT16)DL_STR_StrLen(iDataStr),
ioMsg);
}
——-
Anyway, thanks of your software. I use it in a real product.
—-
Thanks for this nice software. great work man,
can you , give us , more example (Demo) for using this nice library
Thanks Oscar
hello oscal and others;
im new to iso 8583 and i want to use it in my EMV simulator project.. can somebody help me how to use it?.
kegan
Hi Oscar,
Great work!
Any COM or wrapper for .NET? I’m eager to use this to my project.
Cheers!
tech guy
Hello,
as I could not find way to upload these Makefiles for your software i have packaged and uploaded them to
http://bojanka.net/DL_C_ISO8583_v0_0_4_160708_AllFiles.makefiles.tgz
For unix users so they don’t need to think how to create them 🙂
it by default compiles both demo and benchmark tools (all copyright is transfered to you by this message (and stated in readme file inside))
Hi Oscar,
This is an example ISO network management message.
0800823A0000000000000400000000000000042009061390000109061304200420001
Please please any body tell me how can i use this with this software.
Just a lighthearted “for-fun” comment: There is no ‘S’ in “The quick brown fox jumped over the lazy dog” (the sentence appears in field 62 in the screenshots at the top of the page).
Cheers!
That’s cause it should be JUMPS instead of JUMPED.
Amazing. Thanks a lot.
It just need a bit work to erase all the warnings under GCC.
Nice code, I am now using it on a VeriFone Vx570. I like it better than VeriFone’s own ACT ISO8583 library. Congrats
Hi Axel,
Can you guide us on how u embedd this into the VX570.
Thanks
Anbu