summaryrefslogtreecommitdiffstats
path: root/include/linux/phonet.h
diff options
context:
space:
mode:
authorRemi Denis-Courmont <remi.denis-courmont@nokia.com>2008-09-22 20:09:13 -0700
committerDavid S. Miller <davem@davemloft.net>2008-09-22 20:09:13 -0700
commitbe0c52bfed7f7828494fa00060efd5d758e92580 (patch)
tree1261d101dee4c1d440d1d90c974c62339a556843 /include/linux/phonet.h
parent87ab4e20b445c6d2d2727ab4f96fa17f7259511e (diff)
downloadop-kernel-dev-be0c52bfed7f7828494fa00060efd5d758e92580.zip
op-kernel-dev-be0c52bfed7f7828494fa00060efd5d758e92580.tar.gz
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>
Diffstat (limited to 'include/linux/phonet.h')
-rw-r--r--include/linux/phonet.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/linux/phonet.h b/include/linux/phonet.h
index 001c0e6..3a027f5 100644
--- a/include/linux/phonet.h
+++ b/include/linux/phonet.h
@@ -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;
OpenPOWER on IntegriCloud