diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-06-03 16:11:07 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-06-03 16:11:07 +0000 |
commit | 8d361c07a55685f6eee5209b30f46c392549ba42 (patch) | |
tree | b200dc9c877f77e90edb9580d6c55d898eebfcbb /avahi-core/util.c | |
parent | 4ff0807c04fcc239de52a793bceb88e7f3408f3f (diff) |
* add support for _workstation._tcp
* really fix #3455
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@93 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/util.c')
-rw-r--r-- | avahi-core/util.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/avahi-core/util.c b/avahi-core/util.c index b186817..a41475a 100644 --- a/avahi-core/util.c +++ b/avahi-core/util.c @@ -403,3 +403,26 @@ guint avahi_domain_hash(const gchar *s) { } } +gchar *avahi_format_mac_address(const guint8* mac, guint size) { + gchar *r, *t; + guint i; + static const gchar hex[] = "0123456789abcdef"; + + t = r = g_new(gchar, size > 0 ? size*3 : 1); + + if (size <= 0) { + *r = 0; + return r; + } + + for (i = 0; i < size; i++) { + *(t++) = hex[*mac >> 4]; + *(t++) = hex[*mac & 0xF]; + *(t++) = ':'; + + mac++; + } + + *(--t) = 0; + return r; +} |