Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

derive xinetd protocol from socket_type when not defined in the config file #1448

Merged
merged 1 commit into from
Feb 1, 2017

Conversation

alexpop
Copy link
Contributor

@alexpop alexpop commented Feb 1, 2017

SocketType will sometimes implicitly indicate which ProtocolType will be used within an AddressFamily. For example when the SocketType is Dgram, the ProtocolType is always Udp.When the SocketType is Stream, the ProtocolType is always Tcp.

https://msdn.microsoft.com/en-us/library/system.net.sockets.sockettype(v=vs.110).aspx

From my research, the most common socket_type values are stream(TCP) and dgram(UDP). There's no implicit protocol for raw and seqpacket.

@alexpop alexpop self-assigned this Feb 1, 2017
@alexpop alexpop force-pushed the ap/implicit-protocols branch from 8c1f8e4 to b46d9df Compare February 1, 2017 11:18
@alexpop alexpop changed the title derive protocol from socket_type when no defined in the config file derive xinetd protocol from socket_type when not defined in the config file Feb 1, 2017
…g file

Signed-off-by: Alex Pop <apop@chef.io>
@alexpop alexpop force-pushed the ap/implicit-protocols branch from b46d9df to 495185b Compare February 1, 2017 11:19
it 'params has only the protocols parsed from the config files' do
one = resource.params['services']['chargen'].map{|x| x.params['protocol']}
# in this example(CentOS), protocol is not defined in the config
_(one).must_equal [nil, nil]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this separation! Thank you @alexpop

@chris-rock chris-rock merged commit 17c1c88 into master Feb 1, 2017
@chris-rock chris-rock deleted the ap/implicit-protocols branch February 1, 2017 12:47
@arlimus arlimus added the Type: Enhancement Improves an existing feature label Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Improves an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants