netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
rtmpqry.c File Reference
`#include <arpa/inet.h>`
`#include <sys/param.h>`
`#include <sys/socket.h>`
`#include <sys/time.h>`
`#include <netatalk/at.h>`
`#include <atalk/ddp.h>`
`#include <atalk/netddp.h>`
`#include <atalk/rtmp.h>`
`#include <atalk/util.h>`
`#include <inttypes.h>`
`#include <stdbool.h>`
`#include <stdint.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <unistd.h>`

## Functions
int | setup_ddp_socket (const struct at_addr *local_addr, struct at_addr **remote_addr)
| Set up a DDP socket ready for sending RTMP packets.
void | do_rtmp_rdr (int sockfd, const struct sockaddr_at *sa_remote, bool get_all, int secs_timeout)
| Send an RTMP Route Data Request (RDR) and wait for a reply.
void | print_rtmp_data_packet (const uint8_t *buf, size_t len)
void | do_rtmp_request (int sockfd, struct sockaddr_at *sa_remote)
| Send an RTMP Request and wait for a reply.
static void | usage (char *s)
int | main (int argc, char **argv)
const uint8_t * | print_rtmp_tuple (const uint8_t *buf, const uint8_t *cursor, size_t len, uint16_t router_net, uint8_t router_node)
| Print an RTMP tuple pointed to by 'cursor' within the buffer 'buf' with length 'len'.

## Function Documentation

## ◆ do_rtmp_rdr()

void do_rtmp_rdr | ( | int | sockfd,
|  | const struct sockaddr_at * | sa_remote,
|  | bool | get_all,
|  | int | secs_timeout )

Send an RTMP Route Data Request (RDR) and wait for a reply.

An RTMP RDR solicits RTMP data packets - generally, these are sent out broadcast on a timer, but one can specifically ask for them to be sent to a non-standard socket by means of an RDR. An RDR can also specify whether or not for the router to do split horizon processing (or whether to return all routes).

## ◆ do_rtmp_request()

void do_rtmp_request | ( | int | sockfd,
|  | struct sockaddr_at * | sa_remote )

Send an RTMP Request and wait for a reply.

An RTMP request just requests details of the network this node is connected to; in general, these aren't used on extended networks (instead, a ZIP GetNetInfo is used) but they should be supported anyway.

## ◆ main()

int main | ( | int | argc,
|  | char ** | argv )

## ◆ print_rtmp_data_packet()

void print_rtmp_data_packet | ( | const uint8_t * | buf,
|  | size_t | len )

## ◆ print_rtmp_tuple()

const uint8_t * print_rtmp_tuple | ( | const uint8_t * | buf,
|  | const uint8_t * | cursor,
|  | size_t | len,
|  | uint16_t | router_net,
|  | uint8_t | router_node )

Print an RTMP tuple pointed to by 'cursor' within the buffer 'buf' with length 'len'.

Returns
  the next value of 'cursor' or NULL if no more tuples exist.

## ◆ setup_ddp_socket()

int setup_ddp_socket | ( | const struct at_addr * | local_addr,
|  | struct at_addr ** | remote_addr )

Set up a DDP socket ready for sending RTMP packets.

The remote_addr is a pointer to a pointer so that if it's null we can fill it in with the address the kernel provides, as we do in libatalk/nbp/nbp_lkup.c for example.

## ◆ usage()

void usage | ( | char * | s | ) |
| static