p-net icon indicating copy to clipboard operation
p-net copied to clipboard

IM Data Cannot Set

Open widavies opened this issue 2 years ago • 1 comments
trafficstars

In Proneta, when a device is assigned an IP suite, right clicking the device in the Graphical View, there is an optional to edit additional I&M data:

image A dialog pops up with several options: image

If I change any of these options and hit set, the Proneta request appears to do nothing.

The Wireshark trace shows that the AR connect request has been rejected with code "Error in Parameter ARType":

image

Here is the detailed connect packet from Proneta: image

You can see that the ARType is 0x0006 DeviceAccess AR.

Tracking this down, the following function will reject any ARs that are not PF_ART_IOCAR_SINGLE:

int pf_cmdev_check_ar_type (uint16_t ar_type)
{
   int ret = -1;

   if (ar_type == PF_ART_IOCAR_SINGLE)
   {
      ret = 0;
   }

   return ret;
}

Are there any plans to support IM record updates or any easy way to enable them?

Thanks!

widavies avatar Jun 01 '23 15:06 widavies

Hi, thanks for the input. I can make it work from Proneta with these changes:

in pf_cmdev_check_ar_type() replace

if (ar_type == PF_ART_IOCAR_SINGLE)

with

if (ar_type == PF_ART_IOCAR_SINGLE || ar_type == PF_ART_IOSAR)

and in pf_cmwrr_write() replace

   if (
      (pf_cmdev_get_subslot_full (
          net,
          p_write_request->api,
          p_write_request->slot_number,
          p_write_request->subslot_number,
          &subslot) == 0) &&
      (((subslot->ownsm_state != PF_OWNSM_STATE_IOC) &&
        (subslot->ownsm_state != PF_OWNSM_STATE_IOS)) ||
       (subslot->owner != p_ar)))
   {
      p_result->pnio_status.error_code = PNET_ERROR_CODE_WRITE;
      p_result->pnio_status.error_decode = PNET_ERROR_DECODE_PNIORW;
      p_result->pnio_status.error_code_1 = PNET_ERROR_CODE_1_ACC_ACCESS_DENIED;
      p_result->pnio_status.error_code_2 = 0;
   }
   else if (p_write_request->index <= PF_IDX_USER_MAX)

with

(void)subslot;
if (p_write_request->index <= PF_IDX_USER_MAX)

I have not studied the consequences of making these changes.

pyhys avatar Jun 22 '23 10:06 pyhys