Line data Source code
1 : /* $Id: gmpr_trace.c 346474 2009-11-14 10:18:58Z ssiano $ 2 : * 3 : * gmpr_trace.c - GMP router-side trace support 4 : * 5 : * Dave Katz, March 2008 6 : * 7 : * Copyright (c) 2008, Juniper Networks, Inc. 8 : * All rights reserved. 9 : */ 10 : #include "gmpx_basic_types.h" 11 : #include "gmp.h" 12 : #include "gmpx_environment.h" 13 : #include "gmp_private.h" 14 : #include "gmp_router.h" 15 : #include "gmpr_private.h" 16 : #include "gmp_trace.h" 17 : #include "gmpr_trace.h" 18 : 19 : 20 : /* 21 : * gmpr_client_notif_string 22 : * 23 : * Returns a string given the client notification type. 24 : */ 25 : const char * 26 0 : gmpr_client_notif_string (gmpr_client_notification_type type) 27 : { 28 0 : switch (type) { 29 0 : case GMPR_NOTIF_GROUP_DELETE: 30 0 : return "Group Del"; 31 0 : case GMPR_NOTIF_GROUP_ADD_EXCL: 32 0 : return "Add Group Excl"; 33 0 : case GMPR_NOTIF_GROUP_ADD_INCL: 34 0 : return "Add Group Incl"; 35 0 : case GMPR_NOTIF_ALLOW_SOURCE: 36 0 : return "Allow Source"; 37 0 : case GMPR_NOTIF_BLOCK_SOURCE: 38 0 : return "Block Source"; 39 0 : case GMPR_NOTIF_GROUP_STATE: 40 0 : return "Group State"; 41 0 : case GMPR_NOTIF_REFRESH_END: 42 0 : return "Refresh End"; 43 0 : default: 44 0 : return "Invalid"; 45 : } 46 : } 47 : 48 : 49 : /* 50 : * gmpr_host_notif_string 51 : * 52 : * Returns a string given the host notification type. 53 : */ 54 : const char * 55 0 : gmpr_host_notif_string (gmpr_client_host_notification_type type) 56 : { 57 0 : switch (type) { 58 0 : case GMPR_NOTIF_HOST_UNKNOWN: 59 0 : return "Unknown"; 60 0 : case GMPR_NOTIF_HOST_JOIN: 61 0 : return "Join"; 62 0 : case GMPR_NOTIF_HOST_LEAVE: 63 0 : return "Leave"; 64 0 : case GMPR_NOTIF_HOST_TIMEOUT: 65 0 : return "Timeout"; 66 0 : case GMPR_NOTIF_HOST_IFDOWN: 67 0 : return "Intf Down"; 68 0 : default: 69 0 : return "Invalid"; 70 : } 71 : }