From: Izunna Otiji <[email protected]>
Signed-off-by: Izunna Otiji <[email protected]>
---
port.c | 13 ++++++++++++-
transport.c | 5 +++++
transport.h | 5 +++++
3 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/port.c b/port.c
index 871ad68..acdf1e5 100644
--- a/port.c
+++ b/port.c
@@ -831,6 +831,8 @@ static void port_management_send_error(struct port *p,
struct port *ingress,
static const Octet profile_id_drr[] = {0x00, 0x1B, 0x19, 0x00, 0x01, 0x00};
static const Octet profile_id_p2p[] = {0x00, 0x1B, 0x19, 0x00, 0x02, 0x00};
+static const Octet profile_id_8275_1[] = {0x00, 0x19, 0xA7, 0x01, 0x02, 0x01};
+static const Octet profile_id_8275_2[] = {0x00, 0x19, 0xA7, 0x02, 0x01, 0x00};
static int port_management_fill_response(struct port *target,
struct ptp_message *rsp, int id)
@@ -926,7 +928,16 @@ static int port_management_fill_response(struct port
*target,
if (target->delayMechanism == DM_P2P) {
memcpy(buf, profile_id_p2p, PROFILE_ID_LEN);
} else {
- memcpy(buf, profile_id_drr, PROFILE_ID_LEN);
+ if (config_get_int(transport_config(target->trp), NULL,
"dataset_comparison") ==
+ DS_CMP_G8275) {
+ if (transport_type(target->trp) ==
TRANS_IEEE_802_3) {
+ memcpy(buf, profile_id_8275_1,
PROFILE_ID_LEN);
+ } else {
+ memcpy(buf, profile_id_8275_2,
PROFILE_ID_LEN);
+ }
+ } else {
+ memcpy(buf, profile_id_drr, PROFILE_ID_LEN);
+ }
}
buf += PROFILE_ID_LEN;
datalen = buf - tlv->data;
diff --git a/transport.c b/transport.c
index 9366fbf..41ca999 100644
--- a/transport.c
+++ b/transport.c
@@ -98,6 +98,11 @@ enum transport_type transport_type(struct transport *t)
return t->type;
}
+struct config* transport_config(struct transport *t)
+{
+ return t->cfg;
+}
+
struct transport *transport_create(struct config *cfg,
enum transport_type type)
{
diff --git a/transport.h b/transport.h
index 7a7f87b..3d6dadd 100644
--- a/transport.h
+++ b/transport.h
@@ -118,6 +118,11 @@ int transport_txts(struct fdarray *fda,
*/
enum transport_type transport_type(struct transport *t);
+/**
+ * Returns a pointer to the configuration database for the specific transport.
+ */
+struct config* transport_config(struct transport *t);
+
#define TRANSPORT_ADDR_LEN 16
/**
--
2.37.2
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel