summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--opacket.c24
-rw-r--r--opacket.h9
2 files changed, 29 insertions, 4 deletions
diff --git a/opacket.c b/opacket.c
index dd443c331..5eae633b6 100644
--- a/opacket.c
+++ b/opacket.c
@@ -319,3 +319,27 @@ packet_read_expect(int expected_type)
319 if ((r = ssh_packet_read_expect(active_state, expected_type)) != 0) 319 if ((r = ssh_packet_read_expect(active_state, expected_type)) != 0)
320 sshpkt_fatal(active_state, __func__, r); 320 sshpkt_fatal(active_state, __func__, r);
321} 321}
322
323void
324packet_disconnect(const char *fmt, ...)
325{
326 char buf[1024];
327 va_list args;
328
329 va_start(args, fmt);
330 vsnprintf(buf, sizeof(buf), fmt, args);
331 va_end(args);
332 ssh_packet_disconnect(active_state, "%s", buf);
333}
334
335void
336packet_send_debug(const char *fmt, ...)
337{
338 char buf[1024];
339 va_list args;
340
341 va_start(args, fmt);
342 vsnprintf(buf, sizeof(buf), fmt, args);
343 va_end(args);
344 ssh_packet_send_debug(active_state, "%s", buf);
345}
diff --git a/opacket.h b/opacket.h
index 16fcb9e28..a0a60e550 100644
--- a/opacket.h
+++ b/opacket.h
@@ -102,10 +102,11 @@ void packet_read_expect(int expected_type);
102 ssh_packet_get_string_ptr(active_state, (length_ptr)) 102 ssh_packet_get_string_ptr(active_state, (length_ptr))
103#define packet_get_cstring(length_ptr) \ 103#define packet_get_cstring(length_ptr) \
104 ssh_packet_get_cstring(active_state, (length_ptr)) 104 ssh_packet_get_cstring(active_state, (length_ptr))
105#define packet_send_debug(fmt, args...) \ 105void packet_send_debug(const char *, ...)
106 ssh_packet_send_debug(active_state, (fmt), ##args) 106 __attribute__((format(printf, 1, 2)));
107#define packet_disconnect(fmt, args...) \ 107void packet_disconnect(const char *, ...)
108 ssh_packet_disconnect(active_state, (fmt), ##args) 108 __attribute__((format(printf, 1, 2)))
109 __attribute__((noreturn));
109#define packet_have_data_to_write() \ 110#define packet_have_data_to_write() \
110 ssh_packet_have_data_to_write(active_state) 111 ssh_packet_have_data_to_write(active_state)
111#define packet_not_very_much_data_to_write() \ 112#define packet_not_very_much_data_to_write() \