mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
Phonet: emit errors when a packet cannot be delivered locally
When there is no listener socket for a received packet, send an error back to the sender. Signed-off-by: Remi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
87ab4e20b4
commit
be0c52bfed
3 changed files with 129 additions and 4 deletions
|
@ -45,6 +45,38 @@ struct phonethdr {
|
|||
__u8 pn_sobj;
|
||||
} __attribute__((packed));
|
||||
|
||||
/* Common Phonet payload header */
|
||||
struct phonetmsg {
|
||||
__u8 pn_trans_id; /* transaction ID */
|
||||
__u8 pn_msg_id; /* message type */
|
||||
union {
|
||||
struct {
|
||||
__u8 pn_submsg_id; /* message subtype */
|
||||
__u8 pn_data[5];
|
||||
} base;
|
||||
struct {
|
||||
__u16 pn_e_res_id; /* extended resource ID */
|
||||
__u8 pn_e_submsg_id; /* message subtype */
|
||||
__u8 pn_e_data[3];
|
||||
} ext;
|
||||
} pn_msg_u;
|
||||
};
|
||||
#define PN_COMMON_MESSAGE 0xF0
|
||||
#define PN_PREFIX 0xE0 /* resource for extended messages */
|
||||
#define pn_submsg_id pn_msg_u.base.pn_submsg_id
|
||||
#define pn_e_submsg_id pn_msg_u.ext.pn_e_submsg_id
|
||||
#define pn_e_res_id pn_msg_u.ext.pn_e_res_id
|
||||
#define pn_data pn_msg_u.base.pn_data
|
||||
#define pn_e_data pn_msg_u.ext.pn_e_data
|
||||
|
||||
/* data for unreachable errors */
|
||||
#define PN_COMM_SERVICE_NOT_IDENTIFIED_RESP 0x01
|
||||
#define PN_COMM_ISA_ENTITY_NOT_REACHABLE_RESP 0x14
|
||||
#define pn_orig_msg_id pn_data[0]
|
||||
#define pn_status pn_data[1]
|
||||
#define pn_e_orig_msg_id pn_e_data[0]
|
||||
#define pn_e_status pn_e_data[1]
|
||||
|
||||
/* Phonet socket address structure */
|
||||
struct sockaddr_pn {
|
||||
sa_family_t spn_family;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue