File: packet_unimplemented.c

package info (click to toggle)
tinyssh 20250501-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,388 kB
  • sloc: ansic: 20,245; sh: 1,582; python: 1,449; makefile: 913
file content (27 lines) | stat: -rw-r--r-- 607 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
20150719
20241211 - reformated using clang-format
Jan Mojzis
Public domain.
*/

#include "buf.h"
#include "ssh.h"
#include "log.h"
#include "numtostr.h"
#include "packet.h"

int packet_unimplemented(struct buf *b) {

    char strnum[NUMTOSTR_LEN];

    /* note that b->buf[0] contains packetid */
    log_d3("packet=", numtostr(strnum, b->buf[0]),
           ", sending SSH_MSG_UNIMPLEMENTED message");

    buf_purge(b);
    buf_putnum8(b, SSH_MSG_UNIMPLEMENTED);   /* SSH_MSG_UNIMPLEMENTED */
    buf_putnum32(b, packet.receivepacketid); /* packeid */
    packet_put(b);
    return packet_sendall();
}