Pick up some fixes and enhancements from
http://cvs.fedora.redhat.com/viewcvs/rpms/ethereal/FC-4/: In the LPD dissector, make lpd_client_code a value_string so that we don't segfault. Do the same for lpd_server_code, although it's not strictly necessary. Check to see if htmlview is installed, and use it as our HTML viewer. The Fedora RPM has other patches, but I'm not sure if they should be applied. svn path=/trunk/; revision=15143
This commit is contained in:
parent
e51caa85fb
commit
200ff9dc52
|
@ -218,3 +218,6 @@
|
|||
|
||||
/* We don't know what the plugin installation directory will be. */
|
||||
#define PLUGIN_DIR NULL
|
||||
|
||||
/* We shouldn't need this under Windows but we'll define it anyway. */
|
||||
#define HTML_VIEWER "mozilla"
|
||||
|
|
|
@ -38,6 +38,14 @@ then
|
|||
#
|
||||
AC_MSG_ERROR(I couldn't find pod2html; make sure it's installed and in your path)
|
||||
fi
|
||||
AC_PATH_PROG(HTML_VIEWER, htmlview)
|
||||
if test "x$HTML_VIEWER" = x
|
||||
then
|
||||
AC_DEFINE_UNQUOTED(HTML_VIEWER, "mozilla", [HTML viewer, e.g. mozilla])
|
||||
else
|
||||
AC_DEFINE_UNQUOTED(HTML_VIEWER, "htmlview", [HTML viewer, e.g. mozilla])
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(LEX, flex)
|
||||
AC_PATH_PROG(PYTHON, python)
|
||||
|
||||
|
|
|
@ -57,23 +57,24 @@ dissect_lpd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
/* This information comes from the LPRng HOWTO, which also describes
|
||||
RFC 1179. http://www.astart.com/lprng/LPRng-HOWTO.html */
|
||||
static char *lpd_client_code[] = {
|
||||
"Unknown command",
|
||||
"LPC: start print / jobcmd: abort",
|
||||
"LPR: transfer a printer job / jobcmd: receive control file",
|
||||
"LPQ: print short form of queue status / jobcmd: receive data file",
|
||||
"LPQ: print long form of queue status",
|
||||
"LPRM: remove jobs",
|
||||
"LPRng lpc: do control operation",
|
||||
"LPRng lpr: transfer a block format print job",
|
||||
"LPRng lpc: secure command transfer",
|
||||
"LPRng lpq: verbose status information"
|
||||
static value_string *lpd_client_code[] = {
|
||||
{ 1, "LPC: start print / jobcmd: abort" },
|
||||
{ 2, "LPR: transfer a printer job / jobcmd: receive control file" },
|
||||
{ 3, "LPQ: print short form of queue status / jobcmd: receive data file" },
|
||||
{ 4, "LPQ: print long form of queue status" },
|
||||
{ 5, "LPRM: remove jobs" },
|
||||
{ 6, "LPRng lpc: do control operation" },
|
||||
{ 7, "LPRng lpr: transfer a block format print job" },
|
||||
{ 8, "LPRng lpc: secure command transfer" },
|
||||
{ 9, "LPRng lpq: verbose status information" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
static char *lpd_server_code[] = {
|
||||
"Success: accepted, proceed",
|
||||
"Queue not accepting jobs",
|
||||
"Queue temporarily full, retry later",
|
||||
"Bad job format, do not retry"
|
||||
static value_string *lpd_server_code[] = {
|
||||
{ 0, "Success: accepted, proceed" },
|
||||
{ 1, "Queue not accepting jobs" },
|
||||
{ 2, "Queue temporarily full, retry later" },
|
||||
{ 3, "Bad job format, do not retry" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
||||
|
@ -95,7 +96,7 @@ dissect_lpd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
if (check_col(pinfo->cinfo, COL_INFO)) {
|
||||
if (lpr_packet_type == request) {
|
||||
col_set_str(pinfo->cinfo, COL_INFO, lpd_client_code[code]);
|
||||
col_set_str(pinfo->cinfo, COL_INFO, val_to_str(code, lpd_client_code, "Unknown client code: %u"));
|
||||
}
|
||||
else if (lpr_packet_type == response) {
|
||||
col_set_str(pinfo->cinfo, COL_INFO, "LPD response");
|
||||
|
@ -122,7 +123,7 @@ dissect_lpd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
if (code <= 9 && printer_len != -1) {
|
||||
proto_tree_add_text(lpd_tree, tvb, 0, 1,
|
||||
lpd_client_code[code]);
|
||||
val_to_str(code, lpd_client_code, "Unknown client code: %u"));
|
||||
proto_tree_add_text(lpd_tree, tvb, 1, printer_len,
|
||||
"Printer/options: %s",
|
||||
tvb_format_text(tvb, 1, printer_len));
|
||||
|
@ -134,7 +135,7 @@ dissect_lpd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
else if (lpr_packet_type == response) {
|
||||
if (code <= 3) {
|
||||
proto_tree_add_text(lpd_tree, tvb, 0, 1,
|
||||
"Response: %s", lpd_server_code[code]);
|
||||
"Response: %s", val_to_str(code, lpd_server_code, "Unknown server code: %u"));
|
||||
}
|
||||
else {
|
||||
call_dissector(data_handle,tvb, pinfo, lpd_tree);
|
||||
|
|
|
@ -1028,7 +1028,7 @@ init_prefs() {
|
|||
prefs.gui_fileopen_preview = 3;
|
||||
prefs.gui_ask_unsaved = TRUE;
|
||||
prefs.gui_find_wrap = TRUE;
|
||||
prefs.gui_webbrowser = g_strdup("mozilla %s");
|
||||
prefs.gui_webbrowser = g_strdup(HTML_VIEWER " %s");
|
||||
prefs.gui_window_title = g_strdup("");
|
||||
prefs.gui_layout_type = layout_type_5;
|
||||
prefs.gui_layout_content_1 = layout_pane_content_plist;
|
||||
|
|
Loading…
Reference in New Issue