{
# include SENF_FIXED_PARSER()
- SENF_PARSE_FIELD( destination, Parse_MAC );
- SENF_PARSE_FIELD( source, Parse_MAC );
- SENF_PARSE_FIELD( type, Parse_UInt16 );
+ SENF_PARSER_FIELD( destination, Parse_MAC );
+ SENF_PARSER_FIELD( source, Parse_MAC );
+ SENF_PARSER_FIELD( type, Parse_UInt16 );
SENF_PARSER_FINALIZE(Parse_Ethernet);
};
{
# include SENF_FIXED_PARSER()
- SENF_PARSE_BITFIELD( priority, 3, unsigned );
- SENF_PARSE_BITFIELD( cfi, 1, bool );
- SENF_PARSE_BITFIELD( vlanId, 12, unsigned );
+ SENF_PARSER_BITFIELD( priority, 3, unsigned );
+ SENF_PARSER_BITFIELD( cfi, 1, bool );
+ SENF_PARSER_BITFIELD( vlanId, 12, unsigned );
- SENF_PARSE_FIELD( type, Parse_UInt16 );
+ SENF_PARSER_FIELD( type, Parse_UInt16 );
SENF_PARSER_FINALIZE(Parse_EthVLan);
};
{
# include SENF_FIXED_PARSER()
- SENF_PARSE_BITFIELD( version, 4, unsigned );
- SENF_PARSE_BITFIELD( ihl, 4, unsigned );
-
- SENF_PARSE_FIELD( tos, Parse_UInt8 );
- SENF_PARSE_FIELD( length, Parse_UInt16 );
- SENF_PARSE_FIELD( identifier, Parse_UInt16 );
-
- SENF_PARSE_BITFIELD( reserved, 1, bool );
- SENF_PARSE_BITFIELD( df, 1, bool );
- SENF_PARSE_BITFIELD( mf, 1, bool );
- SENF_PARSE_BITFIELD( frag, 13, unsigned );
-
- SENF_PARSE_FIELD( ttl, Parse_UInt8 );
- SENF_PARSE_FIELD( protocol, Parse_UInt8 );
- SENF_PARSE_FIELD( checksum, Parse_UInt16 );
- SENF_PARSE_FIELD( source, Parse_INet4Address );
- SENF_PARSE_FIELD( destination, Parse_INet4Address );
+ SENF_PARSER_BITFIELD( version, 4, unsigned );
+ SENF_PARSER_BITFIELD( ihl, 4, unsigned );
+
+ SENF_PARSER_FIELD( tos, Parse_UInt8 );
+ SENF_PARSER_FIELD( length, Parse_UInt16 );
+ SENF_PARSER_FIELD( identifier, Parse_UInt16 );
+
+ SENF_PARSER_BITFIELD( reserved, 1, bool );
+ SENF_PARSER_BITFIELD( df, 1, bool );
+ SENF_PARSER_BITFIELD( mf, 1, bool );
+ SENF_PARSER_BITFIELD( frag, 13, unsigned );
+
+ SENF_PARSER_FIELD( ttl, Parse_UInt8 );
+ SENF_PARSER_FIELD( protocol, Parse_UInt8 );
+ SENF_PARSER_FIELD( checksum, Parse_UInt16 );
+ SENF_PARSER_FIELD( source, Parse_INet4Address );
+ SENF_PARSER_FIELD( destination, Parse_INet4Address );
SENF_PARSER_INIT() {
version() = 4;
{
# include SENF_FIXED_PARSER()
- SENF_PARSE_FIELD( nextHeader , Parse_UInt8 );
- SENF_PARSE_FIELD( reserved1 , Parse_UInt8 );
+ SENF_PARSER_FIELD( nextHeader , Parse_UInt8 );
+ SENF_PARSER_FIELD( reserved1 , Parse_UInt8 );
- SENF_PARSE_BITFIELD( fragmentOffset, 13, unsigned );
- SENF_PARSE_BITFIELD( reserved2, 2, unsigned );
- SENF_PARSE_BITFIELD( moreFragments, 1, bool );
+ SENF_PARSER_BITFIELD( fragmentOffset, 13, unsigned );
+ SENF_PARSER_BITFIELD( reserved2, 2, unsigned );
+ SENF_PARSER_BITFIELD( moreFragments, 1, bool );
- SENF_PARSE_FIELD( id , Parse_UInt32 );
+ SENF_PARSER_FIELD( id , Parse_UInt32 );
SENF_PARSER_FINALIZE(Parse_IpV6Extension_Fragment);
};
{
# include SENF_FIXED_PARSER()
- SENF_PARSE_BITFIELD( version, 4, unsigned );
- SENF_PARSE_BITFIELD( trafficClass, 8, unsigned );
- SENF_PARSE_BITFIELD( flowLabel, 20, unsigned );
-
- SENF_PARSE_FIELD( length, Parse_UInt16 );
- SENF_PARSE_FIELD( nextHeader, Parse_UInt8 );
- SENF_PARSE_FIELD( hopLimit, Parse_UInt8 );
- SENF_PARSE_FIELD( source, Parse_INet6Address );
- SENF_PARSE_FIELD( destination, Parse_INet6Address );
+ SENF_PARSER_BITFIELD( version, 4, unsigned );
+ SENF_PARSER_BITFIELD( trafficClass, 8, unsigned );
+ SENF_PARSER_BITFIELD( flowLabel, 20, unsigned );
+
+ SENF_PARSER_FIELD( length, Parse_UInt16 );
+ SENF_PARSER_FIELD( nextHeader, Parse_UInt8 );
+ SENF_PARSER_FIELD( hopLimit, Parse_UInt8 );
+ SENF_PARSER_FIELD( source, Parse_INet6Address );
+ SENF_PARSER_FIELD( destination, Parse_INet6Address );
SENF_PARSER_INIT() {
version() = 6;
{
# include SENF_FIXED_PARSER()
- SENF_PARSE_FIELD( source, senf::Parse_UInt16 );
- SENF_PARSE_FIELD( destination, senf::Parse_UInt16 );
- SENF_PARSE_FIELD( length, senf::Parse_UInt16 );
- SENF_PARSE_FIELD( checksum, senf::Parse_UInt16 );
+ SENF_PARSER_FIELD( source, senf::Parse_UInt16 );
+ SENF_PARSER_FIELD( destination, senf::Parse_UInt16 );
+ SENF_PARSER_FIELD( length, senf::Parse_UInt16 );
+ SENF_PARSER_FIELD( checksum, senf::Parse_UInt16 );
SENF_PARSER_FINALIZE(Parse_UDP);
<< " table_id: 0x" << unsigned(p->table_id()) << "\n"
<< " section_syntax_indicator: " << p->ssi() << "\n"
<< " private_indicator: " << p->private_indicator() << "\n"
- << " reserved_1: " << p->reserved_1() << "\n"
<< std::dec
<< " section_length: " << p->sec_length() << "\n"
<< std::hex
<< " table_id_extension: " << p->table_id_extension() << "\n"
- << " reserved_2: " << p->reserved_2() << "\n"
<< " version_number: " << p->version_num() << "\n"
<< " current_next_indicator: " << p->curr_next_indicator() << "\n"
<< " section_number: " << unsigned(p->sec_num()) << "\n"
{
# include SENF_FIXED_PARSER()
- SENF_PARSE_FIELD( table_id, Parse_UInt8 );
+ SENF_PARSER_FIELD ( table_id , Parse_UInt8 );
- SENF_PARSE_BITFIELD( ssi, 1, bool );
- SENF_PARSE_BITFIELD( private_indicator, 1, bool );
- SENF_PARSE_BITFIELD( reserved_1, 2, unsigned );
- SENF_PARSE_BITFIELD( sec_length, 12, unsigned );
-
- SENF_PARSE_FIELD( table_id_extension, Parse_UInt16 );
-
- SENF_PARSE_BITFIELD( reserved_2, 2, unsigned );
- SENF_PARSE_BITFIELD( version_num, 5, unsigned );
- SENF_PARSE_BITFIELD( curr_next_indicator, 1, bool );
+ SENF_PARSER_BITFIELD ( ssi , 1 , bool );
+ SENF_PARSER_BITFIELD ( private_indicator , 1 , bool );
+ SENF_PARSER_SKIP_BITS( 2 );
+ SENF_PARSER_BITFIELD ( sec_length , 12 , unsigned );
+
+ SENF_PARSER_FIELD ( table_id_extension , Parse_UInt16 );
+
+ SENF_PARSER_SKIP_BITS( 2 );
+ SENF_PARSER_BITFIELD ( version_num , 5 , unsigned );
+ SENF_PARSER_BITFIELD ( curr_next_indicator , 1 , bool );
- SENF_PARSE_FIELD( sec_num, Parse_UInt8 );
- SENF_PARSE_FIELD( last_sec_num, Parse_UInt8 );
+ SENF_PARSER_FIELD ( sec_num , Parse_UInt8 );
+ SENF_PARSER_FIELD ( last_sec_num , Parse_UInt8 );
- SENF_PARSER_FINALIZE(Parse_DSMCCSection);
+ SENF_PARSER_FINALIZE( Parse_DSMCCSection );
Parse_UInt32 crc() const { return parse<Parse_UInt32>( data().size()-4 ); }
};
<< " table_id: 0x" << unsigned(p->table_id()) << "\n"
<< " section_syntax_indicator: " << p->ssi() << "\n"
<< " private_indicator: " << p->private_indicator() << "\n"
- << " reserved_1: " << p->reserved_1() << "\n"
<< std::dec
<< " section_length: " << p->sec_length() << "\n"
<< std::hex
<< " MAC_address_6: " << unsigned(p->mac_addr_6()) << "\n"
<< " MAC_address_5: " << unsigned(p->mac_addr_5()) << "\n"
- << " reserved_2: " << p->reserved_2() << "\n"
<< " payload_scrambling_control: " << p->payload_scrmbl_ctrl() << "\n"
<< " address_scrambling_control: " << p-> addr_scrmbl_ctrl() << "\n"
<< " LLC_SNAP_flag: " << p->llc_snap_flag() << "\n"
{
# include SENF_FIXED_PARSER()
- SENF_PARSER_INHERIT(Parse_DSMCCSection);
+ SENF_PARSER_INHERIT( Parse_DSMCCSection );
- SENF_PARSE_FIELD( mac_addr_4, Parse_UInt8 );
- SENF_PARSE_FIELD( mac_addr_3, Parse_UInt8 );
- SENF_PARSE_FIELD( mac_addr_2, Parse_UInt8 );
- SENF_PARSE_FIELD( mac_addr_1, Parse_UInt8 );
+ SENF_PARSER_FIELD ( mac_addr_4 , Parse_UInt8 );
+ SENF_PARSER_FIELD ( mac_addr_3 , Parse_UInt8 );
+ SENF_PARSER_FIELD ( mac_addr_2 , Parse_UInt8 );
+ SENF_PARSER_FIELD ( mac_addr_1 , Parse_UInt8 );
- SENF_PARSER_FINALIZE(Parse_DatagramSection);
+ SENF_PARSER_FINALIZE( Parse_DatagramSection );
- typedef Parse_UIntField < 2, 4 > Parse_payload_scrmbl_ctrl;
- typedef Parse_UIntField < 4, 6 > Parse_addr_scrmbl_ctrl;
- typedef Parse_Flag < 6 > Parse_llc_snap_flag;
+ // Parse table_id_extension as two bytes
+ SENF_PARSER_GOTO( table_id_extension );
+ SENF_PARSER_FIELD ( mac_addr_6 , Parse_UInt8 );
+ SENF_PARSER_FIELD ( mac_addr_5 , Parse_UInt8 );
- Parse_UInt8 mac_addr_6() const { return parse<Parse_UInt8>( 3 ); }
- Parse_UInt8 mac_addr_5() const { return parse<Parse_UInt8>( 4 ); }
-
- Parse_payload_scrmbl_ctrl payload_scrmbl_ctrl() const {
- return parse<Parse_payload_scrmbl_ctrl>( 5 );
- }
-
- Parse_addr_scrmbl_ctrl addr_scrmbl_ctrl() const {
- return parse<Parse_addr_scrmbl_ctrl>( 5 );
- }
-
- Parse_llc_snap_flag llc_snap_flag() const {
- return parse<Parse_llc_snap_flag>( 5 );
- }
+ // Divide 5 bit version_num field into several subfields.
+ SENF_PARSER_SKIP_BITS( 2 );
+ SENF_PARSER_BITFIELD ( payload_scrmbl_ctrl , 2, unsigned );
+ SENF_PARSER_BITFIELD ( addr_scrmbl_ctrl , 2, unsigned );
+ SENF_PARSER_BITFIELD ( llc_snap_flag , 1, bool );
};
/** \brief Datagram Section
{
# include SENF_PARSER()
- SENF_PARSE_FIELD( type, Parse_UInt32 );
- SENF_PARSE_FIELD( length, Parse_TLVPacketLength );
+ SENF_PARSER_FIELD( type, Parse_UInt32 );
+ SENF_PARSER_FIELD( length, Parse_TLVPacketLength );
SENF_PARSER_FINALIZE(Parse_TLVPacket);
};
{
# include SENF_FIXED_PARSER()
- SENF_PARSE_FIELD( sync_byte, Parse_UInt8 );
+ SENF_PARSER_FIELD( sync_byte, Parse_UInt8 );
- SENF_PARSE_BITFIELD( transport_error_indicator, 1, bool );
- SENF_PARSE_BITFIELD( pusi, 1, bool );
- SENF_PARSE_BITFIELD( transport_priority, 1, bool );
- SENF_PARSE_BITFIELD( pid, 13, unsigned );
- SENF_PARSE_BITFIELD( transport_scrmbl_ctrl, 2, unsigned );
- SENF_PARSE_BITFIELD( adaptation_field_ctrl, 2, unsigned );
- SENF_PARSE_BITFIELD( continuity_counter, 4, unsigned );
+ SENF_PARSER_BITFIELD( transport_error_indicator, 1, bool );
+ SENF_PARSER_BITFIELD( pusi, 1, bool );
+ SENF_PARSER_BITFIELD( transport_priority, 1, bool );
+ SENF_PARSER_BITFIELD( pid, 13, unsigned );
+ SENF_PARSER_BITFIELD( transport_scrmbl_ctrl, 2, unsigned );
+ SENF_PARSER_BITFIELD( adaptation_field_ctrl, 2, unsigned );
+ SENF_PARSER_BITFIELD( continuity_counter, 4, unsigned );
SENF_PARSER_FINALIZE( Parse_TransportPacket );
{
# include SENF_FIXED_PARSER()
- SENF_PARSE_FIELD( type, senf::Parse_UInt16 );
- SENF_PARSE_FIELD( length, senf::Parse_Int32 );
- SENF_PARSE_FIELD( reserved, senf::Parse_UInt16 );
+ SENF_PARSER_FIELD( type, senf::Parse_UInt16 );
+ SENF_PARSER_FIELD( length, senf::Parse_Int32 );
+ SENF_PARSER_FIELD( reserved, senf::Parse_UInt16 );
SENF_PARSER_FINALIZE(BarPacketParser);
};
{
# include SENF_FIXED_PARSER()
- SENF_PARSE_FIELD( name, senf::Parse_UInt16 );
- SENF_PARSE_FIELD( id, senf::Parse_Int32 );
+ SENF_PARSER_FIELD( name, senf::Parse_UInt16 );
+ SENF_PARSER_FIELD( id, senf::Parse_Int32 );
SENF_PARSER_FINALIZE(FooParser);
};
{
# include SENF_PARSER()
- SENF_PARSE_FIELD( name, senf::Parse_UInt16 );
- SENF_PARSE_FIELD( id, senf::Parse_Int32 );
+ SENF_PARSER_FIELD( name, senf::Parse_UInt16 );
+ SENF_PARSER_FIELD( id, senf::Parse_Int32 );
SENF_PARSER_FINALIZE(BarParser);
};
typedef senf::Parse_Array<2,senf::Parse_UInt24> Parse_Array2;
- SENF_PARSE_FIELD( array, Parse_Array2 );
- SENF_PARSE_FIELD( index, senf::Parse_UInt16 );
+ SENF_PARSER_FIELD( array, Parse_Array2 );
+ SENF_PARSER_FIELD( index, senf::Parse_UInt16 );
SENF_PARSER_FINALIZE(SomePacketParser);
};
typedef senf::Parse_Array<1,SomePacketParser> Parse_Array1;
- SENF_PARSE_FIELD( fields, Parse_Array1 );
+ SENF_PARSER_FIELD( fields, Parse_Array1 );
SENF_PARSER_FINALIZE(SomeOtherParser);
};
#define SENF_PARSER_INHERIT BOOST_PP_CAT( SENF_PARSER_INHERIT_ , SENF_PARSER_TYPE )
-#define SENF_PARSE_FIELD BOOST_PP_CAT( SENF_PARSE_FIELD_ , SENF_PARSER_TYPE )
-#define SENF_PARSE_FIELD_RO BOOST_PP_CAT( SENF_PARSE_FIELD_RO_ , SENF_PARSER_TYPE )
-#define SENF_PARSE_CUSTOM_FIELD BOOST_PP_CAT( SENF_PARSE_CUSTOM_FIELD_ , SENF_PARSER_TYPE )
-#define SENF_PARSE_BITFIELD BOOST_PP_CAT( SENF_PARSE_BITFIELD_ , SENF_PARSER_TYPE )
-#define SENF_PARSE_BITFIELD_RO BOOST_PP_CAT( SENF_PARSE_BITFIELD_RO_ , SENF_PARSER_TYPE )
+#define SENF_PARSER_FIELD BOOST_PP_CAT( SENF_PARSER_FIELD_ , SENF_PARSER_TYPE )
+#define SENF_PARSER_FIELD_RO BOOST_PP_CAT( SENF_PARSER_FIELD_RO_ , SENF_PARSER_TYPE )
+#define SENF_PARSER_BITFIELD BOOST_PP_CAT( SENF_PARSER_BITFIELD_ , SENF_PARSER_TYPE )
+#define SENF_PARSER_BITFIELD_RO BOOST_PP_CAT( SENF_PARSER_BITFIELD_RO_ , SENF_PARSER_TYPE )
+#define SENF_PARSER_CUSTOM_FIELD BOOST_PP_CAT( SENF_PARSER_CUSTOM_FIELD_ , SENF_PARSER_TYPE )
+
+#define SENF_PARSER_PRIVATE_FIELD BOOST_PP_CAT( SENF_PARSER_P_FIELD_ , SENF_PARSER_TYPE )
+#define SENF_PARSER_PRIVATE_FIELD_RO BOOST_PP_CAT( SENF_PARSER_P_FIELD_RO_ , SENF_PARSER_TYPE )
+#define SENF_PARSER_PRIVATE_BITFIELD BOOST_PP_CAT( SENF_PARSER_P_BITFIELD_ , SENF_PARSER_TYPE )
+#define SENF_PARSER_PRIVATE_BITFIELD_RO BOOST_PP_CAT( SENF_PARSER_P_BITFIELD_RO_ , SENF_PARSER_TYPE )
#define SENF_PARSER_SKIP BOOST_PP_CAT( SENF_PARSER_SKIP_ , SENF_PARSER_TYPE )
+#define SENF_PARSER_SKIP_BITS BOOST_PP_CAT( SENF_PARSER_SKIP_BITS_ , SENF_PARSER_TYPE )
#define SENF_PARSER_GOTO BOOST_PP_CAT( SENF_PARSER_GOTO_ , SENF_PARSER_TYPE )
#define SENF_PARSER_GOTO_OFFSET BOOST_PP_CAT( SENF_PARSER_GOTO_OFFSET_ , SENF_PARSER_TYPE )
#define SENF_PARSER_LABEL BOOST_PP_CAT( SENF_PARSER_LABEL_ , SENF_PARSER_TYPE )
public:
#
# ///////////////////////////////////////////////////////////////////////////
-# // SENF_PARSE_FIELD_*
+# // SENF_PARSER_FIELD_*
+# // SENF_PARSER_P_FIELD_*
#
-# define SENF_PARSE_FIELD_var(name, type) SENF_PARSER_FIELD_I(name, type, var, rw, public)
-# define SENF_PARSE_FIELD_RO_var(name, type) SENF_PARSER_FIELD_I(name, type, var, ro, public)
+# define SENF_PARSER_FIELD_var(name, type) SENF_PARSER_FIELD_I(name, type, var, rw, public)
+# define SENF_PARSER_FIELD_RO_var(name, type) SENF_PARSER_FIELD_I(name, type, var, ro, public)
+# define SENF_PARSER_FIELD_fix(name, type) SENF_PARSER_FIELD_I(name, type, fix, rw, public)
+# define SENF_PARSER_FIELD_RO_fix(name, type) SENF_PARSER_FIELD_I(name, type, fix, ro, public)
#
-# define SENF_PARSE_FIELD_fix(name, type) SENF_PARSER_FIELD_I(name, type, fix, rw, public)
-# define SENF_PARSE_FIELD_RO_fix(name, type) SENF_PARSER_FIELD_I(name, type, fix, ro, public)
+# define SENF_PARSER_P_FIELD_var(name, type) SENF_PARSER_FIELD_I(name, type, var, rw, private)
+# define SENF_PARSER_P_FIELD_RO_var(name, type) SENF_PARSER_FIELD_I(name, type, var, ro, private)
+# define SENF_PARSER_P_FIELD_fix(name, type) SENF_PARSER_FIELD_I(name, type, fix, rw, private)
+# define SENF_PARSER_P_FIELD_RO_fix(name, type) SENF_PARSER_FIELD_I(name, type, fix, ro, private)
#
# define SENF_PARSER_FIELD_I(name, type, ofstype, rwtype, access) \
access: \
}
#
# ///////////////////////////////////////////////////////////////////////////
-# // SENF_PARSE_CUSTOM_FIELD_*
+# // SENF_PARSER_CUSTOM_FIELD_*
#
-# define SENF_PARSE_CUSTOM_FIELD_var(name, type, size, isize) \
+# define SENF_PARSER_CUSTOM_FIELD_var(name, type, size, isize) \
SENF_PARSER_CUSTOM_FIELD_I(name, type, size, isize, var)
-# define SENF_PARSE_CUSTOM_FIELD_fix(name, type, size) \
+# define SENF_PARSER_CUSTOM_FIELD_fix(name, type, size) \
SENF_PARSER_CUSTOM_FIELD_I(name, type, size, size, fix)
#
# define SENF_PARSER_CUSTOM_FIELD_I(name, type, size, isize, ofstype) \
BOOST_PP_CAT(name, _t) name() const
#
# ///////////////////////////////////////////////////////////////////////////
-# // SENF_PARSE_BITFIELD_*
+# // SENF_PARSER_BITFIELD_*
+# // SENF_PARSER_P_BITFIELD_*
#
-# define SENF_PARSE_BITFIELD_var(name, bits, type) \
+# define SENF_PARSER_BITFIELD_var(name, bits, type) \
SENF_PARSER_BITFIELD_I(name, bits, type, var, rw, public)
-# define SENF_PARSE_BITFIELD_RO_var(name, bits, type) \
+# define SENF_PARSER_BITFIELD_RO_var(name, bits, type) \
SENF_PARSER_BITFIELD_I(name, bits, type, var, ro, public)
-#
-# define SENF_PARSE_BITFIELD_fix(name, bits, type) \
+# define SENF_PARSER_BITFIELD_fix(name, bits, type) \
SENF_PARSER_BITFIELD_I(name, bits, type, fix, rw, public)
-# define SENF_PARSE_BITFIELD_RO_fix(name, bits, type) \
+# define SENF_PARSER_BITFIELD_RO_fix(name, bits, type) \
SENF_PARSER_BITFIELD_I(name, bits, type, fix, ro, public)
#
+# define SENF_PARSER_P_BITFIELD_var(name, bits, type) \
+ SENF_PARSER_BITFIELD_I(name, bits, type, var, rw, private)
+# define SENF_PARSER_P_BITFIELD_RO_var(name, bits, type) \
+ SENF_PARSER_BITFIELD_I(name, bits, type, var, ro, private)
+# define SENF_PARSER_P_BITFIELD_fix(name, bits, type) \
+ SENF_PARSER_BITFIELD_I(name, bits, type, fix, rw, private)
+# define SENF_PARSER_P_BITFIELD_RO_fix(name, bits, type) \
+ SENF_PARSER_BITFIELD_I(name, bits, type, fix, ro, private)
+#
# ////////////////////////////////////////
# // SENF_PARSER_BITFIELD_I
#
public:
#
# ///////////////////////////////////////////////////////////////////////////
+# // SENF_PARSER_SKIP_BITS_*
+#
+# define SENF_PARSER_SKIP_BITS_var(bits) SENF_PARSER_I_SKIP_BITS(bits, var)
+# define SENF_PARSER_SKIP_BITS_fix(bits) SENF_PARSER_I_SKIP_BITS(bits, fix)
+#
+# define SENF_PARSER_I_SKIP_BITS(bits, ofstype) \
+ SENF_MPL_SLOT_SET(bit, SENF_MPL_SLOT_GET(bit) + bits)
+#
+# ///////////////////////////////////////////////////////////////////////////
# // SENF_PARSER_GOTO_*
#
# define SENF_PARSER_GOTO_var(name) \
SENF_PARSER_I_BITFIELD_RESET() \
SENF_PARSER_I_FIELD_INTRO(name, void, private) \
SENF_PARSER_I_FIELD_INIT_ro(name, void, private) \
- BOOST_PP_CAT( SENF_PARSE_I_GOTO_SET_OFS_, ofstype ) (name, offset, initsize) \
+ BOOST_PP_CAT( SENF_PARSER_I_GOTO_SET_OFS_, ofstype ) (name, offset, initsize) \
public:
#
-# define SENF_PARSE_I_GOTO_SET_OFS_var(name, offs, initsize) \
+# define SENF_PARSER_I_GOTO_SET_OFS_var(name, offs, initsize) \
size_type field_offset_(senf::mpl::rv<BOOST_PP_CAT(name,_index)>*) const { \
return offs; \
} \
SENF_MPL_SLOT_SET(init_bytes, initsize);
#
-# define SENF_PARSE_I_GOTO_SET_OFS_fix(name, offs, initsize) \
+# define SENF_PARSER_I_GOTO_SET_OFS_fix(name, offs, initsize) \
SENF_MPL_SLOT_SET(offset, offs);
#
# ///////////////////////////////////////////////////////////////////////////
{
# include SENF_FIXED_PARSER()
- SENF_PARSE_FIELD ( normalField , senf::Parse_UInt16 );
- SENF_PARSE_FIELD_RO ( roField , senf::Parse_UInt16 );
+ SENF_PARSER_FIELD ( normalField , senf::Parse_UInt16 );
+ SENF_PARSER_FIELD_RO ( roField , senf::Parse_UInt16 );
- SENF_PARSE_CUSTOM_FIELD ( customField , int, 2 ) {
+ SENF_PARSER_CUSTOM_FIELD ( customField , int, 2 ) {
return parse<senf::Parse_UInt16>(customField_offset);
}
- SENF_PARSE_BITFIELD ( signedBitfield , 4, signed );
- SENF_PARSE_BITFIELD ( unsignedBitfield , 3, unsigned );
- SENF_PARSE_BITFIELD ( boolBitfield , 1, bool );
+ SENF_PARSER_BITFIELD ( signedBitfield , 4, signed );
+ SENF_PARSER_BITFIELD ( unsignedBitfield , 3, unsigned );
+ SENF_PARSER_BITFIELD ( boolBitfield , 1, bool );
- SENF_PARSE_BITFIELD_RO ( roSignedBitfield , 4, signed );
- SENF_PARSE_BITFIELD_RO ( roUnsignedBitfield , 3, unsigned );
- SENF_PARSE_BITFIELD_RO ( roBoolBitfield , 1, bool );
+ SENF_PARSER_BITFIELD_RO ( roSignedBitfield , 4, signed );
+ SENF_PARSER_BITFIELD_RO ( roUnsignedBitfield , 3, unsigned );
+ SENF_PARSER_BITFIELD_RO ( roBoolBitfield , 1, bool );
SENF_PARSER_LABEL( end );
SENF_PARSER_GOTO( roField );
- SENF_PARSE_FIELD ( overlayOfRoField , senf::Parse_Int16 );
+ SENF_PARSER_FIELD ( overlayOfRoField , senf::Parse_Int16 );
SENF_PARSER_SKIP( 2 );
- SENF_PARSE_FIELD ( overlayOfBitfield , senf::Parse_UInt8 );
+ SENF_PARSER_FIELD ( overlayOfBitfield , senf::Parse_UInt8 );
SENF_PARSER_GOTO_OFFSET( 1 );
- SENF_PARSE_FIELD ( lowbyteOfNormalField , senf::Parse_UInt8 );
+ SENF_PARSER_PRIVATE_FIELD ( privLowbyteOfNormalField , senf::Parse_UInt8 );
+
+ unsigned lowbyteOfNormalField() {
+ return privLowbyteOfNormalField();
+ }
SENF_PARSER_GOTO( end );
SENF_PARSER_INHERIT( FixedBaseParser );
- SENF_PARSE_FIELD ( derivedField , senf::Parse_UInt16 );
+ SENF_PARSER_FIELD ( derivedField , senf::Parse_UInt16 );
SENF_PARSER_LABEL( end );
SENF_PARSER_GOTO( signedBitfield );
- SENF_PARSE_FIELD ( anotherOverlay , senf::Parse_UInt16 );
+ SENF_PARSER_FIELD ( anotherOverlay , senf::Parse_UInt16 );
SENF_PARSER_GOTO( end );
{
# include SENF_PARSER()
- SENF_PARSE_FIELD ( normalField , senf::Parse_UInt16 );
- SENF_PARSE_FIELD_RO ( roField , senf::Parse_UInt16 );
+ SENF_PARSER_FIELD ( normalField , senf::Parse_UInt16 );
+ SENF_PARSER_FIELD_RO ( roField , senf::Parse_UInt16 );
- SENF_PARSE_CUSTOM_FIELD ( customField , int, 2, 2 ) {
+ SENF_PARSER_CUSTOM_FIELD ( customField , int, 2, 2 ) {
return parse<senf::Parse_UInt16>(customField_offset());
}
- SENF_PARSE_BITFIELD ( signedBitfield , 4, signed );
- SENF_PARSE_BITFIELD ( unsignedBitfield , 3, unsigned );
- SENF_PARSE_BITFIELD ( boolBitfield , 1, bool );
+ SENF_PARSER_BITFIELD ( signedBitfield , 4, signed );
+ SENF_PARSER_BITFIELD ( unsignedBitfield , 3, unsigned );
+ SENF_PARSER_BITFIELD ( boolBitfield , 1, bool );
- SENF_PARSE_BITFIELD_RO ( roSignedBitfield , 4, signed );
- SENF_PARSE_BITFIELD_RO ( roUnsignedBitfield , 3, unsigned );
- SENF_PARSE_BITFIELD_RO ( roBoolBitfield , 1, bool );
+ SENF_PARSER_BITFIELD_RO ( roSignedBitfield , 4, signed );
+ SENF_PARSER_BITFIELD_RO ( roUnsignedBitfield , 3, unsigned );
+ SENF_PARSER_BITFIELD_RO ( roBoolBitfield , 1, bool );
SENF_PARSER_LABEL( end );
SENF_PARSER_GOTO( roField );
- SENF_PARSE_FIELD ( overlayOfRoField , senf::Parse_Int16 );
+ SENF_PARSER_FIELD ( overlayOfRoField , senf::Parse_Int16 );
SENF_PARSER_SKIP( 2, 2 );
- SENF_PARSE_FIELD ( overlayOfBitfield , senf::Parse_UInt8 );
+ SENF_PARSER_FIELD ( overlayOfBitfield , senf::Parse_UInt8 );
SENF_PARSER_GOTO_OFFSET( 1, 1 );
- SENF_PARSE_FIELD ( lowbyteOfNormalField , senf::Parse_UInt8 );
+ SENF_PARSER_PRIVATE_FIELD ( privLowbyteOfNormalField , senf::Parse_UInt8 );
+
+ unsigned lowbyteOfNormalField() {
+ return privLowbyteOfNormalField();
+ }
SENF_PARSER_GOTO( end );
SENF_PARSER_INHERIT( VariableBaseParser );
- SENF_PARSE_FIELD ( derivedField , senf::Parse_UInt16 );
+ SENF_PARSER_FIELD ( derivedField , senf::Parse_UInt16 );
SENF_PARSER_LABEL( end );
SENF_PARSER_GOTO( signedBitfield );
- SENF_PARSE_FIELD ( anotherOverlay , senf::Parse_UInt16 );
+ SENF_PARSER_FIELD ( anotherOverlay , senf::Parse_UInt16 );
SENF_PARSER_GOTO( end );
EXPAND_ONLY_PREDEF = YES
PREDEFINED = DOXYGEN \
"SENF_PPI_MODULE(x)=" \
- "SENF_PARSE_FIELD(name,type)=type name()" \
- "SENF_PARSE_FIELD_RO(name,type)=type::value_type name()" \
- "SENF_PARSE_FIELD_AFTER(name,type,prev)=type name()" \
- "SENF_PARSE_FIELD_AFTER_RO(name,type,prev)=type::value_type name()" \
- "SENF_PARSE_BITFIELD(name, bits, type)=type ## _ ## bits name()" \
- "SENF_PARSE_BITFIELD_RO(name, bits, type)=type ## _ ## bits name()" \
+ "SENF_PARSER_FIELD(name,type)=type name() const" \
+ "SENF_PARSER_FIELD_RO(name,type)=type::value_type name() const" \
+ "SENF_PARSER_FIELD_AFTER(name,type,prev)=type name() const" \
+ "SENF_PARSER_FIELD_AFTER_RO(name,type,prev)=type::value_type name() const" \
+ "SENF_PARSER_BITFIELD(name, bits, type)=senf::ParseField_ ## type name() const" \
+ "SENF_PARSER_BITFIELD_RO(name, bits, type)=type ## _ ## bits name() const" \
+ "SENF_PARSER_INHERIT(name)=" \
"SENF_PARSER_FINALIZE(name)=" \
- "SENF_PARSER_INIT()=void init()"
+ "SENF_PARSER_INIT()=void init()" \
+ "SENF_PARSER_SKIP(x)=" \
+ "SENF_PARSER_SKIP_BITS(x)=" \
+ "SENF_PARSER_GOTO(x)=" \
+ "SENF_PARSER_GOTO_OFFSET(x)=" \
+ "SENF_PARSER_LABEL(x)=" \
+ "ParseField_unsigned=Parse_UIntField" \
+ "ParseField_signed=Parse_IntField" \
+ "ParseField_bool=Parse_Flag"
EXPAND_AS_DEFINED = prefix_
HTML_HEADER = "$(TOPDIR)/doclib/doxy-header.html"