OpenSS7
SS7 for the
Common Man

© Copyright 1997-2004,OpenSS7 Corporation, All Rights Reserved.
Last modified:

Home Overview Status News Documentation Resources About
   
 Overview
 Status
 News
 Documentation
 Resources
 About

   
Home Index Prev Next More Download Info FAQ Mail   Home -> Resources -> Browse Source -> ss7codec/test2.cpp


File /code/ss7codec/test2.cpp



#include "L3codec.h"
#include <iostream.h>

int len0 = 3; unsigned char fme0[] = { 0x01, 0xfe, 0x00 };
int len1 = 4; unsigned char fme1[] = { 0x01, 0xfe, 0x01, 0x02 };
int len2 = 5; unsigned char fme2[] = { 0x01, 0xfe, 0x02, 0x05, 0x00 };
int len3 = 6; unsigned char fme3[] = { 0x01, 0xfe, 0x03, 0x01, 0x02, 0x03 };

int len4 = 100; unsigned char fme4[100];
int len5 = 6; unsigned char fme5[] = { 1, 2, 3, 4, 5, 6 };

main() {
    Codec_L3 anMSU;
    Codec_L3* MSU = &anMSU;

    int i;

    len4 = 100;

    Codec::rebuild();
    MSU->MP->set(1);
    MSU->NI->set("NAT");
    MSU->RL->OPC->NET->set(4);
    MSU->RL->OPC->CLS->set(6);
    MSU->RL->OPC->MEM->set(4);
    MSU->RL->DPC->NET->set(8);
    MSU->RL->DPC->CLS->set(12);
    MSU->RL->DPC->MEM->set(8);
    MSU->RL->SLS->set(5);
    MSU->SNMM->build();
    MSU->SNMM->CHM->build();
    MSU->SNMM->CHM->COO->build();
    MSU->SNMM->CHM->COO->FSNL->set(57);
    //if (Codec::encode(MSU,fme4,len4)) cout.form("Encoded %d bytes: ",len4);
    //for (i=0;i<len4;i++) cout.form("%x ",fme4[i]); cout << "\n";
    //Codec::report(MSU); cout << '\n';
    //if (Codec::decode(MSU,fme4,len4)) cout.form("Decoded %d bytes.\n",len4);
    Codec::encode(MSU,fme4,len4);
    Codec::decode(MSU,fme4,len4);
    Codec::report(MSU); cout << '\n';

    len4 = 100;

    Codec::rebuild();
    MSU->MP->set(1);
    MSU->NI->set("NAT");
    MSU->RL->OPC->NET->set(4);
    MSU->RL->OPC->CLS->set(6);
    MSU->RL->OPC->MEM->set(4);
    MSU->RL->DPC->NET->set(8);
    MSU->RL->DPC->CLS->set(12);
    MSU->RL->DPC->MEM->set(8);
    MSU->RL->SLS->set(5);
    MSU->SCCP->build();
    MSU->SCCP->PDU->set(fme5,len5);
    Codec::encode(MSU,fme4,len4);
    Codec::decode(MSU,fme4,len4);
    //if (Codec::encode(MSU,fme4,len4)) cout.form("Encoded %d bytes: ",len4);
    //for (i=0;i<len4;i++) cout.form("%x ",fme4[i]); cout << "\n";
    //Codec::report(MSU); cout << '\n';
    //if (Codec::decode(MSU,fme4,len4)) cout.form("Decoded %d bytes.\n",len4);
    Codec::report(MSU); cout << '\n';

    cout << "...Done.\n";
    cout.flush();
    exit(0);
};



Home Index Prev Next More Download Info FAQ Mail   Home -> Resources -> Browse Source -> ss7codec/test2.cpp

OpenSS7
SS7 for the
Common Man
Home Overview Status News Documentation Resources About

© Copyright 1997-2004,OpenSS7 Corporation, All Rights Reserved.
Last modified: