Wireshark mailing list archives

basic question


From: Brian Oleksa <oleksab () darkcornersoftware com>
Date: Mon, 29 Mar 2010 10:39:59 -0400


Wiresharkers

I have been writing all my dissectors based on the port it will be 
broadcasting on. For example:

static int global_test_port = 11111;

void proto_reg_handoff_test(void) {
    static gboolean isinitialized = FALSE;

        if (!isinitialized) {
            testdata_handle = find_dissector("data");
            test_handle = create_dissector_handle(dissect_test, proto_test);
            dissector_add("udp.port", global_test_port, test_handle);
    }
    isinitialized = TRUE;
}

But what if I just wanted to make this dissector available as "decode 
as" and not by the port it broadcasts on..??

Can I just pass in a NULL for global_test_port..??

dissector_add("udp.port", NULL, test_handle);

Just wanted to see what the best thing to do is here. I was just simply 
going to pick a port that it would never be on...such as 11111.

Thanks,
Brian





___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe


Current thread: