File: default_description.c

package info (click to toggle)
putty 0.78-2%2Bdeb12u2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 13,964 kB
  • sloc: ansic: 137,777; python: 7,775; perl: 1,798; makefile: 133; sh: 111
file content (22 lines) | stat: -rw-r--r-- 794 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
/*
 * Construct a description string for a backend to use as
 * backend_description(), or a plug as plug_description().
 *
 * For some backends this will be overridden: e.g. SSH prefers to
 * think in terms of _logical_ host names (i.e. the one associated
 * with the host key) rather than the physical details of where you're
 * connecting to. But this default is good for simpler backends.
 */

#include "putty.h"

char *default_description(const BackendVtable *backvt,
                          const char *host, int port)
{
    const char *be_name = backvt->displayname_lc;

    if (backvt->default_port && port == backvt->default_port)
        return dupprintf("%s connection to %s", be_name, host);
    else
        return dupprintf("%s connection to %s port %d", be_name, host, port);
}