diff options
author | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-08-17 08:15:13 -0400 |
---|---|---|
committer | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-08-17 08:15:13 -0400 |
commit | b7d456868f90f6c6f763d18922be9f8fe6ce15e6 (patch) | |
tree | dc3f5955011415f5aa127b288e1f16a4f7837290 /parser.c | |
parent | 54bbd8c592c1679c182dd7aad7860331ea8b4868 (diff) |
implemented Go_sys_net_91
Diffstat (limited to 'parser.c')
-rw-r--r-- | parser.c | 29 |
1 files changed, 28 insertions, 1 deletions
@@ -11,6 +11,7 @@ END DESCRIPTION **********************************************************/ #include "parser.h" #include "flash.h" +#include "nicutils.h" #include <glib/gprintf.h> //STATICS @@ -45,7 +46,7 @@ static int Go_int_eprom_48(gchar** response, int channel, char *loc_string,char static int Go_Float_eprom51(gchar** response, int channel, char *loc_string,char *store_string,int command_type); static int Go_char_eprom_70(gchar** response, int channel, char *loc_string,char *store_string,int command_type); static int Go_eprom_siz_86(gchar** response, int channel, int command_type); - +static int Go_sys_net_91(gchar** response, int channel, char *loc_string,char *store_string,int command_type); static int Parser_id_word(char *id_me, int *channel, int *with_id_code) { @@ -755,6 +756,11 @@ void Parser_main (char *raw_in, int interactive_terminal, void(*cbfunc)(gpointer case 86: error_num=Go_eprom_siz_86(&response,channel,command_type); break; + + case 91: + error_num=Go_sys_net_91(&response,channel,parameter,units,command_type); + break; + case 9999: // was only whitespace, ignore break; @@ -1034,6 +1040,27 @@ static int Go_eprom_siz_86(gchar** response, int channel, int command_type) } +static int Go_sys_net_91(gchar **response, int channel, char *loc_string,char *store_string,int command_type) +{ + nicinfo info; + + switch (command_type) { + case query_simple: + if (nicutils_infofordefaultroute(&info)) { + *response = g_strdup_printf ("MAC address: %s, IP address: %s", info.mac, info.ip); + return OK; + } else { + return NetworkNotFound; + } + break; + + default: + return SyntaxError; + break; + } +} + + static int Handle_Units(float *mult,char *units, char *in_base) { int len_base, len_all, pos; |