cscg24-guacamole

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

download.h (2024B)


      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_DOWNLOAD_H
     21#define GUAC_RDP_DOWNLOAD_H
     22
     23#include "common/json.h"
     24
     25#include <guacamole/protocol.h>
     26#include <guacamole/stream.h>
     27#include <guacamole/user.h>
     28
     29#include <stdint.h>
     30
     31/**
     32 * The transfer status of a file being downloaded.
     33 */
     34typedef struct guac_rdp_download_status {
     35
     36    /**
     37     * The file ID of the file being downloaded.
     38     */
     39    int file_id;
     40
     41    /**
     42     * The current position within the file.
     43     */
     44    uint64_t offset;
     45
     46} guac_rdp_download_status;
     47
     48/**
     49 * Handler for acknowledgements of receipt of data related to file downloads.
     50 */
     51guac_user_ack_handler guac_rdp_download_ack_handler;
     52
     53/**
     54 * Handler for get messages. In context of downloads and the filesystem exposed
     55 * via the Guacamole protocol, get messages request the body of a file within
     56 * the filesystem.
     57 */
     58guac_user_get_handler guac_rdp_download_get_handler;
     59
     60/**
     61 * Callback for guac_client_for_user() and similar functions which initiates a
     62 * file download to a specific user if that user is still connected. The path
     63 * for the file to be downloaded must be passed as the arbitrary data parameter
     64 * for the function invoking this callback.
     65 */
     66guac_user_callback guac_rdp_download_to_user;
     67
     68#endif
     69