Home Units Hierarchy Routines All identifiers

Unit unaVC_socks

DescriptionUsesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

Contains socket pipes to be used in Delphi/C++Builder IDE.

IP components:

Version 2.5.2008.02 Split from unaVCIDE.pas unit

Version 2.5.2012.02 STUN C/S and DNS C

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
packed record tunavclInOutIpPipeSwapBuf Internal structure for byte order swapping.
Class unavclDNSClient DNS Client
packed record unavclInOutIPPacket Packet record.
Class unavclInOutIpPipe Base abstract class for TCP/IP stream pipes.
Class unavclIPBroadcastClient Receives audio stream being broadcasted by server component over LAN.
packed record unavclIPBroadcastPacketSelector  
packed record unavclIPBroadcastPacketUnion  
Class unavclIPBroadcastPipe Implements basic broadcast pipe.
Class unavclIPBroadcastServer Broadcasts audio stream over LAN using the broadcast destination IP address and UDP sockets.
Class unavclIPClient IP Client: connects to remote server, sends and receives audio stream over TCP/IP network.
Class unavclIPServer IP Server: initiates listening socket for clients to connect to.
Class unavclSTUNBase STUN Base
Class unavclSTUNClient STUN Client
Class unavclSTUNServer STUN Server

Types

punavclInOutIPPacket = ˆunavclInOutIPPacket;
tunavclProtoType = (...);
tunavclStreamingMode = (...);
tunaSendResult = (...);
tunavclTextDataEvent = procedure (sender: tObject; connId: tConID; const data: string) of object;
tunavclUserDataEvent = procedure (sender: tObject; connId: tConID; data: pointer; len: uint) of object;
tunavclPacketEvent = procedure (sender: tObject; connId: tConID; cmd: uint; data: pointer; len: uint) of object;
tunavclSocketEvent = procedure (sender: tObject; connId: tConID; event: unaSocketEvent; data: pointer; len: uint) of object;
tunavclStreamByteOrder = (...);
tunavclConnectEvent = procedure (sender: tObject; connId: tConID; connected: bool) of object;
unaIpServerConferenceMode = (...);
tunavclAcceptClient = procedure (sender: tObject; connId: tConID; var accept: bool) of object;
punavclIPBroadcastPacketUnion = ˆunavclIPBroadcastPacketUnion;
punavclIPBroadcastPacketSelector = ˆunavclIPBroadcastPacketSelector;
unaSTUNCLientResponseEvent = procedure(sender: tObject; error: int32; mappedIP: uint32; mappedPort, boundPort: uint16) of object;

Constants

cmd_inOutIPPacket_audio = $20;
cmd_inOutIPPacket_audioIndexed = $2A;
cmd_inOutIPPacket_bye = $02;
cmd_inOutIPPacket_byeIndexed = $29;
cmd_inOutIPPacket_formatAudio = $10;
cmd_inOutIPPacket_formatAudioIndexed = $2E;
cmd_inOutIPPacket_formatVideo = $11;
cmd_inOutIPPacket_formatVideoIndexed = $2F;
cmd_inOutIPPacket_hello = $01;
cmd_inOutIPPacket_needFormat = $04;
cmd_inOutIPPacket_outOfSeats = $03;
cmd_inOutIPPacket_text = $22;
cmd_inOutIPPacket_textIndexed = $2C;
cmd_inOutIPPacket_userData = $23;
cmd_inOutIPPacket_userDataIndexed = $2D;
cmd_inOutIPPacket_video = $21;
cmd_inOutIPPacket_videoIndexed = $2B;
c_umaMaxOutpackets = 4096;
c_unaIPServer_co_default = c_unaIPServer_co_inbound or c_unaIPServer_co_outbound;
c_unaIPServer_co_inbound = $00000001;
c_unaIPServer_co_invalid = $80000000;
c_unaIPServer_co_outbound = $00000002;
unavcl_defaultBroadcastPort = 17380;
unavcl_packet_selector00_format = $00;
unavcl_packet_selector00_formatChanges_mask = $1;
unavcl_packet_selector00_formatChanges_shift = 5;
unavcl_packet_selector00_formatIndex_mask = $3;
unavcl_packet_selector00_formatIndex_shift = 0;
unavcl_packet_selector00_formatReserved_mask = $7;
unavcl_packet_selector00_formatReserved_shift = 2;
unavcl_packet_selector01_data = $01;
unavcl_packet_selector01_high6bitsSize_mask = $3F;
unavcl_packet_selector01_high6bitsSize_shift = 0;
unavcl_packet_selector10_high6bitsSync_mask = $3F;
unavcl_packet_selector10_high6bitsSync_shift = 0;
unavcl_packet_selector10_sync = $02;
unavcl_packet_selector11_custom = $03;
unavcl_packet_selector11_customReserved_mask = $1;
unavcl_packet_selector11_customReserved_shift = 5;
unavcl_packet_selector11_customValue_mask = $1F;
unavcl_packet_selector11_customValue_res000 = $0;
unavcl_packet_selector11_customValue_res011 = $3;
unavcl_packet_selector11_customValue_res100 = $4;
unavcl_packet_selector11_customValue_res101 = $5;
unavcl_packet_selector11_customValue_res110 = $6;
unavcl_packet_selector11_customValue_res111 = $7;
unavcl_packet_selector11_customValue_shift = 0;
unavcl_packet_selector11_customValue_text = $1;
unavcl_packet_selector11_customValue_videoFormat = $2;
unavcl_packet_selector_mask = $03;
unavcl_packet_selector_shift = 6;
unavcl_union01_channelFormatIndex_mask = $3;
unavcl_union01_channelFormatIndex_shift = 2;
unavcl_union01_channelMedia_audio = $0;
unavcl_union01_channelMedia_mask = $1;
unavcl_union01_channelMedia_newChunkFlag = $2;
unavcl_union01_channelMedia_shift = 0;
unavcl_union01_channelMedia_video = $1;
unavcl_union01_channelSeqNum_mask = $F;
unavcl_union01_channelSeqNum_shift = 4;

Description

Types

punavclInOutIPPacket = ˆunavclInOutIPPacket;

Pointer to a packet

tunavclProtoType = (...);

Sockets proto. Could be UDP or TCP.

Values
  • unapt_TCP:  
  • unapt_UDP:  
tunavclStreamingMode = (...);

Streaming mode. Could be VC compatible or RAW.

Values
  • unasm_VC:  
  • unasm_RAW:  
tunaSendResult = (...);

Result of send operation. OK or fail.

Values
  • unasr_OK:  
  • unasr_fail:  
tunavclTextDataEvent = procedure (sender: tObject; connId: tConID; const data: string) of object;

OnText event

tunavclUserDataEvent = procedure (sender: tObject; connId: tConID; data: pointer; len: uint) of object;

OnUserData event

tunavclPacketEvent = procedure (sender: tObject; connId: tConID; cmd: uint; data: pointer; len: uint) of object;

OnPacket event

tunavclSocketEvent = procedure (sender: tObject; connId: tConID; event: unaSocketEvent; data: pointer; len: uint) of object;

OnSocketEvent event

tunavclStreamByteOrder = (...);

http://lakeofsoft.com/vcx/automatic-byte-order-detection.html for RAW streaming.

  • (unasbo_dontCare - byte order not changed)

  • (unasbo_swap - low and high bytes are always swapped)

  • (unasbo_autoDetectOnce - byte order is detected once)

  • (unasbo_autoDetectCont - byte order is detected continuously)

Values
  • unasbo_dontCare:  
  • unasbo_swap:  
  • unasbo_autoDetectOnce:  
  • unasbo_autoDetectCont:  
tunavclConnectEvent = procedure (sender: tObject; connId: tConID; connected: bool) of object;
 
unaIpServerConferenceMode = (...);

– conference mode for IPServer –

Values
  • uipscm_oneToMany:  
tunavclAcceptClient = procedure (sender: tObject; connId: tConID; var accept: bool) of object;

vc25pro more to come – –

punavclIPBroadcastPacketUnion = ˆunavclIPBroadcastPacketUnion;

Broadcast packet format.

NOTE: If you add something here, do not forget to change the calcPacketRawSize() routine!

punavclIPBroadcastPacketSelector = ˆunavclIPBroadcastPacketSelector;

– unavclIPBroadcastPacketSelector –

unaSTUNCLientResponseEvent = procedure(sender: tObject; error: int32; mappedIP: uint32; mappedPort, boundPort: uint16) of object;

Parameters
sender
object instance
error
error code, or 200 if no error

Constants

cmd_inOutIPPacket_audio = $20;
 
cmd_inOutIPPacket_audioIndexed = $2A;
 
cmd_inOutIPPacket_bye = $02;
 
cmd_inOutIPPacket_byeIndexed = $29;
 
cmd_inOutIPPacket_formatAudio = $10;
 
cmd_inOutIPPacket_formatAudioIndexed = $2E;
 
cmd_inOutIPPacket_formatVideo = $11;
 
cmd_inOutIPPacket_formatVideoIndexed = $2F;
 
cmd_inOutIPPacket_hello = $01;

——————— – IP components – ——————— Hello command

cmd_inOutIPPacket_needFormat = $04;
 
cmd_inOutIPPacket_outOfSeats = $03;
 
cmd_inOutIPPacket_text = $22;
 
cmd_inOutIPPacket_textIndexed = $2C;
 
cmd_inOutIPPacket_userData = $23;
 
cmd_inOutIPPacket_userDataIndexed = $2D;
 
cmd_inOutIPPacket_video = $21;
 
cmd_inOutIPPacket_videoIndexed = $2B;
 
c_umaMaxOutpackets = 4096;
 
c_unaIPServer_co_default = c_unaIPServer_co_inbound or c_unaIPServer_co_outbound;

default flags (both inbound and outbound are enabled)

c_unaIPServer_co_inbound = $00000001;

client options for IP server accept inbound data from this client

c_unaIPServer_co_invalid = $80000000;
 
c_unaIPServer_co_outbound = $00000002;

send outbound data to this client

unavcl_defaultBroadcastPort = 17380;
 
unavcl_packet_selector00_format = $00;

– selector fields –

unavcl_packet_selector00_formatChanges_mask = $1;
 
unavcl_packet_selector00_formatChanges_shift = 5;
 
unavcl_packet_selector00_formatIndex_mask = $3;
 
unavcl_packet_selector00_formatIndex_shift = 0;
 
unavcl_packet_selector00_formatReserved_mask = $7;
 
unavcl_packet_selector00_formatReserved_shift = 2;
 
unavcl_packet_selector01_data = $01;
 
unavcl_packet_selector01_high6bitsSize_mask = $3F;
 
unavcl_packet_selector01_high6bitsSize_shift = 0;
 
unavcl_packet_selector10_high6bitsSync_mask = $3F;
 
unavcl_packet_selector10_high6bitsSync_shift = 0;
 
unavcl_packet_selector10_sync = $02;
 
unavcl_packet_selector11_custom = $03;
 
unavcl_packet_selector11_customReserved_mask = $1;
 
unavcl_packet_selector11_customReserved_shift = 5;
 
unavcl_packet_selector11_customValue_mask = $1F;
 
unavcl_packet_selector11_customValue_res000 = $0;
 
unavcl_packet_selector11_customValue_res011 = $3;
 
unavcl_packet_selector11_customValue_res100 = $4;
 
unavcl_packet_selector11_customValue_res101 = $5;
 
unavcl_packet_selector11_customValue_res110 = $6;
 
unavcl_packet_selector11_customValue_res111 = $7;
 
unavcl_packet_selector11_customValue_shift = 0;
 
unavcl_packet_selector11_customValue_text = $1;
 
unavcl_packet_selector11_customValue_videoFormat = $2;
 
unavcl_packet_selector_mask = $03;
 
unavcl_packet_selector_shift = 6;
 
unavcl_union01_channelFormatIndex_mask = $3;
 
unavcl_union01_channelFormatIndex_shift = 2;
 
unavcl_union01_channelMedia_audio = $0;

======= BROADCAST ====== – union fields –

unavcl_union01_channelMedia_mask = $1;
 
unavcl_union01_channelMedia_newChunkFlag = $2;
 
unavcl_union01_channelMedia_shift = 0;
 
unavcl_union01_channelMedia_video = $1;
 
unavcl_union01_channelSeqNum_mask = $F;
 
unavcl_union01_channelSeqNum_shift = 4;
 

Author

(c) 2012 Lake of Soft


Generated by PasDoc 0.12.1 on 2012-10-09