• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/OpenSSH-189/openssh/

Lines Matching defs:packet

1 /* $OpenBSD: packet.c,v 1.182 2013/04/11 02:27:50 djm Exp $ */
6 * This file contains code implementing the packet protocol and communication
16 * SSH2 packet format added by Markus Friedl.
64 #include "packet.h"
97 struct packet {
98 TAILQ_ENTRY(packet) next;
128 /* Buffer for the partial outgoing packet being constructed. */
131 /* Buffer for the incoming packet currently being processed. */
134 /* Scratch buffer for packet compression/decompression. */
139 * Flag indicating whether packet compression/decompression is
144 /* default maximum packet size */
161 /* The maximum time that we will wait to send or receive a packet */
194 TAILQ_HEAD(, packet) outgoing;
515 * Starts packet compression from the next packet on in both directions.
573 /* Start constructing a packet to send. */
648 * Finalizes and sends the packet. If the encryption key has been set,
649 * encrypts the packet before sending.
661 * If using packet compression, compress the payload of the outgoing
662 * packet.
678 /* Compute packet length without padding (add checksum, remove padding). */
724 * Note that the packet is now only buffered in output. It won't be
842 * Finalize packet in SSH2 format (compress, mac, encrypt, enqueue)
898 len -= aadlen; /* packet length is not encrypted for EtM modes */
935 /* compute MAC over seqnr and packet(length fields, payload, padding) */
941 /* encrypt packet and append to output buffer. */
980 struct packet *p;
992 debug("enqueue packet: %u", type);
1014 debug("dequeue packet: %u", type);
1036 * Waits until a packet has been received, and returns its type. Note that
1057 /* Stay in the loop until we have received a complete packet. */
1059 /* Try to read a packet from the buffer. */
1067 /* If we got a packet, return it. */
1134 * Waits until a packet has been received, verifies that its type matches
1145 packet_disconnect("Protocol error: expected packet type %d, got %d",
1149 /* Checks if a full packet is available in the data received so far via
1150 * packet_process_incoming. If so, reads the packet; otherwise returns
1165 /* Check if input size is less than minimum packet size. */
1168 /* Get length of incoming packet. */
1172 packet_disconnect("Bad packet length %u.", len);
1175 /* Check if the packet has been entirely received. */
1179 /* The entire packet is in buffer. */
1181 /* Consume packet length. */
1214 /* Compute packet checksum. */
1245 packet_disconnect("Invalid ssh1 packet type: %d", type);
1284 logit("Bad packet length %u.", active_state->packlen);
1291 * decrypt first block and extract length of incoming packet
1307 logit("Bad packet length %u.", active_state->packlen);
1314 DBG(debug("input: packet len %u", active_state->packlen+4));
1321 * have a partial packet of block_size bytes
1325 DBG(debug("partial packet: block %d, need %d, maclen %d, authlen %d,"
1335 * check if the entire packet has been received and
1357 * compute MAC over seqnr and packet,
1358 * increment sequence number for incoming packet
1396 /* skip packet size + padlen, discard padding */
1414 * get packet type, implies consume.
1419 packet_disconnect("Invalid ssh2 packet type: %d", type);
1429 /* reset for next packet */
1446 DBG(debug("received packet type %d", type));
1498 DBG(debug("received packet type %d", type));
1523 /* Returns a character from the packet. */
1534 /* Returns an integer from the packet data. */
1542 /* Returns an 64 bit integer from the packet data. */
1551 * Returns an arbitrary precision integer from the packet data. The integer
1592 * Returns a string from the packet data. The string is allocated using
1653 * Logs the error plus constructs and sends a disconnect packet, closes the