Ethereal-dev: [Ethereal-dev] Programming style/performance question

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Yaniv Kaul" <ykaul@xxxxxxxxxxxxxxxx>
Date: Wed, 28 Aug 2002 12:40:40 +0200
Which is better?

1. proto_tree_add_item(ntree, hf_ip_addr, tvb, offset, SIZE_IP_ADDR, 0);

or

2. proto_tree_add_ipv4(ntree, hf_ip_addr, tvb, offset, SIZE_IP_ADDR, ip);


where hf_ip is defined anyway as:

{ &hf_ip,
    { "IP Address", "protocol.ip", FT_IPv4, BASE_DEC, NULL, 0x0, "IP
Address", HFILL}},


I assume #2.