- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Programming dedicated LAT application ports on...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-01-2011 08:01 AM
тАО04-01-2011 08:01 AM
Re: Programming dedicated LAT application ports on Itanium
Yea, there is some really nasty code here and fortunately I did not write it but equally unfortunately it was thrown over the wall and I have less than a week to make it work. I have spent most of the week trying to fix the obvious, when I took the VAXC out of the build.
I have stepped through this code line by line with the debugger putting break points a all of the Async entry points and I do not get into any loops. In fact the error happens attemting to post the first AST. Guess what, examining the buffers from the strncpy in the debugger indicates that what they appear to have intended with the statement actually worked? Go figure...
I guess you get what you pay for, as they say...
Have Fun,
twhjr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-01-2011 08:12 AM
тАО04-01-2011 08:12 AM
Re: Programming dedicated LAT application ports on Itanium
From the Docs:
Programming Application Services and Dedicated Ports
Rather than the normal timesharing service offered by the operating system, application programs can make use of LAT application services that allow terminal server users (or users on sytems with outgoing connections) to connect to a specialized application. To do this, the system manager must create LAT ports that are dedicated to a particular application service. (Alternatively, this LAT port creation can be done from a program using the QIOs discussed in previous sections, providing OPER privilege.) When the remote user makes the connection to the application service, the connection is directly to the application program that controls a LAT port (LTA device) associated with the service. In this case the prompt, Username:, is not received. HP recommends that you follow these steps to create an application service:
1. Define the dedicated ports in LAT$SYSTARTUP.COM and execute the command procedure in SYSTARTUP_VMS.COM. (Refer to the HP OpenVMS System Management Utilities Reference Manual and the HP OpenVMS System Manager's Manual for additional information.)
2. Run the application program. Within the application program, allocate dedicated ports with the same name as those defined in LAT$SYSTARTUP.COM. Use the Assign I/O Channel ($ASSIGN) system service to assign service channels to the ports.
3. Post a read request to the dedicated ports. When the terminal user connects to the service and presses the Return key, the application program can perform I/O to the dedicated port.
4. To break the connection, use the Deassign I/O Channel ($DASSGN) system service to deassign the channel and the Deallocate Device ($DALLOC) system service to deallocate the device. The application program must reallocate the port and reassign the channel in preparation for the next connection.
An example of the application service concept is a program that provides the time of day. For this example, the system manager includes the following lines in LAT$SYSTARTUP.COM (or enters them manually in the LATCP program):
CREATE SERVICE TIME/ID="At the tone, the time will be"/APPLICATION
CREATE PORT LTA99:/DEDICATED
SET PORT LTA99:/SERVICE=TIME
An application program then assigns a channel to device LTA99. When a terminal server user types CONNECT TIME, the user is connected to this application program, and the program prints out the time of day. The program then deassigns the channel, which disconnects the server user.
A system manager may associate more than one LAT port with the same service. In that case, the application program that offers the service should assign channels to all of the LTA devices created for that service.
Have Fun,
twhjr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-01-2011 08:26 AM
тАО04-01-2011 08:26 AM
Re: Programming dedicated LAT application ports on Itanium
As I recall, LAT needed to be configured to allow in bound connections. If you have more than one network interface, you also need to enable LAT for each NIC. Check the startup proceedures on the working Alphaserver.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-01-2011 08:43 AM
тАО04-01-2011 08:43 AM
Re: Programming dedicated LAT application ports on Itanium
More specifically, your boss gets what your boss is willing to pay for, and your boss also gets what the customers are willing to pay for, etc.
Bad code can become immortal. The same bad decisions and bad designs and bad implementations that wrought the code creature can also lead to its continued zombie-like existence. Existing long past its intended lifetime, the creature will continue seeking brains from anyone in the vicinity, and can survive well past when an incremental rewrite or a port to IP or a port to Unix would have been warranted. But I digress.
Build a small reproducer of this and toss it at HP support.
And check MAXBUF parameter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-01-2011 10:04 AM
тАО04-01-2011 10:04 AM
Re: Programming dedicated LAT application ports on Itanium
If I had any say in these matters I would write them a quick web page that does the RDB lookup and be done with it but government agencies are not always flexible when it comes to changing their interfaces which means changing their docs, etc, etc...
I am going to change the code to use a single port with a QIOW like the repair application and be done with it... I know that works because it is currently running and I can set host/lat to the port in enter repair info.
Have Fun,
twhjr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-01-2011 11:28 AM
тАО04-01-2011 11:28 AM
Re: Programming dedicated LAT application ports on Itanium
http://vouters.dyndns.org/tima/OpenVMS-LAT-Creating-Application-Port-programming-example.html
bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-01-2011 01:23 PM
тАО04-01-2011 01:23 PM
Re: Programming dedicated LAT application ports on Itanium
I have scrutinized every word in the IO Users Guide especiall these sections:
LAT Port Types
QIO functions can be used to create the following LAT port types:
Application Port: This type of port can be used to connect to a remote device (typically a printer) on a terminal server or to a dedicated port on another LAT service node. This is the default port type. See Programming Application Ports for a description of programming an application port.
Dedicated Port: This type of port specifies that the logical port on your node is dedicated to an application service. When users on a terminal server (or on another node that supports outgoing connections) request a connection to this service name, they are connected to a dedicated port. See Programming Application Services and Dedicated Ports for a description of programming a dedicated port and application service.
Forward Port: This type of port is used for outgoing LAT connections (to remote services) and is created by assigning a channel to the LAT template device _LTA0: with the $ASSIGN system service.
I am attempting to utilize a "Dedicated Port" buy utilizing the procedures layed out in the docs and I have included previously in this thread and again here:
Programming Application Services and Dedicated Ports
Rather than the normal timesharing service offered by the operating system, application programs can make use of LAT application services that allow terminal server users (or users on sytems with outgoing connections) to connect to a specialized application. To do this, the system manager must create LAT ports that are dedicated to a particular application service. (Alternatively, this LAT port creation can be done from a program using the QIOs discussed in previous sections, providing OPER privilege.) When the remote user makes the connection to the application service, the connection is directly to the application program that controls a LAT port (LTA device) associated with the service. In this case the prompt, Username:, is not received. HP recommends that you follow these steps to create an application service:
1. Define the dedicated ports in LAT$SYSTARTUP.COM and execute the command procedure in SYSTARTUP_VMS.COM. (Refer to the HP OpenVMS System Management Utilities Reference Manual and the HP OpenVMS System Manager's Manual for additional information.)
2. Run the application program. Within the application program, allocate dedicated ports with the same name as those defined in LAT$SYSTARTUP.COM. Use the Assign I/O Channel ($ASSIGN) system service to assign service channels to the ports.
3. Post a read request to the dedicated ports. When the terminal user connects to the service and presses the Return key, the application program can perform I/O to the dedicated port.
4. To break the connection, use the Deassign I/O Channel ($DASSGN) system service to deassign the channel and the Deallocate Device ($DALLOC) system service to deallocate the device. The application program must reallocate the port and reassign the channel in preparation for the next connection.
An example of the application service concept is a program that provides the time of day. For this example, the system manager includes the following lines in LAT$SYSTARTUP.COM (or enters them manually in the LATCP program):
CREATE SERVICE TIME/ID="At the tone, the time will be"/APPLICATION
CREATE PORT LTA99:/DEDICATED
SET PORT LTA99:/SERVICE=TIME
An application program then assigns a channel to device LTA99. When a terminal server user types CONNECT TIME, the user is connected to this application program, and the program prints out the time of day. The program then deassigns the channel, which disconnects the server user.
A system manager may associate more than one LAT port with the same service. In that case, the application program that offers the service should assign channels to all of the LTA devices created for that service.
The example in the docs, besides being full of errors, is for a "Forward Port" which is NOT what I am attempting to accomplish.
Have Fun,
twhjr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2011 02:14 PM
тАО04-02-2011 02:14 PM
Re: Programming dedicated LAT application ports on Itanium
>strncpy(DEV_buf[index], "\0", DEF_IN_BUF_SIZE);
>If you're trying to null terminate ASCIZ strings, this may kinda sorta work
Yes, this will work.
>but definitely looks like it was written by someone unfamiliar with C.
No, it looks like someone too familiar with C but just not enough.
>If the intent is to zero-fill the buffers then the code as written isn't doing that.
Sure it does.
>Compare the docs for strncpy and memset and use the latter.
Right. The wording in memset(3) is much simpler to understand.
>Actually, it won't. strncpy copies the source string up to but *not including* the null terminator. So these calls do precisely nothing because the source strings have nothing in them but a null terminator.
Have you read it carefully? It shows the "broken" design of strncpy(3) where it doesn't work efficiently as a secure replacement for strcpy(3). I.e. if the string is short, it pads it out to the length, not just adding one null byte.
>Hoff: strncpy(LOG_buf[index], "\0", DEF_OUT_BUF_SIZE);
>Definitely broken. Was memset intended there?
I doubt it is broken but if it confuses the two of you, it isn't good code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2011 06:05 AM
тАО04-03-2011 06:05 AM
Re: Programming dedicated LAT application ports on Itanium
Around here, strlcpy() (where available) is preferred, and which reliably terminates the target buffer. Or the use of memset(), which explicitly zero-fills the whole buffer.
From some documentation (and why I prefer the strlcpy() call): "Because strncpy() does not guarantee to NUL terminate the string itself, this must be done explicitly." and "Be aware that the dest argument might not be terminated by a null character after a call to strncpy" In this case, there is a null and the target buffer length is (probably) non-zero, so there's no non-null terminated case here. It'll work.
Ugh. A quarter-century of C coding, and I still get bagged.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2011 11:08 AM
тАО04-03-2011 11:08 AM
Re: Programming dedicated LAT application ports on Itanium
I stand by the assertions that memset() would be better and old code that has been working is not necessarily correct code.
Hoff: Ugh. A quarter-century of C coding, and I still get bagged.
My first exposure to C was in 1987, so I have one more year to reach your level of confusion :-).