aboutsummaryrefslogtreecommitdiffstats
path: root/epan/ftypes/ftype-bytes.c
diff options
context:
space:
mode:
authorKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2009-09-10 18:22:33 +0000
committerKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2009-09-10 18:22:33 +0000
commit56b8d36e03eccf22ea9bb078e0fd7befdc029008 (patch)
tree39c9ec6eceba4376f7bf167ea9be6869149327d0 /epan/ftypes/ftype-bytes.c
parent019625d876f94d1f2ec85a54d3024a34c046c09c (diff)
Introduce a few FT_XXX lengths defines and use those instead of hard coding constants
svn path=/trunk/; revision=29846
Diffstat (limited to 'epan/ftypes/ftype-bytes.c')
-rw-r--r--epan/ftypes/ftype-bytes.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/epan/ftypes/ftype-bytes.c b/epan/ftypes/ftype-bytes.c
index ad24168db3..d408158a67 100644
--- a/epan/ftypes/ftype-bytes.c
+++ b/epan/ftypes/ftype-bytes.c
@@ -39,9 +39,6 @@
#define CMP_MATCHES NULL
#endif
-#define ETHER_LEN 6
-#define IPv6_LEN 16
-
static void
bytes_fvalue_new(fvalue_t *fv)
{
@@ -155,14 +152,14 @@ static void
ether_fvalue_set(fvalue_t *fv, gpointer value, gboolean already_copied)
{
g_assert(!already_copied);
- common_fvalue_set(fv, value, ETHER_LEN);
+ common_fvalue_set(fv, value, FT_ETHER_LEN);
}
static void
ipv6_fvalue_set(fvalue_t *fv, gpointer value, gboolean already_copied)
{
g_assert(!already_copied);
- common_fvalue_set(fv, value, IPv6_LEN);
+ common_fvalue_set(fv, value, FT_IPv6_LEN);
}
static void
@@ -235,12 +232,12 @@ ether_from_unparsed(fvalue_t *fv, char *s, gboolean allow_partial_value, LogFunc
* we'll log a message.
*/
if (bytes_from_unparsed(fv, s, TRUE, NULL)) {
- if (fv->value.bytes->len > ETHER_LEN) {
+ if (fv->value.bytes->len > FT_ETHER_LEN) {
logfunc("\"%s\" contains too many bytes to be a valid Ethernet address.",
s);
return FALSE;
}
- else if (fv->value.bytes->len < ETHER_LEN && !allow_partial_value) {
+ else if (fv->value.bytes->len < FT_ETHER_LEN && !allow_partial_value) {
logfunc("\"%s\" contains too few bytes to be a valid Ethernet address.",
s);
return FALSE;
@@ -593,7 +590,7 @@ ftype_register_bytes(void)
FT_ETHER, /* ftype */
"FT_ETHER", /* name */
"Ethernet or other MAC address",/* pretty_name */
- ETHER_LEN, /* wire_size */
+ FT_ETHER_LEN, /* wire_size */
bytes_fvalue_new, /* new_value */
bytes_fvalue_free, /* free_value */
ether_from_unparsed, /* val_from_unparsed */
@@ -631,7 +628,7 @@ ftype_register_bytes(void)
FT_IPv6, /* ftype */
"FT_IPv6", /* name */
"IPv6 address", /* pretty_name */
- IPv6_LEN, /* wire_size */
+ FT_IPv6_LEN, /* wire_size */
bytes_fvalue_new, /* new_value */
bytes_fvalue_free, /* free_value */
ipv6_from_unparsed, /* val_from_unparsed */