Packages

Simple echo server for testing SSH clients

Current section

Files

Jump to
ssh_echo lib ssh_channel.ex
Raw

lib/ssh_channel.ex

defmodule SSHChannel do
@moduledoc """
A macro wrapping `:ssh_channel` erlang behaviour with a default implementation.
"""
defmacro __using__(_opts) do
quote do
@behaviour :ssh_channel
def init(_), do: {:ok, nil}
def handle_ssh_msg(_, state), do: {:ok, state}
def handle_msg(_, state), do: {:ok, state}
def terminate(_, _), do: :ok
def code_change(_, state, _), do: {:ok, state}
def handle_call(_, _, state), do: {:reply, :ok, state}
def handle_cast(_, state), do: {:noreply, state}
defoverridable :ssh_channel
end
end
end