12#ifndef SYNPROTO_TIMEOUT_MS
14# define SYNPROTO_TIMEOUT_MS 5000
18# define swap_32( num ) (num)
19# define swap_16( num ) (num)
25#define swap_32( num ) ((((num)>>24)&0xff) | (((num)<<8)&0xff0000) | (((num)>>8)&0xff00) | (((num)<<24)&0xff000000))
30#define swap_16( num ) (((num)>>8) | ((num)<<8))
39#define synproto_exval_32( buffer, offset ) \
40 (swap_32( *((uint32_t*)&(buffer[offset])) ))
47#define synproto_exval_16( buffer, offset ) \
48 (swap_16( *((uint16_t*)&(buffer[offset])) ))
50#define synproto_exval_8( buffer, offset ) (buffer[offset])
74 char* buf,
size_t buf_sz,
const char* fmt, va_list vargs );
85uint32_t
synproto_send(
int sockfd, uint8_t force_sz,
const char* fmt, ... );
94 struct NETIO_CFG* config,
const char* pkt_buf, uint32_t pkt_buf_sz );
96void synproto_reset_calv_deadline(
struct NETIO_CFG* config );
uint32_t synproto_send(int sockfd, uint8_t force_sz, const char *fmt,...)
Send a formatted string to the Synergy server with tokens as specified for synproto_vprintf().
int synproto_parse_and_reply(struct NETIO_CFG *config, const char *pkt_buf, uint32_t pkt_buf_sz)
Given a buffer with a string from the Synergy server, parse it and respond or simulate OS activity as...
size_t synproto_vprintf(char *buf, size_t buf_sz, const char *fmt, va_list vargs)
Given a format string and tokens, write those tokens into a buffer using specific tokens listed here.
void synproto_dump(const char *buf, size_t buf_sz)
Given a buffer with a string from the Synergy server, dump it into a more human-readable form.