|
@@ -249,4 +249,34 @@ nf_osf_match(const struct sk_buff *skb, u_int8_t family,
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(nf_osf_match);
|
|
EXPORT_SYMBOL_GPL(nf_osf_match);
|
|
|
|
|
|
|
|
+const char *nf_osf_find(const struct sk_buff *skb,
|
|
|
|
+ const struct list_head *nf_osf_fingers)
|
|
|
|
+{
|
|
|
|
+ const struct iphdr *ip = ip_hdr(skb);
|
|
|
|
+ const struct nf_osf_user_finger *f;
|
|
|
|
+ unsigned char opts[MAX_IPOPTLEN];
|
|
|
|
+ const struct nf_osf_finger *kf;
|
|
|
|
+ struct nf_osf_hdr_ctx ctx;
|
|
|
|
+ const struct tcphdr *tcp;
|
|
|
|
+ const char *genre = NULL;
|
|
|
|
+
|
|
|
|
+ memset(&ctx, 0, sizeof(ctx));
|
|
|
|
+
|
|
|
|
+ tcp = nf_osf_hdr_ctx_init(&ctx, skb, ip, opts);
|
|
|
|
+ if (!tcp)
|
|
|
|
+ return false;
|
|
|
|
+
|
|
|
|
+ list_for_each_entry_rcu(kf, &nf_osf_fingers[ctx.df], finger_entry) {
|
|
|
|
+ f = &kf->finger;
|
|
|
|
+ if (!nf_osf_match_one(skb, f, -1, &ctx))
|
|
|
|
+ continue;
|
|
|
|
+
|
|
|
|
+ genre = f->genre;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return genre;
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL_GPL(nf_osf_find);
|
|
|
|
+
|
|
MODULE_LICENSE("GPL");
|
|
MODULE_LICENSE("GPL");
|