The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,994 other followers

Archive for June 7th, 2017

Functions over read-only properties: you cannot mark a property as deprecated in delphi – via Stack Overflow

Posted by jpluimers on 2017/06/07

I learned one of the reasons you might want to use functions instead of read-only properties from properties – How can I mark a property as deprecated in delphi? – Stack Overflow [WayBack]:

Delphi hinting directives: deprecated, experimental, library and platform cannot be used on properties but can be on other members (like fields, procedures and functions).

Since a read-only property is very much like a read-only field, but fields cannot be read-only it can make sense to replace the read-only property with a function. Then on the function you can place hint directives.

This can help enormously refactoring large code bases where – because of size – you cannot perform a certain replacement in one step.

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

APC 7xxx models, DHCP Option 43 and Mikrotik DHCP servers

Posted by jpluimers on 2017/06/07

When switching my DHCP to a Mikrotik CCR1009, both the AP7920 and AP7921 failed to get IP addresses. The APC7921 would look bounce between waiting and offered states like this:

The cause is the need of DHCP Option 43 (Vendor Class Identifier) specified in RFC2132 – based on [WayBack] RFC 2131 – Dynamic Host Configuration Protocol and [WayBackRFC 1533 – DHCP Options and BOOTP Vendor Extensions – which I found first via these links:

“Vendor specific cookie” means “DHCP Option 43” is set.

I then found more details in the ASTE-6Z6K56_R0_EN.pdf documentation:

DHCP. You can use a RFC2131/RFC2132-compliant DHCP server to configure the TCP/IP settings for the Switched Rack PDU.

This section briefly summarizes the Switched Rack PDU communication with a DHCP server. For more detail about how a DHCP server is used to configure the network settings for the Switched Rack PDU, see “DHCP Configuration” in the User’s Guide.

  1. The Switched Rack PDU sends a DHCP request that uses the following to identify itself:
    • Vendor Class Identifier (APC by default)
    • Client Identifier (by default, the Switched Rack PDU’s MAC address value)
    • User Class Identifier (by default, the identification of the Switched Rack PDU’s application firmware)
  2. A properly configured DHCP server responds with a DHCP offer that includes all of the settings that the Switched Rack PDU needs for network communication. The DHCP offer also includes the Vendor Specific Information option (DHCP option 43). By default, the Switched Rack PDU ignores DHCP offers that do not encapsulate the APC cookie in the Vendor Specific Information option using the following hexidecimal format:
         Option 43 = 01 04 31 41 50 43
    

    where
    – The first byte (01) is the code
    – The second byte (04) is the length
    – The remaining bytes (31 41 50 43) are the APC cookie

    See your DHCP server documentation to add code to the Vendor Specific Information option.

    To disable the APC cookie requirement, see “Local access to the control console” on page 10. To change the control console’s DHCP Cookie Is setting, an Advanced option in the TCP/IP menu, see “Remote access to the control console” on page 10.

Read the rest of this entry »

Posted in Development, Internet, MikroTik, Power User, RouterOS, Routers, Scripting, Software Development | 3 Comments »

 
%d bloggers like this: