FreeBSD/contrib/ofed/libsdp/src/config_parser.c
/* dump the current state in readable format */
dump the current state in readable format
dump the current state in readable format
static void  __sdp_dump_config_state() {
  char buf[1024];
  sprintf(buf, "CONFIG: use %s %s %s", 
          __sdp_get_family_str(__sdp_rule.target_family), 
          __sdp_get_role_str( current_role ),
          __sdp_rule.prog_name_expr);
  if (__sdp_rule.match_by_addr) {
      sprintf(buf+strlen(buf), " %s/%d", 
              addr2str(&__sdp_rule.ip), __sdp_rule.prefixlen);
  } else {
    sprintf(buf+strlen(buf), " *");
  }
  if (__sdp_rule.match_by_port) {
    sprintf(buf+strlen(buf), ":%d",__sdp_rule.sport);
    if (__sdp_rule.eport > __sdp_rule.sport) 
      sprintf(buf+strlen(buf), "-%d",__sdp_rule.eport);
  }
  else
    sprintf(buf+strlen(buf), ":*");
  sprintf(buf+strlen(buf), "\n");
  __sdp_log(1, buf);
}
static void __sdp_dump_config_state ( ) { char buf [ 1024 ] ; sprintf ( buf , " " , __sdp_get_family_str ( __sdp_rule . target_family ) , __sdp_get_role_str ( current_role ) , __sdp_rule . prog_name_expr ) ; if ( __sdp_rule . match_by_addr ) { sprintf ( buf + strlen ( buf ) , " " , addr2str ( & __sdp_rule . ip ) , __sdp_rule . prefixlen ) ; } else { sprintf ( buf + strlen ( buf ) , " " ) ; } if ( __sdp_rule . match_by_port ) { sprintf ( buf + strlen ( buf ) , " " , __sdp_rule . sport ) ; if ( __sdp_rule . eport > __sdp_rule . sport ) sprintf ( buf + strlen ( buf ) , " " , __sdp_rule . eport ) ; } else sprintf ( buf + strlen ( buf ) , " " ) ; sprintf ( buf + strlen ( buf ) , " \n " ) ; __sdp_log ( 1 , buf ) ; }
dump the current state in readable format
dump the current state in readable format