require '_h2ph_pre.ph';

unless(defined(&_NET_IF_PFSYNC_H_)) {
    eval 'sub _NET_IF_PFSYNC_H_ () {1;}' unless defined(&_NET_IF_PFSYNC_H_);
    if(defined(&_KERNEL)) {
    }
    eval 'sub PFSYNC_VERSION () {1;}' 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_MAX () {4;}' unless defined(&PFSYNC_ACT_MAX);
    eval 'sub PFSYNC_HDRLEN () {$sizeof{\'struct pfsync_header\'};}' unless defined(&PFSYNC_HDRLEN);
    eval 'sub PFSYNC_ACTIONS () {"CLR ST", "INS ST", "UPD ST", "DEL ST";}' unless defined(&PFSYNC_ACTIONS);
    eval 'sub pf_state_peer_hton {
        local($s,$d) = @_;
	    eval q( &do { ($d)-> &seqlo =  &htonl(($s)-> &seqlo); ($d)-> &seqhi =  &htonl(($s)-> &seqhi); ($d)-> &seqdiff =  &htonl(($s)-> &seqdiff); ($d)-> &max_win =  &htons(($s)-> &max_win); ($d)-> &state = ($s)-> &state; }  &while (0));
    }' unless defined(&pf_state_peer_hton);
    eval 'sub pf_state_peer_ntoh {
        local($s,$d) = @_;
	    eval q( &do { ($d)-> &seqlo =  &ntohl(($s)-> &seqlo); ($d)-> &seqhi =  &ntohl(($s)-> &seqhi); ($d)-> &seqdiff =  &ntohl(($s)-> &seqdiff); ($d)-> &max_win =  &ntohs(($s)-> &max_win); ($d)-> &state = ($s)-> &state; }  &while (0));
    }' unless defined(&pf_state_peer_ntoh);
    if(defined(&_KERNEL)) {
	eval 'sub pfsync_insert_state {
	    local($st) = @_;
    	    eval q( &pfsync_pack_state( &PFSYNC_ACT_INS, ($st)));
	}' unless defined(&pfsync_insert_state);
	eval 'sub pfsync_update_state {
	    local($st) = @_;
    	    eval q( &pfsync_pack_state( &PFSYNC_ACT_UPD, ($st)));
	}' unless defined(&pfsync_update_state);
	eval 'sub pfsync_delete_state {
	    local($st) = @_;
    	    eval q( &pfsync_pack_state( &PFSYNC_ACT_DEL, ($st)));
	}' unless defined(&pfsync_delete_state);
    }
}
1;
