示例#1
0
struct proto_expectation *proto_expectation_alloc_from_conntrack(struct conntrack_entry *ce, struct proto *proto, void *priv) {

	struct proto_expectation *e = proto_expectation_alloc(proto, priv);

	if (!e)
		return NULL;

	if (!ce->fwd_value && !ce->rev_value) // This is a unique conntrack, match the upper layer instead
		ce = ce->parent->ce;

	while (1) {
		if (proto_expectation_prepend(e, ce->proto, ce->fwd_value, ce->rev_value) != POM_OK) {
			proto_expectation_cleanup(e);
			return NULL;
		}
	
		if (!ce->parent)
			break;

		ce = ce->parent->ce;
			
	}

	return e;
}
示例#2
0
文件: proto.c 项目: nomnom100/pom-ng
struct proto_expectation *proto_expectation_alloc_from_conntrack(struct conntrack_entry *ce, struct proto *proto, void *priv) {

    struct proto_expectation *e = proto_expectation_alloc(proto, priv);

    if (!e)
        return NULL;

    while (1) {
        if (proto_expectation_prepend(e, ce->proto, ce->fwd_value, ce->rev_value) != POM_OK) {
            proto_expectation_cleanup(e);
            return NULL;
        }

        if (!ce->parent)
            break;

        ce = ce->parent->ce;

    }


    return e;
}