244 |
const u32 *address, const u16 port) |
const u32 *address, const u16 port) |
245 |
{ |
{ |
246 |
const int idx = ccs_read_lock(); |
const int idx = ccs_read_lock(); |
247 |
const int error = ccs_network_entry2(is_ipv6, operation, |
const int error = ccs_network_entry2(is_ipv6, operation, address, |
248 |
address, port); |
port); |
249 |
ccs_read_unlock(idx); |
ccs_read_unlock(idx); |
250 |
return error; |
return error; |
251 |
} |
} |
394 |
* |
* |
395 |
* Returns 0 on success, negative value otherwise. |
* Returns 0 on success, negative value otherwise. |
396 |
*/ |
*/ |
397 |
static inline int ccs_network_listen_acl(const bool is_ipv6, |
static inline int ccs_network_listen_acl(const bool is_ipv6, const u8 *address, |
|
const u8 *address, |
|
398 |
const u16 port) |
const u16 port) |
399 |
{ |
{ |
400 |
return ccs_network_entry(is_ipv6, CCS_NETWORK_TCP_LISTEN, |
return ccs_network_entry(is_ipv6, CCS_NETWORK_TCP_LISTEN, |
413 |
*/ |
*/ |
414 |
static inline int ccs_network_connect_acl(const bool is_ipv6, |
static inline int ccs_network_connect_acl(const bool is_ipv6, |
415 |
const int sock_type, |
const int sock_type, |
416 |
const u8 *address, |
const u8 *address, const u16 port) |
|
const u16 port) |
|
417 |
{ |
{ |
418 |
u8 operation; |
u8 operation; |
419 |
switch (sock_type) { |
switch (sock_type) { |
467 |
* |
* |
468 |
* Returns 0 on success, negative value otherwise. |
* Returns 0 on success, negative value otherwise. |
469 |
*/ |
*/ |
470 |
static inline int ccs_network_accept_acl(const bool is_ipv6, |
static inline int ccs_network_accept_acl(const bool is_ipv6, const u8 *address, |
|
const u8 *address, |
|
471 |
const u16 port) |
const u16 port) |
472 |
{ |
{ |
473 |
int retval; |
int retval; |
490 |
*/ |
*/ |
491 |
static inline int ccs_network_sendmsg_acl(const bool is_ipv6, |
static inline int ccs_network_sendmsg_acl(const bool is_ipv6, |
492 |
const int sock_type, |
const int sock_type, |
493 |
const u8 *address, |
const u8 *address, const u16 port) |
|
const u16 port) |
|
494 |
{ |
{ |
495 |
u8 operation; |
u8 operation; |
496 |
if (sock_type == SOCK_DGRAM) |
if (sock_type == SOCK_DGRAM) |
513 |
*/ |
*/ |
514 |
static inline int ccs_network_recvmsg_acl(const bool is_ipv6, |
static inline int ccs_network_recvmsg_acl(const bool is_ipv6, |
515 |
const int sock_type, |
const int sock_type, |
516 |
const u8 *address, |
const u8 *address, const u16 port) |
|
const u16 port) |
|
517 |
{ |
{ |
518 |
int retval; |
int retval; |
519 |
const u8 operation |
const u8 operation |
783 |
else |
else |
784 |
port = htons(sock->sk->sk_protocol); |
port = htons(sock->sk->sk_protocol); |
785 |
error = ccs_network_sendmsg_acl(false, type, |
error = ccs_network_sendmsg_acl(false, type, |
786 |
(u8 *) &addr4->sin_addr, |
(u8 *) &addr4->sin_addr, port); |
|
port); |
|
787 |
break; |
break; |
788 |
} |
} |
789 |
return error; |
return error; |