summaryrefslogtreecommitdiff
path: root/src/options.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2012-06-13 10:25:18 +0200
committerMartin Sustrik <sustrik@250bpm.com>2012-06-13 10:25:18 +0200
commit0a2f88984a4543aa69c15d8d8639180816857a6b (patch)
tree759f4d025d4cb95e010081839197045a7fde9826 /src/options.cpp
parentb018208d5901873a374d08a98cf31e3bb89d12d0 (diff)
Revert "Implement SP wire protocol"
This reverts commit a34ea4d80609395150742259fd8c9caa4409e961.
Diffstat (limited to 'src/options.cpp')
-rw-r--r--src/options.cpp42
1 files changed, 14 insertions, 28 deletions
diff --git a/src/options.cpp b/src/options.cpp
index 26fa62c..62c03a2 100644
--- a/src/options.cpp
+++ b/src/options.cpp
@@ -48,12 +48,7 @@ xs::options_t::options_t () :
sndtimeo (-1),
ipv4only (1),
keepalive (0),
- legacy_protocol (false),
- sp_service (0),
- sp_pattern (-1),
- sp_version (-1),
- sp_role (-1),
- sp_complement (-1),
+ protocol (0),
filter (XS_FILTER_PREFIX),
survey_timeout (-1),
delay_on_close (true),
@@ -241,29 +236,29 @@ int xs::options_t::setsockopt (int option_, const void *optval_,
return 0;
}
- case XS_FILTER:
- if (optvallen_ != sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- filter = *((int*) optval_);
- return 0;
-
- case XS_SERVICE_ID:
+ case XS_PROTOCOL:
{
if (optvallen_ != sizeof (int)) {
errno = EINVAL;
return -1;
}
int val = *((int*) optval_);
- if (val < 0 || val > 0xffff) {
+ if (val < 0) {
errno = EINVAL;
return -1;
}
- sp_service = val;
+ protocol = val;
return 0;
}
+ case XS_FILTER:
+ if (optvallen_ != sizeof (int)) {
+ errno = EINVAL;
+ return -1;
+ }
+ filter = *((int*) optval_);
+ return 0;
+
case XS_SURVEY_TIMEOUT:
if (type != XS_SURVEYOR) {
errno = ENOTSUP;
@@ -457,21 +452,12 @@ int xs::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
*optvallen_ = sizeof (int);
return 0;
- case XS_PATTERN_VERSION:
- if (*optvallen_ < sizeof (int)) {
- errno = EINVAL;
- return -1;
- }
- *((int*) optval_) = sp_version;
- *optvallen_ = sizeof (int);
- return 0;
-
- case XS_SERVICE_ID:
+ case XS_PROTOCOL:
if (*optvallen_ < sizeof (int)) {
errno = EINVAL;
return -1;
}
- *((int*) optval_) = sp_service;
+ *((int*) optval_) = protocol;
*optvallen_ = sizeof (int);
return 0;