35 lines
807 B
C
35 lines
807 B
C
/**
|
|
* Copyright (c) 2025 Dominic Masters
|
|
*
|
|
* This software is released under the MIT License.
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#pragma once
|
|
#include "packetbase.h"
|
|
|
|
#define PACKET_WELCOME_STRING "DUSK"
|
|
#define PACKET_WELCOME_SIZE 4
|
|
|
|
typedef struct {
|
|
char_t dusk[PACKET_WELCOME_SIZE];
|
|
} packetwelcome_t;
|
|
|
|
/**
|
|
* Creates a welcome packet.
|
|
*
|
|
* @param packet Pointer to the packet structure to initialize.
|
|
*/
|
|
void packetWelcomeCreate(packet_t *packet);
|
|
|
|
/**
|
|
* Handles a welcome packet received FROM a server INTO a client.
|
|
*
|
|
* @param packet Pointer to the packet structure to handle.
|
|
* @param client Pointer to the client structure.
|
|
* @return ERROR_OK on success, or an error code on failure.
|
|
*/
|
|
errorret_t packetWelcomeClientProcess(
|
|
const packet_t *packet,
|
|
client_t *client
|
|
); |