version 1.1.1.1, 2019/10/21 14:25:31
|
version 1.1.1.2, 2021/03/17 00:07:30
|
Line 11
|
Line 11
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
GNU General Public License for more details. |
|
|
You should have received a copy of the GNU General Public License | You should have received a copy of the GNU General Public License along |
along with this program; if not, write to the Free Software | with this program; if not, write to the Free Software Foundation, Inc., |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
*/ |
*/ |
|
|
#include "config.h" |
#include "config.h" |
|
|
|
#include <errno.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
|
#include <string.h> |
#include <sys/types.h> |
#include <sys/types.h> |
#include <time.h> |
#include <time.h> |
|
|
Line 79 void display_open(
|
Line 81 void display_open(
|
case DisplayTXT: |
case DisplayTXT: |
txt_open(); |
txt_open(); |
break; |
break; |
|
#ifdef HAVE_JANSSON |
case DisplayJSON: |
case DisplayJSON: |
json_open(); |
json_open(); |
break; |
break; |
|
#endif |
case DisplayXML: |
case DisplayXML: |
xml_open(); |
xml_open(); |
break; |
break; |
Line 125 void display_close(
|
Line 129 void display_close(
|
case DisplayTXT: |
case DisplayTXT: |
txt_close(ctl); |
txt_close(ctl); |
break; |
break; |
|
#ifdef HAVE_JANSSON |
case DisplayJSON: |
case DisplayJSON: |
json_close(ctl); |
json_close(ctl); |
break; |
break; |
|
#endif |
case DisplayXML: |
case DisplayXML: |
xml_close(ctl); |
xml_close(ctl); |
break; |
break; |
Line 223 void display_rawping(
|
Line 229 void display_rawping(
|
void display_rawhost( |
void display_rawhost( |
struct mtr_ctl *ctl, |
struct mtr_ctl *ctl, |
int host, |
int host, |
ip_t * ip_addr) | ip_t * ip_addr, |
| struct mplslen *mpls) |
{ |
{ |
if (ctl->DisplayMode == DisplayRaw) |
if (ctl->DisplayMode == DisplayRaw) |
raw_rawhost(ctl, host, ip_addr); | raw_rawhost(ctl, host, ip_addr, mpls); |
} |
} |
|
|
|
|
Line 249 void display_clear(
|
Line 256 void display_clear(
|
if (ctl->DisplayMode == DisplayCurses) |
if (ctl->DisplayMode == DisplayCurses) |
mtr_curses_clear(ctl); |
mtr_curses_clear(ctl); |
#endif |
#endif |
|
} |
|
|
|
|
|
/* |
|
Given an errno error code corresponding to a host entry, return a |
|
user readable error string. |
|
*/ |
|
char *host_error_to_string( |
|
int err) |
|
{ |
|
if (err == ENETUNREACH) { |
|
return "no route to host"; |
|
} |
|
|
|
if (err == ENETDOWN) { |
|
return "network down"; |
|
} |
|
|
|
if (err == 0) { |
|
return "waiting for reply"; |
|
} |
|
|
|
return strerror(err); |
} |
} |