Page MenuHomeFreeBSD

Add new casper socket service
Needs ReviewPublic

Authored by tig_freebsdfoundation.org on Apr 16 2020, 3:24 PM.
Referenced Files
F86826195: D24442.id70854.diff
Wed, Jun 26, 4:19 AM
Unknown Object (File)
Sun, Jun 23, 2:00 AM
Unknown Object (File)
Fri, Jun 21, 12:28 AM
Unknown Object (File)
Thu, Jun 20, 1:08 PM
Unknown Object (File)
Thu, Jun 20, 6:59 AM
Unknown Object (File)
Thu, Jun 20, 5:34 AM
Unknown Object (File)
Thu, Jun 20, 5:06 AM
Unknown Object (File)
May 4 2024, 12:12 PM
Subscribers

Details

Reviewers
emaste
markj
Summary

Casper service to provide a connected socket

  • lets user initialize allowed destinations in cap_socket_init(). destinations are of type "socket_type:hostname:portnumber" eg. "tcp:www.google.com:80" Hostname is mandatory while socket type and port number have sentinel value to allow any. eg. "any:127.0.0.1:-1" allows any connection to localhost
  • cap_socket_connect() attempts to connect to destination provided if it's allowed. From what I've been seeing the user should pass a full destination. eg. "tcp:www.google.com:80" passing "any" or "-1" might cause socket() or connect() to fail.
Test Plan


currently tested using a simple client and server on localhost.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped