-
Notifications
You must be signed in to change notification settings - Fork 119
/
zmq_sockopt.c
2176 lines (1697 loc) · 58.5 KB
/
zmq_sockopt.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
+-----------------------------------------------------------------------------------+
| ZMQ extension for PHP |
| Copyright (c) 2010-2020, Mikko Koppanen <mkoppanen@php.net> |
| All rights reserved. |
+-----------------------------------------------------------------------------------+
| Redistribution and use in source and binary forms, with or without |
| modification, are permitted provided that the following conditions are met: |
| * Redistributions of source code must retain the above copyright |
| notice, this list of conditions and the following disclaimer. |
| * Redistributions in binary form must reproduce the above copyright |
| notice, this list of conditions and the following disclaimer in the |
| documentation and/or other materials provided with the distribution. |
| * Neither the name of the copyright holder nor the |
| names of its contributors may be used to endorse or promote products |
| derived from this software without specific prior written permission. |
+-----------------------------------------------------------------------------------+
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| DISCLAIMED. IN NO EVENT SHALL MIKKO KOPPANEN BE LIABLE FOR ANY |
| DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+-----------------------------------------------------------------------------------+
*/
/*
WARNING! WARNING!
This file is generated code. See README for editing
*/
#include "php_zmq.h"
#include "php_zmq_private.h"
#include "zmq_object_access.c"
#include "zmq_sockopts_makros.h"
/*
sockopts_register.gsl
*/
void php_zmq_register_sockopt_constants (zend_class_entry *php_zmq_sc_entry)
{
#define PHP_ZMQ_REGISTER_SOCKOPT(const_name, value) zend_declare_class_constant_long(php_zmq_sc_entry, const_name, sizeof(const_name) - 1, value);
#if (ZMQ_VERSION_MAJOR >= 4)
# if (ZMQ_VERSION_MINOR >= 3)
# ifdef ZMQ_ONLY_FIRST_SUBSCRIBE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_ONLY_FIRST_SUBSCRIBE", ZMQ_ONLY_FIRST_SUBSCRIBE);
# endif
# ifdef ZMQ_WSS_TRUST_SYSTEM
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_WSS_TRUST_SYSTEM", ZMQ_WSS_TRUST_SYSTEM);
# endif
# ifdef ZMQ_WSS_HOSTNAME
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_WSS_HOSTNAME", ZMQ_WSS_HOSTNAME);
# endif
# ifdef ZMQ_WSS_TRUST_PEM
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_WSS_TRUST_PEM", ZMQ_WSS_TRUST_PEM);
# endif
# ifdef ZMQ_WSS_CERT_PEM
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_WSS_CERT_PEM", ZMQ_WSS_CERT_PEM);
# endif
# ifdef ZMQ_WSS_KEY_PEM
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_WSS_KEY_PEM", ZMQ_WSS_KEY_PEM);
# endif
# ifdef ZMQ_OUT_BATCH_SIZE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_OUT_BATCH_SIZE", ZMQ_OUT_BATCH_SIZE);
# endif
# ifdef ZMQ_IN_BATCH_SIZE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_IN_BATCH_SIZE", ZMQ_IN_BATCH_SIZE);
# endif
# ifdef ZMQ_SOCKS_PASSWORD
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_SOCKS_PASSWORD", ZMQ_SOCKS_PASSWORD);
# endif
# ifdef ZMQ_SOCKS_USERNAME
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_SOCKS_USERNAME", ZMQ_SOCKS_USERNAME);
# endif
# ifdef ZMQ_XPUB_MANUAL_LAST_VALUE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_XPUB_MANUAL_LAST_VALUE", ZMQ_XPUB_MANUAL_LAST_VALUE);
# endif
# ifdef ZMQ_ROUTER_NOTIFY
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_ROUTER_NOTIFY", ZMQ_ROUTER_NOTIFY);
# endif
# ifdef ZMQ_MULTICAST_LOOP
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_MULTICAST_LOOP", ZMQ_MULTICAST_LOOP);
# endif
# ifdef ZMQ_METADATA
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_METADATA", ZMQ_METADATA);
# endif
# ifdef ZMQ_LOOPBACK_FASTPATH
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_LOOPBACK_FASTPATH", ZMQ_LOOPBACK_FASTPATH);
# endif
# ifdef ZMQ_ZAP_ENFORCE_DOMAIN
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_ZAP_ENFORCE_DOMAIN", ZMQ_ZAP_ENFORCE_DOMAIN);
# endif
# ifdef ZMQ_GSSAPI_PRINCIPAL_NAMETYPE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_GSSAPI_PRINCIPAL_NAMETYPE", ZMQ_GSSAPI_PRINCIPAL_NAMETYPE);
# endif
# ifdef ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE", ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE);
# endif
# ifdef ZMQ_BINDTODEVICE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_BINDTODEVICE", ZMQ_BINDTODEVICE);
# endif
# endif
#endif /* ZMQ_MAJOR_VERSION == 4 */
#if (ZMQ_VERSION_MAJOR >= 4)
# if (ZMQ_VERSION_MINOR >= 2)
# ifdef ZMQ_HEARTBEAT_IVL
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_HEARTBEAT_IVL", ZMQ_HEARTBEAT_IVL);
# endif
# ifdef ZMQ_HEARTBEAT_TTL
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_HEARTBEAT_TTL", ZMQ_HEARTBEAT_TTL);
# endif
# ifdef ZMQ_HEARTBEAT_TIMEOUT
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_HEARTBEAT_TIMEOUT", ZMQ_HEARTBEAT_TIMEOUT);
# endif
# ifdef ZMQ_USE_FD
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_USE_FD", ZMQ_USE_FD);
# endif
# ifdef ZMQ_XPUB_MANUAL
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_XPUB_MANUAL", ZMQ_XPUB_MANUAL);
# endif
# ifdef ZMQ_XPUB_WELCOME_MSG
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_XPUB_WELCOME_MSG", ZMQ_XPUB_WELCOME_MSG);
# endif
# ifdef ZMQ_STREAM_NOTIFY
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_STREAM_NOTIFY", ZMQ_STREAM_NOTIFY);
# endif
# ifdef ZMQ_INVERT_MATCHING
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_INVERT_MATCHING", ZMQ_INVERT_MATCHING);
# endif
# ifdef ZMQ_XPUB_VERBOSER
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_XPUB_VERBOSER", ZMQ_XPUB_VERBOSER);
# endif
# ifdef ZMQ_CONNECT_TIMEOUT
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_CONNECT_TIMEOUT", ZMQ_CONNECT_TIMEOUT);
# endif
# ifdef ZMQ_TCP_MAXRT
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_TCP_MAXRT", ZMQ_TCP_MAXRT);
# endif
# ifdef ZMQ_THREAD_SAFE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_THREAD_SAFE", ZMQ_THREAD_SAFE);
# endif
# ifdef ZMQ_MULTICAST_MAXTPDU
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_MULTICAST_MAXTPDU", ZMQ_MULTICAST_MAXTPDU);
# endif
# ifdef ZMQ_VMCI_BUFFER_SIZE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_VMCI_BUFFER_SIZE", ZMQ_VMCI_BUFFER_SIZE);
# endif
# ifdef ZMQ_VMCI_BUFFER_MIN_SIZE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_VMCI_BUFFER_MIN_SIZE", ZMQ_VMCI_BUFFER_MIN_SIZE);
# endif
# ifdef ZMQ_VMCI_BUFFER_MAX_SIZE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_VMCI_BUFFER_MAX_SIZE", ZMQ_VMCI_BUFFER_MAX_SIZE);
# endif
# ifdef ZMQ_VMCI_CONNECT_TIMEOUT
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_VMCI_CONNECT_TIMEOUT", ZMQ_VMCI_CONNECT_TIMEOUT);
# endif
# endif
#endif /* ZMQ_MAJOR_VERSION == 4 */
#if (ZMQ_VERSION_MAJOR >= 4)
# if (ZMQ_VERSION_MINOR >= 1)
# ifdef ZMQ_TOS
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_TOS", ZMQ_TOS);
# endif
# ifdef ZMQ_ROUTER_HANDOVER
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_ROUTER_HANDOVER", ZMQ_ROUTER_HANDOVER);
# endif
# ifdef ZMQ_CONNECT_RID
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_CONNECT_RID", ZMQ_CONNECT_RID);
# endif
# ifdef ZMQ_HANDSHAKE_IVL
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_HANDSHAKE_IVL", ZMQ_HANDSHAKE_IVL);
# endif
# ifdef ZMQ_SOCKS_PROXY
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_SOCKS_PROXY", ZMQ_SOCKS_PROXY);
# endif
# ifdef ZMQ_XPUB_NODROP
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_XPUB_NODROP", ZMQ_XPUB_NODROP);
# endif
# endif
#endif /* ZMQ_MAJOR_VERSION == 4 */
#if (ZMQ_VERSION_MAJOR >= 4)
# ifdef ZMQ_ROUTER_MANDATORY
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_ROUTER_MANDATORY", ZMQ_ROUTER_MANDATORY);
# endif
# ifdef ZMQ_PROBE_ROUTER
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_PROBE_ROUTER", ZMQ_PROBE_ROUTER);
# endif
# ifdef ZMQ_REQ_RELAXED
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_REQ_RELAXED", ZMQ_REQ_RELAXED);
# endif
# ifdef ZMQ_REQ_CORRELATE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_REQ_CORRELATE", ZMQ_REQ_CORRELATE);
# endif
# ifdef ZMQ_CONFLATE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_CONFLATE", ZMQ_CONFLATE);
# endif
# ifdef ZMQ_ZAP_DOMAIN
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_ZAP_DOMAIN", ZMQ_ZAP_DOMAIN);
# endif
# ifdef ZMQ_MECHANISM
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_MECHANISM", ZMQ_MECHANISM);
# endif
# ifdef ZMQ_PLAIN_SERVER
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_PLAIN_SERVER", ZMQ_PLAIN_SERVER);
# endif
# ifdef ZMQ_PLAIN_USERNAME
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_PLAIN_USERNAME", ZMQ_PLAIN_USERNAME);
# endif
# ifdef ZMQ_PLAIN_PASSWORD
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_PLAIN_PASSWORD", ZMQ_PLAIN_PASSWORD);
# endif
# ifdef ZMQ_CURVE_SERVER
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_CURVE_SERVER", ZMQ_CURVE_SERVER);
# endif
# ifdef ZMQ_CURVE_PUBLICKEY
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_CURVE_PUBLICKEY", ZMQ_CURVE_PUBLICKEY);
# endif
# ifdef ZMQ_CURVE_SECRETKEY
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_CURVE_SECRETKEY", ZMQ_CURVE_SECRETKEY);
# endif
# ifdef ZMQ_CURVE_SERVERKEY
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_CURVE_SERVERKEY", ZMQ_CURVE_SERVERKEY);
# endif
# ifdef ZMQ_GSSAPI_SERVER
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_GSSAPI_SERVER", ZMQ_GSSAPI_SERVER);
# endif
# ifdef ZMQ_GSSAPI_PLAINTEXT
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_GSSAPI_PLAINTEXT", ZMQ_GSSAPI_PLAINTEXT);
# endif
# ifdef ZMQ_GSSAPI_PRINCIPAL
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_GSSAPI_PRINCIPAL", ZMQ_GSSAPI_PRINCIPAL);
# endif
# ifdef ZMQ_GSSAPI_SERVICE_PRINCIPAL
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_GSSAPI_SERVICE_PRINCIPAL", ZMQ_GSSAPI_SERVICE_PRINCIPAL);
# endif
# ifdef ZMQ_IPV6
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_IPV6", ZMQ_IPV6);
# endif
# ifdef ZMQ_IMMEDIATE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_IMMEDIATE", ZMQ_IMMEDIATE);
# endif
#endif /* ZMQ_MAJOR_VERSION == 4 */
#if (ZMQ_VERSION_MAJOR >= 3)
# ifdef ZMQ_SNDHWM
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_SNDHWM", ZMQ_SNDHWM);
# endif
# ifdef ZMQ_RCVHWM
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_RCVHWM", ZMQ_RCVHWM);
# endif
# ifdef ZMQ_MAXMSGSIZE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_MAXMSGSIZE", ZMQ_MAXMSGSIZE);
# endif
# ifdef ZMQ_MULTICAST_HOPS
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_MULTICAST_HOPS", ZMQ_MULTICAST_HOPS);
# endif
# ifdef ZMQ_XPUB_VERBOSE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_XPUB_VERBOSE", ZMQ_XPUB_VERBOSE);
# endif
# ifdef ZMQ_TCP_KEEPALIVE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_TCP_KEEPALIVE", ZMQ_TCP_KEEPALIVE);
# endif
# ifdef ZMQ_TCP_KEEPALIVE_IDLE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_TCP_KEEPALIVE_IDLE", ZMQ_TCP_KEEPALIVE_IDLE);
# endif
# ifdef ZMQ_TCP_KEEPALIVE_CNT
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_TCP_KEEPALIVE_CNT", ZMQ_TCP_KEEPALIVE_CNT);
# endif
# ifdef ZMQ_TCP_KEEPALIVE_INTVL
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_TCP_KEEPALIVE_INTVL", ZMQ_TCP_KEEPALIVE_INTVL);
# endif
# ifdef ZMQ_TCP_ACCEPT_FILTER
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_TCP_ACCEPT_FILTER", ZMQ_TCP_ACCEPT_FILTER);
# endif
# ifdef ZMQ_LAST_ENDPOINT
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_LAST_ENDPOINT", ZMQ_LAST_ENDPOINT);
# endif
# ifdef ZMQ_ROUTER_RAW
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_ROUTER_RAW", ZMQ_ROUTER_RAW);
# endif
# ifdef ZMQ_IPV4ONLY
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_IPV4ONLY", ZMQ_IPV4ONLY);
# endif
# ifdef ZMQ_DELAY_ATTACH_ON_CONNECT
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_DELAY_ATTACH_ON_CONNECT", ZMQ_DELAY_ATTACH_ON_CONNECT);
# endif
#endif /* ZMQ_MAJOR_VERSION == 3 */
#if (ZMQ_VERSION_MAJOR >= 2)
# ifdef ZMQ_HWM
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_HWM", ZMQ_HWM);
# endif
# ifdef ZMQ_SWAP
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_SWAP", ZMQ_SWAP);
# endif
# ifdef ZMQ_AFFINITY
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_AFFINITY", ZMQ_AFFINITY);
# endif
# ifdef ZMQ_IDENTITY
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_IDENTITY", ZMQ_IDENTITY);
# endif
# ifdef ZMQ_RATE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_RATE", ZMQ_RATE);
# endif
# ifdef ZMQ_RECOVERY_IVL
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_RECOVERY_IVL", ZMQ_RECOVERY_IVL);
# endif
# ifdef ZMQ_RECOVERY_IVL_MSEC
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_RECOVERY_IVL_MSEC", ZMQ_RECOVERY_IVL_MSEC);
# endif
# ifdef ZMQ_MCAST_LOOP
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_MCAST_LOOP", ZMQ_MCAST_LOOP);
# endif
# ifdef ZMQ_RCVTIMEO
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_RCVTIMEO", ZMQ_RCVTIMEO);
# endif
# ifdef ZMQ_SNDTIMEO
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_SNDTIMEO", ZMQ_SNDTIMEO);
# endif
# ifdef ZMQ_SNDBUF
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_SNDBUF", ZMQ_SNDBUF);
# endif
# ifdef ZMQ_RCVBUF
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_RCVBUF", ZMQ_RCVBUF);
# endif
# ifdef ZMQ_LINGER
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_LINGER", ZMQ_LINGER);
# endif
# ifdef ZMQ_RECONNECT_IVL
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_RECONNECT_IVL", ZMQ_RECONNECT_IVL);
# endif
# ifdef ZMQ_RECONNECT_IVL_MAX
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_RECONNECT_IVL_MAX", ZMQ_RECONNECT_IVL_MAX);
# endif
# ifdef ZMQ_BACKLOG
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_BACKLOG", ZMQ_BACKLOG);
# endif
# ifdef ZMQ_SUBSCRIBE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_SUBSCRIBE", ZMQ_SUBSCRIBE);
# endif
# ifdef ZMQ_UNSUBSCRIBE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_UNSUBSCRIBE", ZMQ_UNSUBSCRIBE);
# endif
# ifdef ZMQ_TYPE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_TYPE", ZMQ_TYPE);
# endif
# ifdef ZMQ_RCVMORE
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_RCVMORE", ZMQ_RCVMORE);
# endif
# ifdef ZMQ_FD
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_FD", ZMQ_FD);
# endif
# ifdef ZMQ_EVENTS
PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_EVENTS", ZMQ_EVENTS);
# endif
#endif /* ZMQ_MAJOR_VERSION == 2 */
#if ZMQ_VERSION_MAJOR > 2
// PHP_ZMQ_REGISTER_SOCKOPT("SOCKOPT_HWM", ZMQ_HWM); // already present
#endif
#undef PHP_ZMQ_REGISTER_SOCKOPT
}
/* {{{ proto mixed ZMQSocket::getSockOpt()
Get a socket option
*/
PHP_METHOD(zmqsocket, getsockopt)
{
php_zmq_socket_object *intern;
zend_long key;
size_t value_len;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &key) == FAILURE) {
return;
}
intern = PHP_ZMQ_SOCKET_OBJECT;
if (!intern->socket || !intern->socket->z_socket) {
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "The socket is not properly initialised", PHP_ZMQ_INTERNAL_ERROR);
return;
}
if (key > INT_MAX) {
zend_throw_exception_ex(php_zmq_socket_exception_sc_entry_get (), PHP_ZMQ_INTERNAL_ERROR, "The key must be smaller than or equal to %d", INT_MAX);
return;
}
#if (ZMQ_VERSION_MAJOR >= 4)
# if (ZMQ_VERSION_MINOR >= 3)
switch (key) {
# ifdef ZMQ_ONLY_FIRST_SUBSCRIBE
case ZMQ_ONLY_FIRST_SUBSCRIBE:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_ONLY_FIRST_SUBSCRIBE is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_ONLY_FIRST_SUBSCRIBE */
# ifdef ZMQ_WSS_TRUST_SYSTEM
case ZMQ_WSS_TRUST_SYSTEM:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_WSS_TRUST_SYSTEM is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_WSS_TRUST_SYSTEM */
# ifdef ZMQ_WSS_HOSTNAME
case ZMQ_WSS_HOSTNAME:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_WSS_HOSTNAME is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_WSS_HOSTNAME */
# ifdef ZMQ_WSS_TRUST_PEM
case ZMQ_WSS_TRUST_PEM:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_WSS_TRUST_PEM is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_WSS_TRUST_PEM */
# ifdef ZMQ_WSS_CERT_PEM
case ZMQ_WSS_CERT_PEM:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_WSS_CERT_PEM is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_WSS_CERT_PEM */
# ifdef ZMQ_WSS_KEY_PEM
case ZMQ_WSS_KEY_PEM:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_WSS_KEY_PEM is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_WSS_KEY_PEM */
# ifdef ZMQ_OUT_BATCH_SIZE
case ZMQ_OUT_BATCH_SIZE:
SOCKOPTS_GET_INT(OUT_BATCH_SIZE, int);
break;
# endif /* ZMQ_OUT_BATCH_SIZE */
# ifdef ZMQ_IN_BATCH_SIZE
case ZMQ_IN_BATCH_SIZE:
SOCKOPTS_GET_INT(IN_BATCH_SIZE, int);
break;
# endif /* ZMQ_IN_BATCH_SIZE */
# ifdef ZMQ_SOCKS_PASSWORD
case ZMQ_SOCKS_PASSWORD:
SOCKOPTS_GET_STRING(SOCKS_PASSWORD, 255, 0)
break;
# endif /* ZMQ_SOCKS_PASSWORD */
# ifdef ZMQ_SOCKS_USERNAME
case ZMQ_SOCKS_USERNAME:
SOCKOPTS_GET_STRING(SOCKS_USERNAME, 255, 0)
break;
# endif /* ZMQ_SOCKS_USERNAME */
# ifdef ZMQ_XPUB_MANUAL_LAST_VALUE
case ZMQ_XPUB_MANUAL_LAST_VALUE:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_XPUB_MANUAL_LAST_VALUE is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_XPUB_MANUAL_LAST_VALUE */
# ifdef ZMQ_ROUTER_NOTIFY
case ZMQ_ROUTER_NOTIFY:
SOCKOPTS_GET_INT(ROUTER_NOTIFY, int);
break;
# endif /* ZMQ_ROUTER_NOTIFY */
# ifdef ZMQ_MULTICAST_LOOP
case ZMQ_MULTICAST_LOOP:
SOCKOPTS_GET_INT(MULTICAST_LOOP, int);
break;
# endif /* ZMQ_MULTICAST_LOOP */
# ifdef ZMQ_METADATA
case ZMQ_METADATA:
SOCKOPTS_GET_STRING(METADATA, 255, 0)
break;
# endif /* ZMQ_METADATA */
# ifdef ZMQ_LOOPBACK_FASTPATH
case ZMQ_LOOPBACK_FASTPATH:
SOCKOPTS_GET_INT(LOOPBACK_FASTPATH, int);
break;
# endif /* ZMQ_LOOPBACK_FASTPATH */
# ifdef ZMQ_ZAP_ENFORCE_DOMAIN
case ZMQ_ZAP_ENFORCE_DOMAIN:
SOCKOPTS_GET_INT(ZAP_ENFORCE_DOMAIN, int);
break;
# endif /* ZMQ_ZAP_ENFORCE_DOMAIN */
# ifdef ZMQ_GSSAPI_PRINCIPAL_NAMETYPE
case ZMQ_GSSAPI_PRINCIPAL_NAMETYPE:
SOCKOPTS_GET_INT(GSSAPI_PRINCIPAL_NAMETYPE, int);
break;
# endif /* ZMQ_GSSAPI_PRINCIPAL_NAMETYPE */
# ifdef ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE
case ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE:
SOCKOPTS_GET_INT(GSSAPI_SERVICE_PRINCIPAL_NAMETYPE, int);
break;
# endif /* ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE */
# ifdef ZMQ_BINDTODEVICE
case ZMQ_BINDTODEVICE:
SOCKOPTS_GET_STRING(BINDTODEVICE, 255, 0)
break;
# endif /* ZMQ_BINDTODEVICE */
}
# endif
#endif /* ZMQ_VERSION_MAJOR == 4 */
#if (ZMQ_VERSION_MAJOR >= 4)
# if (ZMQ_VERSION_MINOR >= 2)
switch (key) {
# ifdef ZMQ_HEARTBEAT_IVL
case ZMQ_HEARTBEAT_IVL:
SOCKOPTS_GET_INT(HEARTBEAT_IVL, int);
break;
# endif /* ZMQ_HEARTBEAT_IVL */
# ifdef ZMQ_HEARTBEAT_TTL
case ZMQ_HEARTBEAT_TTL:
SOCKOPTS_GET_INT(HEARTBEAT_TTL, int);
break;
# endif /* ZMQ_HEARTBEAT_TTL */
# ifdef ZMQ_HEARTBEAT_TIMEOUT
case ZMQ_HEARTBEAT_TIMEOUT:
SOCKOPTS_GET_INT(HEARTBEAT_TIMEOUT, int);
break;
# endif /* ZMQ_HEARTBEAT_TIMEOUT */
# ifdef ZMQ_USE_FD
case ZMQ_USE_FD:
SOCKOPTS_GET_INT(USE_FD, int);
break;
# endif /* ZMQ_USE_FD */
# ifdef ZMQ_XPUB_MANUAL
case ZMQ_XPUB_MANUAL:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_XPUB_MANUAL is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_XPUB_MANUAL */
# ifdef ZMQ_XPUB_WELCOME_MSG
case ZMQ_XPUB_WELCOME_MSG:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_XPUB_WELCOME_MSG is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_XPUB_WELCOME_MSG */
# ifdef ZMQ_STREAM_NOTIFY
case ZMQ_STREAM_NOTIFY:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_STREAM_NOTIFY is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_STREAM_NOTIFY */
# ifdef ZMQ_INVERT_MATCHING
case ZMQ_INVERT_MATCHING:
{
if (intern->socket->socket_type != ZMQ_XPUB &&
intern->socket->socket_type != ZMQ_PUB &&
intern->socket->socket_type != ZMQ_SUB) {
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "ZMQ::SOCKOPT_INVERT_MATCHING is not valid for this socket type", errno);
return;
}
}
SOCKOPTS_GET_INT(INVERT_MATCHING, int);
break;
# endif /* ZMQ_INVERT_MATCHING */
# ifdef ZMQ_XPUB_VERBOSER
case ZMQ_XPUB_VERBOSER:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_XPUB_VERBOSER is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_XPUB_VERBOSER */
# ifdef ZMQ_CONNECT_TIMEOUT
case ZMQ_CONNECT_TIMEOUT:
SOCKOPTS_GET_INT(CONNECT_TIMEOUT, int);
break;
# endif /* ZMQ_CONNECT_TIMEOUT */
# ifdef ZMQ_TCP_MAXRT
case ZMQ_TCP_MAXRT:
SOCKOPTS_GET_INT(TCP_MAXRT, int);
break;
# endif /* ZMQ_TCP_MAXRT */
# ifdef ZMQ_THREAD_SAFE
case ZMQ_THREAD_SAFE:
SOCKOPTS_GET_INT(THREAD_SAFE, int);
break;
# endif /* ZMQ_THREAD_SAFE */
# ifdef ZMQ_MULTICAST_MAXTPDU
case ZMQ_MULTICAST_MAXTPDU:
SOCKOPTS_GET_INT(MULTICAST_MAXTPDU, int);
break;
# endif /* ZMQ_MULTICAST_MAXTPDU */
# ifdef ZMQ_VMCI_BUFFER_SIZE
case ZMQ_VMCI_BUFFER_SIZE:
SOCKOPTS_GET_INT(VMCI_BUFFER_SIZE, uint64_t);
break;
# endif /* ZMQ_VMCI_BUFFER_SIZE */
# ifdef ZMQ_VMCI_BUFFER_MIN_SIZE
case ZMQ_VMCI_BUFFER_MIN_SIZE:
SOCKOPTS_GET_INT(VMCI_BUFFER_MIN_SIZE, uint64_t);
break;
# endif /* ZMQ_VMCI_BUFFER_MIN_SIZE */
# ifdef ZMQ_VMCI_BUFFER_MAX_SIZE
case ZMQ_VMCI_BUFFER_MAX_SIZE:
SOCKOPTS_GET_INT(VMCI_BUFFER_MAX_SIZE, uint64_t);
break;
# endif /* ZMQ_VMCI_BUFFER_MAX_SIZE */
# ifdef ZMQ_VMCI_CONNECT_TIMEOUT
case ZMQ_VMCI_CONNECT_TIMEOUT:
SOCKOPTS_GET_INT(VMCI_CONNECT_TIMEOUT, int);
break;
# endif /* ZMQ_VMCI_CONNECT_TIMEOUT */
}
# endif
#endif /* ZMQ_VERSION_MAJOR == 4 */
#if (ZMQ_VERSION_MAJOR >= 4)
# if (ZMQ_VERSION_MINOR >= 1)
switch (key) {
# ifdef ZMQ_TOS
case ZMQ_TOS:
SOCKOPTS_GET_INT(TOS, int);
break;
# endif /* ZMQ_TOS */
# ifdef ZMQ_ROUTER_HANDOVER
case ZMQ_ROUTER_HANDOVER:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_ROUTER_HANDOVER is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_ROUTER_HANDOVER */
# ifdef ZMQ_CONNECT_RID
case ZMQ_CONNECT_RID:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_CONNECT_RID is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_CONNECT_RID */
# ifdef ZMQ_HANDSHAKE_IVL
case ZMQ_HANDSHAKE_IVL:
SOCKOPTS_GET_INT(HANDSHAKE_IVL, int);
break;
# endif /* ZMQ_HANDSHAKE_IVL */
# ifdef ZMQ_SOCKS_PROXY
case ZMQ_SOCKS_PROXY:
SOCKOPTS_GET_STRING(SOCKS_PROXY, 255, 0)
break;
# endif /* ZMQ_SOCKS_PROXY */
# ifdef ZMQ_XPUB_NODROP
case ZMQ_XPUB_NODROP:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_XPUB_NODROP is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_XPUB_NODROP */
}
# endif
#endif /* ZMQ_VERSION_MAJOR == 4 */
#if (ZMQ_VERSION_MAJOR >= 4)
switch (key) {
# ifdef ZMQ_ROUTER_MANDATORY
case ZMQ_ROUTER_MANDATORY:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_ROUTER_MANDATORY is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_ROUTER_MANDATORY */
# ifdef ZMQ_PROBE_ROUTER
case ZMQ_PROBE_ROUTER:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_PROBE_ROUTER is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_PROBE_ROUTER */
# ifdef ZMQ_REQ_RELAXED
case ZMQ_REQ_RELAXED:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_REQ_RELAXED is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_REQ_RELAXED */
# ifdef ZMQ_REQ_CORRELATE
case ZMQ_REQ_CORRELATE:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_REQ_CORRELATE is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_REQ_CORRELATE */
# ifdef ZMQ_CONFLATE
case ZMQ_CONFLATE:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_CONFLATE is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_CONFLATE */
# ifdef ZMQ_ZAP_DOMAIN
case ZMQ_ZAP_DOMAIN:
SOCKOPTS_GET_STRING(ZAP_DOMAIN, 255, 0)
break;
# endif /* ZMQ_ZAP_DOMAIN */
# ifdef ZMQ_MECHANISM
case ZMQ_MECHANISM:
SOCKOPTS_GET_INT(MECHANISM, int);
break;
# endif /* ZMQ_MECHANISM */
# ifdef ZMQ_PLAIN_SERVER
case ZMQ_PLAIN_SERVER:
SOCKOPTS_GET_INT(PLAIN_SERVER, int);
break;
# endif /* ZMQ_PLAIN_SERVER */
# ifdef ZMQ_PLAIN_USERNAME
case ZMQ_PLAIN_USERNAME:
SOCKOPTS_GET_STRING(PLAIN_USERNAME, 255, 0)
break;
# endif /* ZMQ_PLAIN_USERNAME */
# ifdef ZMQ_PLAIN_PASSWORD
case ZMQ_PLAIN_PASSWORD:
SOCKOPTS_GET_STRING(PLAIN_PASSWORD, 255, 0)
break;
# endif /* ZMQ_PLAIN_PASSWORD */
# ifdef ZMQ_CURVE_SERVER
case ZMQ_CURVE_SERVER:
SOCKOPTS_GET_INT(CURVE_SERVER, int);
break;
# endif /* ZMQ_CURVE_SERVER */
# ifdef ZMQ_CURVE_PUBLICKEY
case ZMQ_CURVE_PUBLICKEY:
SOCKOPTS_GET_STRING(CURVE_PUBLICKEY, 32, 1)
break;
# endif /* ZMQ_CURVE_PUBLICKEY */
# ifdef ZMQ_CURVE_SECRETKEY
case ZMQ_CURVE_SECRETKEY:
SOCKOPTS_GET_STRING(CURVE_SECRETKEY, 32, 1)
break;
# endif /* ZMQ_CURVE_SECRETKEY */
# ifdef ZMQ_CURVE_SERVERKEY
case ZMQ_CURVE_SERVERKEY:
SOCKOPTS_GET_STRING(CURVE_SERVERKEY, 32, 1)
break;
# endif /* ZMQ_CURVE_SERVERKEY */
# ifdef ZMQ_GSSAPI_SERVER
case ZMQ_GSSAPI_SERVER:
SOCKOPTS_GET_INT(GSSAPI_SERVER, int);
break;
# endif /* ZMQ_GSSAPI_SERVER */
# ifdef ZMQ_GSSAPI_PLAINTEXT
case ZMQ_GSSAPI_PLAINTEXT:
SOCKOPTS_GET_INT(GSSAPI_PLAINTEXT, int);
break;
# endif /* ZMQ_GSSAPI_PLAINTEXT */
# ifdef ZMQ_GSSAPI_PRINCIPAL
case ZMQ_GSSAPI_PRINCIPAL:
SOCKOPTS_GET_STRING(GSSAPI_PRINCIPAL, 255, 0)
break;
# endif /* ZMQ_GSSAPI_PRINCIPAL */
# ifdef ZMQ_GSSAPI_SERVICE_PRINCIPAL
case ZMQ_GSSAPI_SERVICE_PRINCIPAL:
SOCKOPTS_GET_STRING(GSSAPI_SERVICE_PRINCIPAL, 255, 0)
break;
# endif /* ZMQ_GSSAPI_SERVICE_PRINCIPAL */
# ifdef ZMQ_IPV6
case ZMQ_IPV6:
SOCKOPTS_GET_INT(IPV6, int);
break;
# endif /* ZMQ_IPV6 */
# ifdef ZMQ_IMMEDIATE
case ZMQ_IMMEDIATE:
SOCKOPTS_GET_INT(IMMEDIATE, int);
break;
# endif /* ZMQ_IMMEDIATE */
}
#endif /* ZMQ_VERSION_MAJOR == 4 */
#if (ZMQ_VERSION_MAJOR >= 3)
switch (key) {
# ifdef ZMQ_SNDHWM
case ZMQ_SNDHWM:
SOCKOPTS_GET_INT(SNDHWM, int);
break;
# endif /* ZMQ_SNDHWM */
# ifdef ZMQ_RCVHWM
case ZMQ_RCVHWM:
SOCKOPTS_GET_INT(RCVHWM, int);
break;
# endif /* ZMQ_RCVHWM */
# ifdef ZMQ_MAXMSGSIZE
case ZMQ_MAXMSGSIZE:
SOCKOPTS_GET_INT(MAXMSGSIZE, int64_t);
break;
# endif /* ZMQ_MAXMSGSIZE */
# ifdef ZMQ_MULTICAST_HOPS
case ZMQ_MULTICAST_HOPS:
SOCKOPTS_GET_INT(MULTICAST_HOPS, int);
break;
# endif /* ZMQ_MULTICAST_HOPS */
# ifdef ZMQ_XPUB_VERBOSE
case ZMQ_XPUB_VERBOSE:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_XPUB_VERBOSE is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_XPUB_VERBOSE */
# ifdef ZMQ_TCP_KEEPALIVE
case ZMQ_TCP_KEEPALIVE:
SOCKOPTS_GET_INT(TCP_KEEPALIVE, int);
break;
# endif /* ZMQ_TCP_KEEPALIVE */
# ifdef ZMQ_TCP_KEEPALIVE_IDLE
case ZMQ_TCP_KEEPALIVE_IDLE:
SOCKOPTS_GET_INT(TCP_KEEPALIVE_IDLE, int);
break;
# endif /* ZMQ_TCP_KEEPALIVE_IDLE */
# ifdef ZMQ_TCP_KEEPALIVE_CNT
case ZMQ_TCP_KEEPALIVE_CNT:
SOCKOPTS_GET_INT(TCP_KEEPALIVE_CNT, int);
break;
# endif /* ZMQ_TCP_KEEPALIVE_CNT */
# ifdef ZMQ_TCP_KEEPALIVE_INTVL
case ZMQ_TCP_KEEPALIVE_INTVL:
SOCKOPTS_GET_INT(TCP_KEEPALIVE_INTVL, int);
break;
# endif /* ZMQ_TCP_KEEPALIVE_INTVL */
# ifdef ZMQ_TCP_ACCEPT_FILTER
case ZMQ_TCP_ACCEPT_FILTER:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_TCP_ACCEPT_FILTER is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_TCP_ACCEPT_FILTER */
# ifdef ZMQ_LAST_ENDPOINT
case ZMQ_LAST_ENDPOINT:
SOCKOPTS_GET_STRING(LAST_ENDPOINT, 255, 0)
break;
# endif /* ZMQ_LAST_ENDPOINT */
# ifdef ZMQ_ROUTER_RAW
case ZMQ_ROUTER_RAW:
zend_throw_exception(php_zmq_socket_exception_sc_entry_get (), "Getting ZMQ::SOCKOPT_ROUTER_RAW is not supported", PHP_ZMQ_INTERNAL_ERROR);
return;
break;
# endif /* ZMQ_ROUTER_RAW */
# ifdef ZMQ_IPV4ONLY
case ZMQ_IPV4ONLY:
SOCKOPTS_GET_INT(IPV4ONLY, int);
break;
# endif /* ZMQ_IPV4ONLY */
}
#endif /* ZMQ_VERSION_MAJOR == 3 */
#if (ZMQ_VERSION_MAJOR >= 2)
switch (key) {
# ifdef ZMQ_HWM
case ZMQ_HWM:
SOCKOPTS_GET_INT(HWM, uint64_t);
break;