how to create customized messages in veins - omnet++

I'm simulating a scenario in veins when I need to use customized messages with specific fields(it's not wsa,wsm or bsm).
to achieve this I defined .msg file and the .cc and .h file were generated successfully. I included .h file into the cc+ application code, the project builds without errors but when I launch the simulation I have the following error
Model error: WaveMac only accepts WaveShortMessages -- in module (Mac1609_4) MyNetwork.rsu[0].nic.mac1609_4 (id=12), at t=0s, event #1
is it impossible to use customized messages in veins ?
if it's possible how to do it ?

Feel free to amend as many fields as you want to one of the existing message types (or to inherit from them). The bit length of a message is configured separately (in the .ini file of a simulation), so how many fields are in a message has no impact on how the simulation behaves.

Related

Functions needed to be overwritten for own scheduler inheriting cscheduler

I want to create a scheduler inheriting cScheduler. Can someone please tell me which are the functions to be written which must override the functions of cscheduler? Currently, I have written the constructor, destructor, startRun, endRun, guessNextEvent, takeNextEvent, putBackEvent. I have also mentioned the class in the initialization file and able to successfully build my project but when I run the simulation I get the error: Class TraCIConnection" not found -- perhaps it's code was not linked in, or the class wasn't registered with Register_Class(), or in the case of modules and channels with Define_Module()/Define_Channel().
The mentioned error has absolutely nothing to do with the custom scheduler you are trying to implement. Omnet complains because you are using the TraCIConnection simple module in the simulation while its C++ code is not linked into the simulation. You may need to add the C++ code to the project or link with an external model that provides that.

SwiftAutomation custom record compiler error

I'm using the SwiftAutomation framework to drive a scriptable app that searches for lyrics and returns a AS record. Everything was working correctly, until...
I mapped the AppleScript record to a custom Swift structure according to the SwiftAutomation documentation. The code in the xxxGlue.swift file looks correct, but the compiler complains about SwiftAutomation.SelfUnpacking, with several follow-on errors, when building the MacOSGlues framework.
public struct LFBLyricsInfoRecord: SwiftAutomation.SelfPacking, SwiftAutomation.SelfUnpacking { ... }
--> .../MacOSGlues/LyricsFBAGlue.swift:700:81: No type named 'SelfUnpacking' in module 'SwiftAutomation'
The SelfPacking public protocol is defined in SwiftAutomation, and SelfUnpacking protocol is defined right under it, but without the public keyword. Is that the cause of the compiler error, and if so, how do I fix it?
OK, I finally found a resolution. Seems you have to use different options for the aeglue utility when generating the glue file for the MacOSGlues framework and for the swift file where you actually use your automation, such as in the test project. In my case, where my scriptable app is named LyricsFBA.app, these were:
aeglue -S LyricsFBA.app
for MacOSGlues (generates a LyricsFBAGlue.swift that references SwiftAutomation, but does not include the custom record structure definition), and
aeglue -D -s 'LyricsInfo:lyricsInfo=score:Int+title:String+artist:String+composer:String+link:String+lyrics:String' LyricsFBA.app
for the test program (generatea a LyricsFBAGlue.swift that does not reference SwiftAutomation, but does include the custom record structure definition).

Custom event messages with NDIS driver

I'm trying to define a few custom Event Viewer events. I've been following the instructions in MSDN and few other online sources, yet the event viewer can't find the associated text data.
This is what I've done:
Created an input file for the message compiler with the event codes and relevant strings (following the WDK Serial driver example).
Included the .rc file generated by the message compiler in the main driver resource file (MyDriver.rc).
Included the header file generated by the message compiler in the relevant driver module.
Used the NdisWriteErrorLogEntry API to write events with new ids from the included header file.
Added the driver binary to the Inf registry string identifying the event sources:
HKR, , EventMessageFile, 0x00020000, "%%SystemRoot%%\System32\netevent.dll; %%SystemRoot%%\System32\drivers\MyDriver.sys"
HKR, , TypesSupported, 0x00010001, 7
Everything works, except for strings display by the event viewer. It doesn't seem to recognize them and displays "the message resource is present but the message is not found in the string/message table" in the event description.
The only significant difference from the WDK example is the usage of NDIS API instead of the generic WDM API.
I'm also pretty confident that the text is included in the driver binary, since when opening the .sys file with editor I clearly see my strings there.
Would appreciate any suggestions on this issue.
Well, after a year and a half I found the problem. Apparently, the event viewer registry string parser is unable to properly extract the second messages file name if there is a whitespace before it.
Thus, in order to fix it, all is needed is remove the whitespace. I.e., instead of:
HKR, , EventMessageFile, 0x00020000, "%%SystemRoot%%\System32\netevent.dll; %%SystemRoot%%\System32\drivers\MyDriver.sys"
Write this in the inf file:
HKR, , EventMessageFile, 0x00020000, "%%SystemRoot%%\System32\netevent.dll;%%SystemRoot%%\System32\drivers\MyDriver.sys"

Get file path from FTPService for use in RoutingEngine

I have a service of class EnsLib.HL7.Service.FTPService that picks up files from multiple subfolders and sends them to an EnsLib.HL7.MsgRouter.RoutingEngine. What I want to do is somehow capture the subfolder as a variable for use in the routing rules. Is this possible?
Let's say I have the following files and directory structure on my FTP Server
/incoming/green/apple.dat
/incoming/yellow/banana.dat
I want the Routing Rule to be able to send anything that came from the /green/ folder to one operation and from /yellow/ to another.
With a message viewer, you can trace any messages. Where you can see any message properties, and one of them is Source. Text in this property looks like:
Source apple.dat via FTP localhost:21 path '/incoming/green/'
So with all of this data, you can create a rule by this property in a Rule editor

New Bounce Processing Templates in Mailman

When mailman receives a bounceback in a format that it doesn't recognize, it discards the message and sends an "Uncaught bounce notification" to the list administrator.
How would it be possible to define new templates or rules for mailman to process bounces?
For example, the message below is unrecognized by mailman, but is a common bounceback message from a particular domain that many of my list members are using. I would like to be able to have mailman process these automatically.
This message was created automatically by mail delivery software.
A message that you have sent could not be delivered to one or more
recipients. This is a permanent error. The following address failed:
<user#domain.com>: 550 5.1.1 User unknown
You need to write a new bouncer class, eg. Mailman/Bouncers/MyMisbehavingSystem.py. You'll find this in your Mailman installation directory, which might be eg. /usr/lib/mailman/.
Have a look at the other files in Mailman/Bouncers/ for reference. It might be tricky, and I suggest taking a "if we are not absolutely certain, just pass" approach. And enclose your code in a try .. except.
Then, add MyMisbehavingSystem to BOUNCE_PIPELINE in Mailman/Bouncers/BouncerAPI.py.
Finally, please consider contributing the new class to Mailman sources.

Resources