Loading ccsrc/Asn1c/Asn1cEncDec.cc +61 −61 Original line number Diff line number Diff line Loading @@ -176,65 +176,65 @@ int asn1c_ber2per(asn_TYPE_descriptor_t &td, const TTCN_Buffer & ber, TTCN_Buffe } // OER Encoding #include <xer_decoder.h> #include <xer_encoder.h> #include <oer_decoder.h> #include <oer_encoder.h> int asn1c_oer2xer(asn_TYPE_descriptor_t &td, const TTCN_Buffer & oer, TTCN_Buffer & xer, void** ctx ) { //void** obj = ctx; int rc = -1; asn_dec_rval_t rc_d; rc_d = oer_decode(NULL, &td, ctx, oer.get_read_data(), oer.get_read_len()); if(rc_d.code == RC_OK){ asn_enc_rval_t rc_e; xer.clear(); rc_e = xer_encode(&td, (const asn_oer_constraints_t*)ctx, XER_F_BASIC, asn1c_collect_encoded_data, &xer); rc = rc_e.encoded; } /*if(obj) { ASN_STRUCT_FREE(td, obj); }*/ return rc; } int asn1c_xer2oer(asn_TYPE_descriptor_t &td, const TTCN_Buffer & xer, TTCN_Buffer & oer, void** ctx ) { //void** obj = ctx; int rc = -1; asn_dec_rval_t rc_d; rc_d = xer_decode( NULL, &td, ctx, xer.get_data(), xer.get_len()); if(rc_d.code == RC_OK){ loggers::get_instance().log("asn1c_ber2per: XER decoding succeed"); asn_enc_rval_t rc_e; //per.clear(); rc_e = oer_encode(&td, ctx, asn1c_collect_encoded_data, &oer); rc = rc_e.encoded; if(rc < 0) { loggers::get_instance().warning("asn1c_ber2per: OER encoding failed"); } } else { loggers::get_instance().warning("asn1c_ber2per: XER decoding failed"); // td.free_struct(&td, *ctx, 0); } /*if(obj) { ASN_STRUCT_FREE(td, obj); }*/ return rc; } //#include <xer_decoder.h> //#include <xer_encoder.h> //#include <oer_decoder.h> //#include <oer_encoder.h> // //int asn1c_oer2xer(asn_TYPE_descriptor_t &td, const TTCN_Buffer & oer, TTCN_Buffer & xer, void** ctx ) //{ // //void** obj = ctx; // int rc = -1; // asn_dec_rval_t rc_d; // // rc_d = oer_decode(NULL, // &td, ctx, // oer.get_read_data(), oer.get_read_len()); // // if(rc_d.code == RC_OK){ // asn_enc_rval_t rc_e; // xer.clear(); // rc_e = xer_encode(&td, // (const asn_oer_constraints_t*)ctx, // XER_F_BASIC, // asn1c_collect_encoded_data, // &xer); // rc = rc_e.encoded; // } // /*if(obj) { // ASN_STRUCT_FREE(td, obj); // }*/ // return rc; //} // // //int asn1c_xer2oer(asn_TYPE_descriptor_t &td, const TTCN_Buffer & xer, TTCN_Buffer & oer, void** ctx ) //{ // //void** obj = ctx; // int rc = -1; // asn_dec_rval_t rc_d; // rc_d = xer_decode( NULL, &td, // ctx, // xer.get_data(), xer.get_len()); // if(rc_d.code == RC_OK){ // loggers::get_instance().log("asn1c_ber2per: XER decoding succeed"); // asn_enc_rval_t rc_e; // //per.clear(); // rc_e = oer_encode(&td, // ctx, // asn1c_collect_encoded_data, // &oer); // rc = rc_e.encoded; // if(rc < 0) { // loggers::get_instance().warning("asn1c_ber2per: OER encoding failed"); // } // } else { // loggers::get_instance().warning("asn1c_ber2per: XER decoding failed"); // // td.free_struct(&td, *ctx, 0); // } // /*if(obj) { // ASN_STRUCT_FREE(td, obj); // }*/ // return rc; //} ccsrc/Protocols/RawSocket/RawSocketLayer.hh +6 −7 Original line number Diff line number Diff line Loading @@ -2,19 +2,18 @@ #include <sys/types.h> #include <sys/socket.h> #if (OSTYPE == linux) #include <netinet/ether.h> // Used for raw sockets #if (OSTYPE == cygwin) #include <netdb.h> #include <w32api/winsock2.h> #else #include <netinet/ether.h> // Used for raw sockets #include <net/ethernet.h> // Used for raw sockets #include <linux/if_packet.h> // Used for raw sockets #endif #include <netinet/in.h> #include <netinet/tcp.h> #include <arpa/inet.h> #include <net/if.h> // Used for raw sockets #if (OSTYPE == linux) #include <net/ethernet.h> // Used for raw sockets #include <linux/if_packet.h> // Used for raw sockets #else #endif #include "TLayer.hh" #include "Params.hh" Loading ccsrc/Protocols/UDP/UdpLayer.hh +26 −0 Original line number Diff line number Diff line Loading @@ -2,8 +2,34 @@ #define UDP_LAYER_H #include <arpa/inet.h> #if (OSTYPE == cygwin) #include <netdb.h> #include <w32api/winsock2.h> /*struct iphdr { #if defined(__LITTLE_ENDIAN_BITFIELD) u_char ihl:4, version:4; #elif defined (__BIG_ENDIAN_BITFIELD) u_char version:4, ihl:4; #else #error "Please fix <asm/byteorder.h>" #endif u_char tos; u_short tot_len; u_short id; u_short frag_off; u_char ttl; u_char protocol; u_short check; u_int saddr; u_int daddr; /*The options start here. */ };*/ #else #include <linux/ip.h> #include <linux/udp.h> #endif #include "TLayer.hh" #include "Params.hh" Loading Loading
ccsrc/Asn1c/Asn1cEncDec.cc +61 −61 Original line number Diff line number Diff line Loading @@ -176,65 +176,65 @@ int asn1c_ber2per(asn_TYPE_descriptor_t &td, const TTCN_Buffer & ber, TTCN_Buffe } // OER Encoding #include <xer_decoder.h> #include <xer_encoder.h> #include <oer_decoder.h> #include <oer_encoder.h> int asn1c_oer2xer(asn_TYPE_descriptor_t &td, const TTCN_Buffer & oer, TTCN_Buffer & xer, void** ctx ) { //void** obj = ctx; int rc = -1; asn_dec_rval_t rc_d; rc_d = oer_decode(NULL, &td, ctx, oer.get_read_data(), oer.get_read_len()); if(rc_d.code == RC_OK){ asn_enc_rval_t rc_e; xer.clear(); rc_e = xer_encode(&td, (const asn_oer_constraints_t*)ctx, XER_F_BASIC, asn1c_collect_encoded_data, &xer); rc = rc_e.encoded; } /*if(obj) { ASN_STRUCT_FREE(td, obj); }*/ return rc; } int asn1c_xer2oer(asn_TYPE_descriptor_t &td, const TTCN_Buffer & xer, TTCN_Buffer & oer, void** ctx ) { //void** obj = ctx; int rc = -1; asn_dec_rval_t rc_d; rc_d = xer_decode( NULL, &td, ctx, xer.get_data(), xer.get_len()); if(rc_d.code == RC_OK){ loggers::get_instance().log("asn1c_ber2per: XER decoding succeed"); asn_enc_rval_t rc_e; //per.clear(); rc_e = oer_encode(&td, ctx, asn1c_collect_encoded_data, &oer); rc = rc_e.encoded; if(rc < 0) { loggers::get_instance().warning("asn1c_ber2per: OER encoding failed"); } } else { loggers::get_instance().warning("asn1c_ber2per: XER decoding failed"); // td.free_struct(&td, *ctx, 0); } /*if(obj) { ASN_STRUCT_FREE(td, obj); }*/ return rc; } //#include <xer_decoder.h> //#include <xer_encoder.h> //#include <oer_decoder.h> //#include <oer_encoder.h> // //int asn1c_oer2xer(asn_TYPE_descriptor_t &td, const TTCN_Buffer & oer, TTCN_Buffer & xer, void** ctx ) //{ // //void** obj = ctx; // int rc = -1; // asn_dec_rval_t rc_d; // // rc_d = oer_decode(NULL, // &td, ctx, // oer.get_read_data(), oer.get_read_len()); // // if(rc_d.code == RC_OK){ // asn_enc_rval_t rc_e; // xer.clear(); // rc_e = xer_encode(&td, // (const asn_oer_constraints_t*)ctx, // XER_F_BASIC, // asn1c_collect_encoded_data, // &xer); // rc = rc_e.encoded; // } // /*if(obj) { // ASN_STRUCT_FREE(td, obj); // }*/ // return rc; //} // // //int asn1c_xer2oer(asn_TYPE_descriptor_t &td, const TTCN_Buffer & xer, TTCN_Buffer & oer, void** ctx ) //{ // //void** obj = ctx; // int rc = -1; // asn_dec_rval_t rc_d; // rc_d = xer_decode( NULL, &td, // ctx, // xer.get_data(), xer.get_len()); // if(rc_d.code == RC_OK){ // loggers::get_instance().log("asn1c_ber2per: XER decoding succeed"); // asn_enc_rval_t rc_e; // //per.clear(); // rc_e = oer_encode(&td, // ctx, // asn1c_collect_encoded_data, // &oer); // rc = rc_e.encoded; // if(rc < 0) { // loggers::get_instance().warning("asn1c_ber2per: OER encoding failed"); // } // } else { // loggers::get_instance().warning("asn1c_ber2per: XER decoding failed"); // // td.free_struct(&td, *ctx, 0); // } // /*if(obj) { // ASN_STRUCT_FREE(td, obj); // }*/ // return rc; //}
ccsrc/Protocols/RawSocket/RawSocketLayer.hh +6 −7 Original line number Diff line number Diff line Loading @@ -2,19 +2,18 @@ #include <sys/types.h> #include <sys/socket.h> #if (OSTYPE == linux) #include <netinet/ether.h> // Used for raw sockets #if (OSTYPE == cygwin) #include <netdb.h> #include <w32api/winsock2.h> #else #include <netinet/ether.h> // Used for raw sockets #include <net/ethernet.h> // Used for raw sockets #include <linux/if_packet.h> // Used for raw sockets #endif #include <netinet/in.h> #include <netinet/tcp.h> #include <arpa/inet.h> #include <net/if.h> // Used for raw sockets #if (OSTYPE == linux) #include <net/ethernet.h> // Used for raw sockets #include <linux/if_packet.h> // Used for raw sockets #else #endif #include "TLayer.hh" #include "Params.hh" Loading
ccsrc/Protocols/UDP/UdpLayer.hh +26 −0 Original line number Diff line number Diff line Loading @@ -2,8 +2,34 @@ #define UDP_LAYER_H #include <arpa/inet.h> #if (OSTYPE == cygwin) #include <netdb.h> #include <w32api/winsock2.h> /*struct iphdr { #if defined(__LITTLE_ENDIAN_BITFIELD) u_char ihl:4, version:4; #elif defined (__BIG_ENDIAN_BITFIELD) u_char version:4, ihl:4; #else #error "Please fix <asm/byteorder.h>" #endif u_char tos; u_short tot_len; u_short id; u_short frag_off; u_char ttl; u_char protocol; u_short check; u_int saddr; u_int daddr; /*The options start here. */ };*/ #else #include <linux/ip.h> #include <linux/udp.h> #endif #include "TLayer.hh" #include "Params.hh" Loading