diff options
author | Grant Erickson <marathon96@gmail.com> | 2011-05-03 09:15:16 -0700 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-05-31 21:29:49 +0200 |
commit | 8025a0a6c612c803eb676e143989575cd3045e03 (patch) | |
tree | f9ad7b621a4d3df0e822fddf1c0aecafc13c73bb /src | |
parent | 1e7bd9934c4889efcae40d47a8d079cb9bd1e537 (diff) | |
download | connman-8025a0a6c612c803eb676e143989575cd3045e03.tar.gz connman-8025a0a6c612c803eb676e143989575cd3045e03.tar.bz2 connman-8025a0a6c612c803eb676e143989575cd3045e03.zip |
ipconfig: Add Function to Stringify ipconfig Type
Diffstat (limited to 'src')
-rw-r--r-- | src/connman.h | 1 | ||||
-rw-r--r-- | src/ipconfig.c | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/connman.h b/src/connman.h index fd67cf29..bf6e5380 100644 --- a/src/connman.h +++ b/src/connman.h @@ -263,6 +263,7 @@ int __connman_ipconfig_enable(struct connman_ipconfig *ipconfig); int __connman_ipconfig_disable(struct connman_ipconfig *ipconfig); const char *__connman_ipconfig_method2string(enum connman_ipconfig_method method); +const char *__connman_ipconfig_type2string(enum connman_ipconfig_type type); enum connman_ipconfig_method __connman_ipconfig_string2method(const char *method); void __connman_ipconfig_append_ipv4(struct connman_ipconfig *ipconfig, diff --git a/src/ipconfig.c b/src/ipconfig.c index 616cbcba..986943f0 100644 --- a/src/ipconfig.c +++ b/src/ipconfig.c @@ -287,6 +287,20 @@ static struct connman_ipaddress *find_ipaddress(struct connman_ipdevice *ipdevic return NULL; } +const char *__connman_ipconfig_type2string(enum connman_ipconfig_type type) +{ + switch (type) { + case CONNMAN_IPCONFIG_TYPE_UNKNOWN: + return "unknown"; + case CONNMAN_IPCONFIG_TYPE_IPV4: + return "IPv4"; + case CONNMAN_IPCONFIG_TYPE_IPV6: + return "IPv6"; + } + + return NULL; +} + static const char *type2str(unsigned short type) { switch (type) { |