Point-to-Point Tunneling Protocol Requirements: From client send the first message and in reply, the server sends the second message. The client, on receiving the response, should print the vendor name returned by the server. Accept from the user as command line argument how many times the client should send messages to the server and the server IP address. Start-Control-Connection-Request -- From client to server --------------------------------------------------------- 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Length | PPTP Message Type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Magic Cookie | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Control Message Type | Reserved0 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Protocol Version | Reserved1 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Framing Capabilities | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Bearer Capabilities | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + Host Name (64 octets) + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + Vendor String (64 octets) + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Length Total length in octets of this PPTP message, including the entire PPTP header. PPTP Message Type 1 for Control Message. Magic Cookie 0x1A2B3C4D. This constant value is used as a sanity check on received messages. Control Message Type 1 for Start-Control-Connection-Request. Reserved0 This field MUST be 0. Protocol Version The version of the PPTP protocol that the sender wishes to use. Reserved1 This field MUST be 0. Framing Capabilities A set of bits indicating the type of framing that the sender of this message can provide. The currently defined bit settings are: 1 - Asynchronous Framing supported 2 - Synchronous Framing supported Bearer Capabilities A set of bits indicating the bearer capabilities that the sender of this message can provide. The currently defined bit settings are: 1 - Analog access supported 2 - Digital access supported NOTE: accept from the user the above two values - asynchronous/synchronous and analog/digital and use them in these fields. Host Name A 64 octet field containing the DNS name of the client. If less than 64 octets in length, the remainder of this field SHOULD be filled with octets of value 0. Vendor Name A 64 octet field containing a vendor name accepted from the user. NOTE: Accept this name from the user in the client. Start-Control-Connection-Reply -- from server to client ------------------------------------------------------- 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Length | PPTP Message Type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Magic Cookie | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Control Message Type | Reserved0 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Protocol Version | Result Code | Error Code | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Framing Capability | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Bearer Capability | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + Host Name (64 octets) + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + Vendor String (64 octets) + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Length Total length in octets of this PPTP message, including the entire PPTP header. PPTP Message Type 1 for Control Message. Magic Cookie 0x1A2B3C4D. Control Message Type 2 for Start-Control-Connection-Reply. Reserved0 This field MUST be 0. Protocol Version The version of the PPTP protocol that the sender wishes to use. Result Code Indicates the result of the command channel establishment attempt. Current valid Result Code values are: 1 - Successful channel establishment 2 - General error -- Error Code indicates the problem 3 - Command channel already exists; 4 - Requester is not authorized to establish a command channel 5 - The protocol version of the requester is not supported Error Code This field is set to 0 unless a "General Error" exists, in which case Result Code is set to 2 and this field is set to the value corresponding to the general error condition as specified in section 2.2. Framing Capabilities A set of bits indicating the type of framing that the sender of this message can provide. The currently defined bit settings are: 1 - Asynchronous Framing supported 2 - Synchronous Framing supported. Bearer Capabilities A set of bits indicating the bearer capabilities that the sender of this message can provide. The currently defined bit settings are: 1 - Analog access supported 2 - Digital access supported NOTE: On the server side, accept these as command line arguments and form your bit pattern based on whether one or both are supported for both framing and bearer. Host Name A 64 octet field containing the DNS name of server. If less than 64 octets in length, the remainder of this field SHOULD be filled with octets of value 0. Vendor Name Copied from the message received from the client. Group 7: Implement as a UDP server with select Group 8: Implement as an iterative TCP server with select Group 9: Implement as a concurrent TCP server with processes