14 #include <linux/module.h>
16 #include <linux/ctype.h>
20 #include <linux/slab.h>
21 #include <linux/udp.h>
22 #include <linux/tcp.h>
47 MODULE_PARM_DESC(callforward_filter,
"only create call forwarding expectations "
48 "if both endpoints are on different sides "
49 "(determined by routing information)");
53 unsigned char **
data,
int dataoff,
58 unsigned char **
data,
int dataoff,
65 unsigned int protoff,
unsigned char **
data,
70 unsigned int protoff,
unsigned char **
data,
76 unsigned char **
data,
int dataoff,
85 unsigned char **
data,
int dataoff,
92 unsigned char **
data,
int dataoff,
99 unsigned char **
data,
int dataoff,
105 unsigned int protoff,
111 static char *h323_buffer;
118 static int get_tpkt_data(
struct sk_buff *skb,
unsigned int protoff,
122 struct nf_ct_h323_master *
info = nfct_help_data(ct);
133 th = skb_header_pointer(skb, protoff,
sizeof(_tcph), &_tcph);
138 tcpdataoff = protoff + th->doff * 4;
141 tcpdatalen = skb->
len - tcpdataoff;
147 tpkt = skb_header_pointer(skb, tcpdataoff, tcpdatalen,
152 if (tcpdatalen < 4 || tpkt[0] != 0x03 || tpkt[1] != 0) {
154 if (info->tpkt_len[dir] > 0) {
155 pr_debug(
"nf_ct_h323: previous packet "
156 "indicated separate TPKT data of %hu "
157 "bytes\n", info->tpkt_len[dir]);
158 if (info->tpkt_len[dir] <= tcpdatalen) {
162 *datalen = info->tpkt_len[dir];
168 pr_debug(
"nf_ct_h323: fragmented TPKT\n");
178 tcpdatalen -= tpktoff;
184 if (tpkt[0] != 0x03 || tpkt[1] != 0)
189 tpktlen = tpkt[2] * 256 + tpkt[3];
192 if (tpktlen > tcpdatalen) {
193 if (tcpdatalen == 4) {
195 pr_debug(
"nf_ct_h323: separate TPKT header indicates "
196 "there will be TPKT data of %hu bytes\n",
198 info->tpkt_len[dir] = tpktlen - 4;
202 pr_debug(
"nf_ct_h323: incomplete TPKT (fragmented?)\n");
208 *datalen = tpktlen - 4;
209 *dataoff = tpktoff + 4;
213 info->tpkt_len[dir] = 0;
217 info->tpkt_len[dir] = 0;
222 static int get_h245_addr(
struct nf_conn *ct,
const unsigned char *data,
226 const unsigned char *
p;
229 if (taddr->
choice != eH245_TransportAddress_unicastAddress)
233 case eUnicastAddress_iPAddress:
234 if (nf_ct_l3num(ct) !=
AF_INET)
239 case eUnicastAddress_iP6Address:
250 memset((
void *)addr + len, 0,
sizeof(*addr) - len);
257 static int expect_rtp_rtcp(
struct sk_buff *skb,
struct nf_conn *ct,
259 unsigned int protoff,
260 unsigned char **data,
int dataoff,
266 __be16 rtp_port, rtcp_port;
273 if (!get_h245_addr(ct, *data, taddr, &addr, &port) ||
279 rtp_port = port & ~
htons(1);
280 rtcp_port = port | htons(1);
302 sizeof(ct->
tuplehash[dir].tuple.src.u3)) &&
307 ret = nat_rtp_rtcp(skb, ct, ctinfo, protoff, data, dataoff,
308 taddr, port, rtp_port, rtp_exp, rtcp_exp);
310 if (nf_ct_expect_related(rtp_exp) == 0) {
311 if (nf_ct_expect_related(rtcp_exp) == 0) {
312 pr_debug(
"nf_ct_h323: expect RTP ");
313 nf_ct_dump_tuple(&rtp_exp->
tuple);
314 pr_debug(
"nf_ct_h323: expect RTCP ");
315 nf_ct_dump_tuple(&rtcp_exp->
tuple);
331 static int expect_t120(
struct sk_buff *skb,
334 unsigned int protoff,
335 unsigned char **data,
int dataoff,
346 if (!get_h245_addr(ct, *data, taddr, &addr, &port) ||
367 ret = nat_t120(skb, ct, ctinfo, protoff, data, dataoff, taddr,
370 if (nf_ct_expect_related(exp) == 0) {
371 pr_debug(
"nf_ct_h323: expect T.120 ");
372 nf_ct_dump_tuple(&exp->
tuple);
383 static int process_h245_channel(
struct sk_buff *skb,
386 unsigned int protoff,
387 unsigned char **data,
int dataoff,
392 if (channel->
options & eH2250LogicalChannelParameters_mediaChannel) {
394 ret = expect_rtp_rtcp(skb, ct, ctinfo, protoff, data, dataoff,
401 options & eH2250LogicalChannelParameters_mediaControlChannel) {
403 ret = expect_rtp_rtcp(skb, ct, ctinfo, protoff, data, dataoff,
415 unsigned int protoff,
416 unsigned char **data,
int dataoff,
421 pr_debug(
"nf_ct_h323: OpenLogicalChannel\n");
424 eOpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters_h2250LogicalChannelParameters)
426 ret = process_h245_channel(skb, ct, ctinfo,
427 protoff, data, dataoff,
429 forwardLogicalChannelParameters.
431 h2250LogicalChannelParameters);
437 eOpenLogicalChannel_reverseLogicalChannelParameters) &&
439 eOpenLogicalChannel_reverseLogicalChannelParameters_multiplexParameters)
442 eOpenLogicalChannel_reverseLogicalChannelParameters_multiplexParameters_h2250LogicalChannelParameters))
445 process_h245_channel(skb, ct, ctinfo,
446 protoff, data, dataoff,
448 reverseLogicalChannelParameters.
450 h2250LogicalChannelParameters);
455 if ((olc->
options & eOpenLogicalChannel_separateStack) &&
459 choice == eDataApplicationCapability_application_t120 &&
461 t120.
choice == eDataProtocolCapability_separateLANStack &&
463 eNetworkAccessParameters_networkAddress_localAreaAddress) {
464 ret = expect_t120(skb, ct, ctinfo, protoff, data, dataoff,
477 unsigned int protoff,
unsigned char **data,
int dataoff,
483 pr_debug(
"nf_ct_h323: OpenLogicalChannelAck\n");
486 eOpenLogicalChannelAck_reverseLogicalChannelParameters) &&
488 eOpenLogicalChannelAck_reverseLogicalChannelParameters_multiplexParameters)
491 eOpenLogicalChannelAck_reverseLogicalChannelParameters_multiplexParameters_h2250LogicalChannelParameters))
493 ret = process_h245_channel(skb, ct, ctinfo,
494 protoff, data, dataoff,
496 reverseLogicalChannelParameters.
498 h2250LogicalChannelParameters);
504 eOpenLogicalChannelAck_forwardMultiplexAckParameters) &&
506 eOpenLogicalChannelAck_forwardMultiplexAckParameters_h2250LogicalChannelAckParameters))
509 h2250LogicalChannelAckParameters;
511 eH2250LogicalChannelAckParameters_mediaChannel) {
513 ret = expect_rtp_rtcp(skb, ct, ctinfo,
514 protoff, data, dataoff,
521 eH2250LogicalChannelAckParameters_mediaControlChannel) {
523 ret = expect_rtp_rtcp(skb, ct, ctinfo,
524 protoff, data, dataoff,
531 if ((olca->
options & eOpenLogicalChannelAck_separateStack) &&
533 eNetworkAccessParameters_networkAddress_localAreaAddress) {
534 ret = expect_t120(skb, ct, ctinfo, protoff, data, dataoff,
547 unsigned int protoff,
unsigned char **data,
int dataoff,
551 case eMultimediaSystemControlMessage_request:
553 eRequestMessage_openLogicalChannel) {
554 return process_olc(skb, ct, ctinfo,
555 protoff, data, dataoff,
558 pr_debug(
"nf_ct_h323: H.245 Request %d\n",
561 case eMultimediaSystemControlMessage_response:
563 eResponseMessage_openLogicalChannelAck) {
564 return process_olca(skb, ct, ctinfo,
565 protoff, data, dataoff,
567 openLogicalChannelAck);
569 pr_debug(
"nf_ct_h323: H.245 Response %d\n",
581 static int h245_help(
struct sk_buff *skb,
unsigned int protoff,
585 unsigned char *data =
NULL;
596 spin_lock_bh(&nf_h323_lock);
599 while (get_tpkt_data(skb, protoff, ct, ctinfo,
600 &data, &datalen, &dataoff)) {
601 pr_debug(
"nf_ct_h245: TPKT len=%d ", datalen);
608 pr_debug(
"nf_ct_h245: decoding error: %s\n",
610 "out of bound" :
"out of range");
616 if (process_h245(skb, ct, ctinfo, protoff,
617 &data, dataoff, &mscm) < 0)
621 spin_unlock_bh(&nf_h323_lock);
625 spin_unlock_bh(&nf_h323_lock);
632 .max_expected = H323_RTP_CHANNEL_MAX * 4 + 2 ,
639 .data_len =
sizeof(
struct nf_ct_h323_master),
643 .expect_policy = &h245_exp_policy,
651 const unsigned char *
p;
655 case eTransportAddress_ipAddress:
656 if (nf_ct_l3num(ct) !=
AF_INET)
661 case eTransportAddress_ip6Address:
672 memset((
void *)addr + len, 0,
sizeof(*addr) - len);
681 unsigned int protoff,
unsigned char **data,
int dataoff,
704 exp->
helper = &nf_conntrack_helper_h245;
713 ret = nat_h245(skb, ct, ctinfo, protoff, data, dataoff, taddr,
716 if (nf_ct_expect_related(exp) == 0) {
717 pr_debug(
"nf_ct_q931: expect H.245 ");
718 nf_ct_dump_tuple(&exp->
tuple);
734 const struct nf_afinfo *afinfo;
738 afinfo = nf_get_afinfo(family);
747 memset(&fl1, 0,
sizeof(fl1));
750 memset(&fl2, 0,
sizeof(fl2));
753 flowi4_to_flowi(&fl1),
false)) {
755 flowi4_to_flowi(&fl2),
false)) {
756 if (rt_nexthop(rt1, fl1.daddr) ==
757 rt_nexthop(rt2, fl2.daddr) &&
758 rt1->
dst.dev == rt2->
dst.dev)
766 #if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6)
771 memset(&fl1, 0,
sizeof(fl1));
772 fl1.daddr = src->
in6;
774 memset(&fl2, 0,
sizeof(fl2));
775 fl2.daddr = dst->
in6;
777 flowi6_to_flowi(&fl1),
false)) {
779 flowi6_to_flowi(&fl2),
false)) {
782 rt1->
dst.dev == rt2->
dst.dev)
797 static int expect_callforwarding(
struct sk_buff *skb,
800 unsigned int protoff,
801 unsigned char **data,
int dataoff,
817 if (callforward_filter &&
818 callforward_do_filter(&addr, &ct->tuplehash[!dir].
tuple.src.u3,
820 pr_debug(
"nf_ct_q931: Call Forwarding not tracked\n");
828 &ct->
tuplehash[!dir].tuple.src.u3, &addr,
830 exp->
helper = nf_conntrack_helper_q931;
834 sizeof(ct->
tuplehash[dir].tuple.src.u3)) &&
839 ret = nat_callforwarding(skb, ct, ctinfo,
840 protoff, data, dataoff,
843 if (nf_ct_expect_related(exp) == 0) {
844 pr_debug(
"nf_ct_q931: expect Call Forwarding ");
845 nf_ct_dump_tuple(&exp->
tuple);
858 unsigned int protoff,
859 unsigned char **data,
int dataoff,
871 if (setup->
options & eSetup_UUIE_h245Address) {
872 ret = expect_h245(skb, ct, ctinfo, protoff, data, dataoff,
879 if ((setup->
options & eSetup_UUIE_destCallSignalAddress) &&
885 pr_debug(
"nf_ct_q931: set destCallSignalAddress %pI6:%hu->%pI6:%hu\n",
888 ret = set_h225_addr(skb, protoff, data, dataoff,
891 ct->
tuplehash[!dir].tuple.src.u.tcp.port);
896 if ((setup->
options & eSetup_UUIE_sourceCallSignalAddress) &&
902 pr_debug(
"nf_ct_q931: set sourceCallSignalAddress %pI6:%hu->%pI6:%hu\n",
905 ret = set_h225_addr(skb, protoff, data, dataoff,
908 ct->
tuplehash[!dir].tuple.dst.u.tcp.port);
913 if (setup->
options & eSetup_UUIE_fastStart) {
915 ret = process_olc(skb, ct, ctinfo,
916 protoff, data, dataoff,
927 static int process_callproceeding(
struct sk_buff *skb,
930 unsigned int protoff,
931 unsigned char **data,
int dataoff,
937 pr_debug(
"nf_ct_q931: CallProceeding\n");
939 if (callproc->
options & eCallProceeding_UUIE_h245Address) {
940 ret = expect_h245(skb, ct, ctinfo, protoff, data, dataoff,
946 if (callproc->
options & eCallProceeding_UUIE_fastStart) {
948 ret = process_olc(skb, ct, ctinfo,
949 protoff, data, dataoff,
960 static int process_connect(
struct sk_buff *skb,
struct nf_conn *ct,
962 unsigned int protoff,
963 unsigned char **data,
int dataoff,
971 if (connect->
options & eConnect_UUIE_h245Address) {
972 ret = expect_h245(skb, ct, ctinfo, protoff, data, dataoff,
978 if (connect->
options & eConnect_UUIE_fastStart) {
980 ret = process_olc(skb, ct, ctinfo,
981 protoff, data, dataoff,
992 static int process_alerting(
struct sk_buff *skb,
struct nf_conn *ct,
994 unsigned int protoff,
995 unsigned char **data,
int dataoff,
1001 pr_debug(
"nf_ct_q931: Alerting\n");
1003 if (alert->
options & eAlerting_UUIE_h245Address) {
1004 ret = expect_h245(skb, ct, ctinfo, protoff, data, dataoff,
1010 if (alert->
options & eAlerting_UUIE_fastStart) {
1012 ret = process_olc(skb, ct, ctinfo,
1013 protoff, data, dataoff,
1024 static int process_facility(
struct sk_buff *skb,
struct nf_conn *ct,
1026 unsigned int protoff,
1027 unsigned char **data,
int dataoff,
1033 pr_debug(
"nf_ct_q931: Facility\n");
1035 if (facility->
reason.
choice == eFacilityReason_callForwarded) {
1036 if (facility->
options & eFacility_UUIE_alternativeAddress)
1037 return expect_callforwarding(skb, ct, ctinfo,
1038 protoff, data, dataoff,
1040 alternativeAddress);
1044 if (facility->
options & eFacility_UUIE_h245Address) {
1045 ret = expect_h245(skb, ct, ctinfo, protoff, data, dataoff,
1051 if (facility->
options & eFacility_UUIE_fastStart) {
1053 ret = process_olc(skb, ct, ctinfo,
1054 protoff, data, dataoff,
1065 static int process_progress(
struct sk_buff *skb,
struct nf_conn *ct,
1067 unsigned int protoff,
1068 unsigned char **data,
int dataoff,
1074 pr_debug(
"nf_ct_q931: Progress\n");
1076 if (progress->
options & eProgress_UUIE_h245Address) {
1077 ret = expect_h245(skb, ct, ctinfo, protoff, data, dataoff,
1083 if (progress->
options & eProgress_UUIE_fastStart) {
1085 ret = process_olc(skb, ct, ctinfo,
1086 protoff, data, dataoff,
1099 unsigned int protoff,
unsigned char **data,
int dataoff,
1107 case eH323_UU_PDU_h323_message_body_setup:
1108 ret = process_setup(skb, ct, ctinfo, protoff, data, dataoff,
1111 case eH323_UU_PDU_h323_message_body_callProceeding:
1112 ret = process_callproceeding(skb, ct, ctinfo,
1113 protoff, data, dataoff,
1117 case eH323_UU_PDU_h323_message_body_connect:
1118 ret = process_connect(skb, ct, ctinfo, protoff, data, dataoff,
1121 case eH323_UU_PDU_h323_message_body_alerting:
1122 ret = process_alerting(skb, ct, ctinfo, protoff, data, dataoff,
1125 case eH323_UU_PDU_h323_message_body_facility:
1126 ret = process_facility(skb, ct, ctinfo, protoff, data, dataoff,
1129 case eH323_UU_PDU_h323_message_body_progress:
1130 ret = process_progress(skb, ct, ctinfo, protoff, data, dataoff,
1134 pr_debug(
"nf_ct_q931: Q.931 signal %d\n",
1142 if (pdu->
options & eH323_UU_PDU_h245Control) {
1144 ret = process_h245(skb, ct, ctinfo,
1145 protoff, data, dataoff,
1156 static int q931_help(
struct sk_buff *skb,
unsigned int protoff,
1160 unsigned char *data =
NULL;
1171 spin_lock_bh(&nf_h323_lock);
1174 while (get_tpkt_data(skb, protoff, ct, ctinfo,
1175 &data, &datalen, &dataoff)) {
1176 pr_debug(
"nf_ct_q931: TPKT len=%d ", datalen);
1182 pr_debug(
"nf_ct_q931: decoding error: %s\n",
1184 "out of bound" :
"out of range");
1190 if (process_q931(skb, ct, ctinfo, protoff,
1191 &data, dataoff, &q931) < 0)
1195 spin_unlock_bh(&nf_h323_lock);
1199 spin_unlock_bh(&nf_h323_lock);
1207 .max_expected = H323_RTP_CHANNEL_MAX * 4 + 4,
1215 .data_len =
sizeof(
struct nf_ct_h323_master),
1220 .expect_policy = &q931_exp_policy,
1229 .expect_policy = &q931_exp_policy,
1234 static unsigned char *get_udp_data(
struct sk_buff *skb,
unsigned int protoff,
1241 uh = skb_header_pointer(skb, protoff,
sizeof(_uh), &_uh);
1244 dataoff = protoff +
sizeof(_uh);
1245 if (dataoff >= skb->
len)
1247 *datalen = skb->
len - dataoff;
1248 return skb_header_pointer(skb, dataoff, *datalen, h323_buffer);
1256 struct net *
net = nf_ct_net(ct);
1260 memset(&tuple.src.u3, 0,
sizeof(tuple.src.u3));
1261 tuple.src.u.tcp.port = 0;
1262 memcpy(&tuple.dst.u3, addr,
sizeof(tuple.dst.u3));
1263 tuple.dst.u.tcp.port =
port;
1267 if (exp && exp->
master == ct)
1274 unsigned int timeout)
1288 unsigned int protoff,
unsigned char **data,
1291 struct nf_ct_h323_master *info = nfct_help_data(ct);
1301 for (i = 0; i < count; i++) {
1304 sizeof(addr)) == 0 && port != 0)
1319 exp->
helper = nf_conntrack_helper_q931;
1325 ret = nat_q931(skb, ct, ctinfo, protoff, data,
1326 taddr, i, port, exp);
1328 if (nf_ct_expect_related(exp) == 0) {
1329 pr_debug(
"nf_ct_ras: expect Q.931 ");
1330 nf_ct_dump_tuple(&exp->
tuple);
1333 info->sig_port[dir] =
port;
1346 unsigned int protoff,
1356 return set_ras_addr(skb, ct, ctinfo, protoff, data,
1357 &grq->rasAddress, 1);
1364 unsigned int protoff,
1375 if (!
get_h225_addr(ct, *data, &gcf->rasAddress, &addr, &port))
1379 if (!
memcmp(&addr, &ct->tuplehash[dir].tuple.src.u3,
sizeof(addr)) &&
1380 port == ct->tuplehash[dir].tuple.src.u.udp.port)
1391 &ct->tuplehash[!dir].tuple.src.u3, &addr,
1393 exp->
helper = nf_conntrack_helper_ras;
1395 if (nf_ct_expect_related(exp) == 0) {
1396 pr_debug(
"nf_ct_ras: expect RAS ");
1397 nf_ct_dump_tuple(&exp->
tuple);
1409 unsigned int protoff,
1412 struct nf_ct_h323_master *info = nfct_help_data(ct);
1414 typeof(set_ras_addr_hook) set_ras_addr;
1418 ret = expect_q931(skb, ct, ctinfo, protoff, data,
1419 rrq->callSignalAddress.
item,
1420 rrq->callSignalAddress.count);
1427 ret = set_ras_addr(skb, ct, ctinfo, protoff, data,
1434 if (rrq->
options & eRegistrationRequest_timeToLive) {
1438 info->timeout = default_rrq_ttl;
1446 unsigned int protoff,
1449 struct nf_ct_h323_master *info = nfct_help_data(ct);
1459 ct->
status & IPS_NAT_MASK) {
1460 ret = set_sig_addr(skb, ct, ctinfo, protoff, data,
1467 if (rcf->
options & eRegistrationConfirm_timeToLive) {
1472 if (info->timeout > 0) {
1473 pr_debug(
"nf_ct_ras: set RAS connection timeout to "
1474 "%u seconds\n", info->timeout);
1475 nf_ct_refresh(ct, skb, info->timeout *
HZ);
1478 spin_lock_bh(&nf_conntrack_lock);
1479 exp = find_expect(ct, &ct->
tuplehash[dir].tuple.dst.u3,
1480 info->sig_port[!dir]);
1482 pr_debug(
"nf_ct_ras: set Q.931 expect "
1483 "timeout to %u seconds for",
1485 nf_ct_dump_tuple(&exp->
tuple);
1486 set_expect_timeout(exp, info->
timeout);
1488 spin_unlock_bh(&nf_conntrack_lock);
1497 unsigned int protoff,
1500 struct nf_ct_h323_master *info = nfct_help_data(ct);
1503 typeof(set_sig_addr_hook) set_sig_addr;
1509 ct->
status & IPS_NAT_MASK) {
1510 ret = set_sig_addr(skb, ct, ctinfo, protoff, data,
1519 info->sig_port[dir] = 0;
1520 info->sig_port[!dir] = 0;
1523 nf_ct_refresh(ct, skb, 30 *
HZ);
1531 unsigned int protoff,
1534 const struct nf_ct_h323_master *info = nfct_help_data(ct);
1543 if ((arq->
options & eAdmissionRequest_destCallSignalAddress) &&
1546 !
memcmp(&addr, &ct->tuplehash[dir].tuple.src.u3,
sizeof(addr)) &&
1547 port == info->sig_port[dir] &&
1549 set_h225_addr && ct->
status & IPS_NAT_MASK) {
1551 return set_h225_addr(skb, protoff, data, 0,
1553 &ct->tuplehash[!dir].tuple.dst.u3,
1554 info->sig_port[!dir]);
1557 if ((arq->
options & eAdmissionRequest_srcCallSignalAddress) &&
1562 ct->
status & IPS_NAT_MASK) {
1564 return set_h225_addr(skb, protoff, data, 0,
1576 unsigned int protoff,
1584 typeof(set_sig_addr_hook) set_sig_addr;
1596 ct->status & IPS_NAT_MASK)
1597 return set_sig_addr(skb, ct, ctinfo, protoff, data,
1606 &ct->tuplehash[!dir].tuple.src.u3, &addr,
1609 exp->
helper = nf_conntrack_helper_q931;
1611 if (nf_ct_expect_related(exp) == 0) {
1612 pr_debug(
"nf_ct_ras: expect Q.931 ");
1613 nf_ct_dump_tuple(&exp->
tuple);
1625 unsigned int protoff,
1628 typeof(set_ras_addr_hook) set_ras_addr;
1634 ct->
status & IPS_NAT_MASK)
1635 return set_ras_addr(skb, ct, ctinfo, protoff, data,
1636 &lrq->replyAddress, 1);
1643 unsigned int protoff,
1662 &ct->tuplehash[!dir].tuple.src.u3, &addr,
1665 exp->
helper = nf_conntrack_helper_q931;
1667 if (nf_ct_expect_related(exp) == 0) {
1668 pr_debug(
"nf_ct_ras: expect Q.931 ");
1669 nf_ct_dump_tuple(&exp->
tuple);
1683 unsigned int protoff,
1687 typeof(set_ras_addr_hook) set_ras_addr;
1688 typeof(set_sig_addr_hook) set_sig_addr;
1694 ct->
status & IPS_NAT_MASK) {
1695 ret = set_ras_addr(skb, ct, ctinfo, protoff, data,
1703 ct->
status & IPS_NAT_MASK) {
1704 ret = set_sig_addr(skb, ct, ctinfo, protoff, data,
1717 unsigned int protoff,
1721 case eRasMessage_gatekeeperRequest:
1722 return process_grq(skb, ct, ctinfo, protoff, data,
1724 case eRasMessage_gatekeeperConfirm:
1725 return process_gcf(skb, ct, ctinfo, protoff, data,
1727 case eRasMessage_registrationRequest:
1728 return process_rrq(skb, ct, ctinfo, protoff, data,
1730 case eRasMessage_registrationConfirm:
1731 return process_rcf(skb, ct, ctinfo, protoff, data,
1733 case eRasMessage_unregistrationRequest:
1734 return process_urq(skb, ct, ctinfo, protoff, data,
1736 case eRasMessage_admissionRequest:
1737 return process_arq(skb, ct, ctinfo, protoff, data,
1739 case eRasMessage_admissionConfirm:
1740 return process_acf(skb, ct, ctinfo, protoff, data,
1742 case eRasMessage_locationRequest:
1743 return process_lrq(skb, ct, ctinfo, protoff, data,
1745 case eRasMessage_locationConfirm:
1746 return process_lcf(skb, ct, ctinfo, protoff, data,
1748 case eRasMessage_infoRequestResponse:
1749 return process_irr(skb, ct, ctinfo, protoff, data,
1760 static int ras_help(
struct sk_buff *skb,
unsigned int protoff,
1764 unsigned char *
data;
1770 spin_lock_bh(&nf_h323_lock);
1773 data = get_udp_data(skb, protoff, &datalen);
1776 pr_debug(
"nf_ct_ras: RAS message len=%d ", datalen);
1782 pr_debug(
"nf_ct_ras: decoding error: %s\n",
1784 "out of bound" :
"out of range");
1789 if (process_ras(skb, ct, ctinfo, protoff, &data, &ras) < 0)
1793 spin_unlock_bh(&nf_h323_lock);
1797 spin_unlock_bh(&nf_h323_lock);
1812 .data_len =
sizeof(
struct nf_ct_h323_master),
1817 .expect_policy = &ras_exp_policy,
1822 .data_len =
sizeof(
struct nf_ct_h323_master),
1827 .expect_policy = &ras_exp_policy,
1832 static void __exit nf_conntrack_h323_fini(
void)
1844 static int __init nf_conntrack_h323_init(
void)
1866 pr_debug(
"nf_ct_h323: init success\n");