require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_NET_IF_PFSYNC_H_)) {
    eval 'sub _NET_IF_PFSYNC_H_ () {1;}' unless defined(&_NET_IF_PFSYNC_H_);
    eval 'sub PFSYNC_ID_LEN () {$sizeof{ &u_int64_t};}' unless defined(&PFSYNC_ID_LEN);
    eval 'sub PFSYNC_BUS_START () {1;}' unless defined(&PFSYNC_BUS_START);
    eval 'sub PFSYNC_BUS_END () {2;}' unless defined(&PFSYNC_BUS_END);
    eval 'sub PFSYNCCTL_STATS () {1;}' unless defined(&PFSYNCCTL_STATS);
    eval 'sub PFSYNCCTL_MAXID () {2;}' unless defined(&PFSYNCCTL_MAXID);
    eval 'sub PFSYNCCTL_NAMES () {{ { 0, 0}, { "stats",  &CTLTYPE_STRUCT }, };}' unless defined(&PFSYNCCTL_NAMES);
    if(defined(&_KERNEL)) {
    }
    eval 'sub PFSYNC_VERSION () {4;}' unless defined(&PFSYNC_VERSION);
    eval 'sub PFSYNC_ACT_CLR () {0;}' unless defined(&PFSYNC_ACT_CLR);
    eval 'sub PFSYNC_ACT_INS () {1;}' unless defined(&PFSYNC_ACT_INS);
    eval 'sub PFSYNC_ACT_UPD () {2;}' unless defined(&PFSYNC_ACT_UPD);
    eval 'sub PFSYNC_ACT_DEL () {3;}' unless defined(&PFSYNC_ACT_DEL);
    eval 'sub PFSYNC_ACT_UPD_C () {4;}' unless defined(&PFSYNC_ACT_UPD_C);
    eval 'sub PFSYNC_ACT_DEL_C () {5;}' unless defined(&PFSYNC_ACT_DEL_C);
    eval 'sub PFSYNC_ACT_INS_F () {6;}' unless defined(&PFSYNC_ACT_INS_F);
    eval 'sub PFSYNC_ACT_DEL_F () {7;}' unless defined(&PFSYNC_ACT_DEL_F);
    eval 'sub PFSYNC_ACT_UREQ () {8;}' unless defined(&PFSYNC_ACT_UREQ);
    eval 'sub PFSYNC_ACT_BUS () {9;}' unless defined(&PFSYNC_ACT_BUS);
    eval 'sub PFSYNC_ACT_TDB_UPD () {10;}' unless defined(&PFSYNC_ACT_TDB_UPD);
    eval 'sub PFSYNC_ACT_MAX () {11;}' unless defined(&PFSYNC_ACT_MAX);
    eval 'sub PFSYNC_BULKPACKETS () {1;}' unless defined(&PFSYNC_BULKPACKETS);
    eval 'sub PFSYNC_MAX_BULKTRIES () {12;}' unless defined(&PFSYNC_MAX_BULKTRIES);
    eval 'sub PFSYNC_HDRLEN () {$sizeof{\'struct pfsync_header\'};}' unless defined(&PFSYNC_HDRLEN);
    eval 'sub PFSYNC_ACTIONS () {"CLR ST", "INS ST", "UPD ST", "DEL ST", "UPD ST COMP", "DEL ST COMP", "INS FR", "DEL FR", "UPD REQ", "BLK UPD STAT", "TDB UPD";}' unless defined(&PFSYNC_ACTIONS);
    eval 'sub PFSYNC_DFLTTL () {255;}' unless defined(&PFSYNC_DFLTTL);
    if(defined(&_KERNEL)) {
	eval 'sub PFSYNC_SI_IOCTL () {0x1;}' unless defined(&PFSYNC_SI_IOCTL);
	eval 'sub PFSYNC_SI_CKSUM () {0x2;}' unless defined(&PFSYNC_SI_CKSUM);
	eval 'sub pfsync_insert_state {
	    my($st) = @_;
    	    eval q( &do {  &if (( ($st->{rule}->{ptr}->{rule_flag}) &  &PFRULE_NOSYNC) || ( ($st->{key[&PF_SK_WIRE]}->{proto}) ==  &IPPROTO_PFSYNC))  ($st->{sync_flags}) |=  &PFSTATE_NOSYNC;  &else  &if (! ($st->{sync_flags}))  &pfsync_pack_state( &PFSYNC_ACT_INS, ($st),  &PFSYNC_FLAG_COMPRESS);  ($st->{sync_flags}) &= ~ &PFSTATE_FROMSYNC; }  &while (0));
	}' unless defined(&pfsync_insert_state);
	eval 'sub pfsync_update_state {
	    my($st) = @_;
    	    eval q( &do {  &if (! ($st->{sync_flags}))  &pfsync_pack_state( &PFSYNC_ACT_UPD, ($st),  &PFSYNC_FLAG_COMPRESS);  ($st->{sync_flags}) &= ~ &PFSTATE_FROMSYNC; }  &while (0));
	}' unless defined(&pfsync_update_state);
	eval 'sub pfsync_delete_state {
	    my($st) = @_;
    	    eval q( &do {  &if (! ($st->{sync_flags}))  &pfsync_pack_state( &PFSYNC_ACT_DEL, ($st),  &PFSYNC_FLAG_COMPRESS); }  &while (0));
	}' unless defined(&pfsync_delete_state);
    }
}
1;
