cscg24-guacamole

CSCG 2024 Challenge 'Guacamole Mashup'
git clone https://git.sinitax.com/sinitax/cscg24-guacamole
Log | Files | Refs | sfeed.txt

rdpdr-messages.h (5457B)


      1/*
      2 * Licensed to the Apache Software Foundation (ASF) under one
      3 * or more contributor license agreements.  See the NOTICE file
      4 * distributed with this work for additional information
      5 * regarding copyright ownership.  The ASF licenses this file
      6 * to you under the Apache License, Version 2.0 (the
      7 * "License"); you may not use this file except in compliance
      8 * with the License.  You may obtain a copy of the License at
      9 *
     10 *   http://www.apache.org/licenses/LICENSE-2.0
     11 *
     12 * Unless required by applicable law or agreed to in writing,
     13 * software distributed under the License is distributed on an
     14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     15 * KIND, either express or implied.  See the License for the
     16 * specific language governing permissions and limitations
     17 * under the License.
     18 */
     19
     20#ifndef GUAC_RDP_CHANNELS_RDPDR_MESSAGES_H
     21#define GUAC_RDP_CHANNELS_RDPDR_MESSAGES_H
     22
     23#include "channels/common-svc.h"
     24#include "channels/rdpdr/rdpdr.h"
     25
     26#include <winpr/stream.h>
     27
     28#include <stdint.h>
     29
     30/**
     31 * A 32-bit arbitrary value for the osType field of certain requests. As this
     32 * value is defined as completely arbitrary and required to be ignored by the
     33 * server, we send "GUAC" as an integer.
     34 */
     35#define GUAC_OS_TYPE (*((uint32_t*) "GUAC"))
     36
     37/**
     38 * Handler which processes a message specific to the RDPDR channel.
     39 *
     40 * @param svc
     41 *     The guac_rdp_common_svc representing the static virtual channel being
     42 *     used for RDPDR.
     43 *
     44 * @param input_stream
     45 *     A wStream containing the entire received message.
     46 */
     47typedef void guac_rdpdr_message_handler(guac_rdp_common_svc* svc,
     48        wStream* input_stream);
     49
     50/**
     51 * Handler which processes a received Server Announce Request message. The
     52 * Server Announce Request message begins the RDPDR exchange and provides a
     53 * client ID which the RDPDR client may use. The client may also supply its
     54 * own, randomly-generated ID, and is required to do so for older versions of
     55 * RDPDR. See:
     56 *
     57 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpefs/046047aa-62d8-49f9-bf16-7fe41880aaf4
     58 */
     59guac_rdpdr_message_handler guac_rdpdr_process_server_announce;
     60
     61/**
     62 * Handler which processes a received Server Client ID Confirm message. The
     63 * Server Client ID Confirm message is sent by the server to confirm the client
     64 * ID requested by the client (in its response to the Server Announce Request)
     65 * has been accepted. See:
     66 *
     67 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpefs/bbbb9666-6994-4cf6-8e65-0d46eb319c6e
     68 */
     69guac_rdpdr_message_handler guac_rdpdr_process_clientid_confirm;
     70
     71/**
     72 * Handler which processes a received Server Device Announce Response message.
     73 * The Server Device Announce Response message is sent in response to a Client
     74 * Device List Announce message to communicate the success/failure status of
     75 * device creation. See:
     76 *
     77 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpefs/a4c0b619-6e87-4721-bdc4-5d2db7f485f3
     78 */
     79guac_rdpdr_message_handler guac_rdpdr_process_device_reply;
     80
     81/**
     82 * Handler which processes a received Device I/O Request message. The Device
     83 * I/O Request message makes up the majority of traffic once RDPDR is
     84 * established. Each I/O request consists of a device-specific major/minor
     85 * function number pair, as well as several parameters. Device-specific
     86 * handling of I/O requests within Guacamole is delegated to device- and
     87 * function-specific implementations of yet another function type:
     88 * guac_rdpdr_device_iorequest_handler.
     89 *
     90 * See:
     91 *
     92 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpefs/a087ffa8-d0d5-4874-ac7b-0494f63e2d5d
     93 */
     94guac_rdpdr_message_handler guac_rdpdr_process_device_iorequest;
     95
     96/**
     97 * Handler which processes a received Server Core Capability Request message.
     98 * The Server Core Capability Request message is sent by the server to
     99 * communicate its capabilities and to request that the client communicate the
    100 * same. See:
    101 *
    102 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpefs/702789c3-b924-4bc2-9280-3221bc7d6797
    103 */
    104guac_rdpdr_message_handler guac_rdpdr_process_server_capability;
    105
    106/**
    107 * Handler which processes a received Server User Logged On message. The Server
    108 * User Logged On message is sent by the server to notify that the user has
    109 * logged on to the session. See:
    110 *
    111 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpefs/dfc0e8ed-a242-4d00-bb88-e779e08f2f61
    112 */
    113guac_rdpdr_message_handler guac_rdpdr_process_user_loggedon;
    114
    115/**
    116 * Handler which processes any one of several RDPDR messages specific to cached
    117 * printer configuration data, each of these messages having the same
    118 * PAKID_PRN_CACHE_DATA packet ID. The Guacamole RDPDR implementation ignores
    119 * all PAKID_PRN_CACHE_DATA messages. See:
    120 *
    121 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpepc/7fccae60-f077-433b-9dee-9bad4238bf40
    122 */
    123guac_rdpdr_message_handler guac_rdpdr_process_prn_cache_data;
    124
    125/**
    126 * Handler which processes a received Server Printer Set XPS Mode message. The
    127 * Server Printer Set XPS Mode message is specific to printers and requests
    128 * that the client printer be set to XPS mode. The Guacamole RDPDR
    129 * implementation ignores any request to set the printer to XPS mode. See:
    130 *
    131 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpepc/f1789a66-bcd0-4df3-bfc2-6e7330d63145
    132 */
    133guac_rdpdr_message_handler guac_rdpdr_process_prn_using_xps;
    134
    135#endif
    136